/* ==========================================================================
   QUANUM LLC — Stylesheet
   Organized top to bottom:
     1. CSS variables (colors, spacing, type) — edit these to restyle the site
     2. Reset / base element styles
     3. Layout utilities
     4. Header & navigation (incl. mobile menu)
     5. Hero
     6. About
     7. Focus cards
     8. Approach principles
     9. Contact
     10. Footer
     11. Buttons & links
     12. Small helper/utility classes
     13. Responsive breakpoints
     14. Accessibility: focus states & reduced motion
   ========================================================================== */

/* 1. CSS VARIABLES ---------------------------------------------------------
   Change these values to restyle the whole site from one place.
--------------------------------------------------------------------------- */
:root {
  /* Palette: warm sepia-brown / off-white / steel blue.
     A restrained nod to film noir — duotone (warm neutral + one cool
     accent), a bit of grain in spirit rather than a literal photo grain. */
  --color-bg: #1a1512;            /* main page background (sepia-brown) */
  --color-bg-alt: #1f1811;        /* alternating section background */
  --color-surface: #241c15;       /* card / raised surface */
  --color-border: rgba(236, 230, 218, 0.12);
  --color-border-strong: rgba(236, 230, 218, 0.22);

  --color-text: #ece6da;          /* primary text (warm off-white) */
  --color-text-muted: #b8ab97;    /* secondary text (muted taupe) */
  --color-text-faint: #998c79;    /* tertiary / footnote text */

  --color-accent: #6b8ca8;        /* steel blue — links, eyebrows, rules */
  --color-accent-strong: #8fa8c0; /* lighter steel blue — hover states */
  --color-on-accent: #1a1512;     /* text color used on top of accent fill */

  /* Typography */
  --font-heading: Georgia, 'Iowan Old Style', 'Palatino Linotype', Palatino, serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --fs-h1: clamp(2.25rem, 1.7rem + 2.4vw, 3.75rem);
  --fs-h2: clamp(1.6rem, 1.35rem + 1.1vw, 2.25rem);
  --fs-h3: clamp(1.15rem, 1.05rem + 0.4vw, 1.3rem);
  --fs-body: 1.0625rem;
  --fs-lead: clamp(1.05rem, 1rem + 0.3vw, 1.2rem);
  --fs-small: 0.9rem;

  --lh-heading: 1.15;
  --lh-body: 1.65;

  /* Spacing scale */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 4.5rem;
  --space-7: 6.5rem;

  /* Layout */
  --content-width: 72rem;
  --content-width-narrow: 42rem;
  --radius: 6px;
  --transition: 180ms ease;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  line-height: var(--lh-heading);
  font-weight: 600;
  margin: 0 0 var(--space-2);
  color: var(--color-text);
}

h1 {
  font-size: var(--fs-h1);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

/* A short accent rule under a heading — the site's one recurring visual
   motif, standing in for a "title card" underscore. Add it after any H1
   or H2 that should carry the look; it's decorative, so it's marked
   aria-hidden in the markup. */
.title-rule {
  width: 48px;
  height: 2px;
  background-color: var(--color-accent);
  margin: 4px 0 var(--space-3);
}

.title-rule--lg {
  width: 72px;
  margin-top: 8px;
}

p {
  margin: 0 0 var(--space-3);
  max-width: 68ch;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: inherit;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

/* 3. LAYOUT UTILITIES --------------------------------------------------------
--------------------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
  padding-inline: var(--space-3);
}

.wrap-narrow {
  max-width: var(--content-width-narrow);
}

section {
  padding-block: var(--space-6);
}

section:nth-of-type(even) {
  background-color: var(--color-bg-alt);
}

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--fs-small);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin: 0 0 var(--space-2);
}

.section-intro {
  color: var(--color-text-muted);
  max-width: 60ch;
}

/* Keeps anchor-linked targets (nav links, skip link) from being tucked
   underneath the sticky header when the browser scrolls to them. */
#main,
#about,
#focus,
#contact {
  scroll-margin-top: 5.5rem;
}

/* 4. HEADER & NAVIGATION -----------------------------------------------------
--------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: rgba(26, 21, 18, 0.9); /* --color-bg at 90% — kept as
    an explicit rgba() because backdrop-blur needs a translucent fill,
    which var(--color-bg) alone can't express; update together. */
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-2);
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-decoration: none;
  color: var(--color-text);
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.site-nav a {
  text-decoration: none;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
  padding: var(--space-1) 0;
  border-bottom: 1px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}

.site-nav a:hover {
  color: var(--color-text);
  border-color: var(--color-border-strong);
}

/* Mobile menu button — hidden on desktop.
   Sized to 44x44px, the minimum recommended touch-target size. */
.menu-toggle {
  display: none;
  position: relative;
  width: 2.75rem;
  height: 2.75rem;
  margin-right: -0.25rem;
  align-items: center;
  justify-content: center;
}

.menu-icon,
.menu-icon::before,
.menu-icon::after {
  display: block;
  width: 1.4rem;
  height: 2px;
  background-color: var(--color-text);
  transition: transform var(--transition), opacity var(--transition);
}

