/* Frosted glass (2026-11-21, frost reduced 20% on review). The header frosts once the page moves under it. Glass tiles:
   the depth statement, the seven functions, the contact card; on the legal page the four plans and the contact block.
   Each tile's glass lives in ::before so tiles.js can turn the glass a degree or two under the pointer while the text
   stays flat and only drifts a few pixels. No glare follows the pointer. Under the pointer a small pool of orange
   flows through the letters (fluid.js, the .lit rule below); the frames never change colour. */

:root {
  --frost-top: rgba(255, 255, 255, 0.044);
  --frost-bottom: rgba(255, 255, 255, 0.016);
  --frost-edge: rgba(236, 235, 229, 0.09);
  --frost-rim: rgba(255, 255, 255, 0.09);
  --frost-blur: blur(14px) saturate(150%);
  --frost-shadow: 0 34px 80px -50px rgba(0, 0, 0, 0.85);
  --warm-edge: rgba(255, 122, 46, 0.38);
  --warm-glow: rgba(255, 122, 46, 0.10);
  --bar-h: 4.75rem;
}

/* ---------- header: clear at the top, frosted once anything is under it ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid transparent;
  transition: background-color 0.35s ease, border-color 0.35s ease, -webkit-backdrop-filter 0.35s ease, backdrop-filter 0.35s ease;
}
.home .site-header { position: fixed; }
.site-header.is-frosted {
  background-color: rgba(17, 17, 16, 0.8);            /* solid enough that text under it reads as tone, not smears */
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  backdrop-filter: blur(24px) saturate(140%);
  border-bottom-color: rgba(236, 235, 229, 0.07);
}
@media (max-width: 719px) {                          /* phones: once scrolled, one short row with the wordmark */
  .site-header.is-frosted, .home .site-header.is-frosted { padding-block: 0.7rem; }
  .home .site-header.is-frosted .site-nav { display: none; }
}
@media (min-width: 900px) {
  .section-head { top: calc(var(--bar-h) + 1.25rem); }
}
.section[id] { scroll-margin-top: calc(var(--bar-h) - 0.5rem); }

/* ---------- the tiles ---------- */
.depth, .contact, .functions li, #pricing .terms > .plan, .legal .contact-lines {
  position: relative;
  isolation: isolate;
  --r: 20px;
}
.depth::before, .contact::before, .functions li::before, #pricing .terms > .plan::before, .legal .contact-lines::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: var(--r);
  pointer-events: none;
  transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
}
/* the glass */
.depth::before, .contact::before, .functions li::before, #pricing .terms > .plan::before, .legal .contact-lines::before {
  background: linear-gradient(180deg, var(--frost-top), var(--frost-bottom));
  border: 1px solid var(--frost-edge);
  box-shadow: inset 0 1px 0 var(--frost-rim), var(--frost-shadow);
  -webkit-backdrop-filter: var(--frost-blur);
  backdrop-filter: var(--frost-blur);
  transition: border-color 0.5s ease, box-shadow 0.5s ease;
}
.tile-hover::before { border-color: rgba(236, 235, 229, 0.15); }

/* text stays flat; it drifts a few pixels with the pointer */
.depth > *, .contact > *, #pricing .terms > .plan > *, .legal .contact-lines > * { transform: translate(var(--tx, 0px), var(--ty, 0px)); }

/* the depth statement: the frame spans the page's full width inside its margins (the same edges as the figures row and
   the header); on wide screens the text still starts on the column every section body starts on */
.depth {
  --pad-x: clamp(1.4rem, 3vw, 3rem);
  margin-top: clamp(2.5rem, 6vw, 5rem);
  padding: clamp(1.5rem, 3.2vw, 3rem) var(--pad-x);
}
@media (min-width: 900px) {
  .depth { margin-left: calc(-1 * var(--pad-x)); }              /* without subgrid: the frame reaches out to the column */
  @supports (grid-template-columns: subgrid) {
    .depth { grid-column: 1 / -1; margin-left: 0; display: grid; grid-template-columns: subgrid; }
    .depth p { grid-column: 2; }
  }
}
@media (max-width: 899px) {           /* phones: a card inside the page margins */
  .depth { --r: 16px; padding: 1.35rem clamp(1.1rem, 5vw, 1.5rem) 1.45rem; }
}

/* the contact card: as wide as the address; on wide screens its text also starts on the column */
.contact {
  --pad-x: clamp(1.4rem, 3vw, 3rem);           /* the depth pane's: the frames line up on the left */
  width: fit-content;
  max-width: 100%;
  border-top: 0;
  padding: clamp(1.25rem, 2.4vw, 2rem) clamp(1.4rem, 4vw, 3.5rem) clamp(1.25rem, 2.4vw, 1.9rem) var(--pad-x);
}
@media (min-width: 900px) {
  .contact { margin-left: calc(-1 * var(--pad-x)); }
}

/* the seven functions as glass tiles; each row fills the full width, the same span as the depth pane above */
.functions {
  border-top: 0;
  border-bottom: 0;
  padding-block: 0;
  gap: clamp(0.5rem, 1vw, 0.75rem);
}
@media (min-width: 900px) {
  .functions { margin-left: calc(-1 * clamp(1.4rem, 3vw, 3rem)); }
}
.functions li {
  --r: 14px;
  flex: 1 1 auto;
  padding: 0.55em 0.95em 0.6em;
  font-size: 0.82em;
  transform: translate(var(--tx, 0px), var(--ty, 0px));
}

/* the seven small tiles: the same glass look without a live blur (little drifts behind them; scrolling is cheaper) */
.functions li::before {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.022));
}

