/* Type section: per-typeface pages (/type/<slug>/). Builds on site.css: same grid, labels and
   palette. Each specimen gets one idea; the frame around it stays identical page to page. */

/* ---------- frame ---------- */
.tf-hero .hero__meta a { text-decoration: none; }
.tf-hero .hero__meta a:hover { text-decoration: underline; }
.tf-name {
  grid-column: 1 / -1; margin: 88px 0 0; font-weight: 400; line-height: 1;
  font-size: min(calc(var(--content) / 6), 220px);   /* type.js fits it to the full width */
  white-space: nowrap; letter-spacing: 0; justify-self: start;
}
.tf-intro { padding-top: 56px; }
.tf-intro__text { grid-column: 1 / span 8; margin: 0; font-size: 28px; line-height: 36px; letter-spacing: -0.01em; }
@media (max-width: 1023px) { .tf-intro__text { grid-column: 1 / -1; font-size: 22px; line-height: 30px; } }

.sp { padding-top: 96px; row-gap: 24px; }
.sp__label { grid-column: 1 / -1; margin: 0; }
.sp__text { grid-column: 9 / span 4; }
.sp__text .body { font-size: 16px; line-height: 24px; color: var(--muted); }
@media (max-width: 1023px) { .sp__text { grid-column: 3 / span 4; } }
@media (max-width: 639px)  { .sp__text { grid-column: 1 / -1; } .sp { padding-top: 72px; } }

/* dark bands (board, sky, deco, masonry) run full bleed with the grid inside */
.sp-balken, .sp-chrono, .sp-trapu { background: var(--ink); color: var(--paper); margin-top: 96px; padding: 48px 0 64px; position: relative; z-index: 1; }
.sp-balken .wrap, .sp-chrono .wrap, .sp-trapu .wrap, .sp-unkel .wrap { row-gap: 24px; }
.sp-balken .label, .sp-chrono .label, .sp-trapu .label { color: rgba(242, 241, 238, 0.65); }
.sp-balken .sp__text .body, .sp-chrono .sp__text .body, .sp-trapu .sp__text .body { color: rgba(242, 241, 238, 0.75); }

/* ---------- Annulet: aperture ---------- */
.iris {
  grid-column: 1 / span 6; aspect-ratio: 1; background: var(--ink); position: relative; overflow: hidden;
  display: grid; place-items: center;
}
.iris__glyph {
  font-family: "Annulet"; color: var(--paper); font-size: calc(var(--content) / 3.4); line-height: 1;
  clip-path: circle(75% at 50% 50%); transition: clip-path 0.55s cubic-bezier(0.7, 0, 0.3, 1);
}
.iris.is-closed .iris__glyph { clip-path: circle(0% at 50% 50%); }
.sp-annulet .sp__text { grid-column: 8 / span 5; align-self: end; }
.iris__strip { grid-column: 1 / -1; margin: 24px 0 0; font-family: "Annulet"; font-size: min(calc(var(--content) / 18), 64px); line-height: 1.2; display: flex; flex-wrap: wrap; gap: 0 0.18em; }
.iris__strip span.is-on { color: var(--accent); }
@media (max-width: 1023px) { .iris { grid-column: 1 / -1; } .iris__glyph { font-size: 50vw; } .sp-annulet .sp__text { grid-column: 1 / -1; } }

