/* Ethan Liu — personal site
   One accent colour (brass); everything else is paper and ink. */

:root {
  --paper: #faf8f4;
  --paper-2: #f2eee6;
  --ink: #1d1c1a;
  --ink-2: #45423d;
  --muted: #6d675e;
  --line: #e3ddd2;
  --accent: #8a5a14;
  --accent-soft: #f3e9d8;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 6px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, video { display: block; max-width: 100%; }

a { color: inherit; text-decoration-color: var(--line); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(44px, 7vw, 76px); }
h2 { font-size: clamp(32px, 4.4vw, 46px); }
h3 { font-size: 24px; }
h4 { font-size: 20px; }
p { margin: 0 0 1em; }
em, cite { font-style: italic; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 720px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 60px; }
.brand { font-family: var(--serif); font-size: 21px; text-decoration: none; white-space: nowrap; }
.nav { display: flex; gap: 26px; font-size: 14px; letter-spacing: 0.02em; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { text-decoration: none; color: var(--ink-2); white-space: nowrap; padding: 4px 0; border-bottom: 1px solid transparent; }
.nav a:hover, .nav a.active { color: var(--ink); border-bottom-color: var(--accent); }

/* ---------- shared pieces ---------- */
.eyebrow {
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 14px;
}
.lead { font-size: 20px; line-height: 1.6; color: var(--ink-2); }
.muted { color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px; font-size: 15px; font-weight: 500;
  text-decoration: none; border: 1px solid var(--ink); transition: background .2s, color .2s;
}
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover { background: var(--accent); border-color: var(--accent); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); }

section { padding: clamp(64px, 9vw, 112px) 0; }
section + section { border-top: 1px solid var(--line); }
.section-head { max-width: 720px; margin-bottom: 48px; }
.section-head h2 { margin-bottom: 18px; }
.sub-head { display: flex; align-items: center; gap: 16px; margin: 72px 0 24px; }
.section-head + .group > .sub-head:first-child { margin-top: 0; }
.sub-head h3 { white-space: nowrap; }
.sub-head::after { content: ""; flex: 1; height: 1px; background: var(--line); order: 2; }

/* ---------- hero ---------- */
.hero { padding-top: clamp(40px, 7vw, 88px); }
.hero .wrap { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.hero h1 { margin-bottom: 22px; }
.hero .lead { max-width: 34em; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-photo { border-radius: var(--radius); overflow: hidden; background: var(--paper-2); aspect-ratio: 4 / 5; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- highlights ---------- */
.highlights { padding: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--paper-2); }
.highlights ul { list-style: none; margin: 0 auto; padding: 0 var(--gutter); display: grid; grid-template-columns: repeat(5, 1fr); }
.highlights li { padding: 28px 20px; border-left: 1px solid var(--line); }
.highlights li:first-child { border-left: 0; padding-left: 0; }
.highlights strong { display: block; font-family: var(--serif); font-weight: 500; font-size: 22px; line-height: 1.2; margin-bottom: 6px; }
.highlights span { font-size: 14px; color: var(--muted); line-height: 1.45; display: block; }

/* ---------- film ---------- */
.film-frame { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #111; }
.film-frame img, .film-frame iframe { width: 100%; height: 100%; object-fit: cover; border: 0; }
.film-frame .film-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  color: #fff; text-align: center; background: linear-gradient(0deg, rgba(0,0,0,.55), rgba(0,0,0,.25));
  border: 0; cursor: pointer; font: inherit; width: 100%;
}
.play-dot { width: 76px; height: 76px; border-radius: 50%; background: rgba(255,255,255,.92); display: grid; place-items: center; }
.play-dot::after { content: ""; border-left: 22px solid var(--ink); border-top: 13px solid transparent; border-bottom: 13px solid transparent; margin-left: 6px; }
.film-overlay .film-title { font-family: var(--serif); font-size: 26px; }
.film-overlay .film-note { font-size: 14px; opacity: .85; }
.film-chapters { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 18px; font-size: 14px; color: var(--muted); }

/* ---------- media grid / cards ---------- */
.grid { display: grid; gap: 40px 32px; }
.grid.two { grid-template-columns: repeat(2, 1fr); }
.grid.three { grid-template-columns: repeat(3, 1fr); }

.card .media { border-radius: var(--radius); overflow: hidden; background: var(--paper-2); aspect-ratio: 16 / 9; }
.card .media.portrait { aspect-ratio: 4 / 5; }
.card .media video, .card .media img { width: 100%; height: 100%; object-fit: cover; }
.card .media video { background: #111; }
.card .media video { object-fit: contain; }
.card h4 { margin: 16px 0 4px; }
.card .tag { margin: 16px 0 0; }
.card .tag + h4 { margin-top: 8px; }
.card .meta { font-size: 14px; color: var(--muted); margin: 0 0 10px; line-height: 1.5; }
.card p:not(.meta) { font-size: 15.5px; color: var(--ink-2); }
.card .tools { font-size: 13px; color: var(--muted); }
.card .tools b { font-weight: 600; color: var(--ink-2); }

.card .media img.fit { object-fit: contain; background: var(--paper-2); }

/* ---------- carousel ----------
   Cards sit in a horizontally scrolling track; arrows sit in the sub-head and
   hide themselves (JS) when everything already fits. */
.sub-head .car-nav { display: flex; gap: 8px; order: 3; margin-left: auto; }
.sub-head .car-nav[hidden] { display: none; }
.car-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper);
  color: var(--ink); cursor: pointer; display: grid; place-items: center; transition: border-color .2s, background .2s, opacity .2s;
}
.car-btn:hover:not(:disabled) { border-color: var(--ink); }
.car-btn:disabled { opacity: .35; cursor: default; }
.car-btn svg { width: 16px; height: 16px; }
.car-count { font-size: 13px; color: var(--muted); align-self: center; min-width: 44px; text-align: right; font-variant-numeric: tabular-nums; }
.car-track {
  display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 32px) / 2); gap: 32px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.car-track::-webkit-scrollbar { display: none; }
.car-track > * { scroll-snap-align: start; min-width: 0; }
.car-track.three { grid-auto-columns: calc((100% - 64px) / 3); }
.group-intro { max-width: 680px; color: var(--ink-2); margin: -8px 0 28px; }
.group-intro .credit { display: block; font-size: 14px; color: var(--muted); margin-top: 6px; }

.closing { background: var(--paper-2); }
.closing blockquote { margin: 0; font-family: var(--serif); font-size: clamp(24px, 3vw, 32px); line-height: 1.4; color: var(--ink); max-width: 860px; }
.closing cite { display: block; font-family: var(--sans); font-style: normal; font-size: 14px; color: var(--muted); margin-top: 22px; }

.tag { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .04em; color: var(--accent); background: var(--accent-soft); padding: 2px 9px; border-radius: 999px; margin-bottom: 6px; }

/* ---------- about / timeline ---------- */
.about .wrap { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.about figure { margin: 0; border-radius: var(--radius); overflow: hidden; }
.about figcaption { font-size: 13px; color: var(--muted); padding-top: 10px; }
.timeline { list-style: none; padding: 0; margin: 32px 0 0; border-left: 1px solid var(--line); }
.timeline li { position: relative; padding: 0 0 24px 26px; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--paper); border: 2px solid var(--accent); }
.timeline .when { font-size: 13px; font-weight: 600; letter-spacing: .06em; color: var(--accent); }
.timeline p { margin: 2px 0 0; font-size: 16px; color: var(--ink-2); }

/* ---------- build feature ---------- */
.feature { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(32px, 5vw, 64px); align-items: center; }
.feature img { border-radius: var(--radius); }
.facts { list-style: none; padding: 0; margin: 24px 0 30px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; }
.facts li { border-top: 1px solid var(--line); padding-top: 10px; font-size: 14.5px; color: var(--muted); }
.facts strong { display: block; color: var(--ink); font-size: 16px; font-weight: 600; }

/* ---------- lists ---------- */
.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list li { display: grid; grid-template-columns: 1fr auto; gap: 4px 24px; padding: 18px 0; border-top: 1px solid var(--line); }
.plain-list li:last-child { border-bottom: 1px solid var(--line); }
.plain-list .what { font-weight: 600; }
.plain-list .when { color: var(--muted); font-size: 14px; white-space: nowrap; }
.plain-list .detail { grid-column: 1 / -1; color: var(--ink-2); font-size: 15.5px; }

.service-lead { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-bottom: 40px; }
.panel { background: var(--paper-2); border-radius: var(--radius); padding: 28px 30px; }
.panel h3 { margin-bottom: 10px; }
.panel p { font-size: 15.5px; color: var(--ink-2); margin: 0; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 64px 0 48px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; align-items: end; }
.site-footer h2 { font-size: 34px; margin-bottom: 8px; }
.site-footer small { color: var(--muted); font-size: 13px; }

/* ---------- article pages (embouchure, cv) ---------- */
.page-head { padding: clamp(48px, 7vw, 88px) 0 40px; }
.page-head h1 { font-size: clamp(38px, 5.6vw, 60px); margin-bottom: 18px; }
.back { font-size: 14px; color: var(--muted); text-decoration: none; display: inline-block; margin-bottom: 26px; }
.back:hover { color: var(--accent); }
.prose h2 { font-size: 32px; margin: 64px 0 18px; }
.prose h3 { font-size: 22px; margin: 36px 0 10px; }
.prose p, .prose li { color: var(--ink-2); }
.prose figure { margin: 32px 0; }
.prose figure img, .prose figure video { border-radius: var(--radius); width: 100%; background: #111; }
.prose figcaption { font-size: 14px; color: var(--muted); margin-top: 10px; }
.wide { max-width: 980px; }

.reasons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 24px 0; }
.reasons .panel h3 { margin-top: 0; font-size: 20px; }

.steps { counter-reset: step; }
.step { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; margin: 40px 0; }
.step h3 { margin-top: 0; }
.step h3::before { counter-increment: step; content: counter(step, decimal-leading-zero); display: block; font-family: var(--sans); font-size: 13px; font-weight: 600; letter-spacing: .1em; color: var(--accent); margin-bottom: 6px; }
.step img { border-radius: var(--radius); }

table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 18px 0; }
th, td { text-align: left; padding: 11px 14px 11px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
tr.final td { font-weight: 600; color: var(--ink); }

/* CV */
.cv section { padding: 40px 0; }
.cv h2 { font-size: 28px; margin-bottom: 16px; }
.cv .row { display: grid; grid-template-columns: 1fr auto; gap: 2px 24px; padding: 10px 0; border-top: 1px solid var(--line); }
.cv .row .when { color: var(--muted); font-size: 14px; white-space: nowrap; }
.cv .row .detail { grid-column: 1 / -1; font-size: 15px; color: var(--ink-2); }
.cv .row .detail ul { margin: 4px 0 0; padding-left: 18px; }
.cv .cols { columns: 2; column-gap: 40px; font-size: 15px; }
.cv .cols p { break-inside: avoid; margin-bottom: 8px; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .highlights ul { grid-template-columns: repeat(2, 1fr); }
  .highlights li, .highlights li:first-child { border-left: 0; padding: 20px 0; border-top: 1px solid var(--line); }
  .highlights li:nth-child(-n+2) { border-top: 0; }
  .highlights li:nth-child(odd) { padding-right: 16px; }
  .grid.three { grid-template-columns: repeat(2, 1fr); }
  .reasons { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .site-header .wrap { height: auto; padding-top: 10px; padding-bottom: 10px; flex-direction: column; align-items: flex-start; gap: 6px; }
  .nav { gap: 20px; width: 100%; }
  .hero .wrap, .about .wrap, .feature, .service-lead, .step { grid-template-columns: 1fr; }
  .hero-photo { max-width: 420px; order: -1; }
  .grid.two, .grid.three { grid-template-columns: 1fr; }
  .car-track, .car-track.three { grid-auto-columns: 86%; gap: 16px; }
  .sub-head { flex-wrap: wrap; }
  .sub-head h3 { white-space: normal; }
  .facts { grid-template-columns: 1fr; }
  .lead { font-size: 18px; }
  .cv .cols { columns: 1; }
}

@media print {
  .site-header, .site-footer, .back, .no-print { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .cv section { padding: 14px 0; break-inside: avoid-page; }
}
