/* CADROLL "Engineered Editorial" identity layer — typography, warm paper palette, engineering
   details and scroll-driven motion. Tokens come from cadroll-glass.css. See DESIGN.md §14. */

/* ---------- Self-hosted type (all SIL Open Font License) ---------- */
@font-face { font-family: "Space Grotesk"; src: url(/fonts/space-grotesk-var.woff2) format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Inter"; src: url(/fonts/inter-var.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url(/fonts/instrument-serif-italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url(/fonts/jetbrains-mono-var.woff2) format("woff2"); font-weight: 100 800; font-display: swap; }

html:root {
  --cr-font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --cr-font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --cr-font-accent: "Instrument Serif", Georgia, "Times New Roman", serif;
  --cr-font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  /* the old personal-use script font is replaced by the accent serif everywhere it was used */
  --font-eagle-horizon: var(--cr-font-accent);
  --font-display: var(--cr-font-accent);
  --font-montserrat: var(--cr-font-body);
  --font-sans: var(--cr-font-display);
  --cr-paper: #F6F2EA;
  --cr-ivory: #FFFDF8;
}

/* ---------- Typography ---------- */
body { font-family: var(--cr-font-body); font-feature-settings: "ss01", "cv11"; }
h1, h2, h3, h4, .h1, .h2, .h3, .h4,
[class*="h1_"], [class*="h2_"], [class*="h3_"], [class*="h4_"] {
  font-family: var(--cr-font-display);
  letter-spacing: -0.035em;
  font-weight: 600;
}
h3, [class*="h3_"], [class*="h4_"] { letter-spacing: -0.02em; }
/* accent words (were a script font): elegant italic serif in gold */
.section-title span, h2 span, h1 > span {
  font-family: var(--cr-font-accent) !important;
  font-style: italic;
  font-weight: 400 !important;
  letter-spacing: -0.01em;
}
.section-title span, h2 span { color: var(--cr-primary-deep); font-size: 1.08em; }
:is(.bg-primary, footer, [class*="bg-[#0"], [class*="bg-[#1"]) :is(.section-title span, h2 span) { color: var(--cr-primary); }
section.min-h-\[90vh\] h1 > span { font-size: 1.08em; letter-spacing: -0.005em; padding-right: .06em; }

/* section labels → numbered technical labels: "01 — BRAND STATEMENT" */
main { counter-reset: cr-section; overflow-x: clip; } /* slide-in reveals never cause sideways scrolling on phones */
main span.uppercase.text-sm.block {
  font-family: var(--cr-font-mono);
  font-size: 12px; font-weight: 500;
  letter-spacing: .16em;
  display: inline-flex !important; align-items: center; gap: 12px;
}
main span.uppercase.text-sm.block::before {
  counter-increment: cr-section;
  content: counter(cr-section, decimal-leading-zero);
  color: inherit; opacity: .7;
}
main span.uppercase.text-sm.block::after {
  content: ""; order: -1; display: none;
}
main span.uppercase.text-sm.block::before { padding-right: 12px; border-right: 1px solid currentColor; }

/* nav + buttons: crisp grotesk labels */
header nav > a, .group.inline-flex.justify-center.font-medium, #cr-agent-fab, .cr-btn { font-family: var(--cr-font-display); letter-spacing: .08em; }
/* buttons get a direction arrow that nudges on hover */
.group.inline-flex.justify-center.font-medium > span.relative::after {
  content: "\2192"; content: "\2192" / "";
  display: inline-block; margin-left: .7em;
  transition: translate var(--spring-select-ms) var(--spring-select);
}
.group.inline-flex.justify-center.font-medium:hover > span.relative::after { translate: 4px 0; }

/* ---------- Warm paper palette for light sections ---------- */
main .bg-white, main .bg-light, main [class*="bg-[#F8FAFC]"] { background-color: var(--cr-ivory); }
main section.bg-white, main section.bg-light, main > section:not(.bg-primary):not([class*="bg-[#0"]) { background-color: var(--cr-paper); }

/* Spacing between sections is padding inside them, never empty margins (which showed plain white). */
body { background-color: var(--cr-paper); }
main > section.mt-32 { margin-top: 0; }
main > section.mt-32:not(.py-20) { padding-block: clamp(72px, 9vw, 128px); }
/* "Proudly supported by" partner band: its own framed ivory strip */
main > section.mt-32.py-20 {
  padding-block: clamp(56px, 6vw, 88px);
  background-color: var(--cr-ivory) !important;
  border-top: 1px solid #E7DFCF;
  background-image:
    linear-gradient(rgb(var(--cr-surface-rgb) / .045) 1px, transparent 1px),
    linear-gradient(90deg, rgb(var(--cr-surface-rgb) / .045) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* ---------- Sharper, engineered card geometry ---------- */
main .rounded-4xl { border-radius: 18px; }
main .rounded-3xl { border-radius: 16px; }
main .rounded-2xl { border-radius: 14px; }
main .rounded-xl { border-radius: 12px; }

/* ---------- CAD crop marks on photos ---------- */
main :is(.rounded-4xl, .rounded-3xl, .rounded-2xl, .rounded-xl).overflow-hidden:has(> img, > span > img) { isolation: isolate; }
main :is(.rounded-4xl, .rounded-3xl, .rounded-2xl, .rounded-xl).overflow-hidden:has(> img, > span > img)::after {
  --m: 14px; --l: 18px; --c: rgb(var(--cr-primary-rgb) / .95);
  content: ""; position: absolute; inset: var(--m); z-index: 2; pointer-events: none;
  background:
    linear-gradient(var(--c), var(--c)) top left / var(--l) 1.5px no-repeat,
    linear-gradient(var(--c), var(--c)) top left / 1.5px var(--l) no-repeat,
    linear-gradient(var(--c), var(--c)) top right / var(--l) 1.5px no-repeat,
    linear-gradient(var(--c), var(--c)) top right / 1.5px var(--l) no-repeat,
    linear-gradient(var(--c), var(--c)) bottom left / var(--l) 1.5px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom left / 1.5px var(--l) no-repeat,
    linear-gradient(var(--c), var(--c)) bottom right / var(--l) 1.5px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom right / 1.5px var(--l) no-repeat;
  opacity: .0;
  transition: opacity var(--dur-medium) var(--ease-emphasized), inset var(--spring-morph-ms) var(--spring-morph);
}
main :is(.rounded-4xl, .rounded-3xl, .rounded-2xl, .rounded-xl).overflow-hidden:has(> img, > span > img):hover::after { opacity: 1; inset: 10px; }

/* ---------- Footer: outlined wordmark ---------- */
footer .text-\[16vw\] { font-family: var(--cr-font-display); letter-spacing: -0.04em; font-weight: 600; }
footer .text-\[16vw\] span {
  color: transparent !important;
  -webkit-text-stroke: 1px rgb(var(--cr-primary-rgb) / .32);
  transition: -webkit-text-stroke-color var(--dur-medium) ease;
}
footer .text-\[16vw\] span:hover { -webkit-text-stroke-color: rgb(var(--cr-primary-rgb) / .9); }

/* ---------- Film grain (tactile texture) ---------- */
body::after {
  content: ""; position: fixed; inset: -50%; z-index: 45; pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: .07; mix-blend-mode: overlay;
}

/* ---------- Scroll progress line ---------- */
#cr-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 55; pointer-events: none;
  background: linear-gradient(90deg, #C9973F, var(--cr-primary), #F6DCA2);
  transform-origin: 0 50%; scale: var(--cr-progress, 0) 1;
}

/* ---------- Services ticker band ---------- */
.cr-marquee {
  position: relative; overflow: hidden; background: var(--cr-surface);
  border-block: 1px solid rgb(var(--cr-primary-rgb) / .18);
  padding: 22px 0; --cr-gap: 48px;
  -webkit-mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.cr-marquee__track { display: flex; width: max-content; gap: var(--cr-gap); animation: cr-marquee 48s linear infinite; }
.cr-marquee:hover .cr-marquee__track { animation-play-state: paused; }
.cr-marquee__item {
  display: inline-flex; align-items: center; gap: var(--cr-gap);
  font-family: var(--cr-font-display); font-weight: 600; letter-spacing: -0.03em;
  font-size: clamp(28px, 4.2vw, 56px); line-height: 1; white-space: nowrap; color: var(--cr-on-surface);
}
.cr-marquee__item:nth-child(even) { color: transparent; -webkit-text-stroke: 1px rgb(var(--cr-on-surface-rgb) / .55); }
.cr-marquee__item i { font-family: var(--cr-font-accent); font-weight: 400; color: var(--cr-primary); font-size: .9em; }
.cr-marquee__item::after { content: ""; width: 10px; height: 10px; rotate: 45deg; background: var(--cr-primary); flex: none; }
@keyframes cr-marquee { to { translate: -50% 0; } }

/* ---------- Hero video: full colour (the old site blended it to monochrome), poster while loading ---------- */
section.min-h-\[90vh\] > .absolute.inset-0.z-0 { background: var(--cr-surface) url(/media/hero-poster.jpg) center / cover no-repeat; }
section.min-h-\[90vh\] video { mix-blend-mode: normal; opacity: 1; filter: saturate(1.06) contrast(1.04); }
@media (prefers-reduced-motion: reduce) { section.min-h-\[90vh\] video { display: none; } } /* still poster instead */
html[data-motion="reduce"] section.min-h-\[90vh\] video { display: none; }

/* ---------- Hero spec card (content: tonal, not glass) ---------- */
.cr-spec {
  position: absolute; right: clamp(24px, 5vw, 80px); bottom: clamp(96px, 14vh, 150px); z-index: 20;
  width: 300px; padding: 20px 22px;
  border-radius: 18px;
  background: rgb(var(--cr-surface-rgb) / .72);
  box-shadow: inset 0 0 0 1px rgb(var(--cr-primary-rgb) / .25), 0 20px 50px rgb(0 0 0 / .35);
  color: var(--cr-on-surface);
  animation: cr-spec-in 900ms var(--ease-emphasized) 600ms both;
}
.cr-spec__label { white-space: nowrap; font-family: var(--cr-font-mono); font-size: 11px; letter-spacing: .14em; color: var(--cr-primary); display: flex; align-items: center; gap: 8px; margin: 0 0 14px; text-transform: uppercase; }
.cr-spec__label::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #3DD68C; box-shadow: 0 0 0 3px rgb(61 214 140 / .2); }
.cr-spec ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: cr-spec; }
.cr-spec li { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: baseline; font-size: 14px; line-height: 1.4; color: var(--cr-on-surface-variant); counter-increment: cr-spec; }
.cr-spec li::before { content: counter(cr-spec, decimal-leading-zero); font-family: var(--cr-font-mono); font-size: 12px; color: var(--cr-primary); }
.cr-spec li strong { color: var(--cr-on-surface); font-weight: 600; }
@keyframes cr-spec-in { from { opacity: 0; translate: 0 16px; } to { opacity: 1; translate: 0 0; } }
@media (max-width: 1100px) { .cr-spec { display: none; } }

/* ---------- Scroll-driven motion (where supported) ---------- */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    /* photos drift and settle as they pass through the viewport (parallax zoom) */
    main :is(.rounded-4xl, .rounded-3xl, .rounded-2xl, .rounded-xl).overflow-hidden > img,
    main :is(.rounded-4xl, .rounded-3xl, .rounded-2xl, .rounded-xl).overflow-hidden > span > img {
      animation: cr-parallax linear both;
      animation-timeline: view();
      animation-range: entry 0% exit 100%;
    }
    @keyframes cr-parallax { from { transform: scale(1.14) translateY(-3%); } to { transform: scale(1.04) translateY(3%); } }
    /* kinetic headings: tracking tightens and focus sharpens as they enter */
    main h2 {
      animation: cr-kinetic linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 80%;
    }
    @keyframes cr-kinetic { from { letter-spacing: .02em; filter: blur(5px); opacity: .25; } to { letter-spacing: -0.035em; filter: blur(0); opacity: 1; } }
    /* progress line follows the page scroll without JavaScript */
    #cr-progress { animation: cr-progress linear both; animation-timeline: scroll(root); }
    @keyframes cr-progress { from { scale: 0 1; } to { scale: 1 1; } }
  }
}

/* ---------- Accessibility modes ---------- */
@media (prefers-reduced-motion: reduce) {
  .cr-marquee__track { animation: none; }
  .cr-spec { animation: none; }
}
html[data-motion="reduce"] .cr-marquee__track,
html[data-motion="reduce"] .cr-spec,
html[data-motion="reduce"] main h2,
html[data-motion="reduce"] main img { animation: none !important; }
@media (prefers-reduced-transparency: reduce) { body::after { display: none; } }
html[data-glass="off"] body::after { display: none; }
@media (prefers-contrast: more) {
  body::after { display: none; }
  .section-title span, h2 span { color: #7A5418; }
  footer .text-\[16vw\] span { -webkit-text-stroke-color: rgb(var(--cr-primary-rgb) / .7); }
}
html[data-contrast="more"] body::after { display: none; }
@media (forced-colors: active) { body::after, #cr-progress { display: none; } }
@media print { body::after, #cr-progress, .cr-marquee { display: none !important; } }
