/* ==========================================================
   Wilson Hidayat — portfolio
   "Showroom turntable" dark theme.
   Edit the variables below to change the look site-wide.
   ========================================================== */
:root {
  --bg: #0f1a15;          /* dark showroom green */
  --ink: #f2f1ec;         /* main text */
  --muted: #b9c2bc;       /* secondary text */
  --accent: #9fd3b8;      /* mint highlight */
  --line: #2a3a32;        /* hairlines */
  --control: #3a4c42;     /* round button outlines */
  --tile-bg: #1c2a23;     /* behind images while they load */
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --pad: clamp(1.25rem, 4vw, 3rem);
  --max: 1440px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.0625rem;
  line-height: 1.6;
}
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
h1, h2, h3 { line-height: 1.05; font-weight: 500; letter-spacing: -0.03em; margin: 0; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--ink); color: var(--bg); padding: .5rem 1rem; z-index: 10; }
.mono { font-family: var(--font-mono); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.25rem var(--pad);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
}
.brand img { height: 36px; width: auto; filter: brightness(0) invert(.95); } /* logo file is black; this turns it off-white */
.site-header nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem clamp(1rem, 3vw, 2rem); font-family: var(--font-mono); font-size: .875rem; }
.site-header nav a[aria-current="page"] { color: var(--accent); }

main { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }

/* ---------- buttons ---------- */
.button {
  display: inline-block; background: var(--ink); color: var(--bg);
  padding: 1rem 1.75rem; border-radius: 999px; font-family: var(--font-mono); font-size: .875rem;
  white-space: nowrap;
}
.button:hover { background: var(--accent); color: var(--bg); }
.ctrl {
  width: 56px; height: 56px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: none; border: 1px solid var(--control); color: var(--ink); cursor: pointer;
}
.ctrl:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- home: hero ---------- */
.home-hero {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 1.5rem;
  padding: clamp(1.5rem, 5vw, 3rem) 0 0;
}
.home-hero h1 { font-size: clamp(3rem, 7vw, 5.5rem); line-height: .92; letter-spacing: -0.04em; }
.home-hero p { margin: 0; max-width: 22rem; font-family: var(--font-mono); font-size: .85rem; color: var(--muted); }

/* ---------- home: turntable ----------
   By default (phones, or if JavaScript is off) the projects are a
   swipeable strip. On screens 768px+ the script adds .is-3d and the
   strip becomes a rotating ring. */
.turntable { margin: clamp(1.5rem, 4vw, 2.5rem) calc(var(--pad) * -1) 0; }.tt-ring {
  list-style: none; margin: 0; padding: 0 var(--pad) 1rem;
  display: flex; gap: 1rem;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 var(--pad);
  -webkit-overflow-scrolling: touch;
}
.tt-card { flex: 0 0 min(82%, 420px); scroll-snap-align: start; }
.tt-card a { display: block; }
.tt-img { display: block; aspect-ratio: 25 / 17; overflow: hidden; background: var(--tile-bg); box-shadow: 0 30px 60px rgba(0,0,0,.45); }
.tt-img img { width: 100%; height: 100%; object-fit: cover; }
.tt-cap { display: flex; gap: .75rem; align-items: baseline; padding-top: .75rem; }
.tt-num { font-family: var(--font-mono); font-size: .75rem; color: var(--accent); }
.tt-title { font-size: 1.25rem; font-weight: 500; }
.tt-kind { display: block; font-family: var(--font-mono); font-size: .75rem; color: var(--muted); }
.tt-panel { display: none; }
.tt-more { padding: 1.5rem 0 3rem; font-family: var(--font-mono); font-size: .875rem; }
.tt-more a { border-bottom: 1px solid var(--control); padding-bottom: 2px; }

