:root {
  --bone: #e9e7de;
  --raised: #f1efe6;
  --ink: #18191c;
  --ink-soft: #3a3d42;
  --muted: #6c706a;
  --accent: #c8412a;
  --accent-soft: rgba(200, 65, 42, .12);
  --line: rgba(24, 25, 28, .14);
  --line-strong: rgba(24, 25, 28, .32);
  --max: 1180px;
  --gut: clamp(22px, 5vw, 64px);
  --serif: "Fraunces", "Iowan Old Style", "Songti SC", Georgia, serif;
  --sans: "Hanken Grotesk", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

* { box-sizing: border-box; }

html {
  color: var(--ink);
  background: var(--bone);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(120% 80% at 85% -10%, rgba(200, 65, 42, .06), transparent 55%),
    var(--bone);
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, p, dl, dd { margin: 0; }
p { text-wrap: pretty; }
ol { margin: 0; padding: 0; list-style: none; }

::selection { background: var(--accent); color: var(--bone); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 1px;
}

/* ---- Frame: crop marks + registration ruler (signature) ---- */

.frame { position: fixed; inset: 0; z-index: 5; pointer-events: none; }
.crop {
  position: absolute; width: 14px; height: 14px;
  border-color: var(--line-strong); border-style: solid; border-width: 0;
}
.crop.tl { top: 10px; left: 10px; border-top-width: 1px; border-left-width: 1px; }
.crop.tr { top: 10px; right: 10px; border-top-width: 1px; border-right-width: 1px; }
.crop.bl { bottom: 10px; left: 10px; border-bottom-width: 1px; border-left-width: 1px; }
.crop.br { bottom: 10px; right: 10px; border-bottom-width: 1px; border-right-width: 1px; }

.ruler {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 9px var(--gut);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: .68rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
}
.ruler-mark { color: var(--accent); font-size: .6rem; }
.ruler-label { flex: 1; text-align: center; }
.ruler-coord { opacity: .8; }

/* ---- Masthead ---- */

.masthead {
  position: sticky; top: 0; z-index: 4;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  width: min(var(--max), calc(100% - var(--gut) * 2));
  margin: 0 auto;
  padding: 20px 0;
  background: linear-gradient(var(--bone), rgba(233, 231, 222, .86));
  backdrop-filter: blur(6px);
}

.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  font-family: var(--mono); font-size: .72rem; font-weight: 500;
  letter-spacing: .02em; color: var(--ink);
  transition: background .2s ease, color .2s ease;
}
.brand:hover .brand-mark { background: var(--ink); color: var(--bone); }
.brand-name {
  font-family: var(--serif); font-size: 1.1rem; font-weight: 500;
  letter-spacing: -.01em;
}

.masthead-right { display: flex; align-items: center; gap: 18px; }

nav { display: flex; flex-wrap: wrap; gap: 2px; }
nav a {
  padding: 8px 12px;
  font-family: var(--mono); font-size: .72rem; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-soft);
  transition: color .18s ease;
}
nav a:hover { color: var(--accent); }

.lang-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 34px; padding: 0 11px;
  border: 1px solid var(--line-strong);
  background: transparent; color: var(--ink);
  font-family: var(--mono); font-size: .7rem; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase;
  cursor: pointer; border-radius: 0;
  transition: color .18s ease, border-color .18s ease;
}
.lang-toggle:hover { border-color: var(--accent); }
.lang-toggle .lang-sep { color: var(--muted); opacity: .6; }
.lang-toggle .lang-opt { color: var(--muted); transition: color .18s ease; }
.lang-toggle .lang-opt.on { color: var(--accent); }
.lang-toggle:hover .lang-opt.on { color: var(--accent); }

/* ---- Layout ---- */

main { width: min(var(--max), calc(100% - var(--gut) * 2)); margin: 0 auto; }

.eyebrow, .tag, .coord, .code, .status, .ruler-label, .ruler-coord, .ruler-mark {
  font-family: var(--mono);
  font-size: .7rem; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  line-height: 1.5;
}

/* ---- Hero ---- */

.hero {
  display: grid; gap: 26px;
  padding: clamp(70px, 12vw, 150px) 0 clamp(60px, 9vw, 110px);
  border-bottom: 1px solid var(--line);
}
.eyebrow { color: var(--accent); }
.display {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(3rem, 8.2vw, 6.6rem);
  line-height: .98;
  letter-spacing: -.035em;
  font-variation-settings: "opsz" 120;
}
.display em {
  font-style: italic; font-weight: 400;
  color: var(--accent);
  font-variation-settings: "opsz" 144;
}
.lede {
  max-width: 46ch;
  font-size: clamp(1.05rem, 1.4vw, 1.3rem);
  line-height: 1.7;
  color: var(--ink-soft);
}
.hero-meta {
  display: flex; flex-wrap: wrap; gap: 40px;
  margin-top: 8px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.hero-meta div { display: grid; gap: 4px; }
.hero-meta dt {
  font-family: var(--mono); font-size: .66rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted);
}
.hero-meta dd { font-size: .95rem; font-weight: 500; color: var(--ink); display: inline-flex; align-items: center; gap: 8px; }
.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #2f8f5b; box-shadow: 0 0 0 3px rgba(47, 143, 91, .18);
}

