/* ==========================================================================
   Azzel Reyhanth Aristo · Portfolio
   One stylesheet, organised top to bottom:

   1. Fonts           6. Hero               11. Contact
   2. Tokens          7. Section heads      12. Footer
   3. Base            8. Work grid          13. Bottom sheet
   4. Utilities       9. About + timeline   14. 404 page
   5. Buttons, nav   10. Skills             15. Motion: reveals, i18n, reduced motion

   Shape rule: interactive controls are pills (999px). Large surfaces use
   24px, media inside them 16px, small tags 8px.
   ========================================================================== */

/* 1. Fonts ----------------------------------------------------------------- */

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../assets/fonts/geist-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("../assets/fonts/geist-mono-latin.woff2") format("woff2");
}

/* 2. Tokens ---------------------------------------------------------------- */

:root {
  color-scheme: dark;

  /* Surfaces: near-black with a faint violet cast, stepping up for depth */
  --bg: #0c0b10;
  --surface-1: #131219;
  --surface-2: #1a1822;
  --surface-3: #221f2c;
  --surface-4: #2b2837;
  --line: rgb(255 255 255 / 0.08);
  --line-strong: rgb(255 255 255 / 0.14);

  /* Text (contrast on --bg: 17.5 / 8.1 / 5.6) */
  --text: #f3f1f7;
  --text-2: #a9a4b6;
  --text-3: #8c8799;

  /* The one accent, plus one tint for text-sized purple on dark */
  --accent: #7457f5; /* white text on it: 4.75:1 */
  --accent-hover: #6a4cf0;
  --accent-tint: #b7a8ff; /* on --bg: 9.4:1 */

  /* Type */
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Radii */
  --r-sm: 8px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-pill: 999px;

  /* Shadows are tinted toward the background hue, one light source from above */
  --shadow-rest: 0 1px 2px rgb(4 2 12 / 0.4);
  --shadow-lift: 0 28px 56px -28px rgb(4 2 12 / 0.95), 0 12px 24px -12px rgb(4 2 12 / 0.7);
  --edge-light: inset 0 1px 0 rgb(255 255 255 / 0.06);

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.3, 0.64, 1); /* fallback; real spring below */
  --ease-spring-soft: cubic-bezier(0.25, 1, 0.5, 1);
  --press: 110ms;

  /* Layout */
  --container: 1200px;
  --gutter: clamp(16px, 4.5vw, 40px);
  --header-h: 64px;

  /* Layers */
  --z-bg: 0;
  --z-content: 1;
  --z-header: 50;
  --z-sheet: 100;
  --z-skip: 200;
}

/* Spring curves generated from a damped oscillator (damping 0.72 / 0.9) */
@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --ease-spring: linear(0, 0.023, 0.082, 0.164, 0.26, 0.36, 0.461, 0.556, 0.645, 0.724, 0.793, 0.852, 0.9, 0.94, 0.971,
      0.995, 1.012, 1.024, 1.032, 1.036, 1.038, 1.037, 1.035, 1.032, 1.029, 1.025, 1.021, 1.017, 1.014, 1.011, 1.008,
      1.006, 1.004, 1.003, 1.001, 1, 1);
    --ease-spring-soft: linear(0, 0.018, 0.062, 0.124, 0.196, 0.272, 0.35, 0.425, 0.496, 0.563, 0.624, 0.678, 0.727,
      0.77, 0.808, 0.841, 0.869, 0.893, 0.913, 0.93, 0.944, 0.956, 0.966, 0.974, 0.98, 0.985, 0.989, 0.992, 0.995, 0.997,
      0.998, 0.999, 1);
  }
}

/* 3. Base ------------------------------------------------------------------ */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
  scrollbar-gutter: stable;
  background: var(--bg);
}

/* Page scroll is locked while the project sheet is open */
html.is-locked {
  overflow: hidden;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

h1,
h2,
h3 {
  font-weight: 600;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

::selection {
  background: rgb(116 87 245 / 0.45);
  color: #fff;
}

/* One focus style everywhere: a purple ring for keyboard users only */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--accent-tint);
  outline-offset: 3px;
  border-radius: 6px;
}

/* 4. Utilities ------------------------------------------------------------- */

.container {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}

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

.icon {
  width: 1.125em;
  height: 1.125em;
  flex: none;
  fill: currentColor;
}

.tnum {
  font-variant-numeric: tabular-nums;
}

