/* Design presets. Colours and fonts come from theme.css; this file holds the layout and
   shape traits that tools/designs.py writes onto <html> as data-* attributes. */

/* ---- Regions that use page colours instead of the dark band ------------------------ */
html[data-light~="header"] .site-header.band,
html[data-light~="hero"] .hero.band:not(.hero--media),
html[data-light~="hero"] .facts-band,
html[data-light~="footer"] .site-footer.band,
html[data-light~="cta"] .cta.band:not(.hero--media) {
  --paper: inherit; --surface: inherit; --ink: inherit; --muted: inherit; --line: inherit;
  --accent-ink: inherit; --signal: inherit; --logo-filter: inherit;
  background: var(--paper);
}
html[data-light~="header"] .site-header.band { background: color-mix(in srgb, var(--surface) var(--hdr-alpha), transparent); }
html[data-light~="header"] .site-header.band.is-scrolled { background: color-mix(in srgb, var(--surface) var(--hdr-alpha-scrolled), transparent); }
/* A light header over a photo or video hero switches to light text until the page scrolls */
html[data-light~="header"]:has(main > .hero--media:first-child, .slide.is-active.slide--media) .site-header.band:not(.is-scrolled) {
  --paper: var(--band); --surface: var(--band-surface); --ink: var(--band-ink); --muted: var(--band-muted);
  --line: var(--band-line); --accent-ink: var(--band-accent); background: color-mix(in srgb, var(--band) var(--hdr-alpha), transparent);
}
html[data-light~="hero"] .hero.band:not(.hero--media) { border-bottom: 1px solid var(--line); }
html[data-light~="hero"] .facts-band { border-bottom: 1px solid var(--line); }
html[data-light~="hero"] .hero--slider { border-bottom: 0; }

/* ---- Hero texture ------------------------------------------------------------------ */
html[data-texture="none"] .hero::before { display: none; }
html[data-texture="dots"] .hero::before {
  background-image: radial-gradient(var(--line) 1.4px, transparent 1.6px); background-size: 22px 22px; opacity: 0.7;
}
html[data-texture="lines"] .hero::before {
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px),
    linear-gradient(color-mix(in srgb, var(--line) 45%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--line) 45%, transparent) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px; opacity: 0.6;
  -webkit-mask-image: none; mask-image: none;
}
html[data-texture="scan"] .hero::before {
  background-image: repeating-linear-gradient(0deg, color-mix(in srgb, var(--accent) 9%, transparent) 0 1px, transparent 1px 4px);
  background-size: auto; opacity: 1;
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 0%, transparent 80%); mask-image: radial-gradient(ellipse at 50% 40%, #000 0%, transparent 80%);
}
html[data-texture="streaks"] .hero::before {
  background-image:
    linear-gradient(118deg, transparent 38%, color-mix(in srgb, var(--accent) 22%, transparent) 46%, transparent 54%),
    linear-gradient(112deg, transparent 58%, color-mix(in srgb, var(--accent) 12%, transparent) 63%, transparent 68%),
    radial-gradient(circle at 82% 18%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 42%);
  background-size: auto; opacity: 1; -webkit-mask-image: none; mask-image: none;
}
html[data-texture="contours"] .hero::before {
  background-image: repeating-radial-gradient(ellipse 120% 70% at 70% 125%, transparent 0 26px, var(--line) 26px 27px);
  background-size: auto; opacity: 0.75;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 60%); mask-image: linear-gradient(180deg, transparent, #000 60%);
}
html[data-texture]:not([data-texture="none"]) .banner::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0.25;
  background-image: radial-gradient(var(--line) 1.2px, transparent 1.4px); background-size: 20px 20px;
}

