/* ==================================================================
   burza.dev site styles: tokens, base, cinematic layer, header, footer,
   actions, glass panels, cards and the pages. Article typography lives
   in reader.css and article-rich.css; font faces in the inline style of index.html.

   Visual language: content floats over the crystal scene on sapphire
   glass — translucent gradient panels with a thin lit top edge, chamfered
   controls, monospace kickers with a leading rule, numbered indices and
   condensed uppercase display type. Readability rules: no screen text
   below 12px; body text sits on glass or veils dark enough for AAA.
   ================================================================== */

:root {
  color-scheme: dark;

  /* Colour: contrast ratios are checked against --surface-solid by tests/typography.test.cjs. */
  --bg: #050a17;
  --surface-solid: #070e1e;
  --surface-raised: #0c1a2f;
  --field: #081325;
  --line: #1c3150;
  --line-strong: #35567f;
  --ink: #f0f6fe;
  --text: #d4dfed;
  --muted: #a9bad0;
  --subtle: #8ea2bc;
  --accent: #93c2f2;
  --accent-strong: #c6e1fb;
  --primary: #2c64a8;
  --primary-hover: #3672bb;
  --primary-deep: #173a66;
  --primary-edge: #a6cbee;
  --danger: #ffb8ab;
  --focus: #b9e2fb;

  /* Glass: translucent sapphire panels; the scene stays visible but cannot reduce text contrast below AA. */
  --glass: linear-gradient(150deg, rgb(18 40 70 / .78), rgb(8 18 36 / .88) 62%);
  --glass-strong: linear-gradient(150deg, rgb(16 36 64 / .93), rgb(7 15 31 / .96) 62%);
  --glass-edge: rgb(128 178 226 / .24);
  --glass-lit: rgb(168 210 248 / .55);
  --veil: rgb(5 10 23 / .8);

  /* Aliases kept for the article component vocabulary (article-plots.css). */
  --sapphire-ink: var(--ink);
  --sapphire-muted: var(--muted);
  --sapphire-accent: var(--accent);
  --sapphire-line: var(--line-strong);

  --font-text: Manrope, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-display: 'Barlow Condensed', 'Arial Narrow', Manrope, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', 'Noto Sans Mono', monospace;

  /* Fluid type scale (16px root): 14, 16, 17→19, 20→24, 24→32, 32→48, 44→80, 52→108. */
  --step-0: 1rem;
  --step-1: clamp(1.0625rem, 1rem + .25vw, 1.1875rem);
  --step-2: clamp(1.25rem, 1.15rem + .4vw, 1.5rem);
  --step-3: clamp(1.5rem, 1.3rem + .9vw, 2rem);
  --step-4: clamp(1.75rem, 1.45rem + 1.3vw, 2.5rem);
  --step-5: clamp(2.5rem, 1.9rem + 2.6vw, 4rem);
  --step-6: clamp(3.25rem, 2.2rem + 5.2vw, 6.75rem);
  --label: .75rem;

  /* Motion scale: every transition and animation in dist/*.css takes its duration and curve from here (see notes/reading-redesign.md).
     The route timeline is --motion-duration-exit, -enter-delay, -enter and -stagger with the exit and enter curves: views.js reads them once per
     route (TransitionPlan.timeline), so the page's CSS and the scene's camera follow the same numbers. */
  --motion-duration-press: 100ms;
  --motion-duration-instant: 120ms;
  --motion-duration-fast: 200ms;
  --motion-duration-exit: 180ms;
  --motion-duration-base: 320ms;
  --motion-duration-enter: 400ms;
  --motion-duration-enter-delay: 80ms;
  --motion-duration-stagger: 50ms;
  --motion-duration: .5s;
  --motion-duration-slow: 800ms;
  --motion-ease: cubic-bezier(.2, .6, .3, 1);
  --motion-ease-enter: cubic-bezier(0, 0, .2, 1);
  --motion-ease-exit: cubic-bezier(.4, 0, 1, 1);

  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;
  --space-9: 7rem;

  /* Layout: every page, the article included, shares one frame. The reading measure is about 68 characters. */
  --frame: 90rem;
  --gutter: clamp(1rem, 4vw, 4rem);
  --measure: 44rem;
  --cut: 10px;
}