.anchor-alias {
  position: absolute;
  top: 0;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: var(--z-skip);
  padding: 10px 16px;
  border-radius: var(--r-pill);
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  font-size: 0.9375rem;
  transform: translateY(-160%);
  transition: transform 200ms var(--ease-out);
}

.skip-link:focus-visible {
  transform: none;
}

/* Background canvas sits behind everything and never takes input */
.bg-threads {
  position: fixed;
  inset: 0;
  z-index: var(--z-bg);
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 1;
  transition: opacity 900ms var(--ease-out);
}

.bg-threads.is-dim {
  opacity: 0.55;
}

main,
.site-footer {
  position: relative;
  z-index: var(--z-content);
}

/* 5. Buttons and navigation ----------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0 1.375rem;
  border-radius: var(--r-pill);
  font-size: 0.9375rem;
  font-weight: 550;
  letter-spacing: -0.005em;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition:
    transform var(--press) var(--ease-out),
    background-color 200ms var(--ease-out),
    box-shadow 200ms var(--ease-out),
    color 200ms var(--ease-out);
}

/* iOS-style press: the control gives slightly under the finger */
.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  position: relative;
  overflow: hidden;
  background: var(--accent);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.18),
    0 10px 24px -14px rgb(116 87 245 / 0.8);
}

/* A light sweep across the one filled, coloured button on the page. Only
   the actual sweep is gated to fine-pointer hover; it never runs on tap. */
.btn-primary::before {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 45%;
  height: 100%;
  background: linear-gradient(115deg, transparent, rgb(255 255 255 / 0.5), transparent);
  transform: skewX(-18deg);
  pointer-events: none;
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.icon-nudge {
  transition: transform 260ms var(--ease-out);
}

/* The same restrained glow-pop reused on every uncoloured button so the
   whole set feels like one family: a soft accent wash fades in from the
   center, distinct from the primary button's literal shine. */
.btn-secondary,
.icon-btn,
.nav-cv,
.pill-link,
.menu-btn {
  position: relative;
}

.btn-secondary::before,
.icon-btn::before,
.nav-cv::before,
.pill-link::before,
.menu-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 50%, rgb(124 92 255 / 0.4), transparent 72%);
  opacity: 0;
  transform: scale(0.6);
  transition:
    opacity 260ms var(--ease-out),
    transform 420ms var(--ease-spring-soft);
  pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover::before {
    animation: btn-shine 950ms var(--ease-out);
  }
  .btn-primary:hover {
    background: var(--accent-hover);
  }
  .btn-secondary:hover {
    background: var(--surface-3);
  }
  .btn-secondary:hover::before,
  .icon-btn:hover::before,
  .nav-cv:hover::before,
  .pill-link:hover::before,
  .menu-btn:hover::before {
    opacity: 1;
    transform: scale(1);
  }
  .btn:hover .icon-nudge {
    transform: translateX(3px);
  }
}

@keyframes btn-shine {
  from {
    left: -60%;
  }
  to {
    left: 125%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn-primary:hover::before {
    animation: none;
  }
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  color: var(--text-2);
  transition:
    transform var(--press) var(--ease-out),
    background-color 200ms,
    color 200ms;
}

.icon-btn:active {
  transform: scale(0.92);
}

@media (hover: hover) and (pointer: fine) {
  .icon-btn:hover {
    background: var(--surface-4);
    color: var(--text);
  }
}

/* Header: translucent material with content scrolling underneath */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: rgb(12 11 16 / 0.72);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  backdrop-filter: saturate(160%) blur(18px);
  box-shadow: 0 1px 0 transparent;
  transition: box-shadow 300ms var(--ease-out), background-color 300ms var(--ease-out);
}

.site-header.is-scrolled {
  box-shadow: 0 1px 0 var(--line);
}

.nav {
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  padding: 4px 6px 4px 0;
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: -0.02em;
  border-radius: var(--r-sm);
  transition: transform var(--press) var(--ease-out);
}

.brand:active {
  transform: scale(0.97);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  font-size: 0.9375rem;
  font-weight: 650;
  letter-spacing: -0.04em;
}

.nav-primary {
  display: none;
}

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

.nav-links a {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  color: var(--text-2);
  font-size: 0.9375rem;
  font-weight: 500;
  transition:
    color 200ms var(--ease-out),
    background-color 200ms var(--ease-out),
    transform var(--press) var(--ease-out);
}

.nav-links a:active {
  transform: scale(0.96);
}

