/* ============================================================
   DAWSONS WEBSITE — UI kit layout styles
   Composes the design-system tokens. Site-specific layout only.
   ============================================================ */

.site { background: var(--color-bg); min-height: 100vh; }

/* --- Header ------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--color-bg-dark);
  border-bottom: 1px solid var(--color-border-dark);
}
.site-header .bar { display: flex; align-items: center; justify-content: space-between; height: 80px; gap: 24px; }
.site-nav { display: flex; align-items: center; gap: 30px; }
.site-nav a {
  font-family: var(--font-display); font-weight: var(--fw-semibold);
  font-size: var(--fs-body-sm); color: var(--steel-300);
  text-decoration: none; letter-spacing: 0.01em;
  transition: color var(--dur-fast) var(--ease-out);
}
.site-nav a:hover, .site-nav a.active { color: var(--white); }
.site-nav a.active { color: var(--white); }
.header-actions { display: flex; align-items: center; gap: 14px; }
.header-phone { display: inline-flex; align-items: center; gap: 8px; color: var(--white); font-family: var(--font-mono); font-weight: 500; font-size: var(--fs-body-sm); text-decoration: none; }
.header-phone .lbl { color: var(--steel-400); }
.header-phone span { white-space: nowrap; }

/* --- Mobile navigation --------------------------------------------------
   Hidden above 900px, where the inline nav is used instead. The panel is
   only mounted while open, so the server-rendered markup and the first
   client render agree and hydration stays clean. */
.nav-toggle {
  display: none;
  align-items: center; justify-content: center;
  width: 44px; height: 44px;          /* comfortable tap target */
  background: transparent; border: 1px solid var(--color-border-dark);
  border-radius: var(--radius-md); color: var(--white); cursor: pointer;
  flex: 0 0 auto;
}
.nav-toggle:hover { background: rgba(255,255,255,0.06); }
.nav-toggle:focus-visible { outline: none; box-shadow: var(--ring); }

.mobile-nav {
  position: fixed; inset: 0; z-index: 1;   /* below the bar, above the page */
  background: var(--black);
  padding: 88px var(--container-pad) 32px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 24px;
  animation: mn-in var(--dur-base) var(--ease-out);
}
@keyframes mn-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .mobile-nav { animation: none; } }

.mobile-nav nav { display: flex; flex-direction: column; }
.mobile-nav .mn-link {
  font-family: var(--font-display); font-weight: var(--fw-extra);
  font-size: var(--fs-h3); color: var(--white); text-decoration: none;
  padding: 12px 0; border-bottom: 1px solid var(--color-border-dark);
}
.mobile-nav .mn-link.active { color: var(--red-500); }
.mobile-nav .mn-heading {
  font-family: var(--font-display); font-weight: var(--fw-bold);
  font-size: var(--fs-eyebrow); letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase; color: var(--steel-500);
  margin-top: 26px; margin-bottom: 6px;
}
.mobile-nav .mn-sub {
  color: var(--steel-300); text-decoration: none;
  font-size: var(--fs-body-sm); padding: 9px 0;
}
/* Two columns keeps the secondary lists from pushing the panel to twice the
   height of a phone screen. */
.mobile-nav .mn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.mobile-nav .mn-cta {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding-bottom: 6px;
}
.mobile-nav .mn-phone {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-mono); font-weight: 500; font-size: var(--fs-body-lg);
  color: var(--white); text-decoration: none;
}
.mobile-nav .mn-hours { font-size: var(--fs-caption); color: var(--steel-500); }

/* The bar and utility strip must paint above the panel: the panel is a child of
   the header, so within that stacking context it would otherwise cover the very
   button used to close it. */
.site-header > .container,
.utility-strip { position: relative; z-index: 2; }

/* top utility strip */
.utility-strip {
  background: var(--black);
  border-bottom: 1px solid var(--color-border-dark);
  font-size: var(--fs-caption);
}
.utility-strip .row { display: flex; align-items: center; justify-content: space-between; height: 40px; }
.utility-strip .left { display: flex; gap: 22px; color: var(--steel-400); }
.utility-strip .left span { display: inline-flex; align-items: center; gap: 7px; }
.utility-strip .right { display: flex; gap: 16px; align-items: center; color: var(--steel-400); }

