/* chenhao.do — the page, loaded last, after look/glass.css (design system v2.0, look.md § load
   order). Every value is a token from look/tokens.css. One page, so the shell is the large-title
   header only (look.md § which shell a site gets): here that is the masthead's wordmark, and the
   bar it docks into wears the bar glass. The section links are an index inside one page, not a tab
   bar. The house illustration's own styles live in src/styles/scene.css. */

/* ─── wordmark: "chenhao.do" ──────────────────────────────────────────── */
.wordmark {
  display: inline-block; color: var(--tx); text-decoration: none;
  font-weight: 650; line-height: 1; white-space: nowrap;
}
/* Not the accent: ".do" is identity, not an action or a state (tokens.md § colour). */
.wordmark__dot { color: var(--mut); }

/* The reference's letter wave: each letter lifts (alternately up and down), counters softly,
   settles, then the word rests. 1.9s of motion, 2.8s of rest, 75ms between letters — the
   reference's Motion timings, written as CSS so it costs a transform and nothing else. */
.logo-letter {
  display: inline-block;
  animation: logo-wave 4.7s infinite;
  animation-delay: calc(var(--i) * 75ms);
}
@keyframes logo-wave {
  0%           { transform: translateY(0); animation-timing-function: cubic-bezier(0, 0, 0.58, 1); }
  13.7%        { transform: translateY(calc(var(--dir) * 7px)); animation-timing-function: cubic-bezier(0.42, 0, 0.58, 1); }
  25.9%        { transform: translateY(calc(var(--dir) * -1.8px)); animation-timing-function: cubic-bezier(0.42, 0, 0.58, 1); }
  40.4%, 100%  { transform: translateY(0); }
}

/* ─── bar: wordmark · section links · theme button ───────────────────── */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--s7);
  display: flex; align-items: center; gap: var(--s2);
  padding: 0 var(--s5);
  pointer-events: none;          /* the bar is see-through until docked; its children opt in */
}
/* Docked, it is a floating surface over the content, so it wears the bar glass and blurs
   (motion.md § where blur may go). Reduced transparency makes it solid --panel with no blur. */
.bar::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--bar-glass); border-bottom: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(24px) saturate(1.6); backdrop-filter: blur(24px) saturate(1.6);
  opacity: 0; transition: opacity var(--d-fast) var(--ease-out);
}
.bar.is-docked::before { opacity: 1; }
.bar > * { pointer-events: auto; }
.bar__brand {
  font-size: var(--t-2xl); letter-spacing: -0.012em;
  transform-origin: top left;
}
.bar__nav { margin-left: auto; display: flex; gap: var(--s1); transform-origin: right center; }

.bar__nav a, .page-nav a {
  display: inline-flex; align-items: center;
  color: var(--mut); text-decoration: none;
  font-size: var(--t-md); font-weight: 600;
  padding: var(--s1) var(--s3); min-height: var(--ctl-h); border-radius: var(--r-full);
  transition: color var(--d-fast) var(--ease-out), background var(--d-fast) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .bar__nav a:hover { color: var(--tx); background: var(--in); }
}

/* where the nav starts, below the house — a placeholder the bar nav travels from */
.page-nav { display: flex; justify-content: center; }
.page-nav__links {
  display: flex; gap: var(--s1);
  margin-top: var(--s5);   /* margin, not padding: the bar nav scales by this box's height */
  visibility: hidden;
}
/* Without the morph (reduced motion), the bar is an ordinary header from the start: the
   masthead wordmark stays in place and the nav lives only in the bar. */
:root:not(.morph) .page-nav { display: none; }
:root.morph .masthead__brand { visibility: hidden; }

/* ─── masthead ────────────────────────────────────────────────────────── */
/* No fill of its own: the page and its mesh show through, under the sky and the house. */
.masthead {
  position: relative; overflow: hidden; text-align: center;
  padding: calc(var(--s7) + var(--s6)) var(--s5) var(--s5);
}
.masthead__sky { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.masthead__sky .sky-narrow { display: none; }   /* the wide set; swapped at the phone break */
.masthead__title {
  position: relative; margin: 0;
  font-size: var(--t-8xl); font-weight: 650; line-height: 1.05; letter-spacing: -0.024em;
}
.masthead__slogan {
  position: relative; margin: var(--s4) auto 0; max-width: var(--measure);
  color: var(--mut); text-wrap: balance;
}

/* ─── hero: the house ─────────────────────────────────────────────────── */
.hero { aspect-ratio: 1600 / 306; }

/* ─── page ────────────────────────────────────────────────────────────── */
/* .page outranks glass.css's `main` padding, which is sized for a tab bar this site has none of. */
.page { max-width: var(--screen); margin: 0 auto; padding: 0 var(--s5) var(--s7); }
.intro {
  max-width: var(--measure); margin: var(--s5) auto var(--s6);
  text-align: center; color: var(--mut); text-wrap: balance;
}

.section {
  display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--s7);
  padding: var(--s7) 0;
}
.section__head { position: sticky; top: calc(var(--s7) + var(--s5)); align-self: start; }
/* the look's eyebrow (look.md § the large-title header): above the title, small caps-style */
.eyebrow {
  display: block; margin-bottom: var(--s1);
  font-size: var(--t-sm); font-weight: 600; line-height: 1.5;
  letter-spacing: .06em; text-transform: uppercase; color: var(--mut);
}
.section__title {
  margin: 0; font-size: var(--t-2xl); font-weight: 700; line-height: 1.3; letter-spacing: -0.015em;
}

