/* Deft website - shared styles
 * Source: docs/figma-specs/*.txt
 * Brand: Richard Robinson V3 (Feb 2026)
 */

/* Self-hosted DM Sans (variable, opsz 9..40 + wght 400..800).
 * Replaces the render-blocking Google Fonts @import. font-display:swap so text
 * paints immediately in the fallback and swaps when the woff2 arrives. */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('fonts/dmsans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('fonts/dmsans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Cross-fade between pages on same-origin navigation. Modern Chromium/Safari.
 * Firefox gracefully falls back to instant page swap. */
@view-transition { navigation: auto; }
::view-transition-old(root) {
  animation: vt-fade-out 0.28s ease forwards;
}
::view-transition-new(root) {
  animation: vt-fade-in 0.32s ease 0.05s backwards;
}
@keyframes vt-fade-out { to { opacity: 0; transform: translateY(-4px); } }
@keyframes vt-fade-in  { from { opacity: 0; transform: translateY(8px); } }
/* Persist the nav across page transitions so it doesn't flicker */
.site-nav { view-transition-name: site-nav; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

:root {
  --red: #FF4145;
  --bk: #000;
  --cap: #D6D1CC;
  --cap-80: #DFDCD7;
  --cap-60: #E7E5E1;
  --cap-40: #EFEDEB;
  --cap-20: #F7F6F5;
  --wh: #FFFFFF;
  --font: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --gut: 50px;
  --gut-inner: 25px;
  --mw: 1440px;
  --mw-inner: 1340px;
  --super: 120px;
  --headline: 64px;
  --sub-head: 40px;
  --body: 28px;
  --caption: 25px;
  --hero-h: 70vh;       /* inner-page hero height (home hero is special) */
  --radius-sm: 30px;    /* buttons, small cards */
  --radius-lg: 50px;    /* large panels */
}

/* Mobile token overrides per Figma mobile frames (Becky's exact values) */
@media (max-width: 760px) {
  :root {
    --gut: 20px;
    --gut-inner: 10px;
    --mw-inner: 343px;
    --super: 60px;
    --headline: 40px;
    --sub-head: 24px;
    --body: 18px;
    --caption: 15px;
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.5;
  color: var(--bk);
  background: var(--cap);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  font-variation-settings: 'opsz' 14;
}
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }

/* Layout container - full viewport width, sections handle their own
 * background colors so no cappuccino strips show at wide viewports */
.page {
  width: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--cap);
  position: relative;
}
/* Inner content stays at max 1440 inside each section */
.section-inner {
  max-width: var(--mw);
  margin: 0 auto;
}
/* Horizontal content frame: centres content in --mw with --gut side gutters.
 * Use on any full-bleed section's content so framing is identical site-wide.
 * Vertical padding stays per-section. Matches the homepage pattern. */
.frame {
  padding-left: max(var(--gut), calc((100% - var(--mw)) / 2 + var(--gut)));
  padding-right: max(var(--gut), calc((100% - var(--mw)) / 2 + var(--gut)));
}

/* Typography tokens (Figma sizes) */
.t-super {
  font-weight: 500;
  font-size: var(--super);
  line-height: 0.85;
  letter-spacing: -0.04em;
}
.t-headline {
  font-weight: 500;
  font-size: var(--headline);
  line-height: 1;
  letter-spacing: -0.02em;
}
.t-sub-head {
  font-weight: 400;
  font-size: var(--sub-head);
  line-height: 1.15;
}
.t-body {
  font-weight: 400;
  font-size: var(--body);
  line-height: 1.15;
}
.t-caption {
  font-weight: 600;
  font-size: var(--caption);
  line-height: 1.15;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
  font-weight: 500;
  font-size: 18px;
  height: 45px;
  padding: 0 20px;
  border-radius: 30px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 0 5px rgba(0,0,0,0.25);
  transition: transform 0.2s, opacity 0.2s;
}
.btn:hover { transform: translateY(-1px); opacity: 0.92; }
.btn-dark { background: var(--bk); color: var(--wh); }
.btn-light { background: var(--cap); color: var(--bk); }
.btn-red { background: var(--red); color: var(--bk); font-weight: 500; }
.btn-outline {
  background: transparent;
  color: var(--wh);
  border: 1.5px solid var(--wh);
  box-shadow: none;
}
.btn-outline:hover { background: rgba(255,255,255,0.1); }

/* ===== NAV ===== */
.site-nav {
  position: absolute;
  top: 25px;
  left: 50%;
  transform: translateX(-50%);
  width: var(--mw-inner);
  height: 80px;
  padding: 20px 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  box-shadow: 0 0 10px rgba(0,0,0,0.25);
  z-index: 100;
  backdrop-filter: blur(6px);
}
.site-nav-logo {
  display: flex;
  align-items: center;
  height: 40px;
  width: 99px;
  font-weight: 800;
  font-size: 28px;
  letter-spacing: -0.04em;
  color: var(--bk);
}
.site-nav-menu {
  display: flex;
  gap: 50px;
  align-items: center;
}
.site-nav-item {
  font-weight: 600;
  font-size: 18px;
  color: var(--bk);
  padding: 8px 0;
  white-space: nowrap;
  transition: opacity 0.2s;
}
.site-nav-item:hover { opacity: 0.7; }
.site-nav-item.active {
  background: var(--red);
  color: var(--bk);
  padding: 0 20px;
  height: 45px;
  display: flex;
  align-items: center;
  border-radius: 30px;
  font-weight: 500;
  box-shadow: 0 0 5px rgba(0,0,0,0.25);
}
.site-nav-contact {
  background: var(--bk);
  color: var(--wh);
  padding: 0 20px;
  height: 45px;
  display: flex;
  align-items: center;
  border-radius: 30px;
  font-weight: 500;
  font-size: 18px;
  white-space: nowrap;
  box-shadow: 0 0 5px rgba(0,0,0,0.25);
  transition: transform 0.2s;
}
.site-nav-contact:hover { transform: translateY(-1px); }
/* Mobile nav per Figma mobile spec: 343w x 60h, logo + red square menu button (45x45) */
@media (max-width: 760px) {
  .site-nav {
    top: 15px;
    width: 343px;
    height: 60px;
    padding: 15px 20px;
    border-radius: 15px;
    box-shadow: 0 0 7.5px rgba(0,0,0,0.25);
  }
  .site-nav-menu { display: none; }
  .site-nav-logo { font-size: 22px; height: 30px; width: 74.25px; }
  .site-nav-contact {
    width: 45px;
    height: 45px;
    padding: 0;
    border-radius: 30px;
    background: var(--red);
    color: var(--bk);
    font-size: 0;
    position: relative;
  }
  /* Hamburger icon inside the red square */
  .site-nav-contact::before,
  .site-nav-contact::after,
  .site-nav-contact > .bar {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 2px;
    background: var(--bk);
  }
  .site-nav-contact::before { top: 14px; }
  .site-nav-contact::after { bottom: 14px; }
  .site-nav-contact > .bar { top: 50%; margin-top: -1px; }
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--red);
  width: 100%;
  padding: 75px 50px 50px;
  color: var(--bk);
}
.site-footer-inner {
  width: var(--mw-inner);
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  gap: 20px;
  align-items: flex-end;
}
.site-footer-brand {
  display: flex;
  gap: 20px;
  align-items: center;
  padding-bottom: 4px;
  width: 660px;
}
.site-footer-logo {
  font-weight: 800;
  font-size: 56px;
  letter-spacing: -0.04em;
  color: var(--bk);
  line-height: 1;
  display: flex;
  align-items: center;
}
.site-footer-tagline {
  font-weight: 500;
  font-size: 24px;
  line-height: 1.1;
  color: var(--bk);
  width: 323px;
}
.site-footer-contacts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
  width: 660px;
}
.site-footer-row {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 385px;
}
.site-footer-row svg,
.site-footer-row img {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: var(--bk);
}
.site-footer-row span,
.site-footer-row a {
  font-weight: 500;
  font-size: 20px;
  line-height: 1.2;
  color: var(--bk);
}
.site-footer-row a:hover { text-decoration: underline; }
/* Mobile footer per Figma mobile spec (4:970): contacts on top, brand below,
 * gap 50, 25px padding-x, 50 top / 25 bottom. Smaller icons + text. */
