/* kfc50.ai — tokens and layout. Mobile first; desktop from 768px. See DESIGN.md. */

@font-face { font-family: "Switzer"; src: url("/fonts/switzer-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Switzer"; src: url("/fonts/switzer-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Switzer"; src: url("/fonts/switzer-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --bg: #0a0a0a;
  --surface: #151515;
  --ink: #efefef;
  --muted: #8c8c8c;
  --accent: #b11226;
  --accent-ink: #ffffff;
  --field: #efefef;
  --field-ink: #0a0a0a;
  --field-muted: #5a5a5a;

  --m: 20px;                                   /* the one pair of page margins */
  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-display: calc((100vw - 2 * var(--m)) / 12.9);

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --font: "Switzer", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --font-code: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", monospace; /* taste-skill-ignore: used only inside pre and code */
}
@media (min-width: 768px) { :root { --m: 32px; } }
@media (min-width: 1680px) { :root { --step-display: 125px; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 var(--step-body)/1.5 var(--font); letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.22em; }
a:hover { color: #ffffff; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--accent-ink); }
h1, h2, h3, p, ol, ul { margin: 0; }
h2 { font-size: var(--step-lead); font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.small { font-size: var(--step-small); }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- header ---------- */
.top { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px var(--m); min-height: 56px; }
.top .mark { font-weight: 600; text-decoration: none; letter-spacing: -0.02em; }
.top nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 20px; }
.top nav a { text-decoration: none; padding: 10px 0; }
.top nav a:hover { text-decoration: underline; }

/* ---------- buttons (one shape: square, flat) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border: 0; border-radius: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font: 500 var(--step-body)/1 var(--font);
  text-decoration: none; transition: transform 160ms var(--ease), background-color 160ms var(--ease);
}
.btn:hover { background: #cc1730; color: var(--accent-ink); }
.btn:active { transform: translateY(2px) scale(0.985); }
.btn.quiet { background: var(--surface); color: var(--ink); }
.btn.quiet:hover { background: #242424; }
.btn[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.sq { width: 48px; padding: 0; background: var(--surface); color: var(--ink); font-size: 20px; }
.sq:hover { background: #242424; }
.sq:disabled { color: #5a5a5a; cursor: default; }

/* ---------- hero ---------- */
.hero { padding: clamp(20px, 5vh, 56px) 0 0; }
.hero h1 {
  padding: 0 var(--m); font-size: var(--step-display); font-weight: 600;
  line-height: 1.08; letter-spacing: -0.03em;
}
.hero h1 span { display: block; white-space: nowrap; }
.hero .say { display: grid; gap: 20px; padding: 24px var(--m) 0; align-items: end; }
.hero .say p { max-width: 30em; }
@media (min-width: 768px) {
  .hero .say { grid-template-columns: 1fr auto; padding-top: 36px; }
}

/* the strip: frames at one height, natural widths, running off both edges */
.strip {
  display: flex; gap: 8px; margin-top: clamp(28px, 5vh, 56px); padding: 0 var(--m);
  overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; cursor: grab;
}
.strip::-webkit-scrollbar { display: none; }
.strip.dragging { cursor: grabbing; scroll-snap-type: none; }
.strip figure { flex: none; margin: 0; scroll-snap-align: center; }
.strip img { height: clamp(190px, 34vh, 320px); width: auto; user-select: none; -webkit-user-drag: none; }
.js .strip.lit img { filter: brightness(0.5); transition: filter 320ms var(--ease); }
.js .strip.lit figure.on img, .js .strip.lit figure:hover img { filter: none; }
.strip-title { padding: 12px var(--m) 0; min-height: 2.6em; }

/* ---------- sections ---------- */
section { padding: clamp(88px, 13vw, 180px) 0 0; }
.wrap { padding: 0 var(--m); }

/* intro: narrow column of his own words, the first cover beside it */
.intro .wrap { display: grid; gap: 28px; }
.intro .col { max-width: 23em; display: grid; gap: 1.1em; }
.intro .col p:nth-of-type(n+2) { color: #c9c9c9; }
.intro .col p:first-of-type { font-weight: 500; }
.intro figure { margin: 0; overflow: hidden; }
.intro figure img { width: 100%; height: auto; }
.intro figcaption { padding-top: 10px; }
@media (min-width: 768px) {
  .intro .wrap { grid-template-columns: repeat(12, 1fr); column-gap: 24px; align-items: start; }
  .intro h2 { grid-column: 1 / span 2; }
  .intro .col { grid-column: 3 / span 6; }
  .intro figure { grid-column: 3 / -1; }
}
@media (min-width: 1024px) {
  .intro .col { grid-column: 3 / span 4; }
  .intro figure { grid-column: 8 / -1; }
}

/* skills: one strip per skill */
.skills .wrap { display: grid; gap: 28px; }
.skills .label p { margin-top: 10px; max-width: 16em; }
.skill { min-width: 0; }
.skill-head { display: grid; gap: 14px; padding-bottom: 20px; }
.skill-head h3 { font-size: var(--step-lead); font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
.skill-head .acts { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; }
.skill .strip { margin: 0 calc(-1 * var(--m)); }
.skill .strip img { height: 190px; }
@media (min-width: 768px) {
  .skills .wrap { grid-template-columns: repeat(12, 1fr); column-gap: 24px; }
  .skills .label { grid-column: 1 / span 2; position: sticky; top: 24px; align-self: start; }
  .skill { grid-column: 3 / -1; }
}
@media (min-width: 1024px) {
  .skill-head { grid-template-columns: 1fr auto; align-items: end; }
}
@media (min-width: 768px) {
  .skill .strip { margin: 0 calc(-1 * var(--m)) 0 0; padding-left: 0; }
}

/* how: a row of moments pulled sideways */
.how-top { display: flex; justify-content: space-between; align-items: end; gap: 16px; }
.how-top .nav { display: none; gap: 8px; }
@media (min-width: 768px) { .how-top .nav { display: flex; } }
.bar { height: 6px; background: var(--surface); margin: 20px var(--m) 0; }
.bar i { display: block; height: 100%; width: 20%; background: var(--ink); transform-origin: left; }
.row {
  display: flex; gap: 16px; padding: 28px var(--m) 0; overflow-x: auto;
  scroll-snap-type: x proximity; scroll-padding-left: var(--m); scrollbar-width: none; cursor: grab;
}
.row::-webkit-scrollbar { display: none; }
.row.dragging { cursor: grabbing; scroll-snap-type: none; }
.row article { flex: none; width: 76vw; max-width: 360px; scroll-snap-align: start; display: flex; flex-direction: column; }
.row h3 { font-size: var(--step-body); font-weight: 600; letter-spacing: -0.01em; }
.row p { margin-top: 8px; color: #c9c9c9; }
.row .gap { flex: none; height: var(--g, 40px); }
.row .pic { overflow: hidden; background: #000; aspect-ratio: 16 / 9; }
.row .pic img, .row .pic video { width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; }
@media (min-width: 768px) { .row { gap: 32px; } .row article { width: 360px; } .row .gap { height: calc(var(--g, 40px) * 2.2); } }

/* the live thing: one camera position, three framings */
.reframe img { transform-origin: 46% 40%; transition: transform 700ms var(--ease); }
.reframe[data-shot="mid"] img { transform: scale(1.55); }
.reframe[data-shot="close"] img { transform: scale(2.3); }
.shots { display: flex; gap: 8px; margin-top: 10px; }
.shots .btn { flex: 1; min-height: 44px; padding: 0 8px; font-size: var(--step-small); }

/* notes: two-ended rows in one narrow column */
.notes .wrap { display: grid; gap: 20px; }
@media (min-width: 768px) {
  .notes .wrap { grid-template-columns: repeat(12, 1fr); column-gap: 24px; align-items: baseline; }
  .notes h2 { grid-column: 1 / span 2; }
  .notes .col { grid-column: 3 / span 7; }
}
.notes ul { list-style: none; padding: 0; }
.notes li a, .notes li > span { display: flex; justify-content: space-between; gap: 24px; min-height: 44px; align-items: center; text-decoration: none; }
.notes li a:hover .t { text-decoration: underline; }
.notes .d { color: var(--muted); font-size: var(--step-small); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* contact + footer: the page inverts to the light field */
.field { background: var(--field); color: var(--field-ink); margin-top: clamp(88px, 13vw, 180px); padding: clamp(72px, 10vw, 150px) 0 0; }
.field a:hover { color: #000; }
.field .muted { color: var(--field-muted); }
.contact .wrap { display: grid; gap: 36px; }
.contact .say { font-size: clamp(1.4rem, 1rem + 1.7vw, 2.25rem); font-weight: 600; line-height: 1.2; letter-spacing: -0.02em; max-width: 13em; }
.contact .who { display: grid; grid-template-columns: 96px 1fr; gap: 20px; align-items: start; }
.contact .who img { width: 100%; height: auto; }
.contact .links { display: grid; gap: 6px; }
.contact .links h2 { font-size: var(--step-body); font-weight: 500; margin-bottom: 8px; }
.contact .links a { font-size: var(--step-lead); font-weight: 500; padding: 6px 0; width: fit-content; }
.contact .links p { margin-top: 14px; }
@media (min-width: 768px) { .contact .who { grid-template-columns: 160px 1fr; gap: 28px; } }
@media (min-width: 1024px) {
  .contact .wrap { grid-template-columns: repeat(12, 1fr); column-gap: 24px; align-items: start; }
  .contact .say { grid-column: 1 / span 6; }
  .contact .who { grid-column: 8 / -1; }
}
.foot { display: grid; gap: 8px; padding: clamp(96px, 16vh, 200px) var(--m) 28px; font-size: var(--step-small); }
.foot nav { display: flex; flex-wrap: wrap; gap: 4px 24px; }
.foot nav a { padding: 8px 0; }
@media (min-width: 768px) {
  .foot { grid-template-columns: 1fr auto 1fr; align-items: baseline; }
  .foot > :last-child { text-align: right; }
}

/* ---------- skill page and note page ---------- */
.page { padding: clamp(28px, 6vh, 72px) var(--m) 0; }
.page h1 { font-size: clamp(2.6rem, 1.4rem + 6vw, 6rem); font-weight: 600; letter-spacing: -0.04em; line-height: 1; }
.page .lede { margin-top: 20px; max-width: 30em; font-size: var(--step-lead); line-height: 1.35; }
.page .acts { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; margin-top: 28px; }
.doc { display: grid; gap: 56px; padding: clamp(64px, 9vw, 120px) var(--m) 0; }
.doc section { padding: 0; display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.doc .body { display: grid; gap: 14px; max-width: 38em; min-width: 0; grid-template-columns: minmax(0, 1fr); }
.doc li { min-width: 0; }
.doc li pre { margin-top: 10px; }
.doc ol, .doc ul { padding-left: 1.3em; display: grid; gap: 10px; }
.doc pre { margin: 0; padding: 16px 18px; background: var(--surface); overflow-x: auto; font: 400 0.92em/1.6 var(--font-code); }
.doc code { font-family: var(--font-code); font-size: 0.92em; }
.doc p code, .doc li code { background: var(--surface); padding: 0.1em 0.35em; }
.doc pre code { background: none; padding: 0; }
.doc .pic { margin: 0; }
@media (min-width: 768px) {
  .doc section { grid-template-columns: repeat(12, 1fr); column-gap: 24px; }
  .doc section > h2 { grid-column: 1 / span 3; }
  .doc section > .body { grid-column: 4 / span 6; }
  .doc section > .side { grid-column: 10 / -1; }
}
.note { max-width: 36em; margin: 0 auto; display: grid; gap: 1.1em; padding: clamp(48px, 8vw, 96px) var(--m) 0; }
.note h2 { margin-top: 1em; }

/* ---------- motion ---------- */
.js .rv { opacity: 0; transform: translateY(24px); transition: opacity 600ms var(--ease), transform 700ms var(--ease); transition-delay: calc(var(--i, 0) * 75ms); }
.js .rv.in { opacity: 1; transform: none; }
.intro figure img { transition: transform 1200ms var(--ease); transform: scale(1.06); }
.intro figure.in img, html:not(.js) .intro figure img { transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .rv, .intro figure img, .reframe img, .btn, .js .strip.lit img { transition: none; transform: none; opacity: 1; }
  .reframe[data-shot="mid"] img { transform: scale(1.55); }
  .reframe[data-shot="close"] img { transform: scale(2.3); }
}