/* ---- Hero layout ------------------------------------------------------------------- */
html[data-hero="center"] .hero-grid { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
html[data-hero="center"] .hero-copy { justify-items: center; max-width: 880px; }
html[data-hero="center"] .hero--plain .hero-copy { margin-inline: auto; text-align: center; }
html[data-hero="center"] .hero-copy .lead { margin-inline: auto; }
html[data-hero="center"] .hero-copy .btn-row, html[data-hero="center"] .crumbs { justify-content: center; }
html[data-hero="center"] .hero-grid > .terminal, html[data-hero="center"] .hero-grid > .diagram { width: min(100%, 680px); text-align: left; }
html[data-hero="center"] .slider-ui-row { justify-content: center; }
html[data-hero="center"] .hero--slider .hero-grid > .terminal,
html[data-hero="center"] .hero--slider .hero-grid > .diagram { display: none; }

html[data-hero="type"] .hero-grid { grid-template-columns: minmax(0, 1fr); }
html[data-hero="type"] .hero-grid > .terminal, html[data-hero="type"] .hero-grid > .diagram { display: none; }
html[data-hero="type"] .hero-copy { max-width: 1040px; }
html[data-hero="type"] .hero h1, html[data-hero="type"] .slide .display { font-size: clamp(2.6rem, 7.6vw, 6.2rem); line-height: 0.98; }

/* ---- Cards ------------------------------------------------------------------------- */
html[data-cards="raised"] .card { border-color: transparent; box-shadow: 0 1px 2px color-mix(in srgb, var(--ink) 7%, transparent), 0 14px 34px -14px color-mix(in srgb, var(--ink) 26%, transparent); }
html[data-cards="raised"] .svc:hover { box-shadow: 0 2px 4px color-mix(in srgb, var(--ink) 8%, transparent), 0 22px 44px -16px color-mix(in srgb, var(--ink) 34%, transparent); }
html[data-cards="filled"] .card { background: color-mix(in srgb, var(--accent) 7%, var(--surface)); border-color: transparent; }
html[data-cards="filled"] .section--surface .card { background: color-mix(in srgb, var(--accent) 6%, var(--paper)); }
html[data-cards="ticked"] .card { position: relative; overflow: visible; }
html[data-cards="ticked"] .card::before, html[data-cards="ticked"] .card::after { content: ""; position: absolute; width: 14px; height: 14px; z-index: 2; pointer-events: none; }
html[data-cards="ticked"] .card::before { top: -1px; left: -1px; border-top: 2px solid var(--signal); border-left: 2px solid var(--signal); }
html[data-cards="ticked"] .card::after { bottom: -1px; right: -1px; border-bottom: 2px solid var(--signal); border-right: 2px solid var(--signal); }
html[data-cards="ticked"] .svc .ph { overflow: hidden; }
html[data-cards="ruled"] .card { background: transparent; border: 0; border-top: 1px solid var(--ink); border-radius: 0; padding-inline: 0; }
html[data-cards="ruled"] .svc { padding: 0; }
html[data-cards="ruled"] .svc .ph { border-radius: var(--radius); margin-top: 18px; }
html[data-cards="ruled"] .svc-body { padding-inline: 0; }
html[data-cards="ruled"] .svc:hover { transform: none; }
html[data-cards="hard"] .card { border: 2px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); }
html[data-cards="hard"] .svc:hover { transform: translate(-3px, -3px); box-shadow: 9px 9px 0 var(--accent); border-color: var(--ink); }
html[data-cards="hard"] .svc-icon { border: 2px solid var(--ink); box-shadow: none; }

/* ---- Buttons ----------------------------------------------------------------------- */
html[data-buttons="soft"] .btn, html[data-buttons="soft"] .slider-btn { border-radius: var(--radius); }
html[data-buttons="hard"] .btn { border: 2px solid var(--ink); border-radius: 0; box-shadow: 4px 4px 0 var(--ink); }
html[data-buttons="hard"] .btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
html[data-buttons="hard"] .slider-btn { border-radius: 0; border-width: 2px; }
html[data-arrows="off"] .arrow { display: none; }

/* ---- Small labels ------------------------------------------------------------------ */
html:not([data-eyebrow="mono"]) :is(.eyebrow, .footer-grid h2, .contact-list h3, .prevnext small, .timeline time) {
  font-family: var(--font-body); text-transform: none; letter-spacing: 0; font-size: 0.95rem; font-weight: 600;
}
html[data-eyebrow="rule"] .eyebrow { display: flex; align-items: center; gap: 12px; color: var(--ink); }
html[data-eyebrow="rule"] .eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--accent); flex: none; }
html[data-hero="center"] .hero-copy .eyebrow { justify-content: center; }

/* ---- Heading case ------------------------------------------------------------------ */
html[data-case="upper"] :is(h1, h2, h3, .slide .display, .facts b, .logo-word) { text-transform: uppercase; }
html[data-case="upper"] h3 { letter-spacing: 0.01em; }