/* ------------------------------------------------------------------ Base */
*, *::before, *::after { box-sizing: border-box; }
html {
  background: var(--bg);
  scroll-padding-top: calc(var(--header-bottom, 72px) + var(--space-4));
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-color: #29446c var(--bg);
}
/* No body background: the fixed scene canvas paints between the root background and the page. */
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
  color: var(--text);
  font: 400 var(--step-0)/1.6 var(--font-text);
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6 { margin: 0; color: var(--ink); font-weight: 600; line-height: 1.2; text-wrap: balance; }
p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
p { text-wrap: pretty; }
em { font-style: normal; color: var(--accent); }
img, svg, video { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-strong); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
[tabindex="-1"]:focus { outline: none; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link {
  position: fixed; top: var(--space-2); left: var(--space-2); z-index: 40; padding: var(--space-3) var(--space-4);
  background: var(--ink); color: var(--bg); font-weight: 700; text-decoration: none; transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* ------------------------------------------------------------------ The cinematic layer */
/* The gradient is its own layer, so it is there from first paint while the crystals fade in over it. */
.scene-backdrop {
  position: fixed; inset: 0; z-index: -3;
  background: radial-gradient(ellipse at 52% 53%, #112c55, var(--bg) 75%);
  transition: opacity var(--motion-duration-slow) var(--motion-ease);
}
#scene {
  position: fixed; inset: 0; z-index: -2; display: block; width: 100%; height: 100%;
  transition: opacity var(--motion-duration-slow) var(--motion-ease);
}
/* Static mode only (scene.js shows the line while the next frame renders, after a delay): a thin line along the bottom edge of the scene layer,
   below the page, so it covers and blocks nothing. Opacity and transform only; without motion it is a still line. */
.scene-loading { position: fixed; left: 0; right: 0; bottom: 0; z-index: -1; height: 2px; overflow: hidden; pointer-events: none; }
.scene-loading-line { display: block; width: 100%; height: 100%; background: var(--accent); opacity: .55; }
@keyframes scene-loading-run { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
/* scene.js sets data-scene="fading" on the first drawn frame and removes it when the animation ends. An animation overrides the
   article rule below (which wins over any plain declaration here), so the fade also runs there and ends at that rule's opacity. */
@keyframes scene-in { from { opacity: 0; } }
@media (prefers-reduced-motion: no-preference) {
  html[data-scene="fading"] #scene { animation: scene-in var(--motion-duration) var(--motion-ease-enter); }
  .scene-loading-line { width: 30%; opacity: .8; animation: scene-loading-run calc(var(--motion-duration-slow) * 2) var(--motion-ease) infinite; }
}
.vignette, .reading-shield { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.vignette { background: radial-gradient(ellipse 120% 90% at 60% 45%, transparent 45%, #030712b3 100%), linear-gradient(180deg, #04091466, transparent 20%, transparent 75%, #040914aa); }
/* Hero scrim: copy on the left stays legible over any frame; the crystals stay bright on the right. */
/* Gradients do not interpolate, so the two scrims are two pre-drawn layers and the view change crossfades their opacity. */
.reading-shield::before, .reading-shield::after { content: ''; position: absolute; inset: 0; transition: opacity var(--motion-duration) var(--motion-ease); }
.reading-shield::before { background: linear-gradient(90deg, #050a17e6 0%, #050a17b0 32%, #050a1730 58%, transparent 76%); }
/* Article: a calm band behind the text column; the scene remains visible at the sides. */
.reading-shield::after { opacity: 0; background: linear-gradient(90deg, #050a1799 0%, #050a17e6 16%, #050a17f2 30%, #050a17f2 74%, #050a17e0 88%, #050a1799 100%); }
body[data-view="article"] #scene, body[data-view="article"] .scene-backdrop { opacity: .7; }
body[data-view="article"] .reading-shield::before { opacity: 0; }
body[data-view="article"] .reading-shield::after { opacity: 1; }
@media (max-width: 860px) {
  .reading-shield::before { background: linear-gradient(180deg, #050a1780 0%, #050a17c8 45%, #050a17eb 100%); }
  .reading-shield::after { background: #050a17eb; }
}
#fallback { position: fixed; left: 50%; bottom: var(--space-6); transform: translateX(-50%); z-index: 30; }

/* ------------------------------------------------------------------ Glass panels */
.glass, .glass-card, .post-card, .service-card, .option-card, .contact-aside, .service-panel, .cta-band {
  position: relative; background: var(--glass); border: 1px solid var(--glass-edge);
}
/* The lit top edge: a thin highlight that fades toward the right, like light along a facet. */
:is(.glass, .glass-card, .post-card, .service-card, .option-card, .contact-aside, .service-panel, .cta-band)::before {
  content: ''; position: absolute; left: -1px; right: 30%; top: -1px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, var(--glass-lit), transparent);
}

/* ------------------------------------------------------------------ Labels */
.eyebrow {
  display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4);
  color: #a6c4ea; font: 500 var(--label)/1.4 var(--font-mono); letter-spacing: .16em; text-transform: uppercase;
}
.eyebrow::before { content: ''; flex: none; width: 1.75rem; height: 1px; background: #6898e6; }

/* ------------------------------------------------------------------ Actions and controls
   One chamfered shape for every button. Primary is reserved for the main call to action. */
.action, .control, .chip {
  --cut: 7px;
  --edge: #58789d;
  --fill: linear-gradient(115deg, #142a46, #0c1a2e);
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 2.75rem; padding: .625rem 1.125rem;
  border: 0; border-radius: 0; background: none;
  color: var(--ink); font: 600 .9375rem/1.3 var(--font-text); letter-spacing: .01em;
  text-decoration: none; text-align: center; cursor: pointer;
  transition: transform var(--motion-duration-fast) var(--motion-ease);
}
.action::before, .action::after, .control::before, .control::after, .chip::before, .chip::after {
  content: ''; position: absolute; pointer-events: none;
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
}
.action::before, .control::before, .chip::before { inset: 0; z-index: -2; background: var(--edge); }
.action::after, .control::after, .chip::after { inset: 1px; z-index: -1; background: var(--fill); }
.action:hover, .control:hover:where(:not(:disabled, [aria-disabled="true"])), .chip:hover { --edge: #9cc6ee; --fill: linear-gradient(115deg, #1c3a60, #12243f); color: #fff; }
.action-primary { --edge: var(--primary-edge); --fill: linear-gradient(115deg, var(--primary), var(--primary-deep)); color: #fff; }
.action-primary:hover { --edge: #e2f2ff; --fill: linear-gradient(115deg, var(--primary-hover), #1d4678); }
.action-large { min-height: 3.25rem; padding-inline: 1.5rem; font-size: 1rem; }
.control { --cut: 5px; min-height: 2.5rem; padding: .5rem .875rem; font-size: .875rem; }
.control:is([aria-pressed="true"], [aria-selected="true"]) { --edge: var(--accent); --fill: linear-gradient(115deg, #234a7a, #15304f); }
.control:disabled, .control[aria-disabled="true"] { opacity: .45; cursor: default; }
.chip { --cut: 5px; min-height: 2.5rem; padding: .375rem .875rem; font-size: .875rem; font-weight: 600; }
.chip[aria-pressed="true"] { --edge: var(--accent); --fill: linear-gradient(115deg, #234a7a, #15304f); }
.chip-static { min-height: 2rem; padding: .25rem .625rem; cursor: default; color: var(--text); font: 500 .8125rem/1.3 var(--font-mono); }
.chip-static:hover { --edge: #58789d; --fill: linear-gradient(115deg, #142a46, #0c1a2e); color: var(--text); }
.action-group { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }

.link-more, .link-button {
  display: inline-flex; align-items: center; gap: .45em; padding: 0; border: 0; background: none;
  color: var(--accent); font-weight: 600; text-decoration: underline; text-decoration-color: #93c2f266;
  text-underline-offset: .3em; cursor: pointer; transition: text-decoration-color var(--motion-duration-fast) var(--motion-ease), color var(--motion-duration-fast) var(--motion-ease);
}
/* inline-block: a transform does not apply to an inline box, and the later `.link-more { display: inline-block }` makes the arrow one. */
.link-more::after { content: '→'; content: '→' / ''; display: inline-block; margin-left: .45em; transition: transform var(--motion-duration-fast) var(--motion-ease); }
.link-more:hover, .link-button:hover { color: var(--accent-strong); text-decoration-color: currentColor; }
.link-more:hover::after { transform: translateX(3px); }

/* ------------------------------------------------------------------ Header */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--space-5); min-height: 4.5rem;
  padding: max(var(--space-3), env(safe-area-inset-top)) max(var(--gutter), env(safe-area-inset-right)) var(--space-3) max(var(--gutter), env(safe-area-inset-left));
  border-bottom: 1px solid transparent; transition: background-color var(--motion-duration-base) var(--motion-ease), border-color var(--motion-duration-base) var(--motion-ease);
}
/* Solid, not blurred: a backdrop filter would re-render the scene behind the header on every frame. */
.site-header[data-scrolled] { background: #050a17fa; border-bottom-color: #7fb0e01f; box-shadow: 0 8px 30px #02050c99; }
.brand { display: inline-flex; align-items: center; gap: .75rem; color: var(--ink); font-size: 1.25rem; font-weight: 700; letter-spacing: .035em; text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand-logo { width: 32px; height: auto; filter: drop-shadow(0 0 10px #3d7fd255); }
.brand-dot { color: var(--accent); }
.menu-toggle { display: none; }
.site-menu { display: flex; align-items: center; gap: var(--space-6); margin-left: auto; }
.site-nav { display: flex; align-items: center; gap: var(--space-6); }
.site-nav a:not(.nav-cta) { position: relative; padding: var(--space-2) 0; color: #c5d4e7; font-weight: 500; font-size: .9375rem; letter-spacing: .02em; text-decoration: none; transition: color var(--motion-duration-fast) var(--motion-ease); }
.site-nav a:not(.nav-cta):hover, .site-nav a[aria-current="page"]:not(.nav-cta) { color: #fff; }
.site-nav a:not(.nav-cta)::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform var(--motion-duration-fast) var(--motion-ease); }
.site-nav a:not(.nav-cta):hover::after, .site-nav a[aria-current="page"]:not(.nav-cta)::after { transform: none; }
.nav-cta.action { min-height: 2.5rem; padding-inline: 1.125rem; }
.nav-cta[aria-current="page"] { --edge: #fff; text-decoration: none; }

.lang-switch ul { display: flex; align-items: center; gap: 0; margin: 0; padding: 0; list-style: none; }
.lang-switch li + li::before { content: '/'; padding: 0 .125rem; color: var(--line-strong); }
.lang-option { display: inline-flex; align-items: center; gap: .3rem; min-height: 2.25rem; padding: .25rem .375rem; color: var(--muted); font: 500 .8125rem/1 var(--font-mono); letter-spacing: .08em; text-decoration: none; }
a.lang-option:hover { color: #fff; }
.lang-option[aria-current] { color: #fff; text-decoration: underline 1px var(--accent); text-underline-offset: .45em; }
.lang-option.is-unavailable { color: var(--subtle); cursor: help; }
.lang-option small { font: 400 .75rem/1 var(--font-text); letter-spacing: 0; }
.site-header .lang-option small { display: none; }

@media (max-width: 860px) {
  .site-header { min-height: 3.75rem; }
  .brand { font-size: 1.125rem; }
  .brand-logo { width: 28px; }
  .menu-toggle {
    display: inline-flex; align-items: center; margin-left: auto; min-height: 2.75rem; padding: 0 var(--space-4);
    border: 1px solid var(--line-strong); background: #0b1729; color: var(--ink); font: 500 .8125rem/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; cursor: pointer;
  }
  .menu-close-label, [aria-expanded="true"] .menu-open-label { display: none; }
  [aria-expanded="true"] .menu-close-label { display: inline; }
  .site-header[data-menu-open] { background: var(--bg); border-bottom-color: var(--line); }
  .site-menu {
    position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: var(--space-5);
    max-height: calc(100dvh - 4rem); overflow-y: auto; padding: var(--space-2) var(--gutter) var(--space-6);
    background: var(--bg); border-bottom: 1px solid var(--line);
  }
  .site-header:not([data-menu-open]) .site-menu { display: none; }
  .site-nav { flex-direction: column; align-items: stretch; gap: 0; }
  .site-nav a:not(.nav-cta) { padding: var(--space-4) 0; border-bottom: 1px solid var(--line); font-size: 1.25rem; }
  .site-nav a:not(.nav-cta)::after { display: none; }
  .site-nav a[aria-current="page"]:not(.nav-cta) { color: #fff; box-shadow: inset 3px 0 0 var(--accent); padding-left: var(--space-3); margin-left: calc(-1 * var(--space-3)); }
  .nav-cta.action { margin-top: var(--space-5); min-height: 3rem; font-size: 1rem; }
  .site-header .lang-option small { display: inline; }
}

/* ------------------------------------------------------------------ Views and page structure */
.view { display: block; min-height: 100vh; }

/* ------------------------------------------------------------------ Route transitions (see notes/reading-redesign.md) */
/* Only the page content moves: the view and the footer fade in while the camera glides through the one live scene (scene.js). The
   background is never captured, faded or cut, so there is no document View Transition: one paints the page and the scene as captures
   over the `::view-transition` backdrop, and in Firefox that backdrop replaced the live scene for most of every route (the dark flash,
   2026-12-02). Opacity only, never a transform, which would become the containing block of fixed descendants (the article's contents bar
   on phones). views.js sets the attribute for the duration of a route that is not the first load. */
@keyframes view-fade { from { opacity: 0; } to { opacity: 1; } }
html[data-transition-kind="css-crossfade"] :is(.view:not([hidden]), .site-footer) { animation: view-fade var(--motion-duration-enter) var(--motion-ease-enter) backwards; }
/* The incoming view's hero lines (the children of `.hero-copy`: opacity and a short translate, never a transform on `.view`) start one stagger step
   apart after the enter delay. The attribute is set by views.js at the swap and outlives the fade until the last line has finished. The
   index is capped at the last line TransitionPlan.HERO_LINES counts. */
@keyframes hero-in { from { opacity: 0; transform: translateY(var(--space-3)); } }
html[data-hero] .view:not([hidden]) .hero-copy > * { animation: hero-in var(--motion-duration-enter) var(--motion-ease-enter) both; animation-delay: calc(var(--motion-duration-enter-delay) + var(--motion-duration-stagger) * var(--hero-line, 0)); }
html[data-hero] .view:not([hidden]) .hero-copy > :nth-child(2) { --hero-line: 1; }
html[data-hero] .view:not([hidden]) .hero-copy > :nth-child(3) { --hero-line: 2; }
html[data-hero] .view:not([hidden]) .hero-copy > :nth-child(4) { --hero-line: 3; }
html[data-hero] .view:not([hidden]) .hero-copy > :nth-child(5) { --hero-line: 4; }
html[data-hero] .view:not([hidden]) .hero-copy > :nth-child(n + 6) { --hero-line: 5; }

/* Page heroes are compact: the page's own content starts within the first screen. Only home is full height. */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: var(--space-6); align-items: center;
  max-width: calc(var(--frame) + 2 * var(--gutter)); margin: 0 auto; padding: calc(var(--header-bottom, 72px) + var(--space-6)) var(--gutter) var(--space-6);
}
.hero-home { grid-template-columns: minmax(0, 1fr); align-items: end; min-height: 100svh; padding-bottom: var(--space-9); }
.hero-compact { padding-bottom: var(--space-4); }
.hero-copy { max-width: 46rem; }
.display { font: 600 var(--step-5)/.92 var(--font-display); letter-spacing: -.01em; text-transform: uppercase; text-shadow: 0 4px 35px #03091f; }
.display em { color: #a9c8f6; }
.hero-home .display { font-size: var(--step-6); text-wrap: balance; }
@media (max-width: 420px) { .hero-home .display { font-size: min(var(--step-6), 13.5vw); } }
/* Laptop heights: the whole hero, including both buttons, stays on the first screen in every language. */
@media (min-width: 761px) and (max-height: 820px) { .hero-home { padding-bottom: var(--space-6); } .hero-home .display { font-size: min(var(--step-6), 11.5svh); } .hero-home .hero-lead { max-width: 44rem; margin-top: var(--space-4); } .hero-home .action-group { margin-top: var(--space-5); } }
.hero-lead { max-width: 38rem; margin-top: var(--space-5); color: var(--text); font-size: var(--step-1); line-height: 1.65; text-shadow: 0 1px 16px #03091f; }
.hero .action-group { margin-top: var(--space-6); }
.hero-proof { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-6); color: #9fb6d6; font: 500 var(--label)/1.4 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; }
.hero-visual { position: relative; min-width: 0; }

/* Crystal windows: transparent lenses through which the camera frames one crystal of the scene. */
.crystal-window {
  position: relative; display: block; width: 100%; height: clamp(14rem, 34vh, 22rem);
  cursor: grab; touch-action: pan-y; user-select: none; border: 0; background: none;
}
.crystal-window::before, .crystal-window::after { content: ''; position: absolute; width: 18px; height: 18px; pointer-events: none; opacity: .65; transition: opacity var(--motion-duration-base) var(--motion-ease); }
.crystal-window::before { left: 0; top: 0; border-left: 1px solid #8cb7d8; border-top: 1px solid #8cb7d8; }
.crystal-window::after { right: 0; bottom: 0; border-right: 1px solid #8cb7d8; border-bottom: 1px solid #8cb7d8; }
.crystal-window[data-active="true"]::before, .crystal-window[data-active="true"]::after { opacity: 1; }
.crystal-window[data-dragging="true"] { cursor: grabbing; }
.crystal-window[aria-hidden="true"] { cursor: default; }
.crystal-window:focus-visible { outline: 1px solid #a7d9ec; outline-offset: 8px; }

/* Below the hero, content stays on the scene behind a veil that deepens as it scrolls in. */
.page-surface { position: relative; padding: 0 var(--gutter) var(--space-8); background: linear-gradient(180deg, transparent, var(--veil) 6rem, var(--veil)); }
.page-surface > * { max-width: var(--frame); margin-inline: auto; }
.section { padding-block: var(--space-7) 0; }
.section-tight { padding-top: var(--space-7); }
.section-head { max-width: 48rem; margin-bottom: var(--space-5); }
.section-head h2 { font-size: var(--step-4); font-weight: 400; letter-spacing: -.02em; line-height: 1.1; }
.section-lead { margin-top: var(--space-4); color: var(--muted); font-size: var(--step-1); text-wrap: balance; }
.section-head-row { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--space-3) var(--space-6); max-width: none; }
.count { color: var(--muted); font: 500 .8125rem/1.4 var(--font-mono); letter-spacing: .08em; }
.section > .link-more { margin-top: var(--space-6); }
.page-surface > .notice { margin-top: var(--space-6); }

@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: var(--space-4); min-height: 0; padding-bottom: var(--space-6); }
  .hero-home { min-height: 100svh; padding-bottom: var(--space-6); }
  .hero-page .hero-visual { order: -1; margin-bottom: calc(-1 * var(--space-6)); }
  .crystal-window { height: clamp(12rem, 32vh, 16rem); }
  .section { padding-top: var(--space-7); }
}

/* ------------------------------------------------------------------ Article cards */
/* Three-across grids: always full rows on desktop, so cards stay centred and justified at every width. */
.card-grid, .card-list, .options-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-5); }
/* The archive centres a short last row, so it never leaves an orphan card on the left. */
.card-list { display: flex; flex-wrap: wrap; justify-content: center; }
.card-list > * { flex: 0 1 calc((100% - 2 * var(--space-5)) / 3); }
@media (max-width: 1000px) { .card-list > * { flex-basis: calc((100% - var(--space-5)) / 2); } }
@media (max-width: 640px) { .card-list > * { flex-basis: 100%; } }
/* A lone card on the last row becomes a wide horizontal card instead of floating in empty space. */
@media (min-width: 1001px) {
  .card-list > .post-card:last-child:nth-child(3n + 1):not(:only-child) { flex: 1 0 100%; flex-direction: row; align-items: stretch; }
  .card-list > .post-card:last-child:nth-child(3n + 1):not(:only-child) .post-card-cover { flex: 0 0 40%; align-self: stretch; aspect-ratio: auto; min-height: 12rem; border-bottom: 0; border-right: 1px solid var(--glass-edge); }
  .card-list > .post-card:last-child:nth-child(3n + 1):not(:only-child) .post-card-body { justify-content: center; padding: var(--space-6); }
}
@media (min-width: 641px) and (max-width: 1000px) {
  .card-list > .post-card:last-child:nth-child(2n + 1):not(:only-child) { flex: 1 0 100%; flex-direction: row; align-items: stretch; }
  .card-list > .post-card:last-child:nth-child(2n + 1):not(:only-child) .post-card-cover { flex: 0 0 40%; align-self: stretch; aspect-ratio: auto; min-height: 12rem; border-bottom: 0; border-right: 1px solid var(--glass-edge); }
  .card-list > .post-card:last-child:nth-child(2n + 1):not(:only-child) .post-card-body { justify-content: center; padding: var(--space-6); }
}
.lang-switch li:last-child .lang-option { padding-right: 0; }
.card-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) { .card-grid:not(.card-grid-2), .options-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .card-grid-2 { grid-template-columns: minmax(0, 1fr); } }
.post-card, .service-card { display: flex; flex-direction: column; min-width: 0; color: inherit; text-decoration: none; transition: border-color var(--motion-duration-fast) var(--motion-ease), transform var(--motion-duration-fast) var(--motion-ease); }
.post-card:hover, .service-card:hover { color: inherit; border-color: #8cbce87a; }
/* The lift's shadow is drawn once and only its opacity changes, so hover costs no repaint. ::before is the lit edge. */
.post-card::after, .service-card::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; box-shadow: 0 .75rem 1.75rem #02060f99;
  opacity: 0; transition: opacity var(--motion-duration-fast) var(--motion-ease);
}
@media (hover: hover) {
  .post-card:hover, .service-card:hover, .post-card:focus-visible, .service-card:focus-visible { transform: translateY(-3px); }
  .post-card:hover::after, .service-card:hover::after, .post-card:focus-visible::after, .service-card:focus-visible::after { opacity: 1; }
}
/* Pressed states come after the lift (equal specificity), so a press wins over a hover. The scale is the whole element: the chamfer layers are its children.
   Static chips, disabled controls and the unavailable language have no press. A card that holds a button does not scale while that button is pressed. */
.option-card, .lang-option { transition: transform var(--motion-duration-fast) var(--motion-ease); }
.action:active:where(:not(:disabled, [aria-disabled="true"])), .control:active:where(:not(:disabled, [aria-disabled="true"])), .chip:active:where(:not(:disabled, [aria-disabled="true"], .chip-static)),
.nav-cta:active, .post-card:active, .service-card:active, a.lang-option:active {
  transform: scale(.98); transition-duration: var(--motion-duration-press); transition-timing-function: var(--motion-ease-enter);
}
/* Its own rule: a browser without :has() drops a rule it cannot parse, and the other pressed states must survive that. */
.option-card:active:not(:has(:is(a, button, .action, .control, .chip):active)) {
  transform: scale(.98); transition-duration: var(--motion-duration-press); transition-timing-function: var(--motion-ease-enter);
}
.post-card-cover { position: relative; display: block; aspect-ratio: 2 / 1; overflow: hidden; background: #0a1830; border-bottom: 1px solid var(--glass-edge); }
.post-card-body { display: flex; flex: 1; flex-direction: column; gap: var(--space-2); padding: var(--space-4) var(--space-5) var(--space-5); }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); color: var(--muted); font: 500 var(--label)/1.4 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; }
.card-category { color: var(--accent); }
.badge { padding: .2rem .5rem; color: #e7f3ff; background: #1f4a7d; border: 1px solid #8fbce8; font: 500 var(--label)/1.2 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; }
.post-card-title { font-size: 1.25rem; font-weight: 500; line-height: 1.3; letter-spacing: -.01em; min-height: calc(2 * 1.3em); transition: color var(--motion-duration-fast) var(--motion-ease); }
.post-card:hover .post-card-title { color: var(--accent-strong); }
.post-card-deck { color: var(--muted); font-size: .9375rem; line-height: 1.65; }


/* ------------------------------------------------------------------ Service cards (home) */
#home-services { counter-reset: service; }
.service-card { counter-increment: service; gap: var(--space-3); padding: var(--space-5); }
/* The counter sits on the heading's ::after (absolute, so it is placed against the card) because the card's own ::after is the hover shadow layer. */
.service-card h3::after { content: counter(service, decimal-leading-zero); content: counter(service, decimal-leading-zero) / ''; position: absolute; top: var(--space-5); right: var(--space-5); color: var(--accent); font: 500 var(--label)/1 var(--font-mono); letter-spacing: .08em; }
.service-card h3 { padding-right: var(--space-6); font-size: 1.25rem; font-weight: 500; }
.service-card p { flex: 1; color: var(--muted); }
.service-card .link-more { margin-top: var(--space-2); }

.about-strip { padding: var(--space-6) var(--space-5); }
.about-strip h2 { font-size: var(--step-4); font-weight: 400; letter-spacing: -.02em; }
.about-strip p { max-width: 46rem; text-wrap: pretty; margin: var(--space-2) 0 var(--space-4); color: var(--text); font-size: var(--step-1); }
.page-surface > .about-strip { margin-top: var(--space-7); }

.cta-band { margin-top: var(--space-7); padding: var(--space-6) var(--space-5); text-align: center; background: radial-gradient(ellipse at 50% 0%, #1e4a7d88, transparent 70%), var(--glass-strong); }
.cta-band h2 { max-width: 44rem; margin: 0 auto; font-size: var(--step-4); font-weight: 400; letter-spacing: -.02em; line-height: 1.1; }
.cta-band p { max-width: 34rem; text-wrap: balance; margin: var(--space-4) auto var(--space-6); color: var(--text); font-size: var(--step-1); }

/* ------------------------------------------------------------------ Forms */
.field { display: grid; gap: var(--space-2); min-width: 0; }
.field-label { color: var(--ink); font-size: .9375rem; font-weight: 600; }
.field-optional { color: var(--subtle); font-weight: 400; }
.field-hint { color: var(--muted); font-size: .875rem; }
.field-error { min-height: 1.25rem; color: var(--danger); font-size: .875rem; font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 3rem; padding: .75rem .875rem; color: var(--ink); font-size: 1rem; line-height: 1.5;
  background: var(--field); border: 1px solid #3a5a85; border-radius: 0; transition: border-color var(--motion-duration-fast) var(--motion-ease);
}
.field textarea { min-height: 7rem; resize: vertical; }
.field input::placeholder { color: var(--subtle); opacity: 1; }
.field :is(input, select, textarea):hover { border-color: #7fa9d6; }
.field :is(input, select, textarea):focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--accent); }
.field [aria-invalid="true"] { border-color: var(--danger); }
.form-status { color: var(--accent-strong); font-weight: 600; }
.form-status:empty { display: none; }

/* Lazy blocks (fragment-client.js): the slot's own min-height or aspect-ratio reserves its size; the skeleton only paints inside it.
   The retry notice of an empty view slot sits in the reserved box, so a failed view never changes the layout. */
.block-slot { position: relative; }
.block-slot:empty.is-loading { background: repeating-linear-gradient(to bottom, var(--surface-raised) 0 .75rem, transparent .75rem 1.9rem) top / min(100%, 44rem) 100% no-repeat; }
/* In flow, so that a slot holding plain links of its own (the menu, the footer) keeps them reachable: the retry notice follows them and may grow the slot. */
.block-slot-retry { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); padding: var(--space-4); border: 1px solid var(--line-strong); background: var(--surface-raised); color: var(--ink); }
.view > .block-slot > .block-slot-retry { position: absolute; inset: 0; align-content: center; overflow: auto; }

/* ------------------------------------------------------------------ Articles archive */
.journal-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(12rem, 16rem); gap: var(--space-4); margin-bottom: var(--space-4); }
.journal-toolbar .field-label { color: #a6c4ea; font: 500 var(--label)/1.4 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; }
.journal-filterline { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-7); }
.chip-group, .chip-list { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.empty-state { padding: var(--space-7) var(--space-5); text-align: center; border: 1px dashed var(--line-strong); }
.empty-state p { margin: var(--space-2) 0 var(--space-5); color: var(--muted); }
@media (max-width: 600px) { .journal-toolbar { grid-template-columns: minmax(0, 1fr); } }

/* ------------------------------------------------------------------ Services */
.services-workspace { display: grid; grid-template-columns: minmax(17rem, 21rem) minmax(0, 1fr); gap: var(--space-6); align-items: start; }
.service-tabs { position: sticky; top: calc(var(--header-bottom, 72px) + var(--space-4)); display: flex; flex-direction: column; gap: var(--space-2); counter-reset: tab; }
.service-tabs [role="tab"] {
  position: relative; display: grid; grid-template-columns: 2ch minmax(0, 1fr) 1ch; align-items: center; gap: var(--space-3); min-width: 0; min-height: 4rem; padding: var(--space-3) var(--space-4);
  counter-increment: tab; border: 1px solid var(--line-strong); background: #0c1a2fee;
  color: #c3d3e6; font-size: 1rem; font-weight: 500; text-align: left; overflow-wrap: anywhere; cursor: pointer; transition: background-color var(--motion-duration-fast) var(--motion-ease), border-color var(--motion-duration-fast) var(--motion-ease), color var(--motion-duration-fast) var(--motion-ease);
}
.service-tabs [role="tab"]::before { content: counter(tab, decimal-leading-zero); content: counter(tab, decimal-leading-zero) / ''; color: var(--subtle); font: 500 var(--label)/1 var(--font-mono); }
.service-tabs [role="tab"]::after { content: '›'; content: '›' / ''; color: var(--accent); font-size: 1.5rem; line-height: 1; }
.service-tabs [role="tab"]:hover { color: #fff; background: #1a3558; border-color: var(--accent); }
.service-tabs [aria-selected="true"] { color: #fff; font-weight: 700; border-color: var(--accent); background: #1e4370; box-shadow: inset 3px 0 var(--accent); }
.service-tabs [aria-selected="true"]::before { color: var(--accent); }
.service-accordion { display: none; }
/* The panel's glass thins out toward the top right, so the crystal framed by the detail lens stays bright. */
.service-panel { padding: var(--space-6); background: linear-gradient(90deg, #08122a8c 0%, #08122a40 55%, transparent 80%); }
.service-story .service-description { text-shadow: 0 1px 14px #03091f; }
.service-panel:focus-visible { outline-offset: -2px; }
.service-story { max-width: 52rem; }
.service-title { font-size: 1.75rem; font-weight: 600; letter-spacing: -.01em; }
.service-description { max-width: 40rem; margin-top: var(--space-5); font-size: var(--step-1); line-height: 1.65; }
.service-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); margin-top: var(--space-6); }
.glass-card { padding: var(--space-5); }
.service-columns h4, .service-practice h4 { display: flex; gap: var(--space-3); margin-bottom: var(--space-4); color: #a6c4ea; font: 500 var(--label)/1.4 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; }
.service-columns h4 > span:first-child { color: var(--accent); }
.mark-list { display: grid; gap: var(--space-3); padding: 0; list-style: none; }
.mark-list li { position: relative; padding-left: 1.25rem; }
.mark-list li::before { content: ''; position: absolute; left: 0; top: .62em; width: 5px; height: 5px; background: var(--accent); box-shadow: 0 0 8px #6fb0f0; }
.service-practice { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-5); align-items: baseline; margin-top: var(--space-5); padding: var(--space-4) var(--space-5); border-left: 2px solid var(--accent); background: #0a182c99; }
.service-practice h4 { margin: 0; }
.service-practice p { color: var(--text); }
.service-panel .chip-list { margin-top: var(--space-5); }
.service-panel > .action { margin-top: var(--space-6); }
@media (max-width: 860px) {
  .services-workspace { display: block; }
  .service-tabs, .services-console { display: none; }
  .service-accordion { display: grid; gap: var(--space-2); counter-reset: tab; }
  .service-disclosure {
    display: flex; align-items: center; gap: var(--space-4); width: 100%; min-height: 3.75rem; padding: var(--space-3) var(--space-4);
    counter-increment: tab; background: var(--glass); border: 1px solid var(--glass-edge); color: var(--ink); font-size: 1.0625rem; font-weight: 500; text-align: left; cursor: pointer;
  }
  .service-disclosure::before { content: counter(tab, decimal-leading-zero); content: counter(tab, decimal-leading-zero) / ''; color: var(--accent); font: 500 var(--label)/1 var(--font-mono); }
  .service-disclosure::after { content: '›'; content: '›' / ''; margin-left: auto; color: var(--accent); font-size: 1.5rem; line-height: 1; }
  .service-disclosure:hover { background: #1a3558; border-color: var(--accent); }
  .service-disclosure[aria-expanded="true"] { background: #1e4370; border-color: var(--accent); font-weight: 700; box-shadow: inset 3px 0 var(--accent); }
  .service-disclosure[aria-expanded="true"]::after { transform: rotate(90deg); }
  .service-disclosure-body .service-panel { border-top: 0; padding: var(--space-5) var(--space-4); }
  .service-columns { grid-template-columns: minmax(0, 1fr); }
  .service-practice { grid-template-columns: minmax(0, 1fr); gap: var(--space-2); }
}

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: var(--space-5); padding: 0; list-style: none; }
.steps li { position: relative; padding: var(--space-5); background: var(--glass); border: 1px solid var(--glass-edge); }
.step-index { display: block; margin-bottom: var(--space-3); color: var(--accent); font: 500 var(--label)/1 var(--font-mono); letter-spacing: .08em; }
.steps p { margin-top: var(--space-2); }

/* Engagement options: the same card language as everything else; subgrid lines up title, text, price,
   terms and action across the three cards, so they read as one justified row. */
.options-grid { grid-auto-rows: auto; }
.option-card {
  display: grid; grid-row: span 5; grid-template-rows: subgrid; row-gap: var(--space-4);
  padding: var(--space-6) var(--space-5) var(--space-5);
}
.option-card h3, .steps h3 { font-size: 1.25rem; font-weight: 500; }
.option-card > p:not(.option-rate), .steps p { color: var(--muted); font-size: 1rem; }
.option-rate { display: flex; flex-direction: column; gap: var(--space-1); padding-block: var(--space-4); border-block: 1px solid var(--line); }
.option-rate strong { color: var(--ink); font: 600 2.5rem/1 var(--font-display); letter-spacing: .01em; }
.option-rate span { color: var(--subtle); font: 500 var(--label)/1.4 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; }
.option-terms { display: grid; align-content: start; gap: var(--space-2); font-size: .9375rem; }
.option-terms div { display: flex; justify-content: space-between; gap: var(--space-4); padding-bottom: var(--space-2); border-bottom: 1px dashed var(--line); }
.option-terms dt { color: var(--muted); }
.option-terms dd { color: var(--ink); text-align: right; }
.option-card .action { align-self: end; justify-self: stretch; }
@media (max-width: 900px) { .option-card { grid-row: auto; grid-template-rows: none; } }

/* Articles page hero: the newest article, with its cover framed as glass on the right. */
.hero-feature { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
.eyebrow-meta { color: var(--muted); }
.eyebrow-meta::before { content: '·'; margin-right: var(--space-3); }
.feature-title { font: 600 clamp(2rem, 1.5rem + 1.6vw, 2.875rem)/1.02 var(--font-display); text-shadow: 0 4px 35px #03091f; }
.feature-title a { color: var(--ink); text-decoration: none; }
.feature-title a:hover { color: #fff; }
.feature-title em { color: #a9c8f6; }
.feature-cover { position: relative; display: block; aspect-ratio: 2 / 1; overflow: hidden; background: #0a1830; border: 1px solid var(--glass-edge); box-shadow: 0 30px 80px #02050ccc; }
.feature-cover::after { content: ''; position: absolute; left: 0; right: 35%; top: 0; height: 1px; background: linear-gradient(90deg, var(--glass-lit), transparent); }
@media (max-width: 860px) { .hero-feature .hero-visual { order: 0; margin: 0; } }

/* ------------------------------------------------------------------ About */
.stat-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: var(--space-2) auto 0; padding: 0; list-style: none; background: var(--glass); border: 1px solid var(--glass-edge); }
.stat-strip li { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-5); border-left: 1px solid var(--line); }
.stat-strip li:first-child { border-left: 0; }
.stat-strip strong { color: #fff; font: 600 2.75rem/1 var(--font-display); text-shadow: 0 0 24px #3d7fd266; }
.stat-strip span { color: var(--muted); font-size: .9375rem; line-height: 1.5; }
.timeline-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5); padding: 0; list-style: none; }
.timeline-grid li { position: relative; padding: var(--space-5); background: var(--glass); border: 1px solid var(--glass-edge); }
.timeline-grid li::before { content: ''; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 2px; background: linear-gradient(180deg, var(--accent), transparent); }
.timeline-date { color: var(--accent); font: 500 .8125rem/1.4 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; }
.timeline-grid h3 { margin-top: var(--space-2); font-size: 1.25rem; font-weight: 500; }
.timeline-grid li p:last-child { margin-top: var(--space-2); color: var(--muted); }
.records-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5); }
.record-list { display: grid; gap: var(--space-5); padding: 0; list-style: none; }
.record-list li { display: grid; gap: var(--space-1); padding: var(--space-5); background: var(--glass); border: 1px solid var(--glass-edge); align-content: start; }
.record-kind { color: var(--subtle); font: 500 var(--label)/1.4 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; }
.record-list a { color: var(--ink); font-weight: 600; text-decoration-color: #93c2f266; }
.record-list a:hover { color: var(--accent-strong); }
.record-list li > span:last-child:not(.record-kind) { color: var(--muted); font-size: 1rem; }
.skill-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5); margin: 0; }
.skill-groups div { padding: var(--space-5); background: var(--glass); border: 1px solid var(--glass-edge); }
.skill-groups dt { margin-bottom: var(--space-2); color: #a6c4ea; font: 500 var(--label)/1.4 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; }
.skill-groups dd { margin: 0; color: var(--text); }
@media (max-width: 900px) {
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-strip li:nth-child(3) { border-left: 0; }
  .stat-strip li:nth-child(n+3) { border-top: 1px solid var(--line); }
  .timeline-grid, .records-grid, .skill-groups { grid-template-columns: minmax(0, 1fr); }
}


/* ------------------------------------------------------------------ Contact */
.contact-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: var(--space-6); align-items: stretch; padding-top: var(--space-7); }
.contact-form { display: grid; gap: var(--space-5); padding: var(--space-6); background: var(--glass-strong); border: 1px solid var(--glass-edge); }
.contact-aside { position: relative; align-content: start; display: grid; gap: var(--space-4); padding: var(--space-6); }
.contact-aside h2 { font-size: var(--step-2); font-weight: 500; }
.contact-aside h2:not(:first-child) { margin-top: var(--space-4); padding-top: var(--space-5); border-top: 1px solid var(--line); }
.guide-list { display: grid; gap: var(--space-4); padding: 0; list-style: none; counter-reset: guide; }
.guide-list li { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--space-4); counter-increment: guide; }
.guide-list li::before { content: counter(guide, decimal-leading-zero); grid-row: span 2; padding-top: .2em; color: var(--accent); font: 500 var(--label)/1.4 var(--font-mono); }
.guide-list h3 { font-size: 1rem; }
.guide-list p { color: var(--muted); }
.channel-list { display: grid; gap: var(--space-2); padding: 0; list-style: none; }
.channel-list span { display: inline-block; min-width: 5.5rem; color: var(--subtle); font: 500 var(--label)/1.4 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; }
@media (max-width: 860px) {
  .contact-layout { grid-template-columns: minmax(0, 1fr); gap: var(--space-5); }
  .contact-form, .contact-aside { padding: var(--space-5); }
}

/* ------------------------------------------------------------------ Footer */
.site-footer { position: relative; padding: var(--space-7) var(--gutter) var(--space-5); background: linear-gradient(180deg, #050b1af2, #030610); border-top: 1px solid #7fb0e033; color: var(--muted); font-size: .9375rem; }
.site-footer::before { content: ''; position: absolute; top: -1px; left: 50%; width: min(32rem, 60%); height: 1px; transform: translateX(-50%); background: linear-gradient(90deg, transparent, #7fc0ff, transparent); pointer-events: none; }
.footer-inner { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr) minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--space-6) var(--space-7); max-width: var(--frame); margin: 0 auto; }
.footer-brand p { max-width: 21rem; margin-top: var(--space-3); color: var(--text); text-wrap: balance; }
.footer-title { margin-bottom: var(--space-3); color: #a6c4ea; font: 500 var(--label)/1.4 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; }
.footer-col ul { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.footer-col a { color: var(--text); text-decoration: none; }
.footer-col a:hover, .footer-formats:hover { color: #fff; text-decoration: underline; }
.footer-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3) var(--space-6); max-width: var(--frame); margin: var(--space-6) auto 0; padding-top: var(--space-4); border-top: 1px solid var(--line); }
.footer-note { color: var(--subtle); font: 500 var(--label)/1.5 var(--font-mono); letter-spacing: .06em; }
.footer-controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-5); }
.footer-formats { color: #a6c4ea; text-decoration: underline; text-decoration-color: #a6c4ea66; text-underline-offset: .25em; }
@media (max-width: 960px) { .footer-inner { grid-template-columns: repeat(3, minmax(0, 1fr)); } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 640px) { .footer-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); } .footer-contact { grid-column: 1 / -1; } }
@media (max-width: 540px) { .footer-inner { gap: var(--space-5); } .footer-bar { flex-direction: column; align-items: flex-start; } }

/* ------------------------------------------------------------------ Status messages */
.toast {
  position: fixed; left: 50%; bottom: var(--space-5); z-index: 30; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 2 * var(--gutter));
  padding: var(--space-3) var(--space-5); background: #0d2340f2; border: 1px solid var(--line-strong); color: var(--ink); font-size: .9375rem;
}
.notice { padding: var(--space-4) var(--space-5); background: #0d2340e6; border: 1px solid var(--line-strong); border-left: 2px solid var(--accent); color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
/* ------------------------------------------------------------------ Review round 1: alignment and compactness */
/* Header contents line up with the page frame on wide screens. */
.site-header { padding-inline: max(var(--gutter), calc((100% - var(--frame)) / 2)); }
.contact-layout { padding-top: var(--space-4); }
.hero-feature { align-items: start; }
.hero-feature .hero-visual { padding-top: var(--space-2); }
.eyebrow-meta { white-space: nowrap; }
@media (max-width: 860px) {
  .hero-feature { grid-template-columns: minmax(0, 1fr); }
}
/* On phones the decorative crystal lenses give way to the page's own content. */
@media (max-width: 720px) {
  .hero-page:not(.hero-feature) .hero-visual { display: none; }
}

@media print {
  #scene, .scene-backdrop, .vignette, .reading-shield, .reading-progress, .site-header, .site-footer, .skip-link, .toast { display: none !important; }
  html, body { background: #fff; color: #000; }
}

/* Review round 3: two-line service titles only matter in the multi-column grid; footer switch on the
   column edge; stacked hero actions share one width on phones. */
.site-footer .lang-switch li:first-child .lang-option { padding-left: 0; }
@media (max-width: 520px) { :is(.hero, .contact-form, .article-cta) .action-group > .action, .cta-band > .action { width: 100%; } }

/* Review round 4. */
/* Home service cards: subgrid rows line titles, text and links up across the row without reserving an empty line. */
@media (min-width: 901px) {
  #home-services .service-card { display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: var(--space-3); }
}
/* Home about strip: name and link on the left, the bio on the right, so the full-width panel is used. */
@media (min-width: 901px) {
  .about-strip > div { display: grid; grid-template-columns: minmax(14rem, 1fr) minmax(0, 2fr); column-gap: var(--space-7); align-items: start; }
  .about-strip h2 { grid-column: 1; grid-row: 1; }
  .about-strip .link-more { grid-column: 1; grid-row: 2; align-self: end; justify-self: start; }
  .about-strip p { grid-column: 2; grid-row: 1 / span 2; max-width: none; margin: 0; }
}
/* Contact: the two selects share a row on wide screens, so the send action stays above the fold. */
@media (min-width: 1101px) {
  .contact-form { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-4); }
  .contact-form > * { grid-column: 1 / -1; }
  .contact-form > .field:nth-of-type(2), .contact-form > .field:nth-of-type(3) { grid-column: auto; }
}
@media (max-width: 520px) {
  /* The featured article's meta takes its own line instead of pushing the page sideways. */
  .hero-feature .eyebrow { flex-wrap: wrap; row-gap: var(--space-2); }
  .hero-feature .eyebrow-meta { flex-basis: 100%; white-space: normal; }
  .hero-feature .eyebrow-meta::before { content: none; }
  .eyebrow { letter-spacing: .12em; text-wrap: balance; }
  /* About stats: one row per stat, number left and caption right. */
  .stat-strip { grid-template-columns: minmax(0, 1fr); }
  .stat-strip li, .stat-strip li:nth-child(n) { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-4) var(--space-5); border-left: 0; border-top: 1px solid var(--line); }
  .stat-strip li:first-child { border-top: 0; }
  .stat-strip strong { font-size: 2.25rem; }
}
/* The open phone menu dims the page behind it, so it reads as an overlay. */
@media (max-width: 860px) {
  .site-header[data-menu-open]::after { content: ''; position: fixed; inset: 0; z-index: -1; background: #050a17d9; }
}

/* Review round 5. */
/* The arrow is inline text, so the link has one underline instead of a second one under the arrow. */
.link-more { display: inline-block; }
.hero-feature { padding-bottom: var(--space-4); }
.hero-feature .hero-lead { max-width: 34rem; font-size: var(--step-0); }
.field-error:empty { display: none; }
@media (max-width: 860px) {
  .site-menu .lang-option { min-height: 2.75rem; min-width: 2.75rem; justify-content: center; font-size: .9375rem; }
}

/* Review round 6. */
/* Article cards in a row share rows for cover, meta, title and summary, so text starts at one height. */
@media (min-width: 901px) {
  .card-grid > .post-card { display: grid; grid-template-columns: minmax(0, 1fr); grid-row: span 4; grid-template-rows: subgrid; row-gap: 0; }
  .card-grid > .post-card > .post-card-cover { grid-row: 1; }
  .card-grid > .post-card > .post-card-body { grid-row: 2 / span 3; display: grid; grid-template-rows: subgrid; row-gap: var(--space-2); }
  .card-grid > .post-card .post-card-title { min-height: 0; }
  /* Publications and patents: both columns share row heights. */
  .record-list { grid-row: span 2; grid-template-rows: subgrid; }
}
/* The reading surface fills the view, so no band of bare scene shows above the footer. */
.view:not([hidden]) { display: flex; flex-direction: column; }
.view > .page-surface, .view > .block-slot > .page-surface { flex-grow: 1; }
/* A view's content arrives in one slot (index.html shell + /_f/ block): the slot takes the view's place as the flex column, and the menu's slot the menu's. */
.view > .block-slot { display: flex; flex-direction: column; flex-grow: 1; }
.site-menu > .block-slot { display: flex; flex-direction: inherit; align-items: inherit; gap: inherit; }
/* "Read next" keeps two aligned cards down to 641 px. */
@media (min-width: 641px) {
  .card-grid-2 > .post-card { display: grid; grid-template-columns: minmax(0, 1fr); grid-row: span 4; grid-template-rows: subgrid; row-gap: 0; }
  .card-grid-2 > .post-card > .post-card-cover { grid-row: 1; }
  .card-grid-2 > .post-card > .post-card-body { grid-row: 2 / span 3; display: grid; grid-template-rows: subgrid; row-gap: var(--space-2); }
  .card-grid-2 > .post-card .post-card-title { min-height: 0; }
}

/* Review round 7. */
/* In the flex-column view, children keep the full width; their own max-width and auto margins centre them on the frame. */
.view > *, .view > .block-slot > * { width: 100%; }
@media (min-width: 861px) and (max-height: 960px) {
  .hero-home { padding-bottom: var(--space-6); }
  .hero-home .hero-lead { max-width: 44rem; }
}
@media (max-width: 860px) {
  .site-menu .lang-switch li:first-child .lang-option { justify-content: flex-start; min-width: 0; padding-left: 0; padding-right: .8125rem; }
}
/* A single column has no row to align, so one-line titles reserve no second line. */
@media (max-width: 640px) { .post-card-title { min-height: 0; } }
@media (max-width: 520px) { .option-rate strong { font-size: 2.25rem; } }
@media (max-width: 380px) { .option-rate strong { font-size: 2rem; } }

/* Review round 8. */
@media (max-width: 520px) { .feature-title br { display: none; } .feature-title br + em::before { content: ' '; } }
/* Article call to action: stacked buttons share one width wherever they stack, and long labels balance. */
@media (max-width: 760px) { .article-cta .action-group > .action { width: 100%; } }
@media (max-width: 600px) { .article-cta .action { padding-inline: var(--space-4); text-wrap: balance; } .article-cta .action-group { display: grid; grid-auto-rows: 1fr; align-items: stretch; } .article-cta .action { align-items: center; justify-content: center; } }
/* Phones: the Articles hero is the newest article's title and summary; its cover would push the archive below the first screen. */
@media (max-width: 640px) { .hero-feature .hero-visual { display: none; } }

/* Review round 14. */
@media (max-width: 520px) {
  /* The Polish primary contact action stays on one line down to 360 px phones. */
  .contact-form, .contact-aside { padding: 1.25rem; }
  .contact-form .action-large { padding-inline: var(--space-4); }
  /* A section heading and its count stack the same way in every language. */
  .section-head-row { flex-direction: column; align-items: flex-start; gap: var(--space-2); }
}
/* The menu toggle keeps one width whether it reads MENU or ZAMKNIJ/CLOSE. */
@media (max-width: 860px) { .menu-toggle { min-width: 6.5rem; justify-content: center; } }
.stat-strip span, .service-card p, .guide-list p, .steps p, .skill-groups dd { text-wrap: balance; }
@media (max-width: 640px) { .about-strip p { text-wrap: balance; } }
@media (max-width: 400px) { .hero-home .eyebrow { letter-spacing: .04em; } }
/* Article call to action: buttons fill the card's row, so stacked or side by side they share the column. */
.article-cta .action-group > .action { flex: 1 1 auto; justify-content: center; }
/* Services: the detail panel keeps the height of its tallest service, so switching tabs does not move the page. */
@media (min-width: 861px) { .service-panel { min-height: 48rem; } }
@media (max-width: 340px) { .footer-inner { column-gap: var(--space-4); } }
/* 320–360 px phones: the CTA band and the Polish contact action stay on one line. */
@media (max-width: 360px) {
  .cta-band { padding-inline: var(--space-4); }
  .cta-band .action-large { padding-inline: var(--space-4); }
  .contact-form .action-large { font-size: .875rem; padding-inline: var(--space-3); }
}
/* Desktop contact: the direct channels sit at the bottom of the aside, level with the form actions. */
@media (min-width: 861px) { .contact-aside { grid-template-rows: auto 1fr auto auto; } .contact-aside .guide-list { align-self: start; gap: var(--space-5); } }

/* Laptop heights: the conversion pages and the archive keep their real content on the first screen. */
@media (min-width: 1000px) and (max-height: 820px) {
  .hero-page:not(.hero-feature) { padding-top: calc(var(--header-bottom, 72px) + var(--space-4)); padding-bottom: var(--space-3); }
  .hero-page:not(.hero-feature) .display { font-size: clamp(2.25rem, 7svh, 3rem); }
  .hero-page:not(.hero-feature) .hero-lead { margin-top: var(--space-3); }
  .journal-filterline { margin-bottom: var(--space-5); }
  .section-tight { padding-top: var(--space-5); }
  .hero-home .hero-lead { margin-top: var(--space-5); }
  .contact-form textarea { min-height: 0; height: 5.5rem; }
  .contact-layout { padding-top: var(--space-2); }
  .contact-form, .contact-aside { padding-block: var(--space-4); }
}
