/* Chris Kwan — Lost in code. Standalone; shares nothing with the main site. */

:root {
  --panel: rgba(250, 246, 238, 0.9);
  --ink: #1f2a22;
  --ink-soft: #4a554c;
  --amber: #d98e32;
  --amber-deep: #a9661a;
  /* --fg / --fg-soft / --glow are updated by main.js as the sky changes */
  --fg: #1f2a22;
  --fg-soft: #3c4a40;
  --glow: rgba(255, 248, 232, 0.55);
  --chip: rgba(250, 246, 238, 0.45);
  --radius: 18px;
  --shadow: 0 10px 30px rgba(20, 24, 30, 0.16), 0 2px 6px rgba(20, 24, 30, 0.08);
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: #f1e7d3; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  background: transparent;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.12; margin: 0; }
p { margin: 0; }
ol, ul { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration-color: var(--amber); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--amber-deep); }
a:focus-visible, .btn:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 50; background: var(--panel); padding: .5rem .9rem; border-radius: 10px; }

/* ---------- the living world ---------- */
.world {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
  background: linear-gradient(#9fc3e0, #f4ead6 70%);
}
main, .mark, .clock { position: relative; z-index: 1; }

.mark {
  position: fixed;
  top: 0; left: 0;
  z-index: 10;
  padding: 1rem clamp(1rem, 4vw, 2.5rem);
  font-family: var(--serif);
  font-size: .95rem;
}
.mark a {
  text-decoration: none;
  color: var(--ink);
  background: var(--panel);
  padding: .35rem .8rem;
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(20, 24, 30, .12);
}
.mark span { color: var(--ink-soft); }
@media (max-width: 480px) { .mark span { display: none; } }

/* clock: the day slipping by */
.clock {
  position: fixed;
  top: .85rem;
  right: clamp(1rem, 4vw, 2.5rem);
  z-index: 10;
  display: grid;
  justify-items: end;
  gap: .15rem;
  font-family: var(--mono);
  color: var(--fg);
  text-shadow: 0 1px 12px var(--glow);
  pointer-events: none;
  padding: .4rem .7rem .5rem;
  border-radius: 12px;
  background: var(--chip);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.clock__time { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 500; letter-spacing: .02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.clock__note { font-size: .72rem; color: var(--fg-soft); }
.clock__bar { width: 7.5rem; height: 2px; background: rgba(127, 127, 127, .3); border-radius: 2px; overflow: hidden; margin-top: .3rem; }
.clock__bar i { display: block; height: 100%; width: 100%; background: var(--amber); transform-origin: left; transform: scaleX(0); }

/* ---------- hero ---------- */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 6rem clamp(1.25rem, 7vw, 6rem) 14vh;
  position: relative;
}
.hero__text { max-width: 44rem; color: var(--fg); text-shadow: 0 1px 22px var(--glow); }
.hero h1 { font-size: clamp(3rem, 9vw, 7rem); letter-spacing: -0.025em; }
.hero__sub {
  margin-top: 1rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.2rem, 2.6vw, 1.85rem);
  line-height: 1.4;
  max-width: 32ch;
  color: var(--fg-soft);
}
.type {
  margin-top: 1.6rem;
  font-family: var(--mono);
  font-size: clamp(.85rem, 1.5vw, 1rem);
  color: var(--fg);
  min-height: 1.6em;
}
.type__caret { display: inline-block; width: .55em; height: 1.1em; vertical-align: -.18em; background: var(--amber); margin-left: 2px; animation: blink 1.05s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.hero__cue {
  position: absolute;
  left: 50%;
  bottom: 1.4rem;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .45rem;
  color: var(--fg);
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .04em;
  text-shadow: 0 1px 12px var(--glow);
  white-space: nowrap;
}
.hero__cue i { width: 1px; height: 34px; background: linear-gradient(var(--fg), transparent); animation: cue 2.2s ease-in-out infinite; transform-origin: top; }
@keyframes cue { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }

/* ---------- content bands ---------- */
.band {
  width: min(1120px, 100% - 2.5rem);
  margin: 0 auto;
  padding: clamp(7rem, 30vh, 16rem) 0 clamp(2rem, 6vh, 4rem);
}
.band__head { max-width: 42rem; margin-bottom: 2.25rem; color: var(--fg); text-shadow: 0 1px 22px var(--glow); }
.eyebrow {
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--fg-soft);
  margin-bottom: .7rem;
}
.eyebrow::before { content: "// "; color: var(--amber); }
.band h2 { font-size: clamp(2rem, 4.6vw, 3.4rem); letter-spacing: -0.015em; }

.panel {
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1.35rem, 3vw, 2rem);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--ink);
}
.panel h3 { font-size: clamp(1.35rem, 2.4vw, 1.65rem); }
.lead { font-family: var(--serif); font-size: 1.12rem; line-height: 1.5; margin-top: .6rem; }

