:root {
  --paper: #f3f2ec;
  --ink: #0b0b0a;
  --muted: #8a8982;
  --line: #c9c8c0;
  --max: 1480px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

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

.page {
  width: min(calc(100% - 56px), var(--max));
  min-height: 100svh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.header {
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  letter-spacing: -0.02em;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.045em;
}

.logo { font: inherit; }

.raw-toggle {
  position: relative;
  appearance: none;
  border: 0;
  padding: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-weight: 500;
  letter-spacing: inherit;
  transition: color 140ms ease;
}

.raw-toggle::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -5px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 160ms ease;
}
.raw-toggle:hover,
.raw-toggle[aria-pressed="true"] { color: var(--ink); }
.raw-toggle:hover::after,
.raw-toggle[aria-pressed="true"]::after { transform: scaleX(1); }

.contact {
  color: var(--muted);
  transition: color 140ms ease;
}
.contact:hover { color: var(--ink); }

.hero {
  padding: clamp(92px, 13vh, 170px) 0 clamp(84px, 12vh, 150px);
}

.hero-kicker {
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 14px;
  letter-spacing: -0.02em;
}

h1 {
  margin: 0;
  max-width: 1200px;
  font-size: clamp(64px, 9.8vw, 154px);
  line-height: 0.86;
  letter-spacing: -0.075em;
  font-weight: 600;
}

h1 span { color: var(--muted); }

.hero-sub {
  margin: 40px 0 0;
  max-width: 620px;
  font-size: clamp(20px, 2vw, 30px);
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.index {
  margin-top: auto;
  padding-bottom: 56px;
}

.rule-head,
.row {
  display: grid;
  grid-template-columns: 56px minmax(220px, 1.1fr) minmax(180px, .8fr) 28px;
  column-gap: 18px;
  align-items: center;
}

.rule-head {
  min-height: 42px;
  border-top: 1px solid var(--ink);
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.rule-head span:first-child { grid-column: 2; }
.rule-head span:last-child { grid-column: 3; text-align: right; }

.row {
  min-height: 78px;
  border-top: 1px solid var(--line);
  transition: opacity 140ms ease;
}
.row:last-child { border-bottom: 1px solid var(--line); }
.index:hover .row { opacity: .38; }
.index .row:hover { opacity: 1; }

.num,
.row-meta {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: -0.02em;
}
.row-title {
  font-size: clamp(23px, 2.4vw, 36px);
  letter-spacing: -0.045em;
  font-weight: 520;
}
.row-meta { text-align: right; }
.arrow {
  text-align: right;
  font-size: 19px;
  transform: translate(0, 0);
  transition: transform 140ms ease, opacity 140ms ease;
}
a.row:hover .arrow { transform: translate(3px, -3px); }
.ghost-arrow { opacity: .16; }

.raw-view {
  display: none;
  flex: 1;
  padding: clamp(72px, 10vh, 132px) 0 80px;
}

.raw-open .site-view { display: none; }
.raw-open .raw-view { display: block; }
.raw-open .footer { border-top: 1px solid var(--line); }

.raw-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 54px;
  color: var(--muted);
  font: 12px/1.2 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.raw-head button {
  appearance: none;
  border: 0;
  padding: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: inherit;
}
.raw-head button:hover { color: var(--ink); }

.raw-view pre {
  margin: 0;
  white-space: pre-wrap;
  color: var(--ink);
  font: clamp(15px, 1.45vw, 21px)/1.72 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  letter-spacing: -0.025em;
}

.footer {
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

::selection { background: var(--ink); color: var(--paper); }

@media (max-width: 760px) {
  .page { width: calc(100% - 36px); }
  .header { height: 68px; }
  .contact { font-size: 12px; }
  .hero { padding: 86px 0 96px; }
  .hero-kicker { margin-bottom: 22px; }
  h1 { font-size: clamp(58px, 18.5vw, 112px); line-height: .88; }
  .hero-sub { margin-top: 32px; max-width: 13ch; }

  .rule-head,
  .row {
    grid-template-columns: 32px 1fr 24px;
    column-gap: 10px;
  }
  .rule-head span:first-child { grid-column: 2; }
  .rule-head span:last-child { display: none; }
  .row { min-height: 72px; }
  .row-title { font-size: 24px; }
  .row-meta { display: none; }
  .arrow { grid-column: 3; }

  .raw-view { padding-top: 72px; }
  .raw-head { margin-bottom: 34px; }
  .raw-view pre { font-size: 13px; line-height: 1.72; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