/* 3D ring (added by js/turntable.js) */
.turntable.is-3d { --card-w: clamp(320px, 36vw, 500px); overflow: hidden; }
.is-3d .tt-stage { perspective: 2200px; perspective-origin: 50% 30%; height: calc(var(--card-w) * .68 + 70px); }
.is-3d .tt-ring {
  display: block; position: relative; height: 100%; padding: 0; overflow: visible;
  transform-style: preserve-3d;
  transition: transform 1s cubic-bezier(.22,.8,.2,1);
}
.is-3d .tt-card {
  position: absolute; left: 50%; top: 0;
  width: var(--card-w); margin-left: calc(var(--card-w) / -2);
  transition: opacity .6s ease, filter .6s ease;
  backface-visibility: hidden;   /* hide the mirrored backs of cards facing away */
}
.is-3d .tt-kind { display: none; }.is-3d .tt-panel {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1.5rem;
  padding: .5rem var(--pad) 0;
}
.tt-info { display: flex; flex-direction: column; gap: .4rem; }
.tt-info-meta { font-family: var(--font-mono); font-size: .8rem; color: var(--accent); }
.tt-info-title { font-size: clamp(2rem, 3.5vw, 2.75rem); font-weight: 500; letter-spacing: -0.03em; line-height: 1; }
.tt-info-line { font-family: var(--font-mono); font-size: .8rem; color: var(--muted); max-width: 32rem; }
.tt-controls { display: flex; align-items: center; gap: 1rem; }
.tt-controls .button { margin-left: 1rem; }
.is-3d + .tt-more { padding: 2rem 0 3rem; }

/* Phone drum (added by js/turntable.js below 768px): a vertical reel, like a slot machine.
   The top and bottom fade out so it reads as a window onto the reel. */
