:root {
  --ink: #1c2a38;
  --mute: #5a6a78;
  --paper: #f3eee4;
  --paper-2: #fffaf2;
  --deep: #12181c;
  --subject: #2a5a8a;
  --amber: #c48a28;
  --sea: #3a6a8a;
  --hot: #b54a2a;
  --ok: #2f8f6b;
  --line: rgba(28, 42, 56, 0.12);
  --glass: rgba(255, 250, 242, 0.94);
  --foil: linear-gradient(135deg, #2a5a8a, #c48a28, #d8c8a8, #3a6a8a);
  --serif: "Noto Serif SC", "Songti SC", serif;
  --sans: "Noto Sans SC", "PingFang SC", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --shadow: 0 22px 48px rgba(36, 24, 15, 0.22);
}

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

html {
  scroll-behavior: smooth;
}

section[id] {
  scroll-margin-top: 96px;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
}

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

a {
  color: inherit;
  text-decoration: none;
}

.app-link {
  color: var(--subject);
  text-decoration: underline;
  text-underline-offset: 3px;
}

footer .app-link {
  color: var(--amber);
}

button {
  font-family: inherit;
  cursor: pointer;
}

code,
.mono {
  font-family: var(--mono);
  font-size: 0.92em;
  font-variant-numeric: tabular-nums;
}

code {
  background: rgba(196, 138, 40, 0.12);
  padding: 0.05em 0.35em;
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  opacity: 0.1;
  background-image: url("images/texture.webp");
  background-size: 520px auto;
  mix-blend-mode: multiply;
}

.skip {
  position: absolute;
  left: -999px;
}

.skip:focus {
  left: 12px;
  top: 12px;
  z-index: 70;
  background: var(--paper-2);
  padding: 8px 12px;
}

.nav {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  width: min(1180px, calc(100% - 24px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px 8px 14px;
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(1.5);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 10px 40px rgba(36, 24, 15, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.brand small {
  display: block;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--mute);
}

.seal {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--paper-2);
  background: var(--subject);
}

.nav-toggle {
  display: none;
  flex-shrink: 0;
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--subject);
  color: var(--subject);
  padding: 6px 12px;
  border-radius: 99px;
}

.nav-links {
  display: flex;
  gap: 14px;
  align-items: center;
  font-size: 13px;
}

.nav-links a {
  color: var(--mute);
  padding: 4px 2px;
}

.nav-links a.is-active,
.nav-links a:hover {
  color: var(--subject);
}

.nav-links .live {
  padding: 6px 12px;
  border: 1px solid var(--subject);
  border-radius: 99px;
  color: var(--subject);
}

.hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  align-items: end;
  overflow: hidden;
  color: #fff8ef;
}

.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(80% 60% at 80% 20%, rgba(196, 138, 40, 0.2), transparent 50%),
    linear-gradient(180deg, rgba(36, 24, 15, 0.12) 0%, rgba(36, 24, 15, 0.5) 50%, rgba(36, 24, 15, 0.92) 100%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  padding: 12vh 8vw 10vh;
  max-width: 980px;
}

.kicker,
.vlabel {
  letter-spacing: 0.22em;
  font-size: 12px;
  color: var(--amber);
  margin: 0 0 12px;
}

.vlabel {
  color: var(--subject);
  font-style: italic;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.08;
  margin: 0 0 16px;
}

h1 {
  font-size: clamp(46px, 8.4vw, 104px);
  letter-spacing: -0.04em;
}

h2 {
  font-size: clamp(28px, 4vw, 44px);
}

h3 {
  font-size: 22px;
}

.lead {
  font-size: 18px;
  max-width: 42em;
  color: rgba(255, 248, 239, 0.88);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0;
}

.chip {
  border: 1px solid rgba(255, 248, 239, 0.35);
  padding: 4px 10px;
  font-size: 12px;
  letter-spacing: 0.08em;
  border-radius: 99px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border: 1px solid currentColor;
  font-size: 14px;
  border-radius: 99px;
}

.btn-fill {
  background: var(--subject);
  color: var(--paper-2);
  border-color: var(--subject);
}

.btn-ghost {
  background: transparent;
  color: inherit;
}

.wrap {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 96px 0;
}

.section-head {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 24px;
  margin-bottom: 40px;
}

.section-head p:last-child {
  color: var(--mute);
  margin: 0;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.card,
.bench {
  background: linear-gradient(var(--paper-2), var(--paper-2)) padding-box, var(--foil) border-box;
  border: 1px solid transparent;
  padding: 22px 22px 18px;
  border-radius: 28px;
}

.card {
  min-height: 220px;
}

.glass {
  backdrop-filter: blur(16px);
}

.stamp {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--sea);
  border: 1px solid var(--sea);
  padding: 2px 8px;
  margin-bottom: 10px;
  font-style: italic;
  border-radius: 99px;
}

.card ul,
.io-grid ul,
.rule-list {
  margin: 0;
  padding-left: 1.1em;
}

.card li,
.io-grid li,
.rule-list li {
  margin: 0.35em 0;
}

.alt {
  background: linear-gradient(180deg, #e4e8ee 0%, var(--paper) 100%);
}

.step {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  align-items: center;
  margin-bottom: 72px;
  scroll-margin-top: 96px;
}

.step.reverse {
  direction: rtl;
}

.step.reverse > * {
  direction: ltr;
}

.num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 28px;
  color: var(--subject);
  display: block;
  margin-bottom: 8px;
}

figure {
  margin: 0;
}

figure img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  border-radius: 28px;
  box-shadow: var(--shadow);
}