/* ---- Section head ---- */

.section-head {
  display: grid;
  grid-template-columns: minmax(140px, .4fr) minmax(0, 1.6fr);
  gap: clamp(28px, 6vw, 80px);
  align-items: end;
  padding: clamp(64px, 8vw, 110px) 0 clamp(36px, 4vw, 56px);
}
.code { color: var(--muted); align-self: start; }
.section-head h2 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1; letter-spacing: -.03em;
  font-variation-settings: "opsz" 100;
}
.section-note {
  grid-column: 2; margin-top: 14px;
  max-width: 50ch; color: var(--muted); font-size: .98rem; line-height: 1.7;
}

/* ---- Register (work entries) ---- */

.register { border-top: 1px solid var(--ink); }

.entry {
  position: relative;
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) auto;
  gap: clamp(20px, 4vw, 56px);
  align-items: start;
  padding: clamp(30px, 4vw, 52px) 0 clamp(30px, 4vw, 52px) 22px;
  border-bottom: 1px solid var(--line);
  transition: background .28s ease;
}
.entry::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 2px; background: var(--accent);
  transform: scaleY(0); transform-origin: top;
  transition: transform .4s cubic-bezier(.2, .7, .2, 1);
}
.entry:hover { background: var(--raised); }
.entry:hover::before { transform: scaleY(1); }

.coord {
  color: var(--muted);
  padding-top: 6px;
  transition: color .28s ease;
}
.entry:hover .coord { color: var(--accent); }

.entry-body { display: grid; gap: 14px; max-width: 60ch; }
.tag { color: var(--accent); }
.entry-body h3 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(1.6rem, 2.8vw, 2.6rem);
  line-height: 1.05; letter-spacing: -.025em;
  font-variation-settings: "opsz" 96;
  transition: color .28s ease;
}
.entry:hover .entry-body h3 { color: var(--accent); }
.entry-body p { color: var(--ink-soft); font-size: 1rem; line-height: 1.7; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 16px;
  border: 1px solid var(--line-strong);
  font-family: var(--mono); font-size: .72rem; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink); background: transparent;
  transition: color .18s ease, background .18s ease, border-color .18s ease;
}
.btn:hover { color: var(--accent); border-color: var(--accent); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--bone); }
.btn.primary:hover { background: var(--accent); border-color: var(--accent); }
.btn.disabled { opacity: .4; cursor: not-allowed; }

.status {
  align-self: start;
  padding: 6px 0;
  color: var(--muted);
  white-space: nowrap;
}
.status[data-status="open"] { color: var(--ink-soft); }
.status[data-status="open"]:hover { color: var(--accent); }
.entry[data-status="closed"] .status { color: var(--muted); opacity: .7; }

/* ---- Colophon ---- */

.colophon { border-bottom: 1px solid var(--line); }
.colophon-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 28px;
  padding-bottom: clamp(64px, 8vw, 110px);
}
.colophon-grid p { color: var(--ink-soft); font-size: .98rem; line-height: 1.7; max-width: 38ch; }
.colophon-grid .actions-row { align-self: end; }
.colophon-grid .actions-row .btn { min-height: 44px; }

/* ---- Footer ---- */

footer {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap;
  width: min(var(--max), calc(100% - var(--gut) * 2));
  margin: 0 auto;
  padding: 26px 0 70px;
  font-family: var(--mono); font-size: .68rem;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted);
}
footer a:hover { color: var(--accent); }

/* ---- Motion ---- */

@media (prefers-reduced-motion: no-preference) {
  [data-rise].rise {
    opacity: 0; transform: translateY(16px);
    animation: rise .8s cubic-bezier(.2, .7, .2, 1) forwards;
    animation-delay: calc(var(--i) * 100ms + 80ms);
  }
  @keyframes rise { to { opacity: 1; transform: none; } }

  .entry {
    opacity: 0; transform: translateY(20px);
    transition: opacity .6s ease, transform .6s cubic-bezier(.2, .7, .2, 1), background .28s ease;
  }
  .entry.in { opacity: 1; transform: none; }
}

/* ---- Responsive ---- */

@media (max-width: 860px) {
  .ruler-coord { display: none; }
  .section-head { grid-template-columns: 1fr; gap: 14px; }
  .section-note { grid-column: 1; }
  .entry {
    grid-template-columns: 1fr;
    gap: 16px;
    padding-left: 16px;
  }
  .status { padding: 0; }
}

@media (max-width: 520px) {
  .masthead { padding: 14px 0; }
  nav a { padding: 8px 8px; font-size: .68rem; }
  .hero-meta { gap: 24px; }
}
