/* Hallmark · sheet styles for the review index and the logo system. Tokens live in tokens.css. */
*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: clip; -webkit-text-size-adjust: 100%; scrollbar-color: var(--ink-3) var(--paper); scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: clip;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.5;
  font-feature-settings: "ss01" 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.5s var(--ease), color 0.5s var(--ease);
}
::selection { background: var(--ink); color: var(--paper); }
svg { display: block; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; text-decoration-color: var(--ink-3); transition: text-decoration-color 0.25s var(--ease), color 0.25s var(--ease); }
a:hover { text-decoration-color: var(--ink); }
a:active { color: var(--ink-2); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: var(--radius-1); }
button { font: inherit; color: inherit; }
button:disabled { opacity: 0.4; cursor: default; }
h1, h2, h3, p, dl, dd, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
.wrap { width: min(var(--page), 100%); margin-inline: auto; padding-inline: var(--space-gutter); }
.mono { font-family: var(--font-outlier); font-size: var(--text-note); line-height: 1.5; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.skip { position: absolute; left: var(--space-4); top: var(--space-4); padding: var(--space-2) var(--space-4); background: var(--ink); color: var(--paper); border-radius: var(--radius-1); transform: translateY(-200%); }
.skip:focus-visible { transform: none; }

/* Bar */
.bar { position: sticky; top: 0; z-index: 20; background: var(--paper); border-bottom: 1px solid var(--line-soft); transition: background-color 0.5s var(--ease); }
.bar-in { display: flex; align-items: center; gap: var(--space-5); min-height: 64px; }
.bar .home { display: inline-flex; color: var(--ink); text-decoration: none; }
.bar .home svg { height: 24px; width: auto; }
.bar nav { margin-left: auto; }
.bar nav ul { display: flex; align-items: center; gap: var(--space-5); font-size: var(--text-small); }
.bar nav a { text-decoration: none; color: var(--ink-2); padding-block: var(--space-2); }
.bar nav a:hover, .bar nav a[aria-current="page"] { color: var(--ink); }
.bar nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--ink); text-underline-offset: 0.45em; }
.light-switch { flex: none; width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-round); background: none; cursor: pointer; transition: border-color 0.25s var(--ease), transform 0.25s var(--ease); }
.light-switch:hover { border-color: var(--ink); }
.light-switch:active { transform: scale(0.94); }
.light-switch svg { width: 14px; height: 14px; transition: transform 0.6s var(--ease); }
[data-theme="dark"] .light-switch svg { transform: rotate(180deg); }

/* Opening */
.open { padding-block: var(--space-section) var(--space-9); }
.open h1 { font-family: var(--font-display); font-size: var(--text-h1); font-weight: 480; line-height: 0.96; letter-spacing: -0.04em; max-width: 14ch; text-wrap: balance; }
.open-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--space-5); row-gap: var(--space-7); align-items: end; }
.open-grid h1 { grid-column: 1 / span 7; }
.open-grid .lead { grid-column: 8 / span 5; font-size: var(--text-lead); line-height: 1.42; color: var(--ink-2); max-width: 42ch; text-wrap: pretty; }
.open-grid .lead strong { color: var(--ink); font-weight: 500; }
.open .onward { margin-top: var(--space-8); }
.facts { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--space-5); border-top: 1px solid var(--line); padding-top: var(--space-4); }
.facts div { grid-column: span 3; padding-right: var(--space-4); }
.facts dt { color: var(--ink-3); }
.facts dd { color: var(--ink); }

/* Overview strip of the four marks */
.four { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.four a { display: grid; gap: var(--space-5); padding: var(--space-7) var(--space-5) var(--space-5); text-decoration: none; border-left: 1px solid var(--line-soft); transition: background-color 0.4s var(--ease); }
.four a:first-child { border-left: 0; }
.four a:hover { background: var(--paper-raise); }
.four svg { width: min(72%, 220px); height: auto; margin-inline: auto; transition: transform 0.6s var(--ease); }
.four a:hover svg { transform: scale(1.03); }
.four .name { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); font-size: var(--text-small); }
.four .name b { font-weight: 500; }

/* One mark */
.mark { padding-block: var(--space-section) 0; scroll-margin-top: var(--space-8); }
.mark-head { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: auto 1fr; column-gap: var(--space-5); row-gap: var(--space-5); align-items: start; padding-bottom: var(--space-7); }
.mark-head h2 { grid-column: 1 / span 6; font-family: var(--font-display); font-size: var(--text-h2); font-weight: 480; line-height: 1; letter-spacing: -0.035em; text-wrap: balance; }
.mark-head .numeral { grid-column: 1 / span 6; grid-row: 2; color: var(--ink-3); }
.mark-head .why { grid-column: 7 / span 6; grid-row: 1 / span 2; display: grid; gap: var(--space-4); font-size: var(--text-lead); line-height: 1.42; color: var(--ink-2); max-width: 46ch; text-wrap: pretty; }
.mark-head .why p:first-child { color: var(--ink); }

