/* ==========================================================================
   Base — reset, type, header (drawing register + tools), reveals, footer
   ========================================================================== */

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 110px; background: var(--paper); }
/* Lenis (smooth.js) drives the easing itself; native smoothing would fight it. */
html.has-lenis { scroll-behavior: auto; }
html.lenis, html.lenis body { height: auto; }
.lenis:not(.lenis-autoToggle).lenis-stopped { overflow: clip; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  transition: background-color .4s ease, color .4s ease;
}
::selection { background: var(--accent); color: var(--paper); }
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
/* Two-tone ring: a paper halo inside a focus ring stays visible on paper, blue and night surfaces. */
:focus-visible { outline: 2px solid transparent; outline-offset: 2px; box-shadow: 0 0 0 2px var(--paper), 0 0 0 5px var(--focus); }
/* Sections that receive focus because an anchor landed on them get a revision
   bar in the margin instead of a ring around the whole block. */
[data-focus-landing]:focus-visible { box-shadow: inset 4px 0 0 var(--focus); }

body::after {
  content: "";
  position: fixed; inset: -50%; z-index: 400;
  pointer-events: none;
  opacity: var(--grain);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 7s steps(6) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-4%, 3%); }
  40% { transform: translate(3%, -5%); }
  60% { transform: translate(-6%, -2%); }
  80% { transform: translate(5%, 4%); }
}

.mono { font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; font-stretch: 90%; }
.section-shell { padding-inline: var(--gutter); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: fixed; left: 16px; top: -80px; z-index: 600; background: var(--ink); color: var(--paper); padding: 14px 20px; }
.skip-link:focus { top: 14px; }
.reading-progress { position: fixed; inset: 0 0 auto; z-index: 320; height: 3px; pointer-events: none; }
.reading-progress span { display: block; width: 100%; height: 100%; background: var(--coral); transform: scaleX(0); transform-origin: left; }

/* ---------- Header: monogram, drawing register, tools ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  display: grid;
  grid-template-columns: auto minmax(110px, 1fr) auto auto auto;
  align-items: center;
  gap: clamp(18px, 2.6vw, 44px);
  min-height: 100px;
  padding: 16px calc(var(--gutter) + 4px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  transition: transform .5s var(--ease-out), background-color .4s ease;
  view-transition-name: site-header;
  --compact-shift: 26px;
}
/* Compact is purely visual: the header slides up and its content re-centres,
   so its box (and everything below it) never moves while scrolling. */
.site-header > * { transition: translate .5s var(--ease-out); }
.site-header.is-compact { transform: translateY(calc(-1 * var(--compact-shift))); }
.site-header.is-compact > * { translate: 0 calc(var(--compact-shift) / 2); }
.site-header.is-hidden { transform: translateY(-101%); }
.brand { display: inline-flex; align-items: center; gap: 16px; width: max-content; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 54px; height: 54px;
  background: var(--block); color: var(--block-ink);
  font-weight: 700; font-size: 16px; letter-spacing: -.1em;
  transform: rotate(-6deg);
  transition: transform .5s var(--ease-out), scale .4s var(--ease-out);
}
.site-header.is-compact .brand-mark { scale: .815; }
.brand:hover .brand-mark { transform: rotate(84deg); }
.brand-slash { margin: 0 1px; color: var(--coral-soft); }
.brand-name { font-size: 16px; line-height: 1.04; font-weight: 700; letter-spacing: -.055em; }
.header-note { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.header-note [data-clock] { color: var(--ink); font-variant-numeric: tabular-nums; }
.site-nav { display: flex; align-items: center; gap: clamp(16px, 2vw, 36px); }
.site-nav a { position: relative; display: inline-flex; flex-direction: column; gap: 2px; padding-block: 8px; font-size: 13px; font-weight: 600; }
.nav-index { font-family: var(--mono); color: var(--muted); font-size: 9px; font-weight: 500; letter-spacing: .06em; }
.site-nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: 3px; height: 1px; background: currentColor; transition: right .35s var(--ease-out); }
.site-nav a:hover::after, .site-nav a:focus-visible::after, .site-nav a[aria-current="page"]::after { right: 0; }
.site-nav a[aria-current="page"] { color: var(--accent); }
.site-nav a[aria-current="page"] .nav-index { color: var(--coral-ink); }