.nav-links a[aria-current="true"] {
  color: var(--text);
  background: var(--surface-2);
}

@media (hover: hover) and (pointer: fine) {
  .nav-links a:hover {
    color: var(--text);
  }
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.nav-cv {
  display: none;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  font-size: 0.875rem;
  font-weight: 550;
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  transition:
    background-color 200ms var(--ease-out),
    transform var(--press) var(--ease-out);
}

.nav-cv:active {
  transform: scale(0.96);
}

@media (hover: hover) and (pointer: fine) {
  .nav-cv:hover {
    background: var(--surface-2);
  }
}

/* Segmented control (EN | ID). The pill slides on a spring curve. */
.seg {
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: transform 160ms var(--ease-out);
}

.seg:has(.seg-btn:active) {
  transform: scale(0.95);
}

.seg-pill {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 3px);
  border-radius: var(--r-pill);
  background: var(--surface-4);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.1),
    0 2px 6px rgb(4 2 12 / 0.5);
  transition: transform 560ms var(--ease-spring);
}

.seg[data-active="id"] .seg-pill {
  transform: translateX(100%);
}

.seg-btn {
  position: relative;
  z-index: 1;
  min-width: 40px;
  height: 30px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-3);
  -webkit-tap-highlight-color: transparent;
  transition: color 240ms var(--ease-out);
}

.seg-btn[aria-pressed="true"] {
  color: var(--text);
}

@media (hover: hover) and (pointer: fine) {
  .seg-btn:hover {
    color: var(--text);
  }
}

.seg-btn:focus-visible {
  outline-offset: 1px;
  border-radius: var(--r-pill);
}

/* Mobile menu */
.menu-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-pill);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color 200ms,
    transform var(--press) var(--ease-out);
}

.menu-btn:active {
  transform: scale(0.92);
}

.menu-btn .icon {
  grid-area: 1 / 1;
  width: 22px;
  height: 22px;
  transition:
    opacity 180ms var(--ease-out),
    transform 260ms var(--ease-out);
}

.menu-btn .icon-close,
.menu-btn[aria-expanded="true"] .icon-open {
  opacity: 0;
  transform: rotate(-45deg) scale(0.7);
}

.menu-btn[aria-expanded="true"] .icon-close {
  opacity: 1;
  transform: none;
}

.mobile-menu {
  border-top: 1px solid var(--line);
  padding: 8px 0 20px;
  transform-origin: top center;
  animation: menu-in 280ms var(--ease-out);
}

.mobile-menu[hidden] {
  display: none;
}

.mobile-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  font-size: 1.375rem;
  font-weight: 550;
  letter-spacing: -0.02em;
  transition:
    color 200ms,
    transform var(--press) var(--ease-out);
}

.mobile-links a:active {
  transform: scale(0.98);
}

.mobile-links li:last-child a {
  margin-top: 8px;
  font-size: 1rem;
  color: var(--text-2);
}

@keyframes menu-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
}

@media (min-width: 760px) {
  .nav-primary {
    display: block;
  }
  .nav-cv {
    display: inline-flex;
  }
  .menu-btn,
  .mobile-menu {
    display: none !important;
  }
  .brand {
    margin-right: 0;
  }
  .nav-primary {
    margin-inline: auto;
  }
}

/* 6. Hero ------------------------------------------------------------------ */

.hero {
  position: relative;
  display: grid;
  align-content: center;
  gap: 28px;
  min-height: calc(100svh - var(--header-h));
  padding-block: clamp(32px, 7vh, 88px) clamp(32px, 6vh, 72px);
}

.hero-copy {
  max-width: 44rem;
}

.hero-role {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--accent-tint);
}

.hero-name {
  margin-top: 14px;
  font-size: clamp(2.75rem, 8.4vw, 5.75rem);
  line-height: 0.98;
  letter-spacing: -0.048em;
  font-weight: 600;
}

.hero-statement {
  margin-top: 24px;
  max-width: 34rem;
  font-size: clamp(1.125rem, 1.9vw, 1.3125rem);
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--text-2);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

/* On phones the portrait becomes a small avatar above the name */
.hero-portrait {
  order: -1;
  width: 88px;
  aspect-ratio: 1;
  border-radius: 24px;
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: var(--shadow-lift), inset 0 0 0 1px var(--line);
}

.hero-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 22%;
}