.board { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius-2); overflow: clip; background: var(--paper-raise); }
.board > * { min-width: 0; }
.cell { position: relative; display: grid; align-content: space-between; gap: var(--space-5); padding: var(--space-5); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cell > figcaption, .cell > .legend { display: flex; justify-content: space-between; gap: var(--space-4); align-items: baseline; }
.cell .legend b, .cell figcaption b { font-weight: 400; color: var(--ink); }
.cell .legend span, .cell figcaption span { text-align: right; }
.construction { grid-column: 1 / span 7; grid-row: 1 / span 2; border-top: 0; border-left: 0; align-content: start; }
.construction svg { width: min(100%, 656px); height: auto; margin-inline: auto; }
.plate { grid-column: 8 / span 5; min-height: 300px; place-items: center; align-content: center; border-top: 0; }
.plate + .plate { border-top: 1px solid var(--line); }
.plate > svg { width: min(52%, 232px); height: auto; }
.plate .legend { position: absolute; left: var(--space-5); right: var(--space-5); bottom: var(--space-4); }
.on-dark { background: var(--plate-dark); color: var(--plate-dark-ink); }
.on-dark .mono { color: var(--plate-dark-ink); }
.on-dark .legend b, .on-light .legend b { color: inherit; }
.on-dark .legend span, .on-light .legend span { opacity: 0.6; }
.on-light { background: var(--plate-light); color: var(--plate-light-ink); }
.on-light .mono { color: var(--plate-light-ink); }
.cut { grid-column: span 4; border-left: 1px solid var(--line); min-height: 250px; }
.cut:nth-child(4) { border-left: 0; }
.cut .stage { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-5); }
.cut .bars { display: grid; gap: var(--space-3); }

/* App icon at true size */
.icons { display: flex; gap: var(--space-5); align-items: flex-end; }
.icon { display: grid; gap: var(--space-2); justify-items: center; font-size: 11px; color: var(--ink-2); }
.icon svg { width: 64px; height: 64px; filter: drop-shadow(0 6px 10px var(--line)); }
.icon.big svg { width: 128px; height: 128px; }

/* Bar lockup at 32 */
.bars { display: grid; gap: var(--space-3); width: 100%; }
.navbar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); height: 56px; padding-inline: var(--space-4); border-radius: var(--radius-1); border: 1px solid var(--plate-light-line); }
.navbar.on-dark { border-color: var(--plate-dark-line); }
.navbar svg { height: 32px; width: auto; flex: none; }
.navbar .rule { flex: 1; height: 1px; background: currentColor; opacity: 0.14; max-width: 96px; }

/* Favicon: true size, and the same pixels at ten times */
.fav { display: flex; align-items: flex-end; gap: var(--space-5); }
.tabs { display: grid; gap: var(--space-2); }
.tabchip { display: inline-flex; align-items: center; gap: var(--space-2); height: 32px; padding-inline: var(--space-3); border-radius: var(--radius-1) var(--radius-1) 0 0; font-size: 12px; white-space: nowrap; border: 1px solid var(--plate-light-line); border-bottom: 0; }
.tabchip.on-dark { border-color: var(--plate-dark-line); }
.tabchip svg { width: 16px; height: 16px; }
.pixels { width: 160px; height: 160px; background: var(--plate-light); color: var(--plate-light-ink); border: 1px solid var(--line); }
.pixels .px { stroke: var(--guide); stroke-opacity: 0.35; stroke-width: 1; vector-effect: non-scaling-stroke; }

/* Lockup row and files */
.lock { grid-column: 1 / -1; border-left: 0; grid-template-columns: minmax(0, 1fr) auto; align-items: center; align-content: center; column-gap: var(--space-7); padding-block: var(--space-7); }
.lock > svg { height: clamp(44px, 6.2vw, 88px); width: auto; max-width: 100%; }
.files { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); justify-content: flex-end; max-width: 420px; }
.files a { color: var(--ink-2); }
.files a:hover { color: var(--ink); }

/* Construction drawing ink */
.construction .m { color: var(--ink); }
.construction .f { stroke: var(--grid-ink); }
.construction .g { stroke: var(--guide); }
.construction .h { stroke: var(--guide); stroke-dasharray: 4 4; }
.construction .a { stroke: var(--axis-ink); stroke-dasharray: 1 5; }
.construction .f, .construction .g, .construction .h, .construction .a { fill: none; stroke-width: 1; vector-effect: non-scaling-stroke; }
.construction .t { font-family: var(--font-outlier); font-size: 13.5px; fill: var(--ink); stroke: none; }

/* Mark IV breathes */
.live .ring { transform-origin: 256px 256px; transform: scale(calc(1 + var(--release, 0) * var(--k, 0))); transition: transform 0.9s var(--ease); }
.live .r1 { --k: 0.06; }
.live .r2 { --k: 0.12; }
.live .r3 { --k: 0.2; }
.js .live.breathing .ring { animation: breathe 6.4s var(--ease) infinite alternate; }
.js .live.breathing .r2 { animation-delay: 0.25s; }
.js .live.breathing .r3 { animation-delay: 0.5s; }
@keyframes breathe { from { transform: scale(1); } to { transform: scale(calc(1 + var(--k, 0) * 0.42)); } }
.breath { justify-self: start; padding: var(--space-2) var(--space-3); border: 1px solid var(--plate-dark-line); border-radius: var(--radius-round); background: none; color: inherit; cursor: pointer; transition: border-color 0.25s var(--ease), transform 0.25s var(--ease); }
.breath:hover { border-color: currentColor; }
.breath:active { transform: scale(0.97); }

