/* ============================================================
   Alina Wang — personal site
   Time-aware sky. All display/body type Instrument Serif;
   all labels/meta/nav/buttons IBM Plex Mono.
   Runtime tokens (--ink, --soft, --line, --ground) are written
   imperatively by script.js every scroll tick. Initial values
   below are the golden-hour phase, so the page paints correctly
   before any script runs.
   ============================================================ */

:root {
  --ink: #2c1a10;
  --soft: rgba(44, 26, 16, 0.62);
  --line: rgba(44, 26, 16, 0.16);
  --ground: #fdf3e6;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #e9c9a4; /* fallback before the sky paints */
}

html { scroll-behavior: smooth; }

body {
  font-family: "Instrument Serif", Georgia, serif;
  color: var(--ink);
}

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

.root {
  position: relative;
  width: 100%;
  color: var(--ink);
  background: #e9c9a4;
}

/* ————— sky ————— */
.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.sky__layer { position: absolute; inset: 0; }
.sky__grain {
  position: absolute;
  inset: 0;
  opacity: 0.3;
  mix-blend-mode: multiply;
  background-image: radial-gradient(rgba(120, 80, 50, 0.5) 0.5px, transparent 0.5px);
  background-size: 3px 3px;
}

/* ————— progress bar ————— */
.progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9;
  pointer-events: none;
}
.progress__track { position: relative; height: 3px; background: var(--line); }
.progress__fill {
  position: absolute; top: 0; left: 0; height: 100%; width: 0%;
  background: var(--ink); opacity: 0.55;
}
.progress__sun {
  position: absolute; top: 50%; left: 0%;
  width: 10px; height: 10px; margin: -5px 0 0 -5px;
  border-radius: 999px; background: var(--ink);
  box-shadow: 0 0 0 5px rgba(255, 214, 150, 0.28);
}

/* ————— time badge ————— */
.badge {
  position: fixed;
  z-index: 9;
  right: clamp(16px, 3vw, 36px);
  bottom: 20px;
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}
.badge__sep { opacity: 0.4; }

/* ————— content column ————— */
.wrap {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4.5vw, 56px);
}

/* ————— header (non-sticky: scrolls away so it never overlaps content) ————— */
.header {
  position: relative;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 14px 20px;
  align-items: baseline;
  justify-content: space-between;
  padding: clamp(22px, 2.6vw, 32px) 0;
}
.header__name { font-size: clamp(17px, 1.5vw, 20px); }
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(12px, 1.9vw, 26px);
  align-items: baseline;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--soft);
}
.nav a { transition: color 0.25s ease; }
.nav a:hover { color: var(--ink); }
.nav__sound {
  appearance: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 13px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--soft);
  cursor: pointer;
  transition: color 0.25s ease;
}
.nav__sound:hover { color: var(--ink); }

/* ————— pills ————— */
.pill {
  padding: 12px 22px;
  border-radius: 999px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: opacity 0.25s ease, background 0.25s ease;
}
.pill--fill { background: var(--ink); color: var(--ground, #fdf3e6); }
.pill--fill:hover { opacity: 0.85; }
.pill--outline { border: 1px solid var(--line); }
.pill--outline:hover { background: rgba(255, 255, 255, 0.22); }

/* ————— About ————— */
.about {
  position: relative;
  min-height: 76vh;
  display: grid;
  align-content: center;
  justify-items: start;
  padding: clamp(36px, 6vw, 76px) 0 clamp(30px, 5vw, 56px);
}
.eyebrow {
  margin: 0 0 clamp(18px, 2.6vw, 30px);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--soft);
}
.hero-h1 {
  margin: 0;
  position: relative;
  font-size: clamp(38px, 6.2vw, 90px);
  line-height: 1.05;
  font-weight: 400;
  letter-spacing: -0.015em;
  max-width: 21ch;
  text-wrap: pretty;
}
.lead {
  margin: clamp(22px, 3vw, 34px) 0 0;
  position: relative;
  font-size: clamp(17px, 1.6vw, 23px);
  line-height: 1.55;
  max-width: 46ch;
  text-wrap: pretty;
}
.secondary {
  margin: 20px 0 0;
  position: relative;
  font-size: 17px;
  line-height: 1.7;
  max-width: 50ch;
  color: var(--soft);
  text-wrap: pretty;
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  position: relative;
}
.about .btn-row { margin-top: clamp(26px, 3.2vw, 38px); }

/* ————— arch graphic ————— */
.arch {
  position: absolute;
  right: -2%;
  top: 4%;
  width: min(40vw, 430px);
  aspect-ratio: 3 / 4;
  pointer-events: none;
  opacity: 0.5;
  animation: driftIn 1800ms ease both;
}
.arch__ring { position: absolute; border: 1px solid var(--line); }
.arch__ring--1 { inset: 0; border-radius: 50% 50% 2px 2px / 62% 62% 2px 2px; }
.arch__ring--2 { inset: 9% 9% 0 9%; border-radius: 50% 50% 2px 2px / 60% 60% 2px 2px; }
.arch__ring--3 { inset: 20% 20% 0 20%; border-radius: 50% 50% 2px 2px / 58% 58% 2px 2px; }
.arch__disc {
  position: absolute; left: 50%; top: 27%; width: 34%; aspect-ratio: 1; margin-left: -17%;
  border-radius: 999px;
  background: radial-gradient(circle at 50% 50%, rgba(255, 222, 170, 0.85), rgba(255, 190, 120, 0.18) 62%, transparent 72%);
}
.arch__disc-ring {
  position: absolute; left: 50%; top: 27%; width: 34%; aspect-ratio: 1; margin-left: -17%;
  border-radius: 999px; border: 1px solid var(--line);
}
.arch__col { position: absolute; left: 50%; bottom: 0; width: 1px; height: 44%; background: var(--line); }

/* ————— sections ————— */
.section { padding: clamp(40px, 6vw, 80px) 0; border-top: 1px solid var(--line); }

.label-row { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.label-row--gap { margin-bottom: 26px; }
.glyph {
  display: block; width: 13px; height: 17px;
  border: 1px solid var(--line);
  border-radius: 50% 50% 1px 1px / 66% 66% 1px 1px;
}
.label {
  margin: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--soft);
  font-weight: 500;
}

/* ————— Experience ————— */
.exp-list { display: grid; }
.exp-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 12px 34px;
  align-items: start;
  padding: clamp(24px, 3vw, 34px) 0;
  border-bottom: 1px solid var(--line);
}
.exp-company { font-size: clamp(24px, 2.4vw, 34px); }
.exp-meta {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--soft);
  margin-top: 8px;
}
.exp-body { font-size: 17px; line-height: 1.6; }
.exp-body--soft { color: var(--soft); }
.exp-case {
  display: inline-block;
  margin-top: 12px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--soft);
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.exp-case:hover { color: var(--ink); border-bottom-color: currentColor; }

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
  gap: 26px;
  padding: clamp(34px, 4.5vw, 56px) 0 0;
}
.metric__fig { font-size: clamp(30px, 3.2vw, 44px); }
.metric__cap { margin: 6px 0 0; font-size: 16px; line-height: 1.55; }