@media (min-width: 880px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
    align-items: end;
    column-gap: clamp(40px, 7vw, 112px);
  }
  .hero-portrait {
    order: 0;
    width: 100%;
    aspect-ratio: 4 / 5;
    border-radius: var(--r-lg);
    position: relative;
    /* A slight, deliberate tilt, like a photo set down on a desk, plus the
       existing offset so it sits a touch lower than the copy block. */
    transform: translateY(24px) rotate(4deg);
    transition: transform 480ms var(--ease-spring-soft);
  }
  /* Purple glow behind the card, biased toward the upper-right corner */
  .hero-portrait::before {
    content: "";
    position: absolute;
    inset: -55% -70% -45% -25%;
    z-index: -1;
    border-radius: 50%;
    background: radial-gradient(closest-side at 66% 30%, rgb(124 92 255 / 0.65), rgb(124 92 255 / 0) 68%);
    filter: blur(46px);
    pointer-events: none;
  }
  .hero-portrait::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px var(--line), var(--edge-light);
    pointer-events: none;
  }
  .hero-portrait img {
    object-position: center;
  }

  @media (hover: hover) and (pointer: fine) {
    .hero-portrait:hover {
      transform: translateY(20px) rotate(1.5deg) scale(1.015);
    }
  }
}

@media (min-width: 880px) and (prefers-reduced-motion: reduce) {
  .hero-portrait {
    transition: none;
  }
}

/* Hero entrance: a short, staggered settle on first load */
@media (prefers-reduced-motion: no-preference) {
  .js [data-enter] {
    animation: enter 720ms var(--ease-out) both;
    animation-delay: calc(var(--i, 0) * 70ms + 60ms);
  }
  @media (min-width: 880px) {
    .js .hero-portrait[data-enter] {
      animation-name: enter-portrait;
    }
  }
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

@keyframes enter-portrait {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.98);
  }
}

/* 7. Section heads --------------------------------------------------------- */

.section {
  padding-block: clamp(48px, 8vw, 112px) clamp(56px, 9vw, 128px);
}

.section-head {
  max-width: 40rem;
  margin-bottom: clamp(40px, 6vw, 72px);
}

.section-head h2,
.about-title {
  font-size: clamp(2rem, 4.6vw, 3.25rem);
  line-height: 1.04;
  letter-spacing: -0.038em;
}

.section-head p {
  margin-top: 16px;
  color: var(--text-2);
  max-width: 34rem;
}

/* 8. Work grid ------------------------------------------------------------- */

.work-grid {
  display: grid;
  gap: clamp(16px, 2.2vw, 28px);
}

.work-item {
  min-width: 0;
}

@media (min-width: 640px) and (max-width: 879px) {
  .work-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .work-item:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

@media (min-width: 880px) {
  .work-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }
  /* 7/5, then 5/7: a staggered rhythm instead of an even grid */
  .work-item:nth-child(4n + 1),
  .work-item:nth-child(4n + 4) {
    grid-column: span 7;
  }
  .work-item:nth-child(4n + 2),
  .work-item:nth-child(4n + 3) {
    grid-column: span 5;
  }
  .work-item:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

.work-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 10px;
  border-radius: var(--r-lg);
  background: var(--surface-1);
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-rest);
  transition:
    transform 520ms var(--ease-spring-soft),
    box-shadow 320ms var(--ease-out),
    background-color 320ms var(--ease-out);
}

.work-media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border-radius: var(--r-md);
  background: var(--surface-2);
}

.work-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 700ms var(--ease-out);
}

.work-media[data-fit="contain"] img {
  object-fit: contain;
  object-position: center;
}

@media (min-width: 880px) {
  .work-media {
    aspect-ratio: auto;
    height: clamp(240px, 27vw, 360px);
  }
}

.work-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 20px 14px 10px;
}

.work-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.work-title {
  font-size: 1.375rem;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

/* The title's button covers the whole card, so the card is one tap target */
.work-open {
  text-align: left;
  font-weight: inherit;
  letter-spacing: inherit;
}

.work-open::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: var(--r-lg);
}

.work-open:focus-visible {
  outline: none;
}

.work-open:focus-visible::after {
  outline: 2px solid var(--accent-tint);
  outline-offset: 3px;
}

.work-year,
.work-type {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-3);
  white-space: nowrap;
}

.work-summary {
  max-width: 46ch;
  color: var(--text-2);
  font-size: 1rem;
  line-height: 1.55;
}

.work-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
  padding-top: 18px;
}

.work-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9375rem;
  font-weight: 550;
  color: var(--accent-tint);
}

