/* ==========================================================================
   FAMILY DESIGN LAB — SHARED SITE STYLES
   --------------------------------------------------------------------------
   Purpose:
   - Shared visual foundation for the main site and future FDL pages.
   - Keep brand colours, type, spacing and responsive rules in one place.
   - Add page-specific styles in a separate file if a future page needs them.

   QUICK EDITS
   - Brand blue:       --ink / --accent
   - Background:       --paper
   - Supporting text:  --muted
   - Borders:           --line
   - Main content width: .wrap
   - Navigation:        nav, .logo, .navlinks
   - Hero spacing:      .hero
   ========================================================================== */

:root {
  /* BRAND COLOURS — centralise changes here rather than hunting through CSS. */
  --ink: #123CFF;       /* FDL electric blue; main text and primary controls */
  --paper: #ffffff;     /* Page background */
  --muted: #5E6FAF;     /* Supporting copy */
  --line: #C9D0F5;      /* Dividers and card outlines */
  --accent: #123CFF;    /* Main brand accent; currently matches --ink */

  /* LAYOUT TOKENS — safe starting points for pages built from this template. */
  --content-width: 980px;
  --page-gutter: 28px;
  --section-space: 72px;
  --border-width: 1px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--accent);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* GLOBAL CONTENT WRAPPER — aligns the header, sections and footer. */
.wrap {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--page-gutter);
}

/* ==========================================================================
   HEADER / NAVIGATION
   Keep the same markup and class names across FDL pages for a consistent header.
   On small screens, the links are currently hidden (matching the original site).
   ========================================================================== */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0;
  border-bottom: var(--border-width) solid var(--line);
}

.logo {
  font-weight: 800;
  letter-spacing: -0.03em;
}

.navlinks {
  display: flex;
  gap: 24px;
  font-size: 14px;
}

.navlinks a {
  color: inherit;
  text-decoration: none;
}

.navlinks a:hover,
.navlinks a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ==========================================================================
   HERO
   The large top padding intentionally leaves room for the animated ticker.
   If the ticker is removed from a page, reduce this padding.
   ========================================================================== */
.hero {
  padding: 190px 0 90px; /* TOP PADDING = space before the hero kicker */
  max-width: 850px;
}

.kicker {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  margin-bottom: 24px;
}

h1 {
  font-size: clamp(58px, 10vw, 108px);
  line-height: 0.9;
  letter-spacing: -0.075em;
  margin: 0 0 28px;
}

.hero p {
  font-size: clamp(20px, 3vw, 30px);
  line-height: 1.25;
  max-width: 720px;
  margin: 0 0 34px;
}

/* PRIMARY CALL TO ACTION — pill shape distinguishes action from text links. */
.cta {
  display: inline-block;
  background: var(--ink);
  color: white;
  text-decoration: none;
  padding: 15px 21px;
  border-radius: 999px;
  font-weight: 700;
}

.cta:hover,
.cta:focus-visible {
  filter: brightness(0.92);
}

.note {
  margin-top: 18px;
  font-size: 14px;
  color: var(--muted);
}

/* ==========================================================================
   CONTENT SECTIONS
   .grid is the standard two-column layout used by the "Why?" and "The Lab" areas.
   ========================================================================== */
.section {
  border-top: var(--border-width) solid var(--line);
  padding: var(--section-space) 0;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 50px;
}

h2 {
  font-size: 38px;
  letter-spacing: -0.05em;
  line-height: 1;
  margin: 0 0 18px;
}

.big {
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.muted {
  color: var(--muted);
}

/* FOUR-STEP CARDS — repeatable card layout for NOTICE / QUESTION / IMAGINE / MAKE. */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 30px;
}

.card {
  border: var(--border-width) solid var(--line);
  padding: 22px;
  min-height: 160px;
}

.num {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 30px;
}

.card h3 {
  font-size: 23px;
  margin: 0 0 8px;
  letter-spacing: -0.04em;
}

.card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

/* DOWNLOAD PANEL — flexible row on desktop, stacked on smaller screens. */
.download {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
  border: var(--border-width) solid var(--ink);
  padding: 32px;
}

.download h3 {
  font-size: 30px;
  letter-spacing: -0.04em;
  margin: 0 0 8px;
}

.download p {
  margin: 0;
  color: var(--muted);
  max-width: 570px;
  line-height: 1.5;
}

/* FOOTER */
footer {
  padding: 35px 0 60px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 14px;
}

/* ==========================================================================
   ANIMATED 3D WORDMARK TICKER
   These rules style the moving letters. Animation calculations live in script.js.
   ========================================================================== */
.fdl-ticker {
  position: absolute;
  left: 50%;
  top: 100px;             /* TICKER POSITION BELOW NAV */
  width: 420px;           /* TICKER VIEWPORT WIDTH */
  height: 90px;           /* TICKER VIEWPORT HEIGHT */
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 4;
  overflow: visible;
}

.fdl-ticker-stage {
  position: absolute;
  inset: 0;
  perspective: 700px;     /* 3D PERSPECTIVE */
  transform-style: preserve-3d;
}

.fdl-ticker-word {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  transform-style: preserve-3d;
}