@media (max-width: 760px) {
  .site-footer { padding: 50px 25px 25px; }
  .site-footer-inner {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 50px;
    width: 100%;
  }
  .site-footer-brand {
    width: auto;
    gap: 10px;
    padding-bottom: 0;
  }
  .site-footer-logo { font-size: 20px; height: 27px; }
  .site-footer-tagline { font-size: 18px; width: auto; max-width: 219px; }
  .site-footer-contacts { width: auto; gap: 6px; }
  .site-footer-row { width: 308px; gap: 8px; }
  .site-footer-row svg, .site-footer-row img { width: 18px; height: 18px; }
  .site-footer-row span, .site-footer-row a { font-size: 16px; }
}

/* ===== HERO BASE ===== */
.hero {
  position: relative;
  height: var(--hero-h);
  overflow: hidden;
  background: var(--bk);
}
.hero-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.hero-media img.hero-bg,
.hero-media video.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.15);
  mix-blend-mode: darken;
  z-index: 1;
}
.hero-shape {
  position: absolute;
  pointer-events: none;
  z-index: 2;
}
.hero-content {
  position: relative;
  z-index: 3;
  height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 50px var(--gut) 0;
}
.hero-headline {
  width: 660px;
  font-weight: 500;
  font-size: var(--super);
  line-height: 0.85;
  letter-spacing: -0.04em;
  color: var(--wh);
  text-align: left;
}
/* Mobile hero per Figma: 812h, super 60px text, padding 50px top */
@media (max-width: 760px) {
  .hero { height: 812px; }
  .hero-headline {
    width: 325px;
    font-size: var(--super);
    line-height: 0.85;
    letter-spacing: -0.04em;
    text-align: left;
  }
  .hero-content {
    padding: 50px 20px 0;
    align-items: center;
    justify-content: flex-start;
  }
}

