/* D2: ash to pearl. One committed light look; every colour explicit. */
:root {
  color-scheme: light only;
  --paper: #EEE9DE;
  --paper-2: #E4DED1;
  --paper-wash: rgba(238, 233, 222, 0.84);
  --ink: #211E1A;
  --ink-2: #4A453E;
  --ash: #8E877C;
  --ash-light: #C9C2B5;
  --iron: #7A3B1E;
  --lye: #A8762B;
  --pearl: #FBF8F1;
  --serif: "Libre Caslon Text", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Public Sans", "Helvetica Neue", Arial, sans-serif;
  --measure: 34em;
  --gutter: clamp(20px, 8vw, 128px);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}
html[lang="zh-Hans"] {
  --serif: "Noto Serif SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", serif;
  --measure: 36em;
}

* { box-sizing: border-box; }
html { background: var(--paper); scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
  min-height: 100vh;
}
html[lang="zh-Hans"] body { font-size: 16px; line-height: 1.85; letter-spacing: 0; }
html[lang="zh-Hans"] .latin { font-family: "Libre Caslon Text", Georgia, serif; }

h1, h2, h3 { font-weight: 400; margin: 0; line-height: 1.1; }
h1 { font-size: clamp(44px, 7.5vw, 104px); letter-spacing: -0.01em; }
h2 { font-size: clamp(28px, 3.4vw, 42px); margin-bottom: 0.6em; }
h3 { font-size: clamp(20px, 2vw, 24px); margin-top: 1.6em; margin-bottom: 0.4em; }
html[lang="zh-Hans"] h1, html[lang="zh-Hans"] h2, html[lang="zh-Hans"] h3 { letter-spacing: 0; line-height: 1.3; }
p { margin: 0 0 1em; max-width: var(--measure); }
a { color: var(--iron); text-decoration: none; }
:focus-visible { outline: 2px solid var(--iron); outline-offset: 3px; }

/* The field: one fixed canvas behind everything (home), or a band (contact). */
.field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
  pointer-events: none;
}
.field--band {
  position: relative;
  inset: auto;
  height: 32vh;
  min-height: 180px;
  max-height: 320px;
  z-index: 0;
  pointer-events: auto;
}
.stage-label {
  position: fixed;
  left: var(--gutter);
  bottom: 22px;
  z-index: 2;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-2);
  pointer-events: none;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 4px 10px 4px 8px;
  margin-left: -8px;
  background: var(--paper-wash);
}
html[lang="zh-Hans"] .stage-label { font-family: var(--serif); }
.stage-label::before {
  content: "";
  width: 7px; height: 7px;
  background: var(--ink);
  transition: background 600ms var(--ease);
}
.stage-label[data-s="1"]::before { background: var(--ash); }
.stage-label[data-s="2"]::before { background: var(--lye); }
.stage-label[data-s="3"]::before { background: var(--ink); outline: 1px solid var(--iron); outline-offset: 2px; }
.stage-label[data-s="4"]::before { background: var(--pearl); box-shadow: 1px 1px 0 var(--ash-light); }
.stage-label span { display: inline-block; transition: opacity 320ms var(--ease), transform 320ms var(--ease); }
.stage-label.swap span { opacity: 0; transform: translateY(4px); }

/* Header */
.top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px var(--gutter);
  font-family: var(--sans);
  font-size: 14px;
  background: linear-gradient(var(--paper) 55%, rgba(238, 233, 222, 0));
}
html[lang="zh-Hans"] .top { font-family: var(--serif); font-size: 14px; }
.top .home {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: "Libre Caslon Text", Georgia, serif;
  font-size: 17px;
  min-height: 44px;
}
.mark { width: 22px; height: 22px; overflow: visible; }
.mark circle { fill: var(--ink); transition: transform 520ms var(--ease), fill 520ms var(--ease); transform-box: fill-box; transform-origin: center; }
.mark circle:nth-child(5) { fill: var(--iron); }
.home:hover .mark circle, .home:focus-visible .mark circle { fill: var(--iron); }
.home:hover .mark circle:nth-child(1), .home:focus-visible .mark circle:nth-child(1) { transform: translate(2px, 3px); }
.home:hover .mark circle:nth-child(2), .home:focus-visible .mark circle:nth-child(2) { transform: translate(0, 4px); }
.home:hover .mark circle:nth-child(3), .home:focus-visible .mark circle:nth-child(3) { transform: translate(-2px, 3px); }
.home:hover .mark circle:nth-child(4), .home:focus-visible .mark circle:nth-child(4) { transform: translate(4px, 0); }
.home:hover .mark circle:nth-child(5), .home:focus-visible .mark circle:nth-child(5) { transform: scale(0.4); }
.home:hover .mark circle:nth-child(6), .home:focus-visible .mark circle:nth-child(6) { transform: translate(-4px, 0); }
.home:hover .mark circle:nth-child(7), .home:focus-visible .mark circle:nth-child(7) { transform: translate(2px, -3px); }
.home:hover .mark circle:nth-child(8), .home:focus-visible .mark circle:nth-child(8) { transform: translate(0, -4px); }
.home:hover .mark circle:nth-child(9), .home:focus-visible .mark circle:nth-child(9) { transform: translate(-2px, -3px); }