.think { display: grid; gap: 1.25rem; }
@media (min-width: 900px) {
  .think { grid-template-columns: repeat(3, 1fr); align-items: start; }
  .think li:nth-child(2) { margin-top: 3rem; }
  .think li:nth-child(3) { margin-top: 6rem; }
}
.num { font-family: var(--mono); font-size: .85rem; color: var(--amber-deep); display: block; margin-bottom: .75rem; }
.proof { margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid rgba(31, 42, 34, .12); font-size: .92rem; color: var(--ink-soft); }
.proof b { display: block; font-family: var(--mono); font-weight: 500; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); margin-bottom: .25rem; }

.timeline { position: relative; display: grid; gap: 1.5rem; max-width: 46rem; padding-left: 2.25rem; }
.timeline::before {
  content: ""; position: absolute; left: .55rem; top: .6rem; bottom: .6rem; width: 2px;
  background: linear-gradient(var(--amber), rgba(217, 142, 50, .25)); border-radius: 2px;
}
.timeline li { position: relative; }
.timeline li::before {
  content: ""; position: absolute; left: calc(-2.25rem + .55rem - 6px); top: 1.9rem;
  width: 14px; height: 14px; border-radius: 50%; background: #faf6ee; border: 3px solid var(--amber);
}
.timeline li.is-now::before { background: var(--amber); box-shadow: 0 0 0 6px rgba(217, 142, 50, .25); }
.timeline time { font-family: var(--mono); font-size: .9rem; color: var(--amber-deep); display: block; margin-bottom: .3rem; }
.timeline h3 span { display: block; font-family: var(--sans); font-size: .88rem; font-weight: 500; color: var(--ink-soft); margin-top: .25rem; }
.timeline p { margin-top: .7rem; }
@media (min-width: 900px) {
  .timeline { margin-left: 8%; }
  .timeline li:nth-child(even) { margin-left: 3rem; }
}

.projects { display: grid; gap: 1.25rem; }
@media (min-width: 760px) { .projects { grid-template-columns: repeat(2, 1fr); } }
.projects .panel { display: flex; flex-direction: column; gap: .7rem; }
.projects .lead { margin-top: 0; }
.projects h3 a { text-decoration: none; }
.projects h3 a:hover { text-decoration: underline; text-decoration-color: var(--amber); }
.stack { font-family: var(--mono); font-size: .78rem; color: var(--ink-soft); }
.go { margin-top: auto; padding-top: .4rem; font-weight: 500; font-size: .95rem; align-self: flex-start; }
.go::after { content: " \2192"; }
.tag {
  margin-top: auto; align-self: flex-start; font-family: var(--mono); font-size: .72rem;
  border: 1px solid var(--amber); color: var(--amber-deep); padding: .2rem .6rem; border-radius: 999px;
}

.writing { max-width: 40rem; padding-top: .5rem; padding-bottom: .5rem; }
.writing li { font-family: var(--serif); font-size: clamp(1.15rem, 2.2vw, 1.35rem); padding: 1rem 0; border-bottom: 1px solid rgba(31, 42, 34, .12); }
.writing li:last-child { border-bottom: 0; }
.writing span { color: var(--ink-soft); }

/* ---------- night & dawn ---------- */
.night, .dawn {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 1.25rem;
}
.night { min-height: 160vh; min-height: 160svh; justify-content: center; }
.big { color: var(--fg); font-size: clamp(2rem, 5.4vw, 4rem); text-shadow: 0 2px 26px var(--glow); }
.dawn { min-height: 130vh; min-height: 130svh; justify-content: flex-end; padding-bottom: clamp(3rem, 9vh, 6rem); gap: 1rem; }
.dawn__sub { font-family: var(--serif); font-style: italic; font-size: clamp(1.1rem, 2.2vw, 1.5rem); color: var(--fg-soft); text-shadow: 0 1px 18px var(--glow); margin-bottom: 14vh; }
.contact { width: min(100%, 26rem); }
.contact h3 { font-size: clamp(1.7rem, 3.4vw, 2.2rem); }
.btn {
  display: inline-block; margin: 1.25rem 0 1.4rem; background: var(--amber); color: var(--ink);
  font-weight: 600; text-decoration: none; padding: .8rem 1.8rem; border-radius: 999px;
  box-shadow: 0 6px 18px rgba(217, 142, 50, .35); transition: transform .2s ease, box-shadow .2s ease;
}
.btn:hover { color: var(--ink); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(217, 142, 50, .45); }
.links { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1.25rem; font-size: .95rem; }

/* ---------- reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .2, 1); }
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .hero__cue i, .type__caret { animation: none; }
  .btn { transition: none; }
}
