/* ============================================================
   BASE + COMPONENTS
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
/* Removes the accidental "double tap to zoom" gesture on
   interactive elements (a well-known mobile Safari/Chrome
   behavior) without disabling pinch-to-zoom, which stays
   available for accessibility. touch-action: manipulation tells
   the browser this element only cares about pans/taps, not the
   double-tap-zoom gesture specifically. */
a, button, input, textarea, select, summary, [role="button"], .accordion-trigger, .gallery-filter, .nav-drop-trigger, .theme-toggle-btn, .tile-link {
  touch-action: manipulation;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation; /* kills double-tap-zoom site-wide, pinch-zoom still works */
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.05;
  margin: 0;
  letter-spacing: -0.005em;
  font-style: normal;
}
h1 { font-size: var(--step-h1); font-weight: 500; }
h2 { font-size: var(--step-h2); font-weight: 500; }
h3 { font-size: var(--step-h3); font-weight: 500; }
p { margin: 0; }

a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--sp-4); }
.container-narrow { max-width: var(--container-narrow); margin: 0 auto; padding: 0 var(--sp-4); }

.eyebrow {
  font-size: var(--step-eyebrow);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--teal-deep);
  font-weight: 600;
}
.dusk .eyebrow { color: var(--gold); }

.lede {
  font-size: var(--step-lg);
  color: var(--ink-soft);
  max-width: 42ch;
  font-weight: 400;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.95em 1.7em;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.btn:hover { transform: translateY(-2px); background: var(--teal-deep); border-color: var(--teal-deep); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.dusk .btn-ghost { color: var(--dusk-ink); border-color: var(--dusk-ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.dusk .btn-ghost:hover { background: var(--dusk-ink); color: var(--dusk); }

.link-underline {
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
  font-weight: 600;
}

/* ---- Growth thread: signature motif, used sparingly ---- */
.thread { position: relative; }
.thread::before {
  content: "";
  position: absolute;
  left: 0; top: 0;
  width: 1px;
  height: 100%;
  background: var(--line);
}
.thread-dot {
  position: absolute;
  left: -4.5px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--gold);
}

/* ---- Section rhythm ---- */
.section { padding: var(--sp-6) 0; }
.section-tight { padding: var(--sp-5) 0; }
.dusk { background: var(--dusk); color: var(--dusk-ink); }
.deep { background: var(--paper-deep); }

/* ---- Nav ---- */
.site-nav {
  position: sticky; top: 0; z-index: 40;
  border-bottom: 1px solid var(--line);
  /* NOTE: backdrop-filter is intentionally NOT set directly on
     .site-nav. Per the CSS spec, backdrop-filter (like transform
     or filter) turns an element into the containing block for any
     position:fixed descendants — and .nav-links (the mobile menu)
     is fixed and lives inside this element. That combination was
     the cause of the mobile menu bug: the menu was being fixed
     relative to this 84px bar instead of the real viewport. The
     frosted-glass blur is applied via ::before instead, which is
     a separate generated box and doesn't create that trap. */
  position: sticky;
}
.site-nav::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: rgba(237, 230, 216, 0.92);
  backdrop-filter: blur(8px);
}
:root[data-theme="dark"] .site-nav::before {
  background: rgba(27, 33, 28, 0.86);
}
.site-nav .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 84px;
}
.brand { font-family: var(--font-display); font-size: 1.25rem; letter-spacing: 0.01em; text-decoration: none; }
.nav-links { display: flex; gap: var(--sp-4); list-style: none; margin: 0; padding: 0; }
.nav-links a {
  text-decoration: none; font-size: 0.92rem; font-weight: 500;
  position: relative; padding-bottom: 4px;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 0;
  background: var(--ink); transition: width var(--dur-fast) var(--ease);
}
.nav-links a:hover::after, .nav-links a[aria-current="page"]::after { width: 100%; }
.nav-cta { display: flex; align-items: center; gap: var(--sp-3); }
.nav-toggle { display: none; }

/* Private Portfolio button duplicated inside the mobile slide-out
   panel (as the last item in nav-links) — hidden here by default
   (desktop), overridden to display:block inside the mobile media
   query below. This rule MUST come before the media query so the
   mobile override actually wins at equal specificity. */
.nav-mobile-cta { display: none; list-style: none; }

@media (max-width: 900px) {
  .nav-links { position: fixed; inset: 84px 0 0 0; background: var(--paper); flex-direction: column;
    padding: var(--sp-5) var(--sp-4); gap: var(--sp-4); transform: translateY(-8px); opacity: 0;
    pointer-events: none; transition: opacity var(--dur-med) var(--ease), transform var(--dur-med) var(--ease);
    overflow-y: auto; }
  .nav-links.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .nav-links a { font-size: 1.3rem; }
  .nav-cta { gap: var(--sp-2); }
  .nav-cta .btn-ghost { display: none; }
  .nav-mobile-cta { display: block; margin-top: var(--sp-2); }
  .nav-mobile-cta .btn { width: 100%; justify-content: center; }
  .theme-label { display: none; }
  .nav-toggle {
    display: block; background: none; border: none; cursor: pointer;
    width: 32px; height: 22px; position: relative; flex: none;
  }
  .nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
    content: ""; display: block; position: absolute; left: 0; width: 100%; height: 1px; background: var(--ink);
    transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
  }
  .nav-toggle span { top: 10px; }
  .nav-toggle span::before { top: -8px; }
  .nav-toggle span::after { top: 8px; }
  .nav-toggle[aria-expanded="true"] span { background: transparent; }
  .nav-toggle[aria-expanded="true"] span::before { transform: translateY(8px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span::after { transform: translateY(-8px) rotate(-45deg); }
}

@media (max-width: 380px) {
  .brand { font-size: 1.05rem; }
  .nav-cta { gap: 6px; }
}

/* ---- Footer ---- */
.site-footer { background: var(--dusk); color: var(--dusk-ink); padding: var(--sp-6) 0 var(--sp-4); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: var(--sp-5); }
.footer-grid h4 { font-family: var(--font-body); font-size: 0.8rem; text-transform: uppercase; letter-spacing: var(--tracking-wide); color: var(--gold); margin-bottom: var(--sp-2); font-weight: 600; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6em; }
.footer-grid a { text-decoration: none; opacity: 0.85; }
.footer-grid a:hover { opacity: 1; text-decoration: underline; }
.footer-bottom {
  margin-top: var(--sp-5); padding-top: var(--sp-3); border-top: 1px solid var(--dusk-line);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--sp-2);
  font-size: 0.85rem; opacity: 0.75;
}
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* ---- Draft-copy marker: invisible to visitors, but easy for
   Justice to find later via the "ph" class in the code. No
   visual treatment on purpose, so the site reads as finished. ---- */
.ph { /* intentionally unstyled */ }

/* ---- Utility: scroll-margin so anchored/scrolled-to fields land
   below the sticky nav rather than under it. ---- */
.field, section[id] { scroll-margin-top: 110px; }

/* ---- Skip link ---- */
.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper);
  padding: 0.8em 1.2em; z-index: 100;
}
.skip-link:focus { left: var(--sp-2); top: var(--sp-2); }