.fdl-ticker-letter {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: center center;
  font-size: 35px;        /* TICKER LETTER SIZE */
  line-height: 1;
  font-weight: 900;       /* TICKER LETTER WEIGHT */
  letter-spacing: -0.055em;
  color: var(--ink);
  white-space: pre;
  will-change: transform, opacity;
}

/* ==========================================================================
   RESPONSIVE RULES
   Mobile adjustments are grouped here so they are easy to find and tune.
   ========================================================================== */
@media (max-width: 700px) {
  .wrap {
    padding: 0 20px;
  }

  .hero {
    padding: 140px 0 70px;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 25px;
  }

  .steps {
    grid-template-columns: 1fr 1fr;
  }

  .download {
    display: block;
  }

  .download .cta {
    margin-top: 20px;
  }

  .navlinks {
    display: none;
  }

  .mobile-menu-toggle {
    display: inline-flex;
  }

  .mobile-navlinks:not([hidden]) {
    display: flex;
  }

  .fdl-ticker {
    width: calc(100vw - 12px);
    max-width: 360px;
    height: 70px;
    top: 98px;            /* KEEP TICKER BELOW NAV ON SMALL SCREENS */
  }

  .fdl-ticker-letter {
    font-size: 18px;
  }
}

@media (max-width: 430px) {
  .steps {
    grid-template-columns: 1fr;
  }
}


/* LINK STATES
   Visited links deliberately keep the same colour and decoration as unvisited links.
   Hover/focus feedback remains available for accessibility and pointer interaction. */
a:visited {
  color: inherit;
}

.cta:visited {
  color: #ffffff;
}




/* ==========================================================================
   FDL SHARED MENU OVERLAY
   Use this same menu treatment for future dropdown/navigation panels.
   Semi-transparent white glass covers the page, with large, bold link rows.
   ========================================================================== */
.mobile-menu-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--accent);
  border-radius: 999px;
  padding: 9px 13px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.mobile-menu-icon { font-size: 18px; line-height: 1; }

.fdl-menu-overlay {
  display: none;
}
.fdl-menu-overlay[hidden] { display: none !important; }

@media (max-width: 700px) {
  nav[aria-label="Main navigation"] > .navlinks { display: none !important; }
  nav[aria-label="Main navigation"] > .mobile-menu-toggle { display: inline-flex; }

  .fdl-menu-overlay:not([hidden]) {
     display: flex !important;
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: 2147483647;
  }
  .fdl-menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.88);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }
  .fdl-menu-panel {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100%;
  }
  .fdl-menu-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);
  }
  .fdl-menu-top .logo {
    color: var(--accent);
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.03em;
    text-decoration: none;
  }
  .fdl-menu-close {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: rgba(255,255,255,.78);
    color: var(--accent);
    font: 400 30px/1 inherit;
    cursor: pointer;
  }
  .fdl-menu-links {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-top: 24px;
  }
  .fdl-menu-links a,
  .fdl-menu-links a:visited {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 20px 0;
    border-bottom: 1px solid var(--line);
    color: var(--accent);
    font-size: clamp(28px, 7.5vw, 40px);
    line-height: 1.05;
    font-weight: 800;
    letter-spacing: -0.045em;
    text-decoration: none;
  }
  .fdl-menu-links a span {
    font-size: 22px;
    font-weight: 500;
    letter-spacing: 0;
  }
  .fdl-menu-links a:hover,
  .fdl-menu-links a:focus-visible {
    opacity: .72;
    text-decoration: none;
  }
  .fdl-menu-footer {
    margin-top: auto;
    padding-top: 36px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .15em;
  }
  body.fdl-menu-open { overflow: hidden; }
}

/* FDL LINK STATES — keep links visually consistent */
a:link,
a:visited {
  color: var(--accent);
  text-decoration: none;
}

a:hover,
a:focus,
a:active {
  color: var(--accent);
  text-decoration: none;
}

/* Keep white text on blue buttons */
.cta:link,
.cta:visited,
.cta:hover,
.cta:focus,
.cta:active {
  color: #ffffff;
  text-decoration: none;
}


/* FDL — remove navigation and menu divider lines */

/* Line underneath the main navigation */
nav {
  border-bottom: none !important;
}

/* Line underneath the mobile dropdown menu links and footer */
.fdl-menu-top,
.fdl-menu-links a,
.fdl-menu-footer,
.fdl-menu-panel {
  border-bottom: none !important;
  border-top: none !important;
}

/* Remove any divider on the mobile menu container */
.fdl-menu-overlay {
  border: none !important;
}


/* ==========================================================================
   FDL MOBILE MENU — reference-style slide-down motion
   Adjust --fdl-menu-duration to change the dropdown speed.
   ========================================================================== */
:root {
  --fdl-menu-duration: 0.5s;
}

@keyframes fdl-reference-slide-down {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

@media (max-width: 700px) {
  .fdl-menu-overlay:not([hidden]) {
    animation: fdl-reference-slide-down var(--fdl-menu-duration) ease-out both;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fdl-menu-overlay:not([hidden]) {
    animation: none;
  }
}

