/* DIGITHRONEX · The Cut · base: reset, rooms, type roles, grid, frames, controls.
   Load after tokens.css. */

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--d-ground); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--d-ground); color: var(--d-text);
  font-family: var(--font-sans); font-size: 17px; line-height: 1.6; font-weight: 400; font-stretch: 100%;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
}
p, h1, h2, h3, h4, dl, dd, figure, blockquote, ul, ol { margin: 0; }
[hidden] { display: none !important; }
ul, ol { padding: 0; list-style: none; }
img, video, canvas, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }

/* Rooms: every act is one or the other. They change only at act boundaries (the house lights). */
.screen, .studio { background: var(--ground); color: var(--text); }
.screen {
  --ground: var(--d-ground); --surface: var(--d-surface); --raised: var(--d-raised); --line: var(--d-line);
  --text: var(--d-text); --text2: var(--d-text2); --text3: var(--d-text3); --signal: var(--d-signal); --select: var(--d-select);
  --mark: var(--brand-azure);
  color-scheme: dark;
}
.studio {
  --ground: var(--s-ground); --surface: var(--s-surface); --raised: var(--s-raised); --line: var(--s-line);
  --text: var(--s-text); --text2: var(--s-text2); --text3: var(--s-text3); --signal: var(--s-signal); --select: var(--s-select);
  --mark: var(--brand-cobalt);
  color-scheme: light;
}
.act { position: relative; overflow-x: clip; }
::selection { background: var(--select, var(--d-select)); }
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--margin); padding-block: clamp(88px, 11vw, 176px); }

/* Type roles. Width is the voice: statements condensed, headlines wide, labels widest. */
.statement { font-stretch: 75%; font-weight: 680; font-size: clamp(72px, 12vw, 232px); line-height: .88; letter-spacing: -.012em; }
.statement .line { display: block; }
@media (min-width: 900px) { .statement .line { white-space: nowrap; } }
.statement--overhang { margin-left: calc(var(--margin) * -.35); }
@media (max-width: 900px) { .statement--overhang { margin-left: 0; } }
.headline { font-stretch: 112.5%; font-weight: 560; font-size: clamp(32px, 4.2vw, 68px); line-height: 1.02; letter-spacing: -.01em; text-wrap: balance; }
.title { font-stretch: 100%; font-weight: 560; font-size: clamp(26px, 2.4vw, 36px); line-height: 1.12; letter-spacing: -.015em; }
.lead { font-size: clamp(19px, 1.45vw, 22px); line-height: 1.45; font-weight: 430; letter-spacing: -.005em; color: var(--text2); max-width: 34em; }
.label { font-stretch: 125%; font-weight: 620; font-size: 11.5px; line-height: 1.3; letter-spacing: .09em; text-transform: uppercase; }
.data { font-family: var(--font-mono); font-stretch: 87.5%; font-weight: 450; font-size: 12px; line-height: 1.5; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.caption { font-family: var(--font-mono); font-stretch: 87.5%; font-weight: 450; font-size: 12px; line-height: 1.5; letter-spacing: .02em; color: var(--text3); }
/* Pinyon Script: 1–3 words, 72px and up, never capitals, at most once per view. Enters with the ink wipe. */
.accent { font-family: var(--font-accent); font-weight: 400; font-stretch: normal; line-height: 1; letter-spacing: 0; }
.accent-wrap { display: inline-block; padding: .2em .3em .34em; margin: -.2em -.3em -.34em; }

/* Grid: 12 columns. Place a cell with --from and --span; below 900px every cell spans the row. */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); row-gap: 48px; }
.cell { grid-column: var(--from, 1) / span var(--span, 12); min-width: 0; }
@media (max-width: 900px) { .grid { row-gap: 32px; } .grid > .cell { grid-column: 1 / -1; } }