/* ---------- Balkenfeder: departures board ---------- */
.board { grid-column: 1 / span 8; font-family: "Balkenfeder"; }
.board__head { margin: 0 0 16px; font-size: min(calc(var(--content) / 6.5), 180px); line-height: 1; }
.board__table { width: 100%; border-collapse: collapse; font-size: min(calc(var(--content) / 30), 34px); }
.board__table th { font: 600 12px/16px var(--sans); letter-spacing: 0.12em; text-transform: uppercase; text-align: left; color: rgba(242, 241, 238, 0.65); padding: 0 0 10px; }
.board__table td { padding: 10px 16px 10px 0; border-top: 1px solid rgba(242, 241, 238, 0.25); white-space: nowrap; }
.board__table td:last-child { color: #e9b35f; }
.board__table td:nth-child(3) { text-align: right; padding-right: 32px; }
.sp-balken .sp__text { align-self: end; }
@media (max-width: 1023px) { .board { grid-column: 1 / -1; } .board__table { font-size: 22px; } .board__table td:nth-child(4), .board__table th:nth-child(4) { display: none; } }
@media (max-width: 639px)  { .board__table { font-size: 17px; } .board__table td:nth-child(3), .board__table th:nth-child(3) { display: none; } }

/* ---------- Chronolith: sky stack and Option keyboard ---------- */
.sp-chrono { background: linear-gradient(#0b0d14, #191b22 60%, #2a2620); }
.chrono__stack { grid-column: 1 / -1; margin: 0; font-family: "Chronolith"; display: flex; flex-direction: column-reverse; line-height: 0.9; }
.chrono__stack span { font-size: calc(min(calc(var(--content) / 6.4), 190px) * (1 - var(--i) * 0.14)); opacity: calc(1 - var(--i) * 0.16); }
.kb__title { margin-top: 48px !important; }
.kb { grid-column: 1 / span 8; display: grid; gap: 8px; align-content: start; }
/* 20 half-key tracks per row: keys span two, rows 2 and 3 step in by one and three like a keyboard */
.kb__row { display: grid; grid-template-columns: repeat(20, minmax(0, 1fr)); gap: 8px; }
.kb__key { grid-column: span 2; }
.kb__row:nth-child(2) .kb__key:first-child { grid-column: 2 / span 2; }
.kb__row:nth-child(3) .kb__key:first-child { grid-column: 4 / span 2; }
.kb__key {
  min-width: 0; aspect-ratio: 1; display: grid; place-items: center; position: relative; cursor: pointer;
  background: rgba(242, 241, 238, 0.06); color: var(--paper); border: 1px solid rgba(242, 241, 238, 0.18);
  font: inherit; padding: 0;
}
.kb__key:hover, .kb__key:focus-visible, .kb__key.is-on { background: var(--paper); color: var(--ink); }
.kb__mark { font-family: "Chronolith"; font-size: min(3.2vw, 40px); line-height: 1; }
.kb__cap { position: absolute; left: 6px; top: 4px; font: 600 9px/12px var(--sans); letter-spacing: 0.08em; opacity: 0.6; }
.kb__loupe { grid-column: 9 / span 4; display: grid; place-items: center; align-content: center; gap: 12px; border: 1px solid rgba(242, 241, 238, 0.18); aspect-ratio: 1; }
.kb__big { font-family: "Chronolith"; font-size: min(calc(var(--content) / 6), 200px); line-height: 1; }
@media (max-width: 1023px) { .kb { grid-column: 1 / -1; } .kb__loupe { grid-column: 1 / span 3; } .kb__mark { font-size: 4vw; } }
@media (max-width: 639px)  { .kb { gap: 4px; } .kb__row { column-gap: 0; gap: 4px 0; } .kb__key { margin: 0 2px; } .kb__cap { display: none; } .kb__loupe { grid-column: 1 / -1; aspect-ratio: auto; padding: 24px 0; } }

/* ---------- Culvert: Waterways map + widths ---------- */
.ww { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; row-gap: 16px; }
.ww__map {
  grid-column: 1 / span 9; min-height: 0; height: calc(7 * 0.5 * var(--ww) + 32px); resize: none; overflow: hidden;
  --ww: calc(var(--content) * 0.7 / 27 / 0.46);
  font: normal var(--ww) / 0.5 "Culvert Waterways"; letter-spacing: 0; white-space: pre; tab-size: 1;
  color: var(--ink); background: rgba(242, 241, 238, 0.85); border: 1px solid var(--rule); padding: 16px; caret-color: var(--accent);
}
.ww__map:focus { outline: none; border-color: var(--accent); }
.ww__legend { grid-column: 10 / span 3; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; align-content: start; }
.ww__key { display: grid; place-items: center; padding: 6px 0 4px; background: none; border: 1px solid var(--line); cursor: pointer; color: var(--ink); font: inherit; }
.ww__key:hover { border-color: var(--accent); color: var(--accent); }
.ww__g { font: normal 40px/0.5 "Culvert Waterways"; height: 26px; display: grid; place-items: center; }
.ww__c { font: 500 10px/12px ui-monospace, Menlo, monospace; margin-top: 4px; }
.cv { grid-column: 1 / -1; margin-top: 48px; }
.cv__toggle, .tt__styles, .cuts__toggle { display: flex; flex-wrap: wrap; gap: 8px; }
.cv__toggle button, .tt__styles button, .cuts__toggle button {
  font: 600 12px/16px var(--sans); letter-spacing: 0.12em; text-transform: uppercase;
  background: transparent; color: inherit; border: 1px solid var(--rule); padding: 5px 10px; cursor: pointer;
}
.cv__toggle [aria-pressed="true"], .tt__styles [aria-pressed="true"], .cuts__toggle [aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.cv__row { display: grid; grid-template-columns: subgrid; margin: 24px 0 0; align-items: baseline; }
.cv { display: grid; grid-template-columns: subgrid; }
.cv__toggle { grid-column: 1 / -1; }
.cv__row { grid-column: 1 / -1; }
.cv__row .label { grid-column: 1 / span 2; }
.cv__w { grid-column: 3 / -1; font-size: min(calc(var(--content) / 12), 120px); line-height: 1; white-space: nowrap; }
@media (max-width: 1023px) {
  .ww__map { grid-column: 1 / -1; --ww: calc(var(--content) / 26 / 0.46); }
  .ww__legend { grid-column: 1 / -1; grid-template-columns: repeat(13, 1fr); }
  .cv__row .label { grid-column: 1 / -1; } .cv__w { grid-column: 1 / -1; font-size: calc(var(--content) / 6); }
}
@media (max-width: 639px) { .ww__legend { grid-template-columns: repeat(7, 1fr); } }

/* ---------- Elytra: specimen drawer ---------- */
.drawer { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(6, 1fr); border: 1px solid var(--ink); background: rgba(242, 241, 238, 0.9); }
.pin { margin: 0; padding: 28px 16px 16px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); display: grid; justify-items: center; gap: 12px; position: relative; }
.pin:nth-child(6n) { border-right: 0; } .pin:nth-last-child(-n+6) { border-bottom: 0; }
.pin::before { content: ""; position: absolute; top: 14px; left: 50%; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); translate: -50% 0; }
.pin__g { font-family: "Elytra"; font-size: min(calc(var(--content) / 11), 120px); line-height: 1.1; transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
.pin:hover .pin__g { transform: rotate(-4deg) scale(1.06); }
.pin__l { display: grid; gap: 2px; justify-items: center; text-align: center; border: 1px solid var(--rule); padding: 4px 8px; background: var(--paper); }
.pin__l i { font: italic 400 12px/16px Georgia, serif; }
.pin__l span { font: 600 8px/10px var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 1023px) { .drawer { grid-template-columns: repeat(4, 1fr); } .pin:nth-child(6n) { border-right: 1px solid var(--rule); } .pin:nth-child(4n) { border-right: 0; } .pin:nth-last-child(-n+6) { border-bottom: 1px solid var(--rule); } .pin:nth-last-child(-n+4) { border-bottom: 0; } .pin__g { font-size: 13vw; } }
@media (max-width: 639px) { .drawer { grid-template-columns: repeat(2, 1fr); } .pin:nth-child(4n) { border-right: 1px solid var(--rule); } .pin:nth-child(2n) { border-right: 0; } .pin:nth-last-child(-n+4) { border-bottom: 1px solid var(--rule); } .pin:nth-last-child(-n+2) { border-bottom: 0; } .pin__g { font-size: 22vw; } }

/* ---------- Rasoir: cover ---------- */
.cover {
  grid-column: 1 / span 6; aspect-ratio: 3 / 4; background: var(--paper); color: var(--ink); border: 1px solid var(--ink);
  font-family: "Rasoir"; padding: 4%; display: grid; grid-template-rows: auto auto 1fr auto; position: relative; overflow: hidden;
}
.cover__mast { margin: 0; font-size: calc(var(--content) * 0.5 / 3.3); line-height: 0.85; letter-spacing: -0.01em; text-align: center; }
.cover__issue { margin: 8px 0 0; font: 600 11px/16px var(--sans); letter-spacing: 0.2em; text-transform: uppercase; text-align: center; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); padding: 6px 0; }
.cover__big { margin: 0; align-self: center; font-size: calc(var(--content) * 0.5 / 4.6); line-height: 0.95; color: var(--accent); }
.cover__lines { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: calc(var(--content) * 0.5 / 26); line-height: 1.2; }
.loupe-a { grid-column: 7 / span 6; aspect-ratio: 3 / 4; overflow: hidden; position: relative; border: 1px solid var(--ink); background: var(--ink); }
.loupe-a span { position: absolute; font-family: "Rasoir"; color: var(--paper); font-size: calc(var(--content) * 1.15); line-height: 1; left: -18%; top: -52%; }
.sp-rasoir .sp__text { grid-column: 7 / span 6; }
@media (max-width: 1023px) { .cover, .loupe-a { grid-column: 1 / -1; } .cover__mast { font-size: calc(var(--content) / 3.4); } .cover__big { font-size: calc(var(--content) / 4.6); } .cover__lines { font-size: 18px; } .loupe-a { aspect-ratio: 4 / 3; } .loupe-a span { font-size: calc(var(--content) * 1.6); } .sp-rasoir .sp__text { grid-column: 1 / -1; } }

/* ---------- Schilf: reeds ---------- */
/* each word stands upright in its own two-column bed, rooted at the bottom like a reed */
.reeds { grid-column: 1 / -1; margin: 0; display: grid; grid-template-columns: repeat(6, 1fr); column-gap: var(--g); align-items: end; font-family: "Schilf"; padding-top: 24px; }
.reed {
  writing-mode: vertical-rl; rotate: 180deg; justify-self: center;   /* reads bottom to top */
  font-size: min(calc(var(--content) / 6.6), 200px); line-height: 1;
  transform-origin: 50% 50%; animation: sway 7s ease-in-out var(--d) infinite alternate;
}
.reed:nth-child(even) { color: var(--accent); }
@keyframes sway { from { transform: skewY(-3deg); } to { transform: skewY(3deg); } }
@media (prefers-reduced-motion: reduce) { .reed { animation: none; } }
@media (max-width: 1023px) { .reed { font-size: calc(var(--content) / 6.2); } }
@media (max-width: 639px)  { .reeds { grid-template-columns: repeat(3, 1fr); row-gap: 24px; } .reed { font-size: calc(var(--content) / 4); } }

/* ---------- Trapu: three cuts ---------- */
.sp-trapu { background: #1a1612; }
.cuts { grid-column: 1 / -1; display: grid; gap: 8px; font-family: "Trapu"; }
.cut { display: grid; grid-template-columns: subgrid; grid-column: 1 / -1; margin: 0; align-items: center; border-top: 1px solid rgba(242, 241, 238, 0.18); padding-top: 12px; }
.cuts { grid-template-columns: subgrid; }
.cut .label { grid-column: 1 / span 2; font-family: var(--sans); }
.cut__w { grid-column: 3 / -1; font-size: min(calc(var(--content) / 12.5), 110px); line-height: 1; color: #e9c46a; white-space: nowrap; }
.cuts.ss01 { font-feature-settings: "ss01"; }
.cuts--tall { font-family: "Trapu Tall"; }
.cuts--tall .cut__w { font-size: min(calc(var(--content) / 15), 92px); line-height: 1.5; }   /* capitals stand 1.4em */
.cuts__toggle { grid-column: 1 / span 4; }
@media (max-width: 1023px) { .cut .label { grid-column: 1 / -1; } .cut__w { grid-column: 1 / -1; font-size: calc(var(--content) / 8.6); } .cuts__toggle { grid-column: 1 / -1; } }

/* ---------- Unkelchunk: masonry ---------- */
.sp-unkel { padding-top: 96px; }
.wall { grid-column: 1 / -1; display: grid; gap: 6px; font-family: "Unkelchunk"; }
.course { display: flex; gap: 6px; }
.course:nth-child(even) { padding-left: calc(var(--content) / 30); }
.stone {
  flex: 1 1 0; display: grid; place-items: center; aspect-ratio: 0.82; min-width: 0;
  background: #cdc9c0; color: #3b3935; font-size: min(calc(var(--content) / 15), 92px); line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45), 0 -1px 0 rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.stone--blank { background: #dcd8d0; }
.sp-unkel .sp__text { margin-top: 16px; }
@media (max-width: 639px) { .wall, .course { gap: 3px; } .stone { font-size: 6.5vw; } }

/* ---------- tester ---------- */
.tt__controls { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center; }
.tt__size { display: flex; align-items: center; gap: 12px; }
.tt__size input { accent-color: var(--accent); width: 200px; }
.tt__out {
  grid-column: 1 / -1; font-size: var(--tt, 120px); line-height: 1.1; outline: none; overflow-wrap: anywhere;
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 24px 0; min-height: 1.3em;
}
.tt__out:focus { border-color: var(--accent); }
.tt__out[data-face="trapu-tall"] { line-height: 1.5; }
@media (max-width: 639px) { .tt__out[data-face="trapu-tall"] { font-size: calc(var(--tt, 120px) * 0.5); } }   /* twice the height: half the size keeps words whole on a phone */
@media (max-width: 639px) { .tt__size input { width: 140px; } }
@media (pointer: coarse) { .tt__size input { height: 32px; } }   /* a slider you can actually grab with a thumb */

/* ---------- character set + loupe ---------- */
.cs .label { font-family: var(--sans); }
.cs__loupe {
  grid-column: 1 / span 4; position: sticky; top: 24px; align-self: start; aspect-ratio: 1;
  display: grid; place-items: center; align-content: center; gap: 12px; border: 1px solid var(--ink); background: var(--paper);
}
.cs__big { font-size: min(calc(var(--content) / 6), 200px); line-height: 1; }
.cs__grid { grid-column: 5 / -1; display: grid; grid-template-columns: repeat(8, 1fr); border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); align-self: start; }
.cs__cell {
  aspect-ratio: 1; display: grid; place-items: center; font: inherit; font-size: min(calc(var(--content) / 32), 40px); line-height: 1;
  background: rgba(242, 241, 238, 0.85); color: var(--ink); border: 0; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); cursor: pointer; padding: 0;
}
.cs__cell:hover, .cs__cell:focus-visible, .cs__cell.is-on { background: var(--ink); color: var(--paper); outline: none; }
@media (max-width: 1023px) { .cs__loupe { grid-column: 1 / span 2; } .cs__grid { grid-column: 3 / -1; grid-template-columns: repeat(6, 1fr); } .cs__cell { font-size: 28px; } }
@media (max-width: 639px) { .cs__loupe { grid-column: 1 / -1; position: relative; top: 0; aspect-ratio: 2 / 1; } .cs__grid { grid-column: 1 / -1; } .cs__cell { font-size: 24px; } }

/* ---------- notes + prev/next ---------- */
.tf-notes__text { grid-column: 1 / span 7; color: var(--muted); font-size: 16px; line-height: 24px; }
@media (max-width: 1023px) { .tf-notes__text { grid-column: 1 / -1; } }
.tf-pn { padding-top: 96px; row-gap: 24px; }
.tf-pn a { text-decoration: none; display: grid; gap: 8px; border-top: 1px solid var(--ink); padding-top: 16px; }
.tf-pn__a { grid-column: 1 / span 6; } .tf-pn__b { grid-column: 7 / span 6; text-align: right; justify-items: end; }
.tf-pn__n { font-size: min(calc(var(--content) / 14), 72px); line-height: 1.1; white-space: nowrap; }
.tf-pn a:hover .tf-pn__n { color: var(--accent); }
@media (max-width: 639px) { .tf-pn__a, .tf-pn__b { grid-column: 1 / -1; } .tf-pn__n { font-size: 40px; } }

/* some faces draw ink well past their advance widths (Trapu's swashes, Culvert Ultra); keep that
   overhang from creating a sideways scroll */
main { overflow-x: clip; }
@media (min-width: 640px) and (max-width: 1023px) { .tf-pn__n { font-size: 48px; } }

.sp-trapu .cuts__toggle button, .sp-chrono button { border-color: rgba(242, 241, 238, 0.35); }
