/* ---------- Local fonts ---------- */
@font-face {
  font-family: "Space Grotesk";
  src: url("assets/fonts/space-grotesk-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("assets/fonts/inter-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
}

/* ---------- Tokens: the navy and amber palette from your reference ---------- */
:root {
  --bg: #0b1220;
  --surface: #121b2e;
  --surface-2: #17233a;
  --border: #22304a;
  --text: #e8eaf0;
  --text-muted: #98a2b8;
  --accent: #f5a623;
  --accent-dim: rgba(245, 166, 35, 0.14);
  --font-display: "Space Grotesk", Arial, sans-serif;
  --font-body: "Inter", Arial, sans-serif;
  --max: 1080px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 110px;
}
html.lenis {
  scroll-behavior: auto;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a {
  color: inherit;
  text-decoration: none;
  touch-action: manipulation;
}
button {
  font: inherit;
  color: inherit;
  touch-action: manipulation;
  cursor: pointer;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
img {
  display: block;
  max-width: 100%;
}
h1,
h2,
h3 {
  font-family: var(--font-display);
  overflow-wrap: anywhere;
}
em {
  font-style: normal;
  color: var(--accent);
}
::selection {
  background: var(--accent);
  color: #17130a;
}
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}
[hidden] {
  display: none !important;
}
main,
.footer {
  position: relative;
  z-index: 1;
}
section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 96px 32px;
}
.section-head {
  margin-bottom: 48px;
  max-width: 570px;
}
.section-kicker {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.09em;
  color: var(--text-muted);
  margin-bottom: 13px;
}
.section-head h2 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
}
.section-head p {
  color: var(--text-muted);
  margin-top: 12px;
  font-size: 1rem;
  line-height: 1.8;
}
.icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  vertical-align: middle;
}
.icon-library {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.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;
}
.skip-link {
  position: fixed;
  top: 15px;
  left: 20px;
  padding: 10px 18px;
  z-index: 100;
  background: var(--accent);
  color: var(--bg);
  transform: translateY(-180%);
  border-radius: 5px;
}
.skip-link:focus {
  transform: translateY(0);
}
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
}

/* Subtle schematic grid. All decoration stays out of pointer interactions. */
.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(245, 166, 35, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 166, 35, 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 65% at 50% 0%, black 30%, transparent 80%);
}

