:root {
  --base-color: white;
  --base-variant: #eeeeee;
  --border-color: #ddd;
  --icon-color: #262626;
  --text-color: black;
  --secondary-text: #555;
  --accent-color: #0077cc;
}

.darkmode {
  --base-color: #1a1a1b;
  --base-variant: #2e2e2e;
  --border-color: #525252;
  --icon-color: #262626;
  --text-color: white;
  --secondary-text: #a4a5b8;
  --accent-color: #0077cc;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
    font-family: 'Inter';
  }
  
  body {
    background-color: var(--base-color);
    color: var(--text-color);
    line-height: 1.6;
  }
  
  header {
    background-color: var(--base-color);
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
  }
  
  .navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .navbar a,
  #theme-switch {
  display: flex;
  align-items: center;  /* makes text/icons sit nicely */
  }

  section {
    min-height: 100vh;      /* ensures section is at least viewport height */
    width: 100%;            /* avoid forcing scrollbars with 100vw */
    scroll-snap-align: start;
    text-align: center;
    justify-content: center;
    padding: 7.5% 2rem;     /* use side padding too */
    box-sizing: border-box; /* safer sizing */
  }

  @keyframes appear {
    from {
      opacity: 0;
      scale: 0.5;
    } to {
      opacity: 1;
      scale: 1;
    }
  }

  .block {
    animation: appear linear;
    animation-timeline: view();
    animation-range: 0% cover 40%;
  }

  .logo {
    text-decoration: none;
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--text-color);
  }
  
  .navbar ul {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    align-items: center;
  }
  
  .navbar a:not(.logo, .resume-btn) {
    text-decoration: none;
    color: var(--secondary-text);
    display: inline-block; /* Needed for transform to work */
    transition: all 0.3s ease-in-out;
  }
  
  .navbar a:not(.logo, .resume-btn):hover {
    transform: scale(1.1);
    color: var(--text-color);
  }

  #theme-switch {
    height: 50px;
    width: 50px;
    border: none;
    border-radius: 50%;
    padding: 0;
    background-color: var(--base-variant);
    color: var(--secondary-text);
    display: flex;
    cursor: pointer;
    justify-content: center;
    align-items: center;
    position: relative;
    transition: all 0.3s ease-in-out;
  }

  #theme-switch:hover {
    color: var(--text-color);
  }

  #theme-switch:active {
    transform: scale(0.8);
  }

  #theme-switch span {
    fill: var(--icon-color)
  }

  #theme-switch span:last-child {
    display: none;
  }

  .darkmode #theme-switch span:first-child {
    display: none;
  }

  .darkmode #theme-switch span:last-child {
    display: block;
  }
  
  .resume-btn {
    background-color: var(--base-variant);
    color: var(--secondary-text);
    padding: 0.5rem 1rem;
    border-radius: 15px;
    text-decoration: none;
    cursor: pointer;
    position: relative;
    transition: color 0.3s ease-in-out;
  }

  .resume-btn:hover {
    color: var(--text-color);
  }

  .hero {
    text-align: center;
    padding: 6.5rem 2rem;
  }

  .gradient-data {
    background: linear-gradient(90deg, #6a11cb, #2575fc); /* purple → blue */
    background-clip: text;            /* Standard property */
    -webkit-background-clip: text;    /* Safari/Chrome/Edge */
    color: transparent;               /* Standard way to hide text */
    -webkit-text-fill-color: transparent; /* WebKit-specific */
  }
  
  .gradient-business {
    background: linear-gradient(90deg, #ff7e5f, #feb47b); /* orange → peach */
    background-clip: text;            
    -webkit-background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
  }
  
  .hero h1 {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    font-weight: 300;
    max-width: 900px;
    margin: 0.5rem auto; /* tighter spacing */
  }

  .hero em {
    font-style: italic;
    font-weight: 500;
    font-size: 1em;
  }

  .hero strong {
    font-weight: 500;
    font-size: 1em;
  }

  .wrapper {
    width: 60%;
    max-width: 1536px;
    margin-inline: auto;
    position: relative;
    height: 50px;
    margin-top: 2rem;
    overflow: hidden;
    mask-image: linear-gradient(
      to right,
      rgba(0,0,0,0),
      rgba(0,0,0,1) 20%,
      rgba(0,0,0,1) 80%,
      rgba(0,0,0,0)
    );
  }

  @keyframes scrollLeft {
    to {
      left: -100px;
    }
  }

  .item {
    width: 100px;
    height: 50px;
    background-size: contain;  /* keep aspect ratio of icons */
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 6px;
    position: absolute;
    left: max(calc(100px * 8), 100%);
    animation-name: scrollLeft;
    animation-duration: 20s;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
  }

  /* gray overlay */
  .item::after {
    content: "";
    position: absolute;
    inset: 0;
    background: inherit; /* copies background-image */
    filter: grayscale(100%);
    background-size: inherit;
    background-repeat: inherit;
    background-position: inherit;
    transition: filter 0.3s ease-in-out;
  }

  .item:hover::after {
    filter: grayscale(0%);
  }

  .item1 {
    background-image: url("icons/java-icon.png");
    animation-delay: calc(20s / 8 * (8 - 1) * -1);
  }

  .item2 {
    background-image: url("icons/javaScript-icon.png");
    animation-delay: calc(20s / 8 * (8 - 2) * -1);
  }

  .item3 {
    background-image: url("icons/MySQL-icon.png");
    animation-delay: calc(20s / 8 * (8 - 3) * -1);
  }

  .item4 {
    background-image: url("icons/html-icon.png");
    animation-delay: calc(20s / 8 * (8 - 4) * -1);
  }

  .item5 {
    background-image: url("icons/python-icon.png");
    animation-delay: calc(20s / 8 * (8 - 5) * -1);
  }

  .item6 {
    background-image: url("icons/css-icon.png");
    animation-delay: calc(20s / 8 * (8 - 6) * -1);
  }

  .item7 {
    background-image: url("icons/swift-icon.png");
    animation-delay: calc(20s / 8 * (8 - 7) * -1);
  }

  .item8 {
    background-image: url("icons/vsCode-icon.png");
    animation-delay: calc(20s / 8 * (8 - 8) * -1);
  }

  .about-section {
    padding: 6rem 2rem;
    background: var(--base-color);
  }

  .about-section h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 2rem;
  }
  
  .about-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 3rem;
    align-items: center;
  }
  
  /* Left Column: Text */
  .about-text {
    flex: 1 1 500px;
  }

  .jp {
    font-family: 'Noto Sans JP';
  }
  
  .about-text h2 {
    text-align: left;
    font-size: 2rem;
    font-weight: 300;
    margin-bottom: 1.5rem;
    line-height: 1.3;
  }
  
  .about-text h2 em {
    font-style: italic;
    font-weight: 600;
  }
  
  .about-text h2 strong {
    font-weight: 600;
  }
  
  .about-text p {
    text-align: left;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--secondary-text);
    margin-bottom: 1.2rem;
  }
  
  /* Right Column: Image */
  .about-image {
    flex: 1 1 400px;
    display: flex;
    justify-content: center;
  }
  
  .about-image img {
    max-width: 100%;
    border-radius: 1rem; /* rounded corners */
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  }  
  
  .projects {
    padding: 4rem 2rem;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
  }

  .projects h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 2rem;
  }
  
  /* Responsive grid */
  .project-grid {
    display: grid;
    gap: 2rem;
    margin-top: 2rem;
    grid-template-columns: 1fr; /* default = single column */
  }

  /* At desktop size, allow 3 columns */
  @media (min-width: 1024px) {
    .project-grid {
      grid-template-columns: repeat(3, 1fr);
    }
  }
  
  .project-card {
    background-color: var(--base-color);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 8px;
    text-align: left;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }

  .project-card:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
    cursor: pointer;
  }
  
  .project-image {
    height: 180px;
    width: 100%;
    border-radius: 6px;
    overflow: hidden;   /* Hide anything outside this box */
    position: relative; /* For positioning the image if needed */
  }

  .project-image.heart { background: linear-gradient(135deg, #f6d7e0, #d0e3f2); }
  .project-image.origami { background: linear-gradient(135deg, #b4f2d2, #f7fbd9); }
  .project-image.chess { background: linear-gradient(135deg, #f7dc85, #fcb19c); }

  model-viewer {
    height: 180px;
    width: auto;
    background-color: transparent;
    border-radius: 6px;
  }
  
  .project-card h3 {
    margin: 1rem 0 0.5rem;
  }
  
  .project-card p {
    color: var(--secondary-text);
    font-size: 0.9rem;
  }
  
  .tags {
    margin: 1rem 0;
  }
  
  .tags span {
    background-color: var(--base-variant);
    padding: 0.3rem 0.6rem;
    margin-right: 0.3rem;
    border-radius: 4px;
    font-size: 0.8rem;
  }

  .tags a {
    color: var(--secondary-text);
    padding: 0.3rem 0.6rem;
    font-size: 25px;
  }
  
/* Footer Base */
.site-footer {
  background: var(--base-color);
  padding: 0;
  border-top: 1px solid var(--text-color);
  font-family: sans-serif;
}

/* Top Moving Banner */
.footer-banner {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--text-color);
  background: var(--base-color);
  height: 2rem;
  display: flex;
  align-items: center;
}

.banner-track {
  display: flex;
  width: max-content;
  animation: scrollBanner 20s linear infinite;
}

.banner-track span {
  flex: none;
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 0.9rem;
  text-transform: uppercase;
}

/* Animation */
@keyframes scrollBanner {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* Footer Content */
.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
}

/* Left Column */
.footer-left h2 {
  font-size: 1.6rem;
  font-weight: bold;
  margin-bottom: 0.8rem;
}

.footer-left .star {
  font-size: 1.7rem;
}

.footer-left .subtitle {
  font-size: 1rem;
  color: var(--secondary-text);
  margin-bottom: 1rem;
}

.footer-left .credit {
  font-size: 0.9rem;
  color: var(--secondary-text);
}

/* Middle + Right */
.footer-middle h3,
.footer-right h3 {
  font-size: 0.95rem;
  font-weight: bold;
  margin-bottom: 0.6rem;
  text-transform: lowercase;
}

.footer-middle ul,
.footer-right ul {
  list-style: none;
  padding: 0;
}

.footer-middle li,
.footer-right li {
  margin-bottom: 0.5rem;
}

.footer-middle a,
.footer-right a {
  text-decoration: none;
  color: var(--text-color);
  font-size: 0.95rem;
}

.footer-middle a:hover,
.footer-right a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-middle,
  .footer-right {
    margin-top: 1.5rem;
  }
}
