:root {
  --ink: #1e1e1e;
  --black: #000;
  --paper: #fff;
  --page-w: min(1200px, calc(100% - 32px));
  --font: 'Google Sans Flex', 'Google Sans', 'Noto Sans Thai', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Smooth scrolling: native for anchor links, Lenis (smooth-scroll.js) for wheel/trackpad. */
html {
  scroll-behavior: smooth;
}

html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 400;
  line-height: normal;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
p,
ul {
  margin: 0;
}

a {
  color: inherit;
}

.container {
  width: var(--page-w);
  margin-inline: auto;
}

/* ---------- Nav ---------- */
.nav {
  position: relative;
  z-index: 10;
  padding-block: 10px;
  background: var(--paper);
}

/* Hamburger button: hidden on desktop, shown at ≤640px */
.nav-toggle {
  display: none;
  position: relative;
  width: 32px;
  height: 32px;
  margin-right: -6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--black);
  cursor: pointer;
}

.nav-toggle-bar {
  position: absolute;
  left: 6px;
  width: 20px;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.nav-toggle-bar:nth-child(1) { top: 10px; }
.nav-toggle-bar:nth-child(2) { top: 15.25px; }
.nav-toggle-bar:nth-child(3) { top: 20.5px; }

.nav.is-open .nav-toggle-bar:nth-child(1) { transform: translateY(5.25px) rotate(45deg); }
.nav.is-open .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav.is-open .nav-toggle-bar:nth-child(3) { transform: translateY(-5.25px) rotate(-45deg); }

.nav-toggle:focus-visible {
  outline: 2px solid var(--black);
  outline-offset: 2px;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 30px;
  font-size: 18px;
  font-weight: 300;
  color: var(--black);
}

.nav a {
  text-decoration: none;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 144px;
}

.nav-links a:hover,
.nav-name:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ---------- Main ---------- */
main {
  /* nav ends at 50px; intro starts at 177px in the design */
  padding-top: 127px;
  padding-bottom: 77px;
}

.content {
  display: flex;
  flex-direction: column;
  gap: 45px;
  padding-left: 245px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Typing intro: ghosts + typed text share one grid cell per line */
.intro-type {
  white-space: nowrap;
}

.intro-name,
.intro-type .intro-role {
  display: grid;
}

.intro-name>*,
.intro-type .intro-role>* {
  grid-area: 1 / 1;
}

.ghost {
  visibility: hidden;
}

/* Blinking caret on whichever line is being typed */
.typed.is-active::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: .9em;
  margin-left: 3px;
  vertical-align: -.1em;
  background: currentColor;
  animation: caret-blink 1s steps(1) infinite;
}

/* Solid caret while characters are appearing/disappearing */
.intro.is-typing .typed.is-active::after {
  animation: none;
}

@keyframes caret-blink {
  50% {
    opacity: 0;
  }
}

.intro-name {
  font-size: 48px;
  font-weight: 500;
  line-height: 60px;
}

.intro-role {
  font-size: 32px;
  font-weight: 400;
  line-height: 40px;
}

.label {
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 10px;
}

.label--sm {
  font-size: 18px;
}

.about {
  max-width: 712px;
}

.about p {
  font-size: 16px;
  line-height: 1.3;
  text-align: justify;
}

.info-line {
  font-size: 18px;
}

.info-sub {
  font-size: 16px;
  margin-top: 6px;
}

.u {
  font-weight: 500;
  text-decoration: underline;
  text-underline-position: from-font;
}

.u strong {
  font-weight: inherit;
}

.u:hover {
  opacity: .6;
}

/* Keep the focus ring for keyboard users, hide it after a mouse click */
a:focus:not(:focus-visible) {
  outline: none;
}

.projects .label {
  line-height: 32px;
  margin-bottom: 10px;
}

.projects ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.projects a {
  display: inline-block;
  font-size: 16px;
  line-height: 32px;
  color: var(--black);
  text-decoration: underline;
  text-underline-position: from-font;
}

.projects a:hover {
  opacity: .6;
}

/* ---------- T-shirt banner ----------
   1200×350 rounded card (Figma) filled by a looping video. */
.tees {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  margin-bottom: 16px;
}

.tees-video {
  display: block;
  width: 100%;
  aspect-ratio: 1200 / 350;
  object-fit: cover;
  background: #8a8a8a;
}

/* Play / pause button, bottom-right of the card */
.tees-toggle {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background-color .2s, transform .2s;
}

.tees-toggle:hover {
  background: rgba(0, 0, 0, .8);
  transform: scale(1.06);
}

.tees-toggle:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Show the icon for the action the button will perform */
.tees-toggle .icon-play,
.tees.is-paused .tees-toggle .icon-pause {
  display: none;
}

.tees.is-paused .tees-toggle .icon-play {
  display: block;
}

@media (max-width: 640px) {
  .tees-toggle {
    right: 8px;
    bottom: 8px;
    width: 32px;
    height: 32px;
  }
}

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  padding-bottom: 32px;
}

/* Infinite sliding marquee: three identical sets, track moves by exactly one set.
   Tile = 342px at a 1440px viewport, as in the Figma design. */
.strip {
  --tile: 23.75vw;
  --strip-speed: 57s;
  overflow: hidden;
}

.strip-track {
  display: flex;
  width: max-content;
  animation: strip-slide var(--strip-speed) linear infinite;
}

.strip:hover .strip-track {
  animation-play-state: paused;
}

.strip-set {
  display: flex;
}

.strip img {
  display: block;
  width: var(--tile);
  height: var(--tile);
  object-fit: cover;
  flex-shrink: 0;
}

@keyframes strip-slide {
  from {
    transform: translateX(0);
  }

  to {
    /* one set out of three, so the loop restarts seamlessly */
    transform: translateX(calc(-100% / 3));
  }
}

@media (prefers-reduced-motion: reduce) {
  .strip {
    overflow-x: auto;
  }

  .strip-track {
    animation: none;
  }

  .strip-set[aria-hidden="true"] {
    display: none;
  }
}

.footer-email {
  display: inline-block;
  margin-top: 25px;
  font-size: 18px;
  font-weight: 300;
  color: var(--black);
  text-decoration: none;
}

.footer-email:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .content {
    padding-left: 0;
  }

  .nav-links {
    gap: 48px;
  }

  main {
    padding-top: 80px;
  }
}

@media (max-width: 640px) {
  .nav-toggle {
    display: block;
  }

  /* Dropdown panel under the header */
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 8px 16px 16px;
    background: var(--paper);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
  }

  .nav.is-open .nav-links {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

  .nav-links a {
    padding-block: 12px;
    font-size: 20px;
  }

  main {
    padding-top: 56px;
    padding-bottom: 48px;
  }

  .content {
    gap: 36px;
  }

  .intro-name {
    font-size: 32px;
    line-height: 40px;
  }

  .intro-type {
    white-space: normal;
  }

  .intro-role {
    font-size: 22px;
    line-height: 28px;
  }

  .about p {
    text-align: left;
  }

  .info-line {
    font-size: 16px;
  }

  .info-sub {
    font-size: 14px;
  }

  .strip {
    --tile: 70vw;
    --strip-speed: 50s;
  }
}