/* ---------- Navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  max-width: var(--max);
  margin: 0 auto;
  backdrop-filter: blur(12px);
  background: linear-gradient(rgba(11, 18, 32, 0.95) 60%, rgba(11, 18, 32, 0.75));
  border-bottom: 1px solid transparent;
  transition:
    border-color 0.2s,
    background 0.2s;
}
.nav.is-scrolled,
.nav.is-open {
  border-color: var(--border);
  background: rgba(11, 18, 32, 0.96);
}
.nav__inner {
  min-height: 90px;
  padding: 22px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav__mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
  transition: border-color 0.2s;
}
.nav__mark:hover {
  border-color: var(--accent);
}
.nav__links {
  display: flex;
  gap: 26px;
}
.nav__links a {
  position: relative;
  color: var(--text-muted);
  font-size: 0.875rem;
  transition: color 0.2s;
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -7px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}
.nav__links a:hover,
.nav__links a[aria-current="location"] {
  color: var(--text);
}
.nav__links a:hover::after,
.nav__links a[aria-current="location"]::after {
  transform: scaleX(1);
}
.nav__cta {
  border: 1px solid var(--border);
  padding: 9px 15px;
  border-radius: 8px;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  transition:
    border-color 0.2s,
    background 0.2s;
}
.nav__cta .icon {
  width: 15px;
  height: 15px;
}
.nav__cta:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.nav__toggle {
  display: none;
  padding: 13px 11px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}
.nav__toggle span {
  display: block;
  height: 1px;
  background: var(--text);
  transition: transform 0.2s;
}
.nav__toggle span + span {
  margin-top: 6px;
}
.nav__toggle[aria-expanded="true"] span:first-child {
  transform: translateY(3.5px) rotate(45deg);
}
.nav__toggle[aria-expanded="true"] span + span {
  transform: translateY(-3.5px) rotate(-45deg);
}
.nav__mobile {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  padding: 10px 24px 26px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  max-height: calc(100svh - 80px);
  overflow-y: auto;
}
.nav__mobile a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: 1.15rem;
}
.nav__mobile a span {
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 0.75rem;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  padding-top: 58px;
  padding-bottom: 56px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.hero__glow {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse at 85% 25%, rgba(245, 166, 35, 0.045), transparent 60%);
  animation: atmosphere 14s ease-in-out infinite alternate;
}
.hero__constellation {
  position: absolute;
  inset: -24px 0 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  opacity: 0.8;
  -webkit-mask-image: radial-gradient(ellipse 88% 75% at 70% 42%, #000 35%, transparent 100%);
  mask-image: radial-gradient(ellipse 88% 75% at 70% 42%, #000 35%, transparent 100%);
}
.hero__constellation::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(11, 18, 32, 0.94) 0%,
    rgba(11, 18, 32, 0.78) 35%,
    rgba(11, 18, 32, 0.25) 75%,
    rgba(11, 18, 32, 0.2) 100%
  );
}
#constellationCanvas {
  display: block;
  width: 100%;
  height: 100%;
}
.hero__status {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: 100px;
  margin-bottom: 32px;
  max-width: 100%;
}
.hero__dot {
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.hero__title {
  font-weight: 500;
  font-size: clamp(2.35rem, 4.5vw, 3.6rem);
  line-height: 1.12;
  letter-spacing: -0.035em;
  margin-bottom: 12px;
  max-width: 100%;
}
.hero__title .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.13em;
  margin-bottom: -0.13em;
}
/* Keep the title visible by default. GSAP sets its starting position in JS. */
.hero__line {
  display: inline-block;
  transform-origin: left bottom;
}
.hero__role {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 24px;
}
.hero__sub {
  max-width: 565px;
  color: var(--text-muted);
  font-size: 1.0625rem;
  line-height: 1.85;
  margin-bottom: 30px;
}
.hero__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 44px;
}
.btn {
  padding: 13px 22px;
  min-height: 49px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition:
    background 0.2s,
    border-color 0.2s,
    color 0.2s,
    box-shadow 0.2s;
}
.btn--primary {
  background: var(--accent);
  color: #17130a;
}
.btn--primary:hover {
  background: #ffb846;
  box-shadow: 0 5px 22px rgba(245, 166, 35, 0.1);
}
.btn--ghost {
  border-color: var(--border);
  color: var(--text);
  background: transparent;
}
.btn--ghost:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.btn--text {
  color: var(--text-muted);
  padding-inline: 12px;
}
.btn--text:hover {
  color: var(--accent);
}
.btn .icon {
  transition: transform 0.2s var(--ease);
}
.btn:hover .icon {
  transform: translate(2px, -2px);
}
.hero__actions .btn--primary:hover .icon {
  transform: translateY(2px);
}
.hero__readout {
  display: flex;
  gap: 56px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  padding-top: 25px;
  width: 100%;
}
.hero__readout dt {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 6px;
}
.hero__readout dd {
  font-family: var(--font-display);
  font-size: 1rem;
}

/* ---------- Work / featured project and compact rows ---------- */
.work {
  padding-top: 58px;
}
.project {
  display: grid;
  grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
  padding: 34px 0;
  border-top: 1px solid var(--border);
}
.project--reverse {
  grid-template-columns: minmax(0, 1fr) minmax(0, 280px);
}
.project--reverse .project__visual {
  order: 2;
}
.project--reverse .project__info {
  order: 1;
}
.project__info {
  min-width: 0;
}
.project__tag {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 500;
  letter-spacing: 0.05em;
}
.project__info h3 {
  font-size: 1.6rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin: 9px 0 12px;
}
.project__info p {
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.75;
  margin-bottom: 14px;
}
.project__info p.project__detail {
  font-size: 0.875rem;
  line-height: 1.8;
}
.project__detail strong {
  color: var(--text);
  font-weight: 500;
}
.project__detail code {
  font-size: 0.94em;
  color: var(--text);
}
.project__stack {
  display: flex;
  gap: 8px;
  list-style: none;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.project__stack li {
  font-size: 0.75rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 6px;
  line-height: 1.7;
}
.project__links {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.project__link {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 3px;
  transition:
    color 0.2s,
    border-color 0.2s;
  line-height: 1.65;
}
.project__link .icon {
  width: 16px;
  height: 16px;
  transition: transform 0.2s var(--ease);
}
.project__link:hover {
  color: var(--accent);
}
.project__link:hover .icon {
  transform: translate(2px, -2px);
}
.project__link--secondary {
  border-color: var(--border);
  color: var(--text-muted);
}
.project__link--secondary:hover {
  border-color: var(--accent);
}
.project__visual {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  height: 228px;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    border-color 0.25s,
    box-shadow 0.25s;
  min-width: 0;
}
.project__visual::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(140deg, rgba(245, 166, 35, 0.025), transparent 55%);
}
.project__visual img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
  transition: transform 0.55s var(--ease);
}
.project__visual--calculator img {
  height: 100%;
  width: auto;
  border-radius: 17px;
}
.project__visual--amazon {
  background: #121d2b;
}
.project__visual:hover,
.project__visual:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.12);
}
.project__visual:hover img,
.project__visual:focus-visible img {
  transform: translateY(-3px) scale(1.025);
}
.project--featured {
  display: block;
  padding-bottom: 42px;
}
.project__feature-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 24px;
}
.project__feature-head h3 {
  font-size: 2.1rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin-top: 8px;
}
.project__feature-head .project__links {
  padding-bottom: 5px;
}
.project--featured .project__visual {
  height: auto;
  padding: 20px;
}
.project--featured .project__visual img {
  width: 100%;
  height: auto;
  max-height: none;
  max-width: 100%;
}
.project__feature-body {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 36px;
  align-items: start;
  margin-top: 24px;
}
.project__feature-body > div > p {
  font-size: 1rem;
  margin-bottom: 18px;
}
.project__feature-body .project__stack {
  margin-bottom: 0;
}
.project__feature-body p.project__detail {
  border-left: 1px solid var(--border);
  padding-left: 24px;
  margin-bottom: 0;
}