.top nav { display: flex; gap: clamp(14px, 2.5vw, 34px); margin-left: auto; }
.top nav a, .lang a, .lang span {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  transition: transform 260ms var(--ease), color 260ms var(--ease);
}
.top nav a::after, .lang a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 9px;
  height: 1.5px;
  background: var(--iron);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 320ms var(--ease);
}
.top nav a:hover, .top nav a:focus-visible, .lang a:hover, .lang a:focus-visible { color: var(--iron); transform: translateY(-1px); }
.top nav a:hover::after, .top nav a:focus-visible::after, .lang a:hover::after, .lang a:focus-visible::after { transform: scaleX(1); }
.lang { display: inline-flex; align-items: center; gap: 8px; position: relative; padding-left: 4px; }
.lang .sep { color: var(--ash); }
.lang [aria-current] { color: var(--ink-2); }
.lang [aria-current]::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 9px;
  height: 1.5px;
  background: var(--ink-2);
  transform-origin: right;
  transition: transform 320ms var(--ease);
}
.lang:hover [aria-current]::after, .lang:focus-within [aria-current]::after { transform: scaleX(0); }
.lang a[lang="zh-Hans"] { font-family: "Noto Serif SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", serif; }

/* Beats */
main { position: relative; z-index: 1; }
.beat {
  position: relative;
  padding: 0 var(--gutter);
}
.beat .col { max-width: var(--measure); }
.panel {
  background: var(--paper-wash);
  padding: 28px 28px 14px;
  margin-left: -28px;
  max-width: calc(var(--measure) + 56px);
}

.beat-fire { min-height: calc(100vh - 72px); display: flex; flex-direction: column; justify-content: center; padding-top: 6vh; padding-bottom: 14vh; }
.beat-fire h1 { max-width: 9em; margin-bottom: 0.35em; }
.beat-fire .lede { font-size: clamp(18px, 1.6vw, 22px); line-height: 1.5; max-width: 30em; }
html[lang="zh-Hans"] .beat-fire .lede { line-height: 1.8; max-width: 32em; }
.beat-fire .tag { color: var(--ink-2); font-style: italic; margin-top: 1.2em; }
html[lang="zh-Hans"] .beat-fire .tag { font-style: normal; }

.beat-ash { min-height: 100vh; padding-top: 16vh; padding-bottom: 30vh; }
.beat-ash dl { margin: 0; max-width: var(--measure); }
.beat-ash dt { font-family: var(--sans); font-size: 13.5px; font-weight: 500; color: var(--ink-2); margin-top: 1.5em; }
html[lang="zh-Hans"] .beat-ash dt { font-family: var(--serif); font-weight: 600; font-size: 14px; }
.beat-ash dd { margin: 0.3em 0 0; }

.beat-leach { min-height: 100vh; padding-top: 22vh; padding-bottom: 22vh; display: flex; }
.beat-leach .col { margin-left: auto; margin-right: 0; width: min(var(--measure), 100%); }
@media (max-width: 900px) { .beat-leach .col { margin-left: 0; } }

.beat-kettle { padding: 0 var(--gutter) 24vh; }
.bleed {
  position: relative;
  height: 100vh;
  margin: 0 calc(-1 * var(--gutter));
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 72px;
}
.bleed .caption {
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--ink-2);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 700ms var(--ease) 300ms, transform 700ms var(--ease) 300ms;
}
html[lang="zh-Hans"] .bleed .caption { font-family: var(--serif); }
.bleed.in .caption { opacity: 1; transform: none; }
@media (hover: none) { .bleed .caption .pointer { display: none; } }
@media (hover: hover) { .bleed .caption .touch { display: none; } }
.beat-kettle ol { margin: 0; padding: 0; list-style: none; counter-reset: step; max-width: var(--measure); }
.beat-kettle li { counter-increment: step; display: grid; grid-template-columns: 2.2em 1fr; gap: 0 8px; padding: 12px 0; border-top: 1px solid var(--ash-light); }
.beat-kettle li:last-child { border-bottom: 1px solid var(--ash-light); }
.beat-kettle li::before { content: counter(step); font-family: var(--sans); font-size: 14px; color: var(--iron); padding-top: 3px; }
.beat-kettle li b { display: block; font-weight: 400; font-family: var(--sans); font-size: 13.5px; color: var(--ink-2); }
html[lang="zh-Hans"] .beat-kettle li b { font-family: var(--serif); font-weight: 600; font-size: 14px; }

