/*! BOMEX GROUP — design tokens, reset and base typography.
    Palette "Gips · Hrast · Grafit": the logo is monochrome, the slate and glass
    come from the layout reference, the oak warmth from the joinery workshop. */

/* ============================================================== 1. TOKENS */
:root {
  /* ink */
  --graphite-900: #1B1B1B;
  --graphite-800: #262626;

  /* slate */
  --slate-700: #4E5960;
  --slate-600: #6A767E;
  --slate-500: #7B8890;
  --slate-300: #A0A6A9;

  /* warmth */
  --stone-300: #B1ABA0;
  --oak-500: #8F7462;
  --oak-400: #9C8071;

  /* light */
  --mist-100: #E7E8EA;
  --gypsum-50: #F2F5F6;
  --white: #FFFFFF;

  /* glass */
  --glass-bg: rgba(255, 255, 255, .14);
  --glass-bg-strong: rgba(242, 245, 246, .78);
  --glass-border: rgba(255, 255, 255, .28);
  --glass-blur: 18px;
  --hairline: rgba(255, 255, 255, .22);

  /* scrims */
  --scrim-top: linear-gradient(180deg, rgba(20, 24, 27, .55), transparent 38%);
  --scrim-bottom: linear-gradient(0deg, rgba(20, 24, 27, .62), transparent 45%);

  /* radii */
  --r-xs: 10px;
  --r-sm: 14px;
  --r-md: 20px;
  --r-lg: 28px;
  --r-pill: 999px;

  /* motion */
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-inout: cubic-bezier(.65, 0, .35, 1);
  --dur-1: 180ms;
  --dur-2: 420ms;
  --dur-3: 900ms;

  /* type */
  --ff-display: "Outfit", "Segoe UI", system-ui, -apple-system, sans-serif;
  --ff-text: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --ff-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  /* §2 hero scale. Inner page heroes use --fs-h1 so 8.4rem does not land on a
     15-page set of one-line titles. */
  --fs-display: clamp(3.2rem, 1.2rem + 7.2vw, 8.4rem);
  --fs-h1: clamp(2.5rem, 1.1rem + 5.4vw, 5.6rem);
  --fs-h2: clamp(1.75rem, 1rem + 2.7vw, 3.25rem);
  --fs-h3: clamp(1.25rem, .95rem + 1.1vw, 1.75rem);
  --fs-lead: clamp(1rem, .95rem + .35vw, 1.1875rem);
  --fs-body: 1rem;
  --fs-sm: .875rem;
  --fs-xs: .8125rem;
  --fs-micro: .6875rem;

  /* rhythm */
  --pad-x: clamp(1rem, .4rem + 2.6vw, 3.5rem);
  /* §5.2 section rhythm. This is the gap BETWEEN two sections; .sect applies
     half of it top and bottom so two neighbours add up to exactly this figure
     rather than double it. Stacking the full value twice opened a 260px band
     of bare slate at 1440 — the §4 empty-band scanner flags anything ≥ 25vh. */
  --sec-y: clamp(72px, 9vw, 140px);
  --card-inset: 10px;
  --gap: clamp(.875rem, .6rem + .8vw, 1rem);

  /* chrome */
  --tabbar-h: 62px;
  --fab-size: 56px;
  --fab-bottom: 24px;
  --fab-side: 24px;
  /* one bar, two heights: 72px floating over the hero, 60px once it is glass */
  --nav-h: 72px;
  --nav-h-stuck: 60px;

  --shadow-card: 0 18px 50px -24px rgba(16, 20, 23, .55);
  --shadow-pop: 0 28px 70px -28px rgba(16, 20, 23, .7);
}

@media (max-width: 1023px) {
  :root {
    --card-inset: 8px;
    --fab-side: 18px;
    /* AI assistant (left) and back-to-top (right) share this exact value,
       so their bottom edges always land on one line above the tab bar. */
    --fab-bottom: calc(var(--tabbar-h) + 14px + env(safe-area-inset-bottom, 0px));
  }
}

/* ======================================================== 2. RESET / BASE */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* the fixed nav must not cover anchor targets */
  scroll-padding-top: calc(var(--nav-h-stuck) + 26px);
}

body {
  margin: 0;
  font-family: var(--ff-text);
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--gypsum-50);
  background-color: var(--slate-500);
  /* the reference board's faint upper-centre light */
  background-image: radial-gradient(120% 70% at 50% -10%,
      rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 62%);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (max-width: 1023px) {
  body { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); }
}