.header-tools { display: flex; gap: 8px; }
.tool-button {
  display: inline-flex; align-items: center; gap: 9px;
  min-height: 44px; padding: 0 13px;
  border: 1px solid var(--line-strong); background: transparent;
  font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase;
  cursor: pointer;
  transition: border-color .3s ease, color .3s ease, background-color .3s ease;
}
.tool-button:hover { border-color: var(--ink); }
.tool-key { display: grid; place-items: center; width: 18px; height: 18px; border: 1px solid currentColor; font-size: 9px; }
.tool-check { border-color: color-mix(in srgb, var(--red) 70%, transparent); color: var(--red); }
.tool-check:hover { border-color: var(--red); }
.tool-check[aria-pressed="true"] { border-color: var(--red); background: var(--red); color: var(--paper); }
.print-swatch { width: 16px; height: 16px; border-radius: 50%; background: linear-gradient(135deg, #f1eee7 0 50%, #173a7a 50% 100%); box-shadow: 0 0 0 1px var(--line-strong); transition: transform .6s var(--ease-out); }
.tool-print[aria-pressed="true"] .print-swatch { transform: rotate(180deg); }

.header-contact {
  position: relative; display: flex; align-items: center; gap: 30px; overflow: hidden;
  padding: 15px 18px;
  background: var(--ink); color: var(--paper);
  font-size: 13px; font-weight: 600; isolation: isolate;
}
.header-contact::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--block); transform: translateY(101%); transition: transform .45s var(--ease-out); }
.header-contact:hover { color: var(--block-ink); }
.header-contact:hover::before, .header-contact:focus-visible::before { transform: none; }
.header-contact span { font-size: 19px; line-height: .6; font-weight: 400; transition: transform .45s var(--ease-out); }
.header-contact:hover span { transform: rotate(45deg); }

/* ---------- Shared type pieces ---------- */
.eyebrow { display: flex; align-items: center; gap: 14px; margin: 0; color: var(--muted); }
.eyebrow-line { width: 25px; height: 1px; background: currentColor; flex: 0 0 25px; }
.sheet-tag { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); }
.sheet-tag b { display: inline-grid; place-items: center; min-width: 42px; height: 22px; padding: 0 6px; border: 1px solid currentColor; border-radius: 11px; color: var(--ink); font-weight: 500; }
.text-link { display: inline-flex; align-items: center; justify-content: space-between; gap: 42px; padding: 0 0 10px; border-bottom: 1.5px solid currentColor; font-size: 15px; font-weight: 700; letter-spacing: -.02em; transition: gap .35s var(--ease-out), color .3s ease; }
.text-link:hover { gap: 58px; color: var(--accent); }
.text-link span { font-size: 20px; font-weight: 400; }
.intro-aside { max-width: 360px; margin: 35px 0 0 auto; color: var(--ink-soft); font-size: 17px; line-height: 1.5; }

.line { display: block; overflow: hidden; padding-bottom: .06em; margin-bottom: -.06em; }
.line-inner { display: block; }
.has-js .line-inner { transform: translateY(108%) rotate(3deg); transform-origin: 0 100%; transition: transform 1.05s var(--ease-out); transition-delay: calc(var(--i, 0) * 90ms + var(--delay, 0ms)); }
.has-js .is-visible .line-inner { transform: none; }
.has-js .reveal { opacity: 0; transform: translateY(36px); transition: opacity .8s ease, transform .9s var(--ease-out); transition-delay: var(--delay, 0ms); }
.has-js .reveal.is-visible { opacity: 1; transform: none; }

.roll { display: inline-flex; align-items: flex-start; overflow: hidden; height: 1em; line-height: 1; vertical-align: bottom; }
.roll-col { display: flex; flex: 0 0 auto; flex-direction: column; align-items: center; transition: transform 1.6s var(--ease-out), width 1.6s var(--ease-out); transition-delay: calc(var(--c, 0) * 110ms); }
.roll-col span { display: block; flex: 0 0 1em; height: 1em; white-space: nowrap; }

.discipline-band { overflow: hidden; background: var(--ink); color: var(--paper); height: 53px; display: flex; align-items: center; white-space: nowrap; }
.discipline-band-inner { display: flex; align-items: center; flex: 0 0 auto; gap: 38px; width: max-content; padding-right: 38px; animation: band-slide 34s linear infinite; }
/* Centre-of-gravity mark: the drafting symbol used as the site's ornament and separator. */
.cg { display: inline-block; flex: 0 0 auto; width: .6em; height: .6em; border: .09em solid currentColor; border-radius: 50%; background: conic-gradient(currentColor 0 25%, transparent 0 50%, currentColor 0 75%, transparent 0); vertical-align: middle; }
.discipline-band-inner i { color: var(--coral); font-size: 23px; font-style: normal; line-height: 1; }
@keyframes band-slide { to { transform: translateX(-50%); } }