.beat-pearl { min-height: 100vh; padding-top: 10vh; padding-bottom: 12vh; }
.beat-contact { padding-top: 6vh; padding-bottom: 14vh; }
.btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 18px;
  border: 1.5px solid var(--iron);
  color: var(--iron);
  font-family: var(--sans);
  font-size: 14.5px;
  position: relative;
  overflow: hidden;
  z-index: 0;
  background: transparent;
  cursor: pointer;
  transition: color 320ms var(--ease);
}
html[lang="zh-Hans"] .btn { font-family: var(--serif); }
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--iron);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 380ms var(--ease);
  z-index: -1;
}
.btn:hover, .btn:focus-visible { color: var(--pearl); }
.btn:hover::before, .btn:focus-visible::before { transform: scaleY(1); }

/* Grain rule: draws from the left when the block is in view. */
.rule {
  height: 3px;
  width: min(var(--measure), 100%);
  margin: 0 0 26px;
  background-image: radial-gradient(circle, var(--ink) 1px, transparent 1.2px);
  background-size: 7px 3px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1100ms var(--ease);
}
.beat-pearl .rule, .beat-contact .rule, .page .rule { background-image: radial-gradient(circle, var(--ash) 1px, transparent 1.2px); }
.in .rule { transform: scaleX(1); }
.settle { opacity: 0; letter-spacing: 0.06em; transform: translateY(6px); transition: opacity 900ms var(--ease), letter-spacing 1100ms var(--ease), transform 900ms var(--ease); }
html[lang="zh-Hans"] .settle { letter-spacing: 0.12em; }
.in .settle { opacity: 1; letter-spacing: 0; transform: none; }
html[lang="zh-Hans"] .in .settle { letter-spacing: 0; }
.in .settle:nth-child(2) { transition-delay: 90ms; }
.in .settle:nth-child(3) { transition-delay: 180ms; }
.in .settle:nth-child(4) { transition-delay: 270ms; }
.in .settle:nth-child(5) { transition-delay: 360ms; }

/* Footer */
footer {
  position: relative;
  z-index: 1;
  padding: 28px var(--gutter) 64px;
  font-size: 14px;
  color: var(--ink-2);
  border-top: 1px solid var(--ash-light);
}
footer p { margin: 0 0 6px; max-width: none; }

/* Contact page */
.page { position: relative; z-index: 1; padding: 6vh var(--gutter) 10vh; }
.page .col { max-width: var(--measure); }
form { max-width: var(--measure); margin-top: 24px; }
.f { display: grid; gap: 6px; margin-bottom: 18px; }
label { font-family: var(--sans); font-size: 13.5px; color: var(--ink-2); }
html[lang="zh-Hans"] label { font-family: var(--serif); }
input, textarea {
  font: inherit;
  color: var(--ink);
  background: var(--pearl);
  border: 1px solid var(--ash-light);
  border-bottom-color: var(--ash);
  padding: 10px 12px;
  min-height: 44px;
  width: 100%;
  border-radius: 0;
  transition: border-color 260ms var(--ease), background 260ms var(--ease);
}
input:focus, textarea:focus { outline: none; border-color: var(--iron); background: #FFFFFF; }
textarea { min-height: 140px; resize: vertical; }
.note { font-family: var(--sans); font-size: 13.5px; color: var(--ink-2); margin-top: 16px; }
html[lang="zh-Hans"] .note { font-family: var(--serif); }
.sent { display: none; padding: 20px 0; border-top: 1px solid var(--ash-light); border-bottom: 1px solid var(--ash-light); max-width: var(--measure); }
form.is-sent { display: none; }
form.is-sent + .sent { display: block; }

@media (max-width: 640px) {
  .top { padding-top: 8px; padding-bottom: 8px; }
  .top nav { display: none; }
  .panel { padding: 20px 20px 8px; margin-left: -20px; max-width: calc(100% + 40px); }
  .beat-fire { min-height: calc(100vh - 60px); }
  .bleed { height: 86vh; padding-bottom: 56px; }
  .stage-label { bottom: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .settle, .rule, .bleed .caption { opacity: 1; transform: none; letter-spacing: 0; transition: none; }
  .mark circle, .top nav a, .lang a, .btn, .btn::before, .top nav a::after, .lang a::after, .lang [aria-current]::after { transition: none; }
}