/* ===== STAT NUMBERS (count-up animated) ===== */
.stat-num {
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
  color: inherit;
}
.stat-num .suffix {
  font-weight: 600;
  font-size: 0.66em;
  letter-spacing: -0.02em;
}

/* ===== REVEAL (placeholder, no-op for now) ===== */
.reveal { opacity: 1; }

/* Skip link for accessibility */
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--bk);
  color: var(--wh);
  padding: 8px 12px;
  z-index: 1000;
}
.skip:focus { left: 8px; top: 8px; }

/* ===== BRAND SHAPES =====
 * Reusable decorative brand-shape layer. Markup is injected by shared.js
 * from a named preset (SHAPE_PRESETS in shared.js). Drop into any section:
 *   <div class="brand-shapes" data-shapes="who" aria-hidden="true"></div>
 * The host section MUST be position:relative (the layer is absolute inset:0).
 * Each preset has a desktop and a mobile composition; CSS swaps them at 760px.
 * Positioning + width come inline from the preset; animation + breakpoint
 * visibility come from the classes below. */
.brand-shapes {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
/* Wrapper holds position + size and does the gentle local WANDER (translate).
 * Inner img does the ROTATION (spin / base tilt / pulse). Two nested elements
 * so the two motions compose without fighting. Wander amplitude is kept small
 * (about 16px max) so shapes never touch or overlap their neighbours. */
.bshape {
  position: absolute;
  will-change: transform;
}
.bshape > img {
  display: block;
  width: 100%;
  height: auto;
  opacity: 0.85;
  will-change: transform, rotate;
}
/* breakpoint swap (site mobile breakpoint is 760px) */
@media (min-width: 761px) { .bshape--mobile { display: none; } }
@media (max-width: 760px) { .bshape--desktop { display: none; } }

/* ROTATION / scale (on the inner img) */
.bshape--spin      { animation: bsSpin 22s linear infinite; }
.bshape--rotate    { animation: bsSpin 40s linear infinite; }
.bshape--rotateRev { animation: bsSpin 30s linear infinite reverse; }
.bshape--pulse     { animation: bsPulse 8s ease-in-out infinite; }
@keyframes bsSpin { to { transform: rotate(360deg); } }
@keyframes bsPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.09); } }

/* WANDER (on the wrapper). Small, slow, varied loops so no two shapes sync. */
.bshape--w-a { animation: bsWanderA 12s ease-in-out infinite; }
.bshape--w-b { animation: bsWanderB 14s ease-in-out infinite; }
.bshape--w-c { animation: bsWanderC 13s ease-in-out infinite; }
.bshape--w-d { animation: bsWanderD 15s ease-in-out infinite; }
.bshape--w-e { animation: bsWanderE 16s ease-in-out infinite; }
.bshape--w-f { animation: bsWanderF 11s ease-in-out infinite; }
@keyframes bsWanderA {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(38px, -26px); }
  50% { transform: translate(-21px, -42px); }
  75% { transform: translate(-35px, 18px); }
}
@keyframes bsWanderB {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-32px, 24px); }
  45% { transform: translate(25px, 38px); }
  70% { transform: translate(41px, -18px); }
}
@keyframes bsWanderC {
  0%, 100% { transform: translate(0, 0); }
  30% { transform: translate(29px, 29px); }
  55% { transform: translate(-38px, 11px); }
  80% { transform: translate(-15px, -32px); }
}
@keyframes bsWanderD {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-26px, -35px); }
  50% { transform: translate(35px, -14px); }
  75% { transform: translate(21px, 32px); }
}
@keyframes bsWanderE {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(35px, 18px); }
  50% { transform: translate(11px, 41px); }
  80% { transform: translate(-32px, -21px); }
}
@keyframes bsWanderF {
  0%, 100% { transform: translate(0, 0); }
  30% { transform: translate(-29px, 25px); }
  55% { transform: translate(24px, -35px); }
  80% { transform: translate(38px, 14px); }
}

@media (prefers-reduced-motion: reduce) {
  .bshape, .bshape > img { animation: none !important; }
}

/* ===== HERO SHAPES (static) =====
 * Static brand shapes layered over a hero photo (injected by shared.js from
 * HERO_SHAPES). No animation. Sits above the photo, below the hero headline.
 * Markup: <div class="hero-shapes" data-hero-shapes="wwdHero" aria-hidden="true">
 * Host .hero is already position:relative; overflow:hidden. */
.hero-shapes {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}
.hshape {
  position: absolute;
  display: block;
}
/* breakpoint swap (site mobile breakpoint is 760px) */
@media (min-width: 761px) { .hshape--mobile { display: none; } }
@media (max-width: 760px) { .hshape--desktop { display: none; } }