/* §5.4 ambient light: one large blurred radial that drifts with scroll
   position at low strength. It is a fixed, pointer-transparent layer behind
   everything, so it costs one composited paint and never moves layout. */
.js body::before {
  content: ""; position: fixed; inset: -20vh -10vw; z-index: -1;
  pointer-events: none;
  background: radial-gradient(48vw 42vh at var(--amb-x, 50%) var(--amb-y, 30%),
      rgba(255, 255, 255, .2), rgba(255, 255, 255, 0) 70%);
  transition: opacity var(--dur-3) var(--ease-out);
}
@media (prefers-reduced-motion: reduce) { .js body::before { display: none; } }

img, picture, svg, video, canvas { display: block; max-width: 100%; }
/* No placeholder background here: the logo PNGs are transparent and would show
   a grey plate. Photo containers carry their own background instead. */
img { height: auto; border-style: none; }

/* <picture> is an inline wrapper with automatic height, so an <img> inside it
   set to height:100% has no resolved height to work against and collapses to
   its intrinsic size. Any picture used as a *fill* image must therefore cover
   its box itself. Containers listed here are all position:relative or absolute
   with a definite height (aspect-ratio, min-height, or inset:0). */
.fill-pic,
picture.bg,
.hero-slide picture,
.pagehero__bg picture,
.card__media picture,
.tile--photo picture,
.mockup__shot picture,
.cert__shot picture,
.gallery picture,
.archive picture { position: absolute; inset: 0; display: block; z-index: 0; }

.fill-pic > img,
picture.bg > img,
.hero-slide picture > img,
.pagehero__bg picture > img,
.card__media picture > img,
.tile--photo picture > img,
.mockup__shot picture > img,
.cert__shot picture > img,
.gallery picture > img,
.archive picture > img { width: 100%; height: 100%; object-fit: cover; }

/* certificates are documents: show the whole page, never crop it */
.cert__shot picture > img { object-fit: contain; }
svg { fill: currentColor; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
  margin: 0;
}
button { background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }

h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
table { border-collapse: collapse; width: 100%; }

/* ============================================================== 3. TYPE */
h1, h2, h3, .display {
  font-family: var(--ff-display);
  font-weight: 300;
  letter-spacing: -.01em;
  line-height: .98;
  text-transform: uppercase;
  text-wrap: balance;
}
h1, .h1 { font-size: var(--fs-h1); font-weight: 200; }
.display { font-size: var(--fs-display); font-weight: 200; }
/* §5.1 one H2 treatment everywhere: uppercase Outfit 300, .03em tracking */
h2, .h2 { font-size: var(--fs-h2); letter-spacing: .03em; }
/* mono index above a section heading — only where the content is a real
   sequence is it numbered; elsewhere it names the section. */
.sect__idx {
  display: block; font-family: var(--ff-mono); font-weight: 500;
  font-size: var(--fs-micro); letter-spacing: .1em; text-transform: uppercase;
  color: rgba(242, 245, 246, .72); margin-bottom: .875rem;
}
.on-slate .sect__idx, .sect__head--light .sect__idx { color: rgba(27, 27, 27, .6); }
h3, .h3 { font-size: var(--fs-h3); line-height: 1.08; letter-spacing: 0; }

p { text-wrap: pretty; }
.lead { font-size: var(--fs-lead); line-height: 1.55; }
.prose p + p { margin-top: 1.1em; }
.prose { max-width: 68ch; }

/* micro label — the reference's "ORIZON DESIGN" / "BEST SHOTS" */
.micro {
  font-family: var(--ff-text);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  line-height: 1.2;
}
.mono {
  font-family: var(--ff-mono);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}
.idx { font-family: var(--ff-mono); font-weight: 500; font-size: var(--fs-xs); opacity: .72; }

/* ==================================================== 4. COLOUR CONTRACT */
/* WCAG 2.2 AA: white body text is never placed directly on --slate-500 (3.5:1).
   Small text lives on a light card in graphite, on slate-700/graphite in white,
   or over a photo that carries one of the scrims. */
.on-light { color: var(--graphite-900); }
.on-light .muted { color: var(--slate-700); }
.on-dark { color: var(--gypsum-50); }
.on-dark .muted { color: rgba(242, 245, 246, .82); }

/* Body copy sitting straight on the slate page gets a darker ink for contrast. */
.on-slate { color: var(--graphite-900); }
.on-slate .muted { color: var(--graphite-800); }