/* ————— Projects ————— */
.proj-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 10px 34px;
  align-items: baseline;
  padding: clamp(24px, 3vw, 34px) 0;
  border-bottom: 1px solid var(--line);
}
.proj-row--link { transition: opacity 0.25s ease; }
.proj-row--link:hover { opacity: 0.72; }
.proj-title { font-size: clamp(24px, 2.4vw, 34px); }
.proj-desc { font-size: 17px; line-height: 1.6; }
.proj-meta {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--soft);
}

/* ————— Outside ————— */
.outside-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: clamp(24px, 3.4vw, 46px);
}
.outside-h3 { margin: 0 0 10px; font-size: clamp(21px, 2.1vw, 28px); font-weight: 400; }
.outside-p { margin: 0; font-size: 17px; line-height: 1.65; }
.inline-link { border-bottom: 1px solid var(--line); transition: border-color 0.25s ease; }
.inline-link:hover { border-bottom-color: currentColor; }

/* ————— Contact ————— */
.contact {
  position: relative;
  padding: clamp(44px, 6vw, 84px) 0 clamp(50px, 6vw, 90px);
  border-top: 1px solid var(--line);
}
.contact__headline {
  margin: 0 0 30px;
  position: relative;
  font-size: clamp(24px, 3.4vw, 46px);
  line-height: 1.25;
  max-width: 26ch;
  text-wrap: pretty;
}
.sun-ring {
  position: absolute;
  right: 0;
  bottom: clamp(40px, 6vw, 80px);
  width: min(30vw, 260px);
  aspect-ratio: 1;
  pointer-events: none;
  opacity: 0.45;
}
.sun-ring__outer { position: absolute; inset: 0; border-radius: 999px; border: 1px solid var(--line); }
.sun-ring__inner { position: absolute; inset: 14%; border-radius: 999px; border: 1px solid var(--line); }
.sun-ring__core {
  position: absolute; inset: 30%; border-radius: 999px;
  background: radial-gradient(circle at 50% 50%, rgba(255, 222, 170, 0.8), rgba(255, 190, 120, 0.16) 66%, transparent 74%);
}
.sun-ring__horizon { position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--line); }

/* ————— footer ————— */
.footer {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 30px;
  justify-content: space-between;
  padding: 20px 0 56px;
  border-top: 1px solid var(--line);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--soft);
}

/* ————— motion ————— */
@keyframes riseIn  { from { opacity: 0; transform: translateY(14px); }             to { opacity: 1; transform: none; } }
@keyframes driftIn { from { opacity: 0; transform: translateY(24px) scale(0.985); } to { opacity: 1; transform: none; } }

/* Hero staggered entrance (cheap stagger via durations, matching the design). */
.rise { animation: riseIn 900ms ease both; }
.rise--1 { animation-duration: 900ms; }
.rise--2 { animation-duration: 1100ms; }
.rise--3 { animation-duration: 1300ms; }
.rise--4 { animation-duration: 1450ms; }
.rise--5 { animation-duration: 1600ms; }

/* data-reveal elements are controlled by script.js (rect check, not
   IntersectionObserver). Final state is set directly; the keyframe is
   only applied when the document is actually rendering. */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rise, .arch { animation: none; }
  .reveal { opacity: 1 !important; transform: none !important; animation: none !important; }
}