/* Smaller cards complete the six-project selection. */
.work__more-head {
  margin-top: 40px;
  margin-bottom: 28px;
}
.work__more-head h3 {
  font-size: 1.4rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.work__more-head p {
  font-size: 1rem;
  color: var(--text-muted);
}
.experiments {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.experiment {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 27px 25px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.25s;
  min-width: 0;
}
.experiment:hover {
  border-color: #88632b;
}
.experiment__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.experiment__top .icon {
  color: var(--accent);
  width: 23px;
  height: 23px;
}
.experiment__number {
  font-family: var(--font-display);
  font-size: 0.75rem;
  color: var(--text-muted);
}
.experiment h3 {
  font-size: 1.3rem;
  line-height: 1.3;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.experiment p {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.85;
  margin-bottom: 22px;
}
.experiment .project__stack {
  margin-top: auto;
  margin-bottom: 26px;
  gap: 6px;
}
.experiment .project__stack li {
  padding-inline: 7px;
}
.experiment .project__link {
  width: fit-content;
}

/* ---------- About ---------- */
.about {
  border-top: 1px solid var(--border);
}
.about__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 72px;
  align-items: start;
}
.about__copy p {
  font-size: 1rem;
  line-height: 1.9;
  color: var(--text-muted);
  margin-bottom: 22px;
}
.about__copy p:last-child {
  margin-bottom: 0;
}
.about__copy p.about__lead {
  font-size: 1.18rem;
  color: var(--text);
  line-height: 1.8;
  letter-spacing: -0.015em;
}
.about__aside {
  background: rgba(18, 27, 46, 0.7);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
}
.about__aside-label {
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.07em;
}
.about__aside dl {
  margin: 25px 0 0;
}
.about__aside dl > div + div {
  margin-top: 21px;
}
.about__aside dt {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.about__aside dd {
  font-family: var(--font-display);
  font-size: 0.9375rem;
}

/* ---------- Skills ---------- */
.skills {
  border-top: 1px solid var(--border);
}
.skills__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.skill {
  background: var(--surface);
  padding: 29px 27px;
  display: flex;
  gap: 21px;
  align-items: flex-start;
  min-width: 0;
}
.skill > div {
  min-width: 0;
}
.skill__symbol {
  display: grid;
  place-items: center;
  width: 39px;
  height: 42px;
  flex-shrink: 0;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-top: 2px;
}
.skill__symbol--small {
  font-size: 1.125rem;
}
.skill__symbol .icon {
  width: 28px;
  height: 28px;
}
.skill__label {
  display: block;
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 9px;
}
.skill__value {
  font-size: 1.04rem;
  line-height: 1.55;
  font-weight: 500;
}
.skill p {
  font-size: 0.875rem;
  line-height: 1.8;
  color: var(--text-muted);
  margin-top: 9px;
}
.skills__note {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 25px;
}

/* ---------- Education & experience ---------- */
.journey {
  border-top: 1px solid var(--border);
}
.timeline {
  list-style: none;
  margin: 8px 0 0 5px;
}
.timeline__item {
  display: grid;
  grid-template-columns: 165px minmax(0, 1fr);
  gap: 40px;
  position: relative;
  border-left: 1px solid var(--border);
  padding: 0 0 46px 33px;
}
.timeline__item:last-child {
  padding-bottom: 0;
}
.timeline__dot {
  position: absolute;
  top: 7px;
  left: -5px;
  width: 9px;
  height: 9px;
  border: 1px solid var(--text-muted);
  border-radius: 50%;
  background: var(--bg);
}
.timeline__item:first-child .timeline__dot {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-dim);
}
.timeline__date {
  font-family: var(--font-display);
  font-size: 0.9375rem;
}
.timeline__date span {
  display: block;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.75rem;
  margin-top: 4px;
}
.timeline__content h3 {
  font-size: 1.3rem;
  line-height: 1.4;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.timeline__content .timeline__org {
  color: var(--accent);
  font-size: 0.8125rem;
  margin: 9px 0 14px;
}
.timeline__content p {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.85;
  max-width: 610px;
}

/* ---------- Contact ---------- */
.contact {
  position: relative;
  isolation: isolate;
  border-top: 1px solid var(--border);
  padding-bottom: 88px;
}
.contact__glow {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse at 85% 100%, rgba(245, 166, 35, 0.04), transparent 66%);
}
.contact h2 {
  font-size: clamp(2rem, 4.2vw, 3.1rem);
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin-bottom: 19px;
}
.contact p {
  color: var(--text-muted);
  margin-bottom: 30px;
  font-size: 1rem;
  line-height: 1.85;
}
.contact__links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.contact__email {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: 29px;
  max-width: 100%;
}
.email-link {
  font-size: 0.9375rem;
  color: var(--text-muted);
  overflow-wrap: anywhere;
  transition: color 0.2s;
}
.email-link:hover {
  color: var(--accent);
}
.copy-email {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  background: transparent;
  border-radius: 8px;
  color: var(--text-muted);
  transition:
    border-color 0.2s,
    color 0.2s;
}
.copy-email:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.copy-email .icon {
  width: 16px;
  height: 16px;
}
.footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 29px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 0.8125rem;
  border-top: 1px solid var(--border);
}
.footer a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  transition: color 0.2s;
}
.footer a:hover {
  color: var(--accent);
}
.footer .icon {
  width: 15px;
  height: 15px;
}
.toast {
  position: fixed;
  z-index: 80;
  bottom: 24px;
  left: 50%;
  max-width: calc(100% - 40px);
  padding: 12px 20px;
  background: var(--surface-2);
  border: 1px solid #906b33;
  border-radius: 8px;
  font-size: 0.875rem;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 16px);
  pointer-events: none;
  transition:
    opacity 0.2s,
    transform 0.2s;
}
.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@keyframes atmosphere {
  from {
    opacity: 0.45;
  }
  to {
    opacity: 1;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .project {
    grid-template-columns: minmax(0, 240px) minmax(0, 1fr);
    gap: 32px;
  }
  .project--reverse {
    grid-template-columns: minmax(0, 1fr) minmax(0, 240px);
  }
  .experiments {
    gap: 15px;
  }
  .experiment {
    padding: 25px 21px;
  }
  .about__layout {
    gap: 44px;
  }
  .skill {
    padding: 27px 23px;
    gap: 15px;
  }
}
@media (max-width: 800px) {
  html {
    scroll-padding-top: 95px;
  }
  section {
    padding: 72px 24px;
  }
  .nav__inner {
    min-height: 78px;
    padding: 16px 24px;
    gap: 16px;
  }
  .nav__links {
    display: none;
  }
  .nav__cta {
    margin-left: auto;
  }
  .nav__toggle {
    display: block;
  }
  .hero {
    padding-top: 50px;
    padding-bottom: 52px;
  }
  .hero__title {
    font-size: clamp(2.3rem, 6vw, 3.2rem);
  }
  .hero__actions {
    margin-bottom: 44px;
  }
  .hero__readout {
    gap: 26px 38px;
  }
  .work {
    padding-top: 58px;
  }
  .project,
  .project--reverse {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 30px 0;
  }
  .project--reverse .project__visual,
  .project--reverse .project__info {
    order: initial;
  }
  .project__visual {
    height: 218px;
    padding: 16px;
  }
  .project__info h3 {
    font-size: 1.6rem;
  }
  .project--featured .project__visual {
    padding: 14px;
  }
  .project__feature-body {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 24px;
  }
  .experiments {
    grid-template-columns: 1fr;
    gap: 17px;
  }
  .experiment {
    padding: 27px;
  }
  .experiment__top {
    margin-bottom: 18px;
  }
  .experiment p {
    font-size: 1rem;
    max-width: 600px;
  }
  .experiment .project__stack {
    margin-bottom: 22px;
  }
  .about__layout {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 30px;
  }
  .about__aside {
    padding: 24px;
  }
  .skill {
    padding: 25px 22px;
    display: block;
  }
  .skill__symbol {
    margin: 0 0 15px;
    justify-content: start;
  }
  .timeline__item {
    grid-template-columns: 135px minmax(0, 1fr);
    gap: 24px;
  }
  .contact {
    padding-bottom: 68px;
  }
  .footer {
    padding-inline: 24px;
  }
}
@media (max-width: 580px) {
  section {
    padding: 64px 20px;
  }
  .nav__inner {
    padding: 15px 20px;
    min-height: 75px;
    gap: 12px;
  }
  .nav__cta {
    font-size: 0.8125rem;
    padding: 9px 12px;
  }
  .nav__cta .icon {
    display: none;
  }
  .nav__mobile {
    padding-inline: 20px;
  }
  .hero {
    padding-top: 40px;
    padding-bottom: 40px;
  }
  .hero__status {
    font-size: 0.75rem;
    padding: 7px 11px;
    line-height: 1.65;
    margin-bottom: 26px;
  }
  .hero__title {
    font-size: clamp(1.85rem, 7.4vw, 2.5rem);
    margin-bottom: 10px;
  }
  .hero__role {
    font-size: 1.125rem;
    margin-bottom: 20px;
  }
  .hero__constellation {
    opacity: 0.65;
  }
  .hero__constellation::after {
    background: linear-gradient(90deg, rgba(11, 18, 32, 0.86), rgba(11, 18, 32, 0.6));
  }
  .hero__sub {
    font-size: 1rem;
    margin-bottom: 29px;
  }
  .hero__actions {
    gap: 10px;
    margin-bottom: 39px;
  }
  .btn {
    font-size: 0.875rem;
    padding: 12px 17px;
    gap: 9px;
  }
  .hero__actions .btn--text {
    padding-inline: 4px;
  }
  .hero__readout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 18px;
    padding-top: 23px;
  }
  .hero__readout > div:last-child {
    grid-column: 1/-1;
  }
  .hero__readout dd {
    font-size: 0.9375rem;
  }
  .section-head {
    margin-bottom: 34px;
  }
  .section-kicker {
    font-size: 0.75rem;
    letter-spacing: 0.05em;
  }
  .section-head h2 {
    font-size: 1.85rem;
  }
  .section-head p {
    font-size: 1rem;
  }
  .work {
    padding-top: 45px;
  }
  .project {
    padding: 28px 0;
    gap: 20px;
  }
  .project__visual {
    height: 205px;
    padding: 14px;
    border-radius: 12px;
  }
  .project__info h3 {
    font-size: 1.5rem;
  }
  .project__feature-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 20px;
  }
  .project__feature-head h3 {
    font-size: 1.85rem;
  }
  .project__feature-head .project__links {
    padding-bottom: 0;
  }
  .project--featured .project__visual {
    padding: 10px;
  }
  .project__feature-body {
    grid-template-columns: 1fr;
    margin-top: 20px;
    gap: 18px;
  }
  .project__feature-body p.project__detail {
    border-left: 0;
    padding-left: 0;
  }
  .project__links {
    gap: 23px;
  }
  .project__stack {
    gap: 7px;
  }
  .project__stack li {
    padding-inline: 9px;
  }
  .work__more-head {
    margin-top: 27px;
    margin-bottom: 23px;
  }
  .experiment {
    padding: 25px;
  }
  .about__layout {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .about__copy p.about__lead {
    font-size: 1.12rem;
  }
  .about__aside {
    padding: 25px;
  }
  .about__aside dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 18px;
  }
  .about__aside dl > div + div {
    margin-top: 0;
  }
  .about__aside dd {
    font-size: 0.875rem;
  }
  .skills__grid {
    grid-template-columns: 1fr;
  }
  .skill {
    display: flex;
    padding: 25px 21px;
    gap: 17px;
  }
  .skill__symbol {
    margin: 2px 0 0;
  }
  .skill__value {
    font-size: 1.04rem;
  }
  .skill p {
    font-size: 0.875rem;
  }
  .timeline__item {
    grid-template-columns: 1fr;
    gap: 15px;
    padding-left: 26px;
    padding-bottom: 35px;
  }
  .timeline__date {
    font-size: 0.875rem;
  }
  .timeline__date span {
    display: inline;
    margin-left: 12px;
  }
  .timeline__content h3 {
    font-size: 1.23rem;
  }
  .contact h2 {
    font-size: 2rem;
  }
  .contact p br {
    display: none;
  }
  .contact__links {
    gap: 10px;
  }
  .contact__email {
    gap: 9px;
  }
  .email-link {
    font-size: 0.875rem;
  }
  .copy-email {
    width: 38px;
    height: 38px;
  }
  .footer {
    padding: 25px 20px;
    font-size: 0.75rem;
    gap: 14px;
  }
  .footer .icon {
    width: 13px;
    height: 13px;
  }
}