/* ============================================================= 5. GLASS */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  backdrop-filter: blur(var(--glass-blur)) saturate(140%);
}
.glass-strong {
  background: var(--glass-bg-strong);
  border: 1px solid rgba(255, 255, 255, .5);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  color: var(--graphite-900);
}
.glass-dark {
  background: rgba(27, 27, 27, .62);
  border: 1px solid rgba(255, 255, 255, .16);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  backdrop-filter: blur(var(--glass-blur)) saturate(140%);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: rgba(78, 89, 96, .86); }
  .glass-strong { background: rgba(242, 245, 246, .96); }
  .glass-dark { background: rgba(27, 27, 27, .9); }
}

/* ========================================================== 6. UTILITIES */
.wrap { width: 100%; max-width: 1560px; margin-inline: auto; padding-inline: var(--pad-x); }
.stack > * + * { margin-top: var(--flow, 1rem); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden; white-space: nowrap;
  clip: rect(0 0 0 0); clip-path: inset(50%); border: 0;
}
[hidden] { display: none !important; }

.skip-link {
  position: fixed; top: 0; left: 0; z-index: 2000;
  transform: translateY(-120%);
  background: var(--gypsum-50); color: var(--graphite-900);
  padding: .75rem 1.25rem; border-radius: 0 0 var(--r-sm) 0;
  font-weight: 600;
}
.skip-link:focus { transform: translateY(0); }

/* focus — visible on both light and dark surfaces */
:focus-visible {
  outline: 2px solid var(--gypsum-50);
  outline-offset: 3px;
  border-radius: 4px;
}
.on-light :focus-visible, .glass-strong :focus-visible { outline-color: var(--graphite-900); }

::selection { background: var(--oak-500); color: var(--white); }

/* ====================================================== 7. REVEAL SYSTEM */
/* Content is visible by default. Only when JS confirms support (html.js) and
   motion is allowed do elements start hidden and animate in. */
.js [data-reveal] { will-change: opacity, transform; }
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] { opacity: 0; transition:
      opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out); }
  .js [data-reveal="up"]    { transform: translate3d(0, 22px, 0); }
  .js [data-reveal="fade"]  { transform: none; }
  .js [data-reveal="scale"] { transform: scale(.965); }
  .js [data-reveal="clip"]  { clip-path: inset(0 100% 0 0); opacity: 1;
                              transition: clip-path var(--dur-3) var(--ease-out); }
  .js [data-reveal].is-in { opacity: 1; transform: none; clip-path: inset(0 0 0 0); }
  .js [data-reveal-stagger] > * {
    opacity: 0; transform: translate3d(0, 18px, 0);
    transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out);
    transition-delay: var(--d, 0ms);
  }
  .js [data-reveal-stagger].is-in > * { opacity: 1; transform: none; }
}

/* masked line-by-line headline reveal */
.line-mask { display: block; overflow: hidden; }
.line-mask > span { display: block; }
@media (prefers-reduced-motion: no-preference) {
  .js .line-mask > span {
    transform: translate3d(0, 105%, 0);
    transition: transform var(--dur-3) var(--ease-out);
    transition-delay: var(--d, 0ms);
  }
  .js .is-in .line-mask > span, .js .line-mask.is-in > span { transform: none; }
}

/* Safety nets. The .js class is set by a tiny inline script in <head>, so if
   app.js later fails to load or throws, the hidden-until-revealed states above
   would strand content off-screen. These late, forwards-filling animations put
   every such element into its final state regardless. They end on exactly the
   value the JS path produces, so when JS does work they change nothing. */
@media (prefers-reduced-motion: no-preference) {
  .js .line-mask > span { animation: safety-lines 1ms linear 4s forwards; }
  .js [data-reveal], .js [data-reveal-stagger] > * {
    animation: safety-reveal 1ms linear 5s forwards;
  }
}
@keyframes safety-lines { to { transform: none; } }
@keyframes safety-reveal { to { opacity: 1; transform: none; clip-path: inset(0 0 0 0); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ================================================= 8. VIEW TRANSITIONS */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root) { animation: vt-out 160ms var(--ease-inout) both; }
  ::view-transition-new(root) { animation: vt-in 300ms var(--ease-out) both; }
}
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translate3d(0, 10px, 0); } }

/* print — the reference list and contact details should survive paper */
@media print {
  body { background: #fff; color: #000; }
  .nav, .tabbar, .fab, .preloader, .hero-slider, .assistant { display: none !important; }
  .glass, .glass-strong, .glass-dark { background: #fff !important; border-color: #ccc !important; }
}
