/* layout.css — structural rules: page frame, header, footer, section rhythm,
   plus the WB Monogram texture toolkit (grain, brushed silver, asphalt grit,
   falling snow, depth, diagonal cuts). Calm, premium, restrained. */

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: var(--fw-body);
}

/* ================================================================== *
 *  TEXTURE TOOLKIT — reusable atmosphere layers
 * ================================================================== */

/* --- 1. Film grain / noise overlay — kills flatness on any dark panel --- */
.grain { position: relative; }
.grain::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.07;
  mix-blend-mode: overlay;
}
.grain--soft::after { opacity: 0.05; }
.grain--strong::after { opacity: 0.09; }

/* --- 2. Brushed metal — chrome rules, metal UI accents --- */
.metal {
  position: relative;
  background: var(--grad-silver);
  background-size: 100% 100%;
}
.metal::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg,
    rgba(255, 255, 255, 0.05) 0 1px, rgba(0, 0, 0, 0.05) 1px 2px);
  mix-blend-mode: overlay;
  pointer-events: none;
}

/* --- 3. Asphalt grit — dark textured "pavement" surface --- */
.asphalt {
  background-color: #15161a;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255, 255, 255, 0.10) 50%, transparent 52%),
    radial-gradient(1px 1px at 70% 60%, rgba(255, 255, 255, 0.07) 50%, transparent 52%),
    radial-gradient(1.5px 1.5px at 40% 80%, rgba(0, 0, 0, 0.6) 50%, transparent 52%),
    radial-gradient(1px 1px at 85% 15%, rgba(255, 255, 255, 0.06) 50%, transparent 52%);
  background-size: 7px 7px, 11px 11px, 9px 9px, 13px 13px;
}

/* --- 4. Snow / atmosphere — falling-snow particle layer --- */
.snow { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.snow span {
  position: absolute;
  inset: -20% 0 0 0;
  background-image:
    radial-gradient(2px 2px at 10% 10%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 30% 40%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 60% 20%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 80% 70%, #fff 50%, transparent 51%),
    radial-gradient(2.5px 2.5px at 50% 90%, #fff 50%, transparent 51%);
  background-size: 300px 300px;
  animation: snowfall linear infinite;
}
.snow span:nth-child(1) { animation-duration: 11s; opacity: 0.55; }
.snow span:nth-child(2) { animation-duration: 18s; opacity: 0.38; background-size: 420px 420px; }
.snow span:nth-child(3) { animation-duration: 26s; opacity: 0.22; background-size: 560px 560px; }
@keyframes snowfall { from { transform: translateY(-300px); } to { transform: translateY(0); } }

/* --- 5. Soft-edge diagonal cuts (gentle — WB Monogram is calm) --- */
.cut-top  { clip-path: polygon(0 2.4vw, 100% 0, 100% 100%, 0 100%); }
.cut-both { clip-path: polygon(0 2.4vw, 100% 0, 100% calc(100% - 2.4vw), 0 100%); }

@media (prefers-reduced-motion: reduce) {
  .snow span { animation: none; }
}

/* ================================================================== *
 *  STRUCTURE
 * ================================================================== */

/* --- Container --- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* --- Section rhythm --- */
.section {
  position: relative;
  padding-block: var(--space-section);
}

.section--tight {
  position: relative;
  padding-block: clamp(2.75rem, 5.5vw, 4.5rem);
}

/* dark textured alt-surface section — never a flat fill */
.section--surface {
  background: var(--grad-soft-band);
  border-block: 1px solid var(--border);
}
.section--surface::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n2'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n2)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.05;
  mix-blend-mode: overlay;
}
.section--surface > .container { position: relative; z-index: 1; }

/* --- Skip link (accessibility) --- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 200;
  background: var(--accent);
  color: #1a1408;
  padding: 0.6rem 1rem;
  font-weight: var(--fw-bold);
}
.skip-link:focus { left: 0; }

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(19, 18, 16, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition), backdrop-filter var(--transition),
    box-shadow var(--transition), border-color var(--transition);
}
/* JS adds .scrolled past 40px — soft warm hairline + slight darken */
.site-header.scrolled {
  background: rgba(15, 14, 12, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: rgba(227, 170, 46, 0.32);
  box-shadow: 0 8px 26px -16px rgba(0, 0, 0, 0.9),
    0 1px 0 rgba(227, 170, 46, 0.12);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 78px;
}

.site-header__nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

/* --- Footer --- */
.site-footer {
  position: relative;
  background: var(--grad-soft-band);
  border-top: 1px solid var(--border);
  padding-block: 4rem 2.25rem;
  overflow: hidden;
}
.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='nf'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23nf)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.06;
  mix-blend-mode: overlay;
}
/* faint top amber hairline */
.site-footer::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%, rgba(227, 170, 46, 0.4) 22%,
    rgba(227, 170, 46, 0.5) 50%, rgba(227, 170, 46, 0.4) 78%, transparent 100%);
}
.site-footer > .container { position: relative; z-index: 1; }

/* ghosted WB watermark, very faint, low in a corner */
.footer-watermark {
  position: absolute;
  right: -2%;
  bottom: -12%;
  width: 360px;
  max-width: 52vw;
  opacity: 0.04;
  pointer-events: none;
  z-index: 0;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2.75rem;
}

.site-footer__bottom {
  margin-top: 2.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  color: var(--muted);
  font-size: var(--fs-small);
}
.site-footer__bottom strong {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

/* --- Hero frame — calm cinematic night scene --- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: var(--space-section-lg);
  background: var(--grad-hero-sky);
}

/* the layered illustrated scene sits behind the copy */
.hero__scene {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.hero__scene svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
/* parallax layers — JS nudges these; transform is gentle */
.hero__layer {
  position: absolute;
  inset: 0;
  will-change: transform;
}

/* bottom-up vignette so hero copy stays legible */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg,
    rgba(19, 18, 16, 0.15) 0%,
    rgba(19, 18, 16, 0.0) 38%,
    rgba(19, 18, 16, 0.62) 78%,
    rgba(19, 18, 16, 0.92) 100%);
}
/* film grain across the whole composition */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='nh'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23nh)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.07;
  mix-blend-mode: overlay;
}

.hero__inner {
  position: relative;
  z-index: 3;
  max-width: 720px;
}

/* --- Generic grids --- */
.grid {
  display: grid;
  gap: 1.75rem;
}
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2.25rem, 5.5vw, 4.5rem);
  align-items: center;
}