/* Frames: media is sharp-cornered, like film, in its native format. */
.frame { position: relative; overflow: hidden; background: #050607; max-width: 100%; }
.frame > video, .frame > img, .frame > canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.r239 { aspect-ratio: 2.39 / 1; }
.r169 { aspect-ratio: 16 / 9; }
.r45 { aspect-ratio: 4 / 5; }
.r11 { aspect-ratio: 1 / 1; }
.r916 { aspect-ratio: 9 / 16; }
.title-safe { position: absolute; inset: 10%; }

/* Controls */
.ctl {
  appearance: none; font: inherit; font-stretch: 125%; font-weight: 620; font-size: 11.5px; letter-spacing: .09em; text-transform: uppercase; line-height: 1;
  color: var(--text); background: transparent; border: 1px solid var(--line); border-radius: var(--radius-control); padding: 13px 16px;
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer; text-decoration: none;
  transition: border-color calc(4 * var(--f)) var(--ease-snap), background-color calc(4 * var(--f)) var(--ease-snap), transform calc(4 * var(--f)) var(--ease-snap);
}
.ctl:hover { border-color: var(--text3); background: var(--surface); }
.ctl:active { transform: scale(.97); }
.ctl:disabled { opacity: .5; cursor: default; }

/* The primary action: a solid with the brand cut on its top-right corner, the cut drawn in signal.
   Ink on the studio, white on graphite. One per view; it's the project-start handoff. */
.primary {
  --c: 14px; --c-h: calc(var(--c) * var(--angle-tan));
  position: relative; isolation: isolate; appearance: none; border: 0; background: none; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 12px;
  padding: 16px 28px 16px 20px; font-family: var(--font-sans); font-stretch: 112.5%; font-weight: 620; font-size: 13px;
  letter-spacing: .06em; text-transform: uppercase; line-height: 1; color: var(--ground);
}
.primary .fill { position: absolute; inset: 0; z-index: -1; background: var(--text); clip-path: polygon(0 0, calc(100% - var(--c)) 0, 100% var(--c-h), 100% 100%, 0 100%); transition: transform calc(4 * var(--f)) var(--ease-snap); }
.primary .edge { position: absolute; top: 0; right: 0; width: var(--c); height: var(--c-h); background: linear-gradient(to top right, transparent calc(50% - 1.1px), var(--signal) calc(50% - 1.1px), var(--signal) calc(50% + 1.1px), transparent calc(50% + 1.1px)); }
.primary:active .fill { transform: scale(.97); }
.primary:focus-visible { outline: none; }
.primary:focus-visible::after {
  content: ""; position: absolute; inset: -5px; background: var(--signal);
  clip-path: polygon(evenodd, 0 0, calc(100% - var(--c) - 3px) 0, 100% calc(var(--c-h) + 3px), 100% 100%, 0 100%, 2px 2px, calc(100% - var(--c) - 4px) 2px, calc(100% - 2px) calc(var(--c-h) + 4px), calc(100% - 2px) calc(100% - 2px), 2px calc(100% - 2px));
}

/* Secondary actions are text links with an offset underline. Filters and tags are chips. No pills. */
.tlink { color: var(--text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; text-decoration-color: var(--text3); transition: text-decoration-color calc(4 * var(--f)) var(--ease-snap); }
.tlink:hover { text-decoration-color: var(--signal); }
.chip { appearance: none; font-family: var(--font-sans); font-stretch: 112.5%; font-weight: 560; font-size: 12.5px; letter-spacing: .02em; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-chip); color: var(--text2); background: transparent; cursor: pointer; }
.chip[aria-pressed="true"] { color: var(--text); border-color: var(--signal); box-shadow: inset 0 -2px 0 var(--signal); }

/* Focus: a 2px signal outline that follows the shape */
:focus-visible { outline: 2px solid var(--signal, var(--d-signal)); outline-offset: 3px; }

/* Accessibility helpers */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -100px; z-index: 100; padding: 12px 16px; background: var(--d-text); color: var(--d-ground); text-decoration: none; }
.skip-link:focus { top: 12px; }

/* Finish: no word left alone on a paragraph's last line, and the page's scrollbar in the dark room's colours */
p { text-wrap: pretty; }
html { scrollbar-width: thin; scrollbar-color: rgba(241, 242, 244, .28) var(--d-ground); }

/* Page to page: the invisible cuts, in continuity.css (loaded on every page by Base.astro). */

/* Reduced motion: cuts replace moves. Scrubbing still works because the visitor drives it. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; scroll-behavior: auto !important; }
}