.turntable.is-drum { --card-w: min(78vw, 420px); }
.is-drum .tt-stage {
  position: relative; overflow: hidden;
  height: calc(var(--card-w) * 1.45);
  perspective: 900px;
  touch-action: none;   /* a finger on the reel rolls it instead of scrolling the page */
  -webkit-user-select: none; user-select: none;   /* no text selection or image drag while rolling */
  -webkit-touch-callout: none;
  cursor: grab;
  -webkit-mask-image: linear-gradient(transparent, #000 20%, #000 80%, transparent);
          mask-image: linear-gradient(transparent, #000 20%, #000 80%, transparent);
}
.is-drum .tt-ring {
  display: block; position: relative; height: 100%; padding: 0; overflow: visible;
  transform-style: preserve-3d;
  transition: transform .7s cubic-bezier(.22,.8,.2,1);
}
.is-drum .tt-card {
  position: absolute; left: 50%; top: 50%;
  width: var(--card-w); margin-left: calc(var(--card-w) / -2); margin-top: calc(var(--card-w) * -0.4);
  backface-visibility: hidden;
  transition: opacity .5s ease, filter .5s ease;
}
.is-drum .tt-kind { display: none; }
.is-drum .tt-img img { -webkit-user-drag: none; pointer-events: none; }   /* stops the phone grabbing the picture itself */
.is-drum .tt-panel {
  display: flex; flex-direction: column; align-items: stretch; gap: 1rem;
  padding: .75rem var(--pad) 0;
}
.is-drum .tt-info-title { font-size: 1.9rem; }
.is-drum .tt-controls .button { margin-left: auto; }
.is-drum .ctrl { width: 48px; height: 48px; }
.is-drum .tt-prev svg, .is-drum .tt-next svg { transform: rotate(90deg); }   /* arrows point up / down */

/* ---------- project page ---------- */
.hero { margin: 0 calc(var(--pad) * -1); background: var(--tile-bg); }
.hero img { width: 100%; max-height: 85vh; object-fit: cover; }
.project-head {
  display: grid; gap: 2rem 4rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  padding: clamp(2.5rem, 7vw, 5rem) 0 clamp(2rem, 5vw, 3rem);
}
.eyebrow { font-family: var(--font-mono); font-size: .8rem; color: var(--accent); margin: 0 0 1rem; }
.project-head h1 { font-size: clamp(2.6rem, 7vw, 5rem); letter-spacing: -0.04em; }
.tagline { font-size: clamp(1.15rem, 2vw, 1.5rem); margin: 1rem 0 0; max-width: 28rem; color: var(--muted); }
.award {
  display: inline-block; margin-top: 1.5rem; padding: .4rem .9rem;
  font-family: var(--font-mono); font-size: .75rem;
  border: 1px solid var(--accent); color: var(--accent); border-radius: 999px;
}
/* Award with the awarding body's logo beside it (Rieaya). */
.award-row { display: flex; align-items: center; gap: 1rem; margin-top: 1.5rem; }
.award-row .award { margin-top: 0; }
.award-logo { width: 64px; height: 64px; flex: none; border-radius: 6px; }
.project-body p { font-family: var(--font-mono); font-size: .9rem; color: var(--muted); margin: 0 0 1rem; max-width: 40rem; }
.brand-logo { max-width: 160px; margin-bottom: 1.5rem; }

.meta {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem 2rem;
  margin: 0; padding: 1.5rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.meta dt { font-family: var(--font-mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.meta dd { margin: .25rem 0 0; }

.section-title { font-family: var(--font-mono); font-size: .8rem; font-weight: 400; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); margin: 0 0 1.5rem; }
.process { padding: clamp(2.5rem, 6vw, 4rem) 0 0; }

.gallery { display: grid; gap: clamp(1rem, 2vw, 1.5rem); padding: clamp(2rem, 5vw, 4rem) 0; grid-template-columns: 1fr; }
@media (min-width: 768px) {
  .gallery { grid-template-columns: 1fr 1fr; }
  .gallery .wide { grid-column: 1 / -1; }
}
.gallery figure { margin: 0; }
.gallery img, .gallery video { width: 100%; background: var(--tile-bg); }
.gallery figcaption { font-family: var(--font-mono); font-size: .75rem; color: var(--muted); padding: .6rem 0 0; }
.gallery--archive { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.gallery--archive img, .gallery--archive video { aspect-ratio: 1; object-fit: cover; }

.next { border-top: 1px solid var(--line); margin-bottom: clamp(3rem, 8vw, 6rem); }
.next a { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 2rem 0; }
.next span { font-family: var(--font-mono); font-size: .8rem; color: var(--muted); }
.next strong { font-size: clamp(1.5rem, 4vw, 2.75rem); font-weight: 500; letter-spacing: -0.03em; }

/* ---------- about ---------- */
.about {
  display: grid; gap: clamp(2rem, 6vw, 5rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  padding: clamp(2rem, 6vw, 5rem) 0;
  align-items: start;
}
.about-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; filter: grayscale(1); background: var(--tile-bg); }
.about-text h1 { font-size: clamp(2.6rem, 6vw, 4.5rem); letter-spacing: -0.04em; margin-bottom: 1.5rem; }
.about-text h2 { font-size: .8rem; font-family: var(--font-mono); font-weight: 400; text-transform: uppercase; letter-spacing: .1em; margin: 2.5rem 0 1rem; color: var(--accent); }
.about-text p { font-family: var(--font-mono); font-size: .9rem; color: var(--muted); max-width: 38rem; }
.skills { list-style: none; padding: 0; margin: 0 0 2.5rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.skills li { border: 1px solid var(--control); padding: .35rem .85rem; border-radius: 999px; font-size: .9rem; }
.about-text .contact-note { color: var(--ink); }

/* ---------- footer ---------- */
.site-footer {
  max-width: var(--max); margin: 0 auto; padding: clamp(2.5rem, 6vw, 4rem) var(--pad) 2rem;
  border-top: 1px solid var(--line);
  display: grid; gap: 2rem; grid-template-columns: 1fr auto; align-items: end;
}
.footer-cta { font-family: var(--font-mono); font-size: .8rem; color: var(--muted); margin: 0 0 .5rem; }
.footer-email { font-size: clamp(1.3rem, 3.5vw, 2.25rem); letter-spacing: -0.03em; overflow-wrap: anywhere; }
.social { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.5rem; font-family: var(--font-mono); font-size: .8rem; }
.copyright { grid-column: 1 / -1; font-family: var(--font-mono); font-size: .7rem; color: var(--muted); margin: 0; }
@media (max-width: 640px) { .site-footer { grid-template-columns: 1fr; } }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