.work-more .icon {
  transition: transform 300ms var(--ease-out);
}

.work-card:has(.work-open:active) {
  transform: scale(0.985);
  transition-duration: var(--press);
}

@media (hover: hover) and (pointer: fine) {
  .work-card:hover {
    transform: translateY(-4px);
    background: #16151d;
    box-shadow: inset 0 0 0 1px var(--line-strong), var(--shadow-lift);
  }
  .work-card:hover .work-media img {
    transform: scale(1.025);
  }
  .work-card:hover .work-more .icon {
    transform: translateX(3px);
  }
}

.noscript-note {
  color: var(--text-2);
}

.noscript-list {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.noscript-list a {
  color: var(--accent-tint);
  text-decoration: underline;
}

/* 9. About + timeline ------------------------------------------------------ */

.about-grid {
  display: grid;
  gap: 32px;
}

.about-lead {
  font-size: clamp(1.375rem, 2.6vw, 1.875rem);
  line-height: 1.35;
  letter-spacing: -0.022em;
  font-weight: 500;
  max-width: 36ch;
}

.about-copy {
  display: grid;
  gap: 18px;
  margin-top: 28px;
  color: var(--text-2);
}

.about-copy p {
  max-width: 62ch;
}

.about-langs {
  display: grid;
  gap: 4px;
  margin-top: 28px;
  font-size: 0.9375rem;
}

.label {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-3);
}

/* One restrained purple highlight, reused wherever a heading or the hero
   name needs a single accented word instead of an eyebrow or a full-line
   gradient. Never on body copy, never more than one span per heading. */
.accent {
  color: var(--accent-tint);
}

.timeline-title {
  margin-top: clamp(32px, 6vw, 64px);
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.timeline {
  display: grid;
  gap: 28px;
}

.tl-item {
  display: grid;
  gap: 6px;
}

.tl-period {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  padding-top: 3px;
}

.tl-title {
  font-weight: 600;
  letter-spacing: -0.012em;
}

.tl-org {
  color: var(--text-2);
}

.tl-note {
  margin-top: 4px;
  color: var(--text-3);
  font-size: 0.9375rem;
  max-width: 58ch;
}

@media (min-width: 640px) {
  .tl-item {
    grid-template-columns: 8rem minmax(0, 1fr);
    gap: 24px;
  }
}

@media (min-width: 880px) {
  .about-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 28px;
    row-gap: 0;
  }
  /* One sticky label for the whole section (bio + timeline together), so
     there is never a second sticky element to collide with. Each piece of
     right-column content gets its own row, so nothing shares a grid cell. */
  .about-title {
    grid-column: 1 / 5;
    grid-row: 1 / 4;
    align-self: start;
    position: sticky;
    top: calc(var(--header-h) + 32px);
  }
  .about-body {
    grid-column: 5 / 13;
    grid-row: 1;
  }
  .about-copy {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }
  .timeline-title {
    grid-column: 5 / 13;
    grid-row: 2;
    margin-top: clamp(56px, 8vw, 96px);
  }
  .timeline {
    grid-column: 5 / 13;
    grid-row: 3;
    margin-top: 32px;
  }
}

/* 10. Skills --------------------------------------------------------------- */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px 20px;
}

/* Every group is the same shape (one radius, one card language); only the
   primary panel is larger and gets the accent-colored heading. */
.skill-group {
  padding: clamp(20px, 2.8vw, 32px);
  border-radius: var(--r-lg);
  background: var(--surface-1);
  box-shadow: inset 0 0 0 1px var(--line), var(--edge-light);
  transition: box-shadow 240ms var(--ease-out), background-color 240ms var(--ease-out);
}

.skill-group--primary {
  grid-column: 1 / -1;
  padding: clamp(24px, 3.4vw, 44px);
}

@media (hover: hover) and (pointer: fine) {
  .skill-group:hover {
    background: var(--surface-2);
    box-shadow: inset 0 0 0 1px var(--line-strong), var(--edge-light);
  }
}

.skill-name {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--text-2);
}

.skill-group--primary .skill-name {
  color: var(--accent-tint);
}

.skill-note {
  margin-top: 8px;
  max-width: 36ch;
  color: var(--text-2);
  font-size: 1rem;
}

.skill-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.skill-list li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.skill-logo {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--text-2);
}

/* Axure has no vector brand mark in the icon sets used elsewhere on this
   page, so this one is a raster crop of its real glyph (recolored to match
   the SVG icons); let it keep its natural aspect ratio instead of the
   square box the SVGs use. */