/* --- Hero --------------------------------------------------------- */
.hero { position: relative; background: var(--color-bg-dark); color: var(--white); overflow: hidden; }
.blueprint {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  background-image:
    linear-gradient(var(--color-border-dark) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-border-dark) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(120% 100% at 80% 0%, #000 0%, transparent 70%);
          mask-image: radial-gradient(120% 100% at 80% 0%, #000 0%, transparent 70%);
}
.hero-glow { position: absolute; width: 620px; height: 620px; border-radius: 50%; filter: blur(120px); background: rgba(216,30,39,0.22); top: -200px; right: -120px; pointer-events: none; }

/* --- Animated "living blueprint" hero scene — the grid coming alive ------ */
.hero-scene {
  position: absolute; top: 0; right: 0; bottom: 0; width: 64%; max-width: 860px;
  pointer-events: none; z-index: 1;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 22%, #000 100%);
          mask-image: linear-gradient(90deg, transparent 0%, #000 22%, #000 100%);
}
.hero-scene svg { width: 100%; height: 100%; display: block; }

/* grid that extends the blueprint behind the hero */
.hero-scene .hs-gridline { stroke: rgba(255,255,255,0.05); stroke-width: 1; }

/* route + annotations */
.hero-scene .hs-route { stroke: rgba(255,255,255,0.32); stroke-width: 2; stroke-linejoin: round; }
.hero-scene .hs-cross { stroke: rgba(255,255,255,0.34); stroke-width: 1.75; }
.hero-scene .hs-ext   { stroke: rgba(255,255,255,0.10); stroke-width: 1; }
.hero-scene .hs-dim   { stroke: var(--steel-700); stroke-width: 1.5; }
.hero-scene .hs-label { fill: var(--steel-600); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-anchor: middle; }

/* nodes */
.hero-scene .hs-module { stroke: rgba(255,255,255,0.32); stroke-width: 1.75; fill: var(--color-bg-dark); }
.hero-scene .hs-node   { fill: var(--steel-400); }
.hero-scene .hs-term   { stroke: rgba(255,255,255,0.40); stroke-width: 2; fill: var(--color-bg-dark); }
.hero-scene .hs-glow   { opacity: 0; }

/* travelling pulse */
.hero-scene .hs-surge {
  stroke: var(--red-500); stroke-width: 2.5; stroke-linecap: round;
  stroke-dasharray: 4 100; stroke-dashoffset: 104; opacity: 0;
  filter: drop-shadow(0 0 5px rgba(216,30,39,0.9));
}

/* load draw-in: visible by default so reduced-motion users see the full scene */
.hero-scene .hs-draw { stroke-dasharray: 100; stroke-dashoffset: 0; }

@media (prefers-reduced-motion: no-preference) {
  .hero-scene .hs-draw { stroke-dashoffset: 100; animation: hs-draw 1.2s var(--ease-out) 0.2s forwards; }
  .hero-scene .hs-fill { opacity: 0; transform: translateY(8px); animation: hs-fade 0.8s var(--ease-out) 1s forwards; }
  .hero-scene .hs-surge { animation: hs-surge 5s cubic-bezier(.55,0,.45,1) 1.4s infinite; }
  .hero-scene .hs-glow  { animation: hs-glow 5s ease-in-out 1.4s infinite; }
  /* hero copy entrance */
  .hero-bold .hero-copy > * { animation: hs-rise 0.7s var(--ease-out) backwards; }
  .hero-bold .hero-copy > *:nth-child(1) { animation-delay: 0.05s; }
  .hero-bold .hero-copy > *:nth-child(2) { animation-delay: 0.14s; }
  .hero-bold .hero-copy > *:nth-child(3) { animation-delay: 0.23s; }
  .hero-bold .hero-copy > *:nth-child(4) { animation-delay: 0.32s; }
  .hero-bold .hero-copy > *:nth-child(5) { animation-delay: 0.41s; }
}
@keyframes hs-draw  { to { stroke-dashoffset: 0; } }
@keyframes hs-fade  { to { opacity: 1; transform: none; } }
@keyframes hs-surge { 0%, 8% { stroke-dashoffset: 105; opacity: 0; } 14% { opacity: 1; } 60% { opacity: 1; } 74%, 100% { stroke-dashoffset: -5; opacity: 0; } }
@keyframes hs-flow  { to { stroke-dashoffset: -40; } }
@keyframes hs-glow  { 0%, 60%, 100% { opacity: 0; } 72% { opacity: 1; } 88% { opacity: 0.35; } }
@keyframes hs-rise  { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* accessibility: keyboard skip link, visible only when focused */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--brand); color: var(--white);
  padding: 12px 18px; border-radius: 0 0 var(--radius-md) 0;
  font-family: var(--font-display); font-weight: var(--fw-bold); text-decoration: none;
}
.skip-link:focus { left: 0; }

/* site photography */
.photo {
  display: block; width: 100%; height: 100%;
  object-fit: cover; background: var(--steel-800);
}

/* --- Sections ----------------------------------------------------- */
.section { padding-block: var(--section-y); }
.section.dark { background: var(--color-bg-dark); color: var(--white); }
.section.subtle { background: var(--color-bg-subtle); }

/* trust / accreditation strip */
.trust-strip { display: flex; align-items: center; gap: 34px; flex-wrap: wrap; justify-content: center; }
.accred { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: var(--fw-bold); letter-spacing: 0.04em; color: var(--steel-500); font-size: var(--fs-body-sm); text-transform: uppercase; }

/* grids */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }

/* footer */
.site-footer { background: var(--black); color: var(--steel-400); padding-top: var(--space-10); }
.site-footer h4 { color: var(--white); font-size: var(--fs-body); font-weight: var(--fw-bold); margin-bottom: 16px; }
.site-footer a { color: var(--steel-400); text-decoration: none; font-size: var(--fs-body-sm); display: block; padding: 5px 0; transition: color var(--dur-fast) var(--ease-out); }
.site-footer a:hover { color: var(--white); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; }
.footer-bottom { border-top: 1px solid var(--color-border-dark); margin-top: var(--space-9); padding-block: 24px; display: flex; justify-content: space-between; align-items: center; font-size: var(--fs-caption); color: var(--steel-600); }

/* --- Testimonials -------------------------------------------------------- */
.quote {
  margin: 0; display: flex; flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: var(--accent-rule);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}
/* Oversized opening quote mark, set in the display face as a brand device
   rather than an image. Decorative, so hidden from assistive tech. */
.quote::before {
  content: '\201C';
  font-family: var(--font-display); font-weight: var(--fw-black);
  font-size: 68px; line-height: 0.8; color: var(--brand);
  display: block; margin-bottom: 6px;
}
.quote blockquote {
  margin: 0; flex: 1;
  font-size: var(--fs-body-lg); line-height: 1.6; color: var(--text-secondary);
}
.quote figcaption {
  margin-top: var(--space-5); padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
  display: flex; flex-direction: column; gap: 3px;
}
.quote cite {
  font-style: normal;
  font-family: var(--font-display); font-weight: var(--fw-bold);
  font-size: var(--fs-body); color: var(--text-primary);
}
.quote .q-context { font-size: var(--fs-caption); color: var(--text-muted); }

/* media frame — rounded, clipped wrapper for site photography */
.media { position: relative; overflow: hidden; border-radius: var(--radius-xl); background: var(--steel-800); }
.media.flush { border-radius: 0; }
.media figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0;
  padding: 34px 20px 14px;
  background: linear-gradient(180deg, transparent, rgba(12,15,19,0.82));
  color: var(--white); font-size: var(--fs-caption); line-height: 1.4;
}