/* Index entries */
.entries { border-top: 1px solid var(--line); }
.entry { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--space-5); row-gap: var(--space-5); padding-block: var(--space-8); border-bottom: 1px solid var(--line); align-items: start; }
.entry h2 { grid-column: 1 / span 5; font-family: var(--font-display); font-size: var(--text-h2); font-weight: 480; line-height: 1; letter-spacing: -0.035em; }
.entry h2 a { text-decoration: none; }
.entry h2 a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.14em; }
.entry .about { grid-column: 1 / span 5; display: grid; gap: var(--space-4); color: var(--ink-2); max-width: 44ch; text-wrap: pretty; }
.entry .about p:first-child { color: var(--ink); font-size: var(--text-lead); line-height: 1.42; }
.entry dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: var(--space-4); row-gap: var(--space-1); }
.entry dt { color: var(--ink-3); }
.go { justify-self: start; display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-4); border: 1px solid var(--ink); border-radius: var(--radius-round); text-decoration: none; font-size: var(--text-small); font-weight: 500; transition: background-color 0.3s var(--ease), color 0.3s var(--ease), transform 0.3s var(--ease); }
.go:hover { background: var(--ink); color: var(--paper); }
.go:active { transform: scale(0.98); }
.go svg { width: 14px; height: 14px; transition: transform 0.3s var(--ease); }
.go:hover svg { transform: translateX(3px); }
.entry .shots { grid-column: 7 / span 6; grid-row: 1 / span 2; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.292fr); gap: var(--space-3); align-items: start; }
.entry .shots a { display: block; border: 1px solid var(--line); border-radius: var(--radius-2); overflow: clip; background: var(--paper-raise); transition: transform 0.6s var(--ease), border-color 0.3s var(--ease); }
.entry .shots a:hover { transform: translateY(-3px); border-color: var(--ink-3); }
.entry .marks { grid-column: 7 / span 6; grid-row: 1 / span 2; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius-2); overflow: clip; background: var(--paper-raise); }
.entry .marks a { display: grid; place-items: center; aspect-ratio: 1; border-left: 1px solid var(--line-soft); transition: background-color 0.4s var(--ease); }
.entry .marks a:first-child { border-left: 0; }
.entry .marks a:hover { background: var(--paper); }
.entry .marks svg { width: 62%; height: auto; }

.notes { padding-block: var(--space-section) 0; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--space-5); row-gap: var(--space-6); }
.notes h2 { grid-column: 1 / span 5; font-family: var(--font-display); font-size: var(--text-h2); font-weight: 480; line-height: 1; letter-spacing: -0.035em; }
.notes ol { grid-column: 7 / span 6; display: grid; counter-reset: n; border-top: 1px solid var(--line); }
.notes li { counter-increment: n; display: grid; grid-template-columns: 3ch minmax(0, 1fr); column-gap: var(--space-4); padding-block: var(--space-4); border-bottom: 1px solid var(--line-soft); color: var(--ink-2); text-wrap: pretty; }
.notes li::before { content: counter(n, decimal-leading-zero); font-family: var(--font-outlier); font-size: var(--text-note); color: var(--ink-3); padding-top: 0.3em; }
.notes li b { color: var(--ink); font-weight: 500; }
.notes code, .entry code, .lead code, .why code { font-family: var(--font-outlier); font-size: 0.86em; }

.foot { margin-top: var(--space-section); border-top: 1px solid var(--line); padding-block: var(--space-6) var(--space-8); display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-6); justify-content: space-between; }

@media (max-width: 900px) {
  .bar nav ul { gap: var(--space-4); }
  .bar nav .wide { display: none; }
  .open-grid h1, .open-grid .lead { grid-column: 1 / -1; }
  .facts div { grid-column: span 6; padding-bottom: var(--space-3); }
  .four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .four a:nth-child(3) { border-left: 0; }
  .four a:nth-child(n + 3) { border-top: 1px solid var(--line-soft); }
  .mark-head h2, .mark-head .numeral, .mark-head .why { grid-column: 1 / -1; grid-row: auto; }
  .construction, .plate, .cut, .lock { grid-column: 1 / -1; grid-row: auto; border-left: 0; }
  .plate { border-top: 1px solid var(--line); min-height: 260px; }
  .cut { min-height: 0; }
  .lock { grid-template-columns: minmax(0, 1fr); row-gap: var(--space-5); }
  .files { justify-content: flex-start; }
  .entry h2, .entry .about, .entry .shots, .entry .marks { grid-column: 1 / -1; grid-row: auto; }
  .notes h2, .notes ol { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .bar .home svg { height: 20px; }
  .bar nav .mid { display: none; }
  .fav { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms; animation-iteration-count: 1; transition-duration: 0.001ms; }
  html { scroll-behavior: auto; }
}