.skill-logo[src] {
  width: auto;
  height: 20px;
}

.skill-logo-pair {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
}

.skill-logo-pair .icon {
  width: 20px;
  height: 20px;
  color: var(--text-2);
}

.skill-list--lg {
  gap: 10px;
  margin-top: 28px;
}

.skill-list--lg li {
  gap: clamp(10px, 1.4vw, 16px);
  font-size: clamp(1.75rem, 3.6vw, 2.625rem);
  font-weight: 550;
  letter-spacing: -0.035em;
  line-height: 1.18;
}

.skill-list--lg .skill-logo {
  width: 0.68em;
  height: 0.68em;
  color: var(--text);
}

@media (min-width: 880px) {
  .skills-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 28px;
  }
  .skill-group--primary {
    grid-column: 1 / 7;
    grid-row: 1 / 3;
  }
  .skill-group:nth-child(2) {
    grid-column: 7 / 10;
  }
  .skill-group:nth-child(3) {
    grid-column: 10 / 13;
  }
  .skill-group:nth-child(4) {
    grid-column: 7 / 10;
  }
  .skill-group:nth-child(5) {
    grid-column: 10 / 13;
  }
  .skill-group:not(.skill-group--primary) {
    align-self: start;
  }
}

/* Logo marquee: full-bleed, edges masked to transparent, seamless CSS loop */

.marquee {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-top: clamp(48px, 7vw, 88px);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee-scroll 36s linear infinite;
}

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

.marquee-group {
  display: flex;
  align-items: center;
  flex: none;
  gap: clamp(40px, 6vw, 72px);
  padding-inline: clamp(20px, 3vw, 36px);
}

.marquee-logo {
  display: grid;
  place-items: center;
  flex: none;
  color: var(--text-3);
  transition: color 240ms var(--ease-out);
}

.marquee-logo .icon {
  width: clamp(26px, 3vw, 34px);
  height: clamp(26px, 3vw, 34px);
}

@media (hover: hover) and (pointer: fine) {
  .marquee-logo:hover {
    color: var(--text);
  }
}

@keyframes marquee-scroll {
  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .marquee {
    width: auto;
    margin-left: 0;
    -webkit-mask-image: none;
    mask-image: none;
    overflow: visible;
  }
  .marquee-track {
    animation: none;
    flex-wrap: wrap;
    width: auto;
  }
  .marquee-group:last-child {
    display: none;
  }
  .marquee-group {
    flex-wrap: wrap;
  }
}

/* 11. Contact -------------------------------------------------------------- */

.contact {
  padding-bottom: clamp(96px, 12vw, 160px);
}