/* responsive */
@media (max-width: 980px) {
  /* Move the schematic from a right-hand panel to a faded band beneath the
     copy so it still reads on narrow screens — it emerges under the headline
     rather than sitting off to one side. */
  .hero-bold .hero-copy { padding-bottom: 300px; }
  .hero-scene {
    top: auto; bottom: 0; left: 0; right: 0;
    width: 100%; max-width: 560px; margin-inline: auto;
    height: 320px;
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 36%, #000 100%);
            mask-image: linear-gradient(180deg, transparent 0%, #000 36%, #000 100%);
  }
}
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; gap: 32px; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  /* The inline nav is replaced by the toggle + panel below, not simply dropped. */
  .site-nav { display: none; }
  .nav-toggle { display: inline-flex; }
  /* The quote CTA lives in the panel at this width; keeping it in the bar as
     well is what pushed the header into a horizontal overflow. */
  .header-cta { display: none; }
  .site-header .bar { height: 68px; gap: 12px; }
}
@media (max-width: 560px) {
  .grid-3 { grid-template-columns: 1fr; }
  .utility-strip { display: none; }
  .header-phone .lbl { display: none; }
  .header-phone { font-size: var(--fs-caption); }
}
@media (max-width: 400px) {
  /* Below this the number competes with the logo; the icon stays as the tap
     target and the full number is one tap away in the panel. */
  .header-phone span { display: none; }
}