figcaption {
  margin-top: 10px;
  font-size: 13px;
  color: var(--mute);
  font-style: italic;
}

.sheet-demo {
  margin-top: 22px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px dashed rgba(58, 106, 138, 0.45);
  background: rgba(255, 250, 242, 0.78);
}

.clock-label {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--mute);
}

.wall-card {
  position: relative;
  padding: 14px 16px 12px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 1px 1px 0 #d8d0c0;
}

.wall-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hot);
  box-shadow: 0 0 0 4px rgba(181, 74, 42, 0.14);
}

.dot.is-off {
  background: transparent;
  box-shadow: none;
  border: 1px solid var(--line);
}

.wall-card .mono {
  color: var(--mute);
  margin: 8px 0 0;
}

.wall-card p {
  margin: 6px 0 0;
}

.wall-note {
  font-size: 13px;
  color: var(--amber);
}

.clock-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  font-size: 13px;
}

.clock-meta .btn {
  color: var(--subject);
  border-color: var(--subject);
  padding: 6px 12px;
  flex-shrink: 0;
}

#wall-warn {
  color: var(--mute);
}

.bento {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.bench.span-2 {
  grid-column: span 2;
}

.bento .bench:last-child {
  grid-column: 1 / -1;
}

.bench h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.bench p {
  margin: 0;
  color: var(--mute);
  font-size: 14px;
}

.rule-list {
  font-size: 17px;
  max-width: 46em;
}

.io-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

footer {
  border-top: 1px solid var(--line);
  background: var(--deep);
  color: #f4ece1;
}

.footer-inner {
  padding: 32px 0;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
}

@media (max-width: 1024px) {
  .nav {
    border-radius: 24px;
    flex-wrap: wrap;
  }

  .nav:has(.nav-links.open) {
    background: rgba(255, 250, 242, 0.97);
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    padding: 8px 10px 14px;
  }

  .nav-links.open {
    display: flex;
  }

  .section-head,
  .grid-3,
  .step,
  .step.reverse,
  .io-grid,
  .bento {
    grid-template-columns: 1fr;
    direction: ltr;
    display: grid;
  }

  .bench.span-2 {
    grid-column: span 1;
  }

  .footer-inner {
    flex-direction: column;
  }

  h1 {
    font-size: 42px;
  }

  figure img {
    height: 220px;
  }

  .wrap {
    width: min(1120px, calc(100% - 32px));
    padding: 56px 0;
  }

  .clock-meta {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