.contact-title {
  max-width: 15ch;
  font-size: clamp(2.25rem, 6vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.contact-body {
  margin-top: 20px;
  max-width: 44ch;
  color: var(--text-2);
}

.contact-email {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  margin-top: clamp(40px, 6vw, 64px);
}

.email-link {
  font-size: clamp(1.25rem, 5.2vw, 3rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.15;
  overflow-wrap: anywhere;
  padding-bottom: 4px;
  background: linear-gradient(var(--accent), var(--accent)) no-repeat left bottom / 0% 2px;
  transition: background-size 420ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .email-link:hover {
    background-size: 100% 2px;
  }
}

.email-link:focus-visible {
  background-size: 100% 2px;
}

/* Copy button: icon swaps copy -> check, label swaps text */
.btn-copy {
  min-height: 44px;
  padding: 0 1.125rem;
}

.copy-icons {
  display: grid;
}

.copy-icons .icon {
  grid-area: 1 / 1;
  transition:
    opacity 180ms var(--ease-out),
    transform 320ms var(--ease-spring);
}

.icon-check,
.btn-copy.is-copied .icon-copy {
  opacity: 0;
  transform: scale(0.5);
}

.btn-copy.is-copied .icon-check {
  opacity: 1;
  transform: none;
  color: var(--accent-tint);
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: clamp(40px, 5vw, 56px);
}

.pill-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 18px 0 16px;
  border-radius: var(--r-pill);
  background: var(--surface-1);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 0.9375rem;
  font-weight: 500;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color 200ms var(--ease-out),
    box-shadow 200ms var(--ease-out),
    transform var(--press) var(--ease-out);
}

.pill-link .icon {
  color: var(--text-2);
}

.pill-link .icon-out {
  width: 0.875em;
  height: 0.875em;
  color: var(--text-3);
  transition: transform 260ms var(--ease-out);
}

.pill-link:active {
  transform: scale(0.97);
}

@media (hover: hover) and (pointer: fine) {
  .pill-link:hover {
    background: var(--surface-2);
    box-shadow: inset 0 0 0 1px var(--line-strong);
  }
  .pill-link:hover .icon-out {
    transform: translate(2px, -2px);
  }
}

/* 12. Footer --------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--line);
  font-size: 0.875rem;
  color: var(--text-3);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding-block: 28px calc(28px + env(safe-area-inset-bottom));
}

.footer-top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  transition:
    color 200ms,
    transform var(--press) var(--ease-out);
}

.footer-top:active {
  transform: scale(0.96);
}

.footer-top .icon {
  transition: transform 260ms var(--ease-spring-soft);
}

@media (hover: hover) and (pointer: fine) {
  .footer-top:hover {
    color: var(--text);
  }
  /* The arrow already points up; hovering nudges it the way it points */
  .footer-top:hover .icon {
    transform: translateY(-3px);
  }
}

/* 13. Bottom sheet --------------------------------------------------------- */
/* Positions are driven from js/sheet.js with a spring; CSS only styles it. */

.sheet-root {
  position: fixed;
  inset: 0;
  z-index: var(--z-sheet);
}

.sheet-root[hidden] {
  display: none;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgb(6 5 10 / 0.6);
  -webkit-backdrop-filter: blur(8px) saturate(120%);
  backdrop-filter: blur(8px) saturate(120%);
  opacity: 0;
  touch-action: none;
}

.sheet {
  --compact: 236px;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  width: min(100%, 960px);
  height: 92vh;
  height: min(92dvh, 920px);
  margin-inline: auto;
  overflow: hidden;
  border-radius: 28px 28px 0 0;
  background: var(--surface-1);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.09),
    inset 0 0 0 1px var(--line),
    0 -24px 80px -24px rgb(0 0 0 / 0.8);
  transform: translate3d(0, 110%, 0);
  will-change: transform;
}

.sheet:focus-visible {
  outline: none;
}

.sheet-top {
  position: relative;
  flex: none;
  display: flex;
  justify-content: center;
  height: 52px;
  touch-action: none;
  cursor: grab;
  user-select: none;
}

.sheet.is-dragging .sheet-top {
  cursor: grabbing;
}

.sheet-grabber {
  margin-top: 8px;
  width: 40px;
  height: 5px;
  border-radius: 3px;
  background: rgb(255 255 255 / 0.2);
  transition: background-color 200ms;
}

.sheet.is-dragging .sheet-grabber {
  background: rgb(255 255 255 / 0.36);
}

.sheet-close {
  position: absolute;
  top: 12px;
  right: 14px;
}

/* Loading state: the project mark with a thin purple ring drawing around it */
.sheet-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--compact);
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  padding-top: 12px;
  pointer-events: none;
  transition:
    opacity 220ms var(--ease-out),
    transform 360ms var(--ease-out);
}

.loader-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
}

.loader-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.loader-track,
.loader-arc {
  fill: none;
  stroke-width: 1.75;
}

.loader-track {
  stroke: rgb(255 255 255 / 0.07);
}

.loader-arc {
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-dasharray: 232.5;
  stroke-dashoffset: 232.5;
}

.sheet[data-state="loading"] .loader-arc {
  animation: ring-draw var(--load-ms, 800ms) var(--ease-in-out) forwards;
}

.sheet[data-state="loading"] .loader-glyph {
  animation: glyph-breathe var(--load-ms, 800ms) var(--ease-in-out) both;
}

.loader-glyph,
.sc-mark {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: var(--surface-3);
  font-size: 1.3125rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.08),
    0 10px 24px -12px rgb(0 0 0 / 0.9);
}

.loader-text {
  font-size: 0.9375rem;
  color: var(--text-2);
}

.loader-text b {
  color: var(--text);
  font-weight: 600;
}

@keyframes ring-draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes glyph-breathe {
  0% {
    transform: scale(0.94);
  }
  55% {
    transform: scale(1.03);
  }
  100% {
    transform: scale(1);
  }
}

.sheet[data-state="ready"] .sheet-loading {
  opacity: 0;
  transform: translateY(-10px) scale(0.96);
}

/* Detail view: fades in as the sheet expands */
.sheet-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 360ms var(--ease-out) 80ms,
    visibility 0s linear 440ms;
}