/* ---------- Footer: sticky reveal, approval stamp, filled name ---------- */
.page { position: relative; z-index: 2; background: var(--paper); box-shadow: 0 30px 60px -30px var(--shadow); transition: background-color .4s ease; }
.site-footer { position: sticky; bottom: 0; z-index: 1; overflow: hidden; background: var(--night); color: var(--night-ink); }
.footer-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; padding-top: 70px; }
.footer-kicker { margin: 0 0 18px; color: var(--night-muted); }
.footer-cta { display: inline-flex; align-items: flex-end; gap: 26px; font-size: clamp(46px, 6.4vw, 108px); font-weight: 500; line-height: .95; letter-spacing: -.075em; }
.footer-cta em { font-family: var(--serif); font-weight: 400; letter-spacing: -.02em; color: var(--coral-soft); }
.footer-arrow { display: grid; place-items: center; flex: 0 0 auto; width: clamp(56px, 6vw, 96px); aspect-ratio: 1; margin-bottom: .08em; border-radius: 50%; background: var(--block); color: var(--block-ink); font-size: clamp(24px, 2.6vw, 40px); letter-spacing: 0; box-shadow: 0 0 0 1px var(--night-muted); transition: transform .5s var(--ease-out), background-color .3s ease; }
.footer-cta:hover .footer-arrow { transform: rotate(45deg) scale(1.08); background: var(--coral); }
.stamp {
  flex: 0 0 auto;
  display: grid; gap: 4px; justify-items: center;
  padding: 14px 18px;
  border: 3px double var(--red);
  color: var(--red);
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; text-align: center;
  transform: rotate(-8deg);
  opacity: .9;
}
.stamp strong { font-size: 15px; font-weight: 700; letter-spacing: .04em; }
.has-js .stamp { opacity: 0; transform: rotate(-8deg) scale(2.4); }
.has-js .stamp.is-visible { opacity: .9; transform: rotate(-8deg) scale(1); transition: transform .45s cubic-bezier(.3, 1.6, .5, 1), opacity .2s ease; }
.footer-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 30px; margin-top: 60px; padding-block: 30px; border-top: 1px solid rgba(255, 255, 255, .16); }
.footer-grid h2 { margin: 0 0 16px; color: var(--night-muted); }
.footer-grid ul { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; font-size: 15px; }
.footer-grid a { transition: color .25s ease; }
.footer-grid a:hover { color: var(--coral-soft); }
.footer-grid p { margin: 0; font-size: 15px; line-height: 1.5; }
.footer-clock { font-size: 34px; font-weight: 500; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.footer-name {
  display: block; margin: 10px 0 -0.16em; padding-inline: calc(var(--gutter) - .04em);
  font-size: clamp(64px, 12.4vw, 236px); font-weight: 500; line-height: .85; letter-spacing: -.085em; white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1px color-mix(in srgb, var(--night-ink) 35%, transparent);
  background: linear-gradient(90deg, var(--night-ink) 0 var(--fill, 0%), transparent var(--fill, 0%));
  -webkit-background-clip: text; background-clip: text;
}
.footer-bottom { display: flex; justify-content: space-between; gap: 20px; padding-block: 22px 26px; border-top: 1px solid rgba(255, 255, 255, .16); color: var(--night-muted); }
.footer-bottom a:hover { color: var(--night-ink); }

/* ---------- Page transitions (progressive) ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .5s var(--ease-in-out) both; }
::view-transition-new(root) { animation: vt-in .75s var(--ease-out) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-3vh) scale(.985); filter: blur(4px); } }
@keyframes vt-in { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }

@media (max-width: 1250px) { .header-note { display: none; } .site-header { grid-template-columns: auto 1fr auto auto auto; } }
@media (max-width: 1050px) {
  .tool-button .tool-label { display: none; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 850px) {
  .site-header { grid-template-columns: auto 1fr auto; min-height: 84px; --compact-shift: 0px; }
  .site-nav { grid-row: 2; grid-column: 1 / -1; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 4px; }
  .header-contact { display: none; }
  .header-tools { grid-column: 3; grid-row: 1; justify-self: end; }
  .footer-top { flex-direction: column; align-items: flex-start; }
  .site-footer { position: relative; }
  .page { box-shadow: none; }
}
@media (max-width: 600px) {
  html { scroll-padding-top: 140px; }
  .site-header { gap: 10px; padding-block: 10px 2px; }
  .brand { gap: 10px; }
  .brand-mark { width: 42px; height: 42px; font-size: 14px; }
  .site-header.is-compact .brand-mark { scale: 1; }
  .brand-name { font-size: 13px; }
  .site-nav a { font-size: 12px; min-height: 44px; justify-content: center; }
  .tool-button { padding: 0 10px; }
  .discipline-band { height: 46px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 26px 18px; margin-top: 44px; }
  .footer-bottom { flex-wrap: wrap; line-height: 1.5; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0ms !important; }
  .has-js .reveal, .has-js .line-inner, .has-js .stamp { opacity: 1; transform: none; }
  body::after { animation: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}