.menu-icon::before,
.menu-icon::after {
  content: "";
  position: absolute;
}

.menu-icon::before {
  transform: translateY(-6px);
}

.menu-icon::after {
  transform: translateY(6px);
}

.menu-toggle[aria-expanded="true"] .menu-icon {
  background-color: transparent;
}

.menu-toggle[aria-expanded="true"] .menu-icon::before {
  transform: translateY(0) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-icon::after {
  transform: translateY(0) rotate(-45deg);
}

.mobile-nav {
  border-top: 1px solid var(--color-border);
  background-color: var(--color-bg);
}

.mobile-nav ul {
  padding: var(--space-2) var(--space-3) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.mobile-nav a {
  display: block;
  padding: var(--space-2) 0;
  text-decoration: none;
  color: var(--color-text);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: 1px solid var(--color-border);
}

/* 5. HERO --------------------------------------------------------------------
--------------------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: var(--space-7) var(--space-6);
}

/* A faint vignette behind the hero only — the site's one "cinematic"
   moment. z-index: -1 keeps it behind the in-flow content without
   needing z-index on the content itself. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, 0.4) 100%);
  pointer-events: none;
}

.hero h1 {
  max-width: 18ch;
}

.hero-sub {
  color: var(--color-text-muted);
  font-size: var(--fs-lead);
  max-width: 52ch;
  margin-top: var(--space-3);
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-5);
  flex-wrap: wrap;
}

/* 6. ABOUT ---------------------------------------------------------------- */
.about p {
  color: var(--color-text-muted);
}

/* 7. FOCUS CARDS ------------------------------------------------------------
--------------------------------------------------------------------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-4);
}

.card h3 {
  margin-bottom: var(--space-2);
}

.card p {
  color: var(--color-text-muted);
  font-size: 0.98rem;
  margin: 0;
}

/* 8. APPROACH PRINCIPLES -----------------------------------------------------
--------------------------------------------------------------------------- */
.principle-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-top: var(--space-3);
}

.principle h3 {
  margin-bottom: var(--space-1);
}

.principle p {
  color: var(--color-text-muted);
  margin: 0;
}

/* 9. CONTACT ---------------------------------------------------------------- */
.contact p {
  color: var(--color-text-muted);
}

.contact .btn {
  margin-top: var(--space-3);
}

/* 10. FOOTER ------------------------------------------------------------------
--------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding-block: var(--space-5);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.footer-name {
  font-family: var(--font-heading);
  font-weight: 600;
  margin: 0 0 var(--space-1);
}

.footer-location,
.footer-copyright {
  color: var(--color-text-faint);
  font-size: var(--fs-small);
  margin: 0;
}

.footer-links {
  display: flex;
  gap: var(--space-4);
}

.footer-links a {
  text-decoration: none;
  color: var(--color-text-muted);
  font-size: var(--fs-small);
}

.footer-links a:hover {
  color: var(--color-text);
}

/* 11. BUTTONS & LINKS ---------------------------------------------------------
--------------------------------------------------------------------------- */
.btn {
  display: inline-block;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius);
  transition: background-color var(--transition), color var(--transition), border-color var(--transition);
}

/* Outlined rather than filled — a quieter, "credits card" kind of button.
   It still fills solid on hover/focus, so the interactive affordance
   doesn't depend on the border alone. */
.btn-primary {
  background-color: transparent;
  border: 1px solid var(--color-accent);
  color: var(--color-text);
}

.btn-primary:hover {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-on-accent);
}

.btn-link {
  text-decoration: none;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border-strong);
  padding-bottom: 2px;
  transition: color var(--transition), border-color var(--transition);
}

.btn-link:hover {
  color: var(--color-text);
  border-color: var(--color-text);
}

/* 12. UTILITIES ---------------------------------------------------------------
--------------------------------------------------------------------------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -3rem;
  left: var(--space-2);
  background-color: var(--color-accent);
  color: var(--color-on-accent);
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  z-index: 100;
  text-decoration: none;
  font-weight: 600;
  transition: top var(--transition);
}

.skip-link:focus {
  top: var(--space-2);
}

/* 13. RESPONSIVE BREAKPOINTS ---------------------------------------------------
--------------------------------------------------------------------------- */
@media (max-width: 860px) {
  .card-grid,
  .principle-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  /* Hide the desktop nav in favor of the hamburger menu — except on pages
     (like the privacy/terms placeholders) that only have a single "Home"
     link and never got a hamburger menu of their own. */
  .site-nav:not(.site-nav--always) {
    display: none;
  }

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

  .footer-inner {
    flex-direction: column;
  }
}

@media (min-width: 721px) {
  .mobile-nav {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .wrap {
    padding-inline: var(--space-2);
  }

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }

  .btn {
    width: 100%;
    text-align: center;
  }
}

/* 14. ACCESSIBILITY: FOCUS STATES & REDUCED MOTION -----------------------------
--------------------------------------------------------------------------- */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-accent-strong);
  outline-offset: 3px;
  border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