.sheet[data-state="ready"] .sheet-scroll {
  opacity: 1;
  visibility: visible;
  transition:
    opacity 360ms var(--ease-out) 80ms,
    visibility 0s;
}

.sheet-content {
  max-width: 820px;
  margin-inline: auto;
  padding: 0 clamp(20px, 5vw, 48px) calc(48px + env(safe-area-inset-bottom));
}

.sheet[data-state="ready"] .sc-reveal {
  animation: sc-in 560ms var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 55ms + 90ms);
}

@keyframes sc-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

.sc-head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sc-mark {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  font-size: 1.125rem;
  flex: none;
}

.sc-title {
  font-size: clamp(1.75rem, 4.4vw, 2.5rem);
  line-height: 1.05;
  letter-spacing: -0.038em;
}

.sc-meta {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-3);
}

.sc-figure {
  margin-top: 28px;
  overflow: hidden;
  border-radius: var(--r-md);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
}

.sc-figure img {
  width: 100%;
}

.sc-figure[data-fit="contain"] {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
}

.sc-figure[data-fit="contain"] img {
  width: auto;
  height: 100%;
  object-fit: contain;
}

.sc-grid {
  display: grid;
  gap: 32px;
  margin-top: 36px;
}

.sc-label,
.sc-facts dt {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--text-3);
}

.sc-desc {
  margin-top: 10px;
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--text);
}

.sc-facts {
  display: grid;
  gap: 22px;
  align-content: start;
}

.sc-facts dd {
  margin: 6px 0 0;
  color: var(--text-2);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chips li {
  padding: 4px 10px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text);
}

.sc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 40px;
}

@media (min-width: 720px) {
  .sc-grid {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 48px;
  }
}

/* Reduced motion: the sheet simply fades, nothing slides */
.sheet-root.is-rm .sheet,
.sheet-root.is-rm .sheet-backdrop {
  transition: opacity 220ms ease;
}

/* 14. 404 page ------------------------------------------------------------- */

.nf {
  display: grid;
  align-content: center;
  min-height: calc(100svh - var(--header-h) - 90px);
  padding-block: 64px;
}

.nf-code {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--accent-tint);
}

.nf-title {
  margin-top: 14px;
  max-width: 14ch;
  font-size: clamp(2.5rem, 7vw, 4.75rem);
  line-height: 1;
  letter-spacing: -0.045em;
}

.nf-body {
  margin-top: 20px;
  max-width: 40ch;
  color: var(--text-2);
}

.nf .btn {
  margin-top: 36px;
  justify-self: start;
}

/* 15. Motion: scroll reveals, language switch, reduced motion -------------- */

.js .reveal {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 560ms var(--ease-out),
    transform 720ms var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

/* Language switch: text blurs out, swaps, and settles back in (~300ms) */
.i18n-anim [data-i18n],
.i18n-anim [data-i18n-html],
.i18n-anim [data-i18n-dyn] {
  transition:
    opacity 110ms var(--ease-out),
    filter 110ms var(--ease-out);
  transition-delay: var(--i18n-delay, 0ms);
}

.i18n-out {
  opacity: 0 !important;
  filter: blur(4px);
}

/* Hide untranslated text for the first frame when the page opens in ID */
.i18n-pending [data-i18n],
.i18n-pending [data-i18n-html] {
  visibility: hidden;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .js .reveal {
    transform: none;
    transition: opacity 240ms linear;
  }
  .seg-pill {
    transition: none;
  }
  .work-card,
  .work-media img {
    transition-property: background-color, box-shadow;
  }
  .sheet[data-state="loading"] .loader-arc {
    animation: none;
    stroke-dashoffset: 0;
    opacity: 0.6;
  }
  .sheet[data-state="loading"] .loader-glyph,
  .sheet[data-state="ready"] .sc-reveal {
    animation: none;
  }
  .sheet-loading {
    transition: opacity 200ms linear;
  }
  .sheet[data-state="ready"] .sheet-loading {
    transform: none;
  }
  .mobile-menu {
    animation: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .site-header {
    background: var(--bg);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .sheet-backdrop {
    background: rgb(6 5 10 / 0.85);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (prefers-contrast: more) {
  :root {
    --line: rgb(255 255 255 / 0.28);
    --line-strong: rgb(255 255 255 / 0.4);
    --text-2: #cfcbd9;
    --text-3: #b3aec0;
  }
}
