/* ============================================================
   Sam Yang — Portfolio
   Light, editorial, with an electric cobalt accent.
   ============================================================ */

:root {
  --paper:      #f6f6f3;
  --paper-2:    #ffffff;
  --ink:        #14151a;
  --ink-soft:   #3a3c44;
  --muted:      #74767e;
  --line:       #e4e3dc;
  --line-soft:  #eeede7;
  --accent:     #1f3df0;
  --accent-ink: #1a34cc;
  --accent-wash:#eef0fe;

  --max:   1080px;
  --gut:   clamp(20px, 5vw, 56px);

  --f-display: "Space Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
  --f-body:    "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --f-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, video { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 600; letter-spacing: -0.02em; line-height: 1.08; margin: 0; }
p { margin: 0 0 1.1em; }
a { color: inherit; text-decoration: none; }

.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gut); }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: #fff; padding: 10px 16px; z-index: 200; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- shared bits ---------- */
.eyebrow {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin: 0 0 18px;
}
.dot { width: 4px; height: 4px; border-radius: 50%; background: var(--muted); display: inline-block; }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--paper) 80%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.nav__brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--f-display); font-weight: 600; font-size: 16px; letter-spacing: -0.01em;
}
.nav__mark {
  width: 13px; height: 13px; border-radius: 3px;
  background: var(--accent);
  box-shadow: inset 0 0 0 3px var(--paper);
  outline: 1.5px solid var(--accent);
  transition: transform .4s var(--ease);
}
.nav__brand:hover .nav__mark { transform: rotate(45deg); }
.nav__links { display: flex; gap: clamp(18px, 4vw, 38px); }
.nav__links a {
  font-size: 14.5px; color: var(--ink-soft); position: relative; padding: 4px 0;
  transition: color .2s var(--ease);
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1.5px; width: 0;
  background: var(--accent); transition: width .28s var(--ease);
}
.nav__links a:hover { color: var(--ink); }
.nav__links a:hover::after,
.nav__links a.is-active::after { width: 100%; }
.nav__links a.is-active { color: var(--ink); }

/* ============================================================
   HERO
   ============================================================ */
.hero { padding-top: clamp(64px, 12vh, 130px); padding-bottom: clamp(56px, 10vh, 110px); }
.hero__title {
  font-size: clamp(25px, 3.2vw, 38px);
  font-weight: 500;
  line-height: 1.22;
  max-width: 26ch;
  margin-bottom: 30px;
}
.hero__title .hl { color: var(--accent-ink); white-space: nowrap; }
.hero__lead {
  font-size: clamp(17px, 2vw, 20px);
  color: var(--ink-soft);
  max-width: 56ch;
  margin-bottom: 30px;
}
.hero__meta {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  font-family: var(--f-mono); font-size: 13px; color: var(--muted);
}

/* ============================================================
   SECTION HEADS
   ============================================================ */
.section-head { margin-bottom: 40px; max-width: 60ch; }
.section-head--sub { margin-top: clamp(70px, 11vh, 120px); }
.section-title { font-size: clamp(26px, 3.6vw, 38px); }
.section-note { margin-top: 16px; color: var(--ink-soft); font-size: 16.5px; }
.wip-inline {
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em;
  background: var(--accent-wash); color: var(--accent-ink);
  padding: 2px 7px; border-radius: 5px; vertical-align: 1.5px;
}

/* ============================================================
   FEATURE (Hexapod)
   ============================================================ */
.feature {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}
.feature__media {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #0e0f13;
  border: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(20,21,26,.04), 0 30px 60px -40px rgba(20,21,26,.45);
  position: sticky; top: 96px;
}
.feature__video { width: 100%; aspect-ratio: 9 / 11; object-fit: cover; }
.feature__badge {
  position: absolute; left: 14px; bottom: 14px;
  font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .04em;
  color: #fff; background: rgba(15,16,19,.62);
  border: 1px solid rgba(255,255,255,.16);
  padding: 6px 11px 6px 26px; border-radius: 999px;
  backdrop-filter: blur(6px);
}
.feature__badge::before {
  content: ""; position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 7px; height: 7px; border-radius: 50%; background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74,222,128,.7); animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(74,222,128,.55); }
  70% { box-shadow: 0 0 0 8px rgba(74,222,128,0); }
  100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
}

.feature__body p { color: var(--ink-soft); }
.feature__topline { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.feature__title { font-size: clamp(24px, 3vw, 32px); }
.feature__years { font-family: var(--f-mono); font-size: 13px; color: var(--muted); white-space: nowrap; }
.feature__tag {
  font-family: var(--f-display); font-weight: 500; font-size: 18px;
  color: var(--ink); margin: 10px 0 20px;
}

.phase {
  border-left: 2px solid var(--accent);
  background: linear-gradient(90deg, var(--accent-wash), transparent 90%);
  padding: 16px 18px; border-radius: 0 10px 10px 0; margin: 8px 0 22px;
}
.phase p { margin: 0; }
.phase__label {
  font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent-ink); margin-bottom: 8px !important;
}
.phase strong { color: var(--ink); }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.chips li {
  font-family: var(--f-mono); font-size: 12.5px;
  color: var(--ink-soft); background: var(--paper-2);
  border: 1px solid var(--line); border-radius: 7px; padding: 5px 10px;
}