/* the fluid light: while the pointer is over a tile or the figures row, fluid.js marks its text .lit and moves three
   soft orange pools (a, b, c) through the letters. Each pool is an ellipse whose size and place fluid.js sets per text
   element; --fa fades the whole light in and out. Outside the pools the letters keep their own colour (--base).
   The colour lives on the text elements, never on the tile, so it paints above the glass and the frames stay neutral. */
.lit {
  --fa: 0;
  background-image:
    radial-gradient(ellipse var(--aw, 1px) var(--ah, 1px) at var(--ax, -999px) var(--ay, -999px),
      rgb(255 138 56 / var(--fa)) 0%, rgb(255 106 30 / var(--fa)) 60%, rgb(255 106 30 / 0) 100%),
    radial-gradient(ellipse var(--bw, 1px) var(--bh, 1px) at var(--bx, -999px) var(--by, -999px),
      rgb(255 98 26 / var(--fa)) 0%, rgb(255 98 26 / calc(var(--fa) * 0.9)) 55%, rgb(255 98 26 / 0) 100%),
    radial-gradient(ellipse var(--cw, 1px) var(--ch, 1px) at var(--cx, -999px) var(--cy, -999px),
      rgb(246 84 22 / var(--fa)) 0%, rgb(246 84 22 / calc(var(--fa) * 0.85)) 55%, rgb(246 84 22 / 0) 100%),
    linear-gradient(var(--base), var(--base));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* bolder while lit, without reflow: a clear stroke widens the letters the colour is clipped to (no-op where unsupported) */
  -webkit-text-stroke-width: calc(var(--fa) * var(--bold, 0.026em));
}
.figures .l.lit, .contact .signature.lit, #pricing .plan li.lit, #pricing .plan .unit.lit { --bold: 0.014em; }  /* small sans text: less, so it stays crisp */
.lit, .lit a { text-decoration-color: var(--rule-strong); }  /* links keep their underline while their letters are lit */
/* lit letters are painted only inside their own box, so ink that rises above it was cut off: the figures' tall numerals
   (line-height 0.9) lost their tops, and the bolder stroke grazed the edge of the function names. Room above and below,
   with nothing moved: the numerals are blocks, so a matching negative margin cancels the padding; the names are inline,
   where vertical padding never moves a line. tools/test_clip.py checks every lit element for lost ink. */
.figures .n { padding-block: 0.16em; margin-block: -0.16em; }
.functions .fn { padding-block: 0.14em; }

/* the two quiet lines under the functions read as one note; the closing line reads as the section's last statement */
.functions + .prose p { color: var(--muted); }
.functions + .prose p + p { margin-top: 0.3rem; }
.closing {
  font-style: normal;
  font-size: var(--step-2);
  line-height: 1.2;
  letter-spacing: -0.015em;
  max-width: 24ch;
  font-variation-settings: "opsz" 60;
}
.closing em { display: block; font-style: italic; color: var(--accent); }

/* legal: the section index as one glass capsule (still) */
.legal .toc ul {
  width: fit-content;
  max-width: 100%;
  padding: 0.75rem 1.4rem;
  border-radius: 18px;
  background: linear-gradient(180deg, var(--frost-top), var(--frost-bottom));
  border: 1px solid var(--frost-edge);
  box-shadow: inset 0 1px 0 var(--frost-rim), var(--frost-shadow);
  -webkit-backdrop-filter: var(--frost-blur);
  backdrop-filter: var(--frost-blur);
}

/* legal: the four plans, two by two on wider screens */
#pricing .terms { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.9rem; border-top: 0; }
@media (min-width: 720px) { #pricing .terms { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
#pricing .terms > .plan { padding: 1.3rem 1.5rem 1.4rem; border-bottom: 0; }

/* legal: the contact block */
.legal .contact-lines {
  width: fit-content;
  max-width: 100%;
  padding: clamp(1.25rem, 2.4vw, 1.9rem) clamp(1.4rem, 3.5vw, 3rem) clamp(1.25rem, 2.4vw, 1.9rem) clamp(1.25rem, 2.4vw, 2rem);
}

/* the headline's second line: two shimmers once the page has loaded */
.hero h1 .turn { -webkit-box-decoration-break: clone; box-decoration-break: clone; }
@media (prefers-reduced-motion: no-preference) {
  .shimmer .hero h1 .turn {
    background-image: linear-gradient(100deg, var(--accent) 0%, var(--accent) 40%, #ffe3d2 50%, var(--accent) 60%, var(--accent) 100%);
    background-size: 260% 100%;
    background-position: 100% 0;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: di-shimmer 1.5s cubic-bezier(0.45, 0, 0.25, 1) 0.35s 2 both;
  }
}
@keyframes di-shimmer { from { background-position: 100% 0; } to { background-position: 0% 0; } }

/* without backdrop blur: the same tiles, a little more solid */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .depth::before, .contact::before, .functions li::before, #pricing .terms > .plan::before, .legal .contact-lines::before, .legal .toc ul { background: rgba(28, 28, 27, 0.88); }
  .site-header.is-frosted { background-color: rgba(17, 17, 16, 0.94); }
}
@media (prefers-reduced-motion: reduce) {
  .depth::before, .contact::before, .functions li::before, #pricing .terms > .plan::before, .legal .contact-lines::before { transform: none; }
}
@media print {
  .site-header, .home .site-header { position: static; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .depth::before, .contact::before, .functions li::before, #pricing .terms > .plan::before, .legal .contact-lines::before, .legal .toc ul { background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; border-color: #bbb; }
  .lit { color: #000; background: none; }
}