/* Lambda: a DWDM spectrum along the bottom of the hero */
html[data-texture="spectrum"] .hero::before {
  background-image: repeating-linear-gradient(90deg, transparent 0 22px, color-mix(in srgb, var(--line) 70%, transparent) 22px 23px);
  background-size: auto; opacity: 0.6; -webkit-mask-image: linear-gradient(0deg, #000, transparent 70%); mask-image: linear-gradient(0deg, #000, transparent 70%);
}
html[data-design^="lambda"] .facts-band, html[data-design^="lambda"] main > .hero:first-child:not(.hero--slider) {
  border-bottom: 3px solid transparent;
  border-image: linear-gradient(90deg, #ff3b30, #ff9500, #ffd60a, #34c759, #00c7be, #0a84ff, #5e5ce6, #bf5af2) 1;
}
html[data-design^="lambda"] .facts b { color: var(--band-accent); }

/* ---- Background pattern on every section (site setting) ------------------------------ */
html { --pat-a: 30%; }
html[data-strength="medium"] { --pat-a: 55%; }
html[data-strength="strong"] { --pat-a: 85%; }
html:not([data-sections="none"]) :is(.section, .cta, .site-footer, .map-band) { position: relative; isolation: isolate; overflow: hidden; }
html:not([data-sections="none"]) :is(.section, .cta, .site-footer, .map-band)::before {
  content: ""; position: absolute; inset: -112px; z-index: -1; pointer-events: none; background-position: center;
}
html[data-sections="grid"] :is(.section, .cta, .site-footer, .map-band)::before {
  background-image:
    linear-gradient(color-mix(in srgb, var(--line) var(--pat-a), transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--line) var(--pat-a), transparent) 1px, transparent 1px);
  background-size: 56px 56px;
}
html[data-sections="dots"] :is(.section, .cta, .site-footer, .map-band)::before {
  background-image: radial-gradient(color-mix(in srgb, var(--line) calc(var(--pat-a) + 20%), transparent) 1.3px, transparent 1.5px);
  background-size: 22px 22px;
}

/* Grid motion: each section's pattern drifts, breathes or recedes on its own slow cycle.
   Transforms only, so it stays cheap; switched off for reduced motion and by the "motion" setting. */
@keyframes g-pan-x { from { transform: translate3d(-28px, 0, 0); } to { transform: translate3d(28px, 0, 0); } }
@keyframes g-pan-y { from { transform: translate3d(0, -28px, 0); } to { transform: translate3d(0, 28px, 0); } }
@keyframes g-drift { from { transform: translate3d(-24px, -24px, 0); } to { transform: translate3d(24px, 24px, 0); } }
@keyframes g-drift-up { from { transform: translate3d(-20px, 22px, 0); } to { transform: translate3d(22px, -20px, 0); } }
@keyframes g-breathe { from { transform: scale(1); } to { transform: scale(1.14); } }
@keyframes g-recede { from { transform: scale(1.12) translate3d(10px, 0, 0); } to { transform: scale(0.96) translate3d(-10px, 0, 0); } }
html[data-motion="on"] :is(.section, .cta, .site-footer, .map-band)::before { animation: g-pan-x calc(28s / var(--grid-speed, 1)) ease-in-out infinite alternate; will-change: transform; }
html[data-motion="on"] main > section:nth-of-type(6n+1)::before { animation-name: g-drift; animation-duration: calc(34s / var(--grid-speed, 1)); }
html[data-motion="on"] main > section:nth-of-type(6n+2)::before { animation-name: g-breathe; animation-duration: calc(24s / var(--grid-speed, 1)); }
html[data-motion="on"] main > section:nth-of-type(6n+3)::before { animation-name: g-pan-y; animation-duration: calc(30s / var(--grid-speed, 1)); }
html[data-motion="on"] main > section:nth-of-type(6n+4)::before { animation-name: g-recede; animation-duration: calc(36s / var(--grid-speed, 1)); }
html[data-motion="on"] main > section:nth-of-type(6n+5)::before { animation-name: g-drift-up; animation-duration: calc(32s / var(--grid-speed, 1)); }
html[data-motion="on"] main > section:nth-of-type(6n)::before { animation-name: g-pan-x; animation-duration: calc(26s / var(--grid-speed, 1)); }
html[data-motion="on"] .site-footer::before { animation-name: g-breathe; animation-duration: calc(40s / var(--grid-speed, 1)); animation-direction: alternate-reverse; }
html[data-motion="on"] .hero:not(.hero--media)::before { inset: -64px; animation: g-drift calc(38s / var(--grid-speed, 1)) ease-in-out infinite alternate; will-change: transform; }
html[data-motion="on"] .hero--slider::before { animation-name: g-breathe; animation-duration: calc(30s / var(--grid-speed, 1)); }
html[data-strength="faint"]:not([data-texture="none"]) .hero::before { opacity: 0.5; }
html[data-strength="strong"]:not([data-texture="none"]) .hero::before { opacity: 0.9; }

html[data-light~="hero"] .hero--slider .slide:not(.slide--media) .slider-btn,
html[data-light~="hero"] .hero--slider .slider-btn { background: var(--surface); }