/* ============================================================
   GALLERY
   ============================================================ */
.gallery { margin-top: clamp(36px, 6vh, 64px); }
.gallery__label { font-family: var(--f-mono); font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.gallery__grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
.shot {
  border: 1px solid var(--line); background: var(--paper-2);
  padding: 0; border-radius: 11px; overflow: hidden; cursor: zoom-in;
  aspect-ratio: 1; transition: transform .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease);
}
.shot img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.shot:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  box-shadow: 0 18px 30px -22px rgba(20,21,26,.4);
}
.shot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ============================================================
   PROJECTS LIST
   ============================================================ */
.projects { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.project {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: clamp(14px, 3vw, 40px);
  align-items: start;
  padding: 26px 6px;
  border-bottom: 1px solid var(--line);
  transition: background .3s var(--ease);
}
.project:hover { background: var(--paper-2); }
.project__index { font-family: var(--f-mono); font-size: 13px; color: var(--muted); padding-top: 4px; }
.project__head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.project__name { font-size: clamp(18px, 2.2vw, 22px); }
.project__desc { color: var(--ink-soft); margin: 0; max-width: 60ch; font-size: 16px; }
.project__meta {
  font-family: var(--f-mono); font-size: 12.5px; color: var(--muted);
  white-space: nowrap; padding-top: 6px; text-align: right;
}
.tag-wip {
  font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .12em;
  color: var(--accent-ink); background: var(--accent-wash);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
  padding: 2px 8px; border-radius: 999px;
}

/* ============================================================
   ABOUT
   ============================================================ */
.about { padding-top: clamp(70px, 11vh, 120px); }
.about__grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(30px, 6vw, 80px); }
.about__col p { color: var(--ink-soft); }
.about__col p:last-child { margin-bottom: 0; }
.facts { margin: 0; display: grid; gap: 0; }
.facts > div {
  display: grid; grid-template-columns: 96px 1fr; gap: 14px;
  padding: 13px 0; border-top: 1px solid var(--line-soft);
}
.facts > div:first-child { border-top: 0; padding-top: 0; }
.facts dt { font-family: var(--f-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.facts dd { margin: 0; font-size: 15.5px; color: var(--ink); }

/* ============================================================
   CONTACT
   ============================================================ */
.contact { padding-top: clamp(64px, 10vh, 104px); padding-bottom: clamp(48px, 8vh, 88px); }
.contact__inner {
  border-top: 1px solid var(--line);
  padding-top: clamp(28px, 4vw, 40px);
}
.contact__inner .eyebrow { margin-bottom: 14px; }
.contact__email {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--f-display); font-weight: 500;
  font-size: clamp(17px, 2vw, 22px); color: var(--ink);
  position: relative;
  border-bottom: 2px solid color-mix(in srgb, var(--accent) 30%, transparent);
  padding-bottom: 3px; transition: border-color .25s var(--ease), color .25s var(--ease);
}
.contact__email:hover { color: var(--accent-ink); border-color: var(--accent); }
.contact__arrow { transition: transform .3s var(--ease); }
.contact__email:hover .contact__arrow { transform: translate(5px, -2px); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { border-top: 1px solid var(--line); }
.footer__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 76px; font-family: var(--f-mono); font-size: 13px; color: var(--muted);
}

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox {
  position: fixed; inset: 0; z-index: 300;
  display: grid; place-items: center; padding: 5vw;
  background: rgba(14,15,19,.86); backdrop-filter: blur(4px);
  opacity: 0; transition: opacity .25s var(--ease);
}
.lightbox.is-open { opacity: 1; }
.lightbox__img { max-width: 100%; max-height: 90vh; border-radius: 10px; background: #fff; }
.lightbox__close {
  position: absolute; top: 20px; right: 26px;
  background: none; border: 0; color: #fff; font-size: 34px; line-height: 1; cursor: pointer;
  opacity: .8; transition: opacity .2s;
}
.lightbox__close:hover { opacity: 1; }

/* ============================================================
   REVEAL ANIMATION
   ============================================================ */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .feature__badge::before { animation: none; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 860px) {
  .feature { grid-template-columns: 1fr; }
  .feature__media { position: static; top: auto; max-width: 460px; }
  .feature__video { aspect-ratio: 4 / 3; }
  .about__grid { grid-template-columns: 1fr; }
  .gallery__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .nav__links { gap: 18px; }
  .project { grid-template-columns: 1fr; gap: 6px; }
  .project__index { display: none; }
  .project__meta { text-align: left; padding-top: 2px; }
  .hero__meta { font-size: 12px; }
}