/* Cards: the rows inside supply the bottom space glass.css's 8px leaves (16 in all). */
.prose p { margin: 0 0 var(--s4); max-width: var(--measure); }
.prose p:last-child { margin-bottom: var(--s2); }

.focus { list-style: none; margin: 0; padding: 0; }
.focus__item { display: grid; grid-template-columns: var(--s6) minmax(0, 1fr); gap: var(--s3); align-items: baseline; }
.focus__item > div { padding-bottom: var(--s2); }
.focus__num { font: var(--t-sm)/1.4 var(--f-mono); color: var(--mut); }
.focus__body { margin: 0; color: var(--mut); max-width: var(--measure); }

/* one list card, rows divided by a rule (components.md § card: one card with a rule across it) */
.timeline { list-style: none; }
.timeline__row {
  display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: var(--s4);
  align-items: baseline;
  padding: var(--s3) 0;
}
.timeline__row:first-child { padding-top: var(--s1); }
.timeline__row + .timeline__row { border-top: 1px solid var(--line); }
.timeline__date { font: var(--t-sm)/1.5 var(--f-mono); color: var(--mut); }
.timeline__main p { margin: 0; }
.timeline__body { font-size: var(--t-sm); color: var(--mut); }
.timeline__title { font-weight: 650; }

.contact p { margin: 0 0 var(--s4); max-width: var(--measure); }
.contact__links { list-style: none; margin: 0 0 var(--s2); padding: 0; display: flex; flex-wrap: wrap; gap: var(--s2); }

.footer {
  display: flex; justify-content: space-between; gap: var(--s4);
  margin-top: var(--s7); padding-top: var(--s5); border-top: 1px solid var(--line);
  font-size: var(--t-xs); color: var(--mut);
}

/* section entrances (motion.md § entrance) */
.reveals .reveal { opacity: 0; transform: translateY(var(--s2)); }
.reveals .reveal.is-in {
  opacity: 1; transform: none;
  transition: opacity var(--d-enter) var(--ease-out), transform var(--d-enter) var(--ease-out);
  transition-delay: calc(var(--i, 0) * 40ms);
}

.noscript { max-width: var(--measure); margin: 0 auto; padding: var(--s7) var(--s5); }
.noscript h1 { font-size: var(--t-4xl); font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; }
.noscript a { color: var(--ac-tx); }

/* ─── phone ───────────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  .bar { padding: 0 var(--s4); }
  .bar__brand { font-size: var(--t-lg); letter-spacing: -0.006em; }
  .bar__nav, .page-nav__links { gap: 0; }
  .bar__nav a, .page-nav a { font-size: var(--t-sm); padding: 0 var(--s2); }
  .masthead { padding: calc(var(--s7) + var(--s5)) var(--s4) var(--s4); }
  .masthead__title { font-size: var(--t-5xl); line-height: 1.2; letter-spacing: -0.018em; }
  .masthead__sky .sky-wide { display: none; }
  .masthead__sky .sky-narrow { display: inline; }
  /* the full 1600×306 strip is a sliver on a phone: crop to the house instead */
  .hero { aspect-ratio: 1.9; }
  .page { padding: 0 var(--s4) var(--s6); }
  .intro { margin: var(--s4) auto var(--s5); }
  .section { grid-template-columns: minmax(0, 1fr); gap: var(--s4); padding: var(--s6) 0; }
  .section__head { position: static; }
  .timeline__row { grid-template-columns: minmax(0, 1fr) auto; gap: var(--s1) var(--s3); }
  .timeline__main { grid-column: 1 / -1; grid-row: 2; }
}
/* 44px targets on a phone or any touch screen (look.md § targets) */
@media (max-width: 760px), (pointer: coarse) {
  .bar__nav a, .page-nav a { min-height: 44px; }
  /* The docked wordmark is about 15px tall. Its box can't grow, because the scroll morph scales
     it by the ratio of the two wordmarks' heights, so a 44px hit area hangs off a pseudo-element. */
  .bar__brand { position: relative; }
  .bar__brand::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 44px; transform: translateY(-50%); }
}
@media (max-width: 360px) {
  /* wordmark, four links and a 44px touch theme button fit at 320 */
  .bar { padding: 0 var(--s2); gap: var(--s1); }
  .bar__nav a, .page-nav a { font-size: var(--t-xs); padding: 0 var(--s1); }
}