/* ---------- Reduced motion / print ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
@media print {
  body {
    background: #fff;
    color: #111;
    font-size: 11pt;
  }
  .nav,
  .grid-overlay,
  .hero__glow,
  .hero__constellation,
  .contact__glow,
  .scroll-progress,
  .project__visual,
  .hero__actions,
  .contact__links,
  .copy-email,
  .toast,
  .skip-link {
    display: none !important;
  }
  section {
    max-width: none;
    padding: 20px 0;
  }
  .hero {
    padding-top: 0;
  }
  .hero__title {
    font-size: 30pt;
  }
  .hero__readout {
    gap: 24px;
  }
  .hero__role,
  .hero__sub,
  .section-head p,
  .project__info p,
  .project__detail strong,
  .project__detail code,
  .experiment p,
  .about__copy p,
  .skill p,
  .timeline__content p,
  .contact p,
  .email-link {
    color: #444;
  }
  [data-reveal],
  .hero__line,
  .hero__status,
  .hero__role,
  .hero__sub,
  .hero__actions,
  .hero__readout {
    opacity: 1 !important;
    transform: none !important;
  }
  .project {
    display: block;
    padding: 20px 0;
    break-inside: avoid;
  }
  .experiments {
    display: block;
  }
  .experiment {
    background: none;
    break-inside: avoid;
    margin-bottom: 16px;
  }
  .about__layout {
    gap: 24px;
  }
  .about__aside,
  .skill {
    background: none;
  }
  .skills__grid {
    background: none;
  }
  .skill {
    break-inside: avoid;
  }
  .timeline__item {
    break-inside: avoid;
  }
  em,
  .project__tag,
  .skill__label,
  .timeline__content .timeline__org {
    color: #805100;
  }
  .footer {
    max-width: none;
    padding-inline: 0;
  }
}

/* Screenshot cards use the existing featured-project layout. */
.project__visual--legalaya { background: #131e26; }
.project__visual--curio { background: #201e35; }
.project__visual--yoru { background: #161b23; }
.project__preview-hint {
  position: absolute;
  right: 30px;
  bottom: 30px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #627086;
  border-radius: 6px;
  padding: 7px 11px;
  background: #0b1220;
  color: #e8eaf0;
  font-size: .75rem;
  line-height: 1.5;
  pointer-events: none;
}
.project__preview-hint .icon { width: 14px; height: 14px; }
#legalaya-experience { scroll-margin-top: 110px; }
html.has-project-preview { overflow: hidden; }
.project-preview {
  margin: auto;
  width: min(1400px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  padding: 20px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg);
  color: var(--text);
}
.project-preview::backdrop { background: rgba(3, 8, 17, .9); }
.project-preview__bar { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 16px; }
.project-preview__bar h2 { font-size: 1.15rem; line-height: 1.4; font-weight: 500; }
.project-preview__close { flex-shrink: 0; display: flex; gap: 10px; align-items: center; border: 1px solid var(--border); border-radius: 6px; padding: 8px 12px; color: var(--text); background: var(--surface); font: inherit; font-size: .875rem; cursor: pointer; }
.project-preview__close:hover { border-color: var(--accent); }
.project-preview__close span { font-size: 1.25rem; line-height: 1; }
.project-preview__image { display: block; width: 100%; max-height: calc(100dvh - 180px); object-fit: contain; border-radius: 6px; }
.project-preview__caption { margin-top: 12px; font-size: .8rem; color: var(--text-muted); }
@media (max-width: 600px) {
  .project__preview-hint { right: 17px; bottom: 17px; padding: 5px 8px; font-size: .65rem; }
  .project-preview { padding: 14px; width: calc(100% - 20px); }
}
@media print { .project-preview, .project__preview-hint { display: none !important; } }
