/* Aesthera — shared styles */

:root {
  /* Aesthera brand palette (default) */
  --bg: #F9F7F4;
  --bg-2: #EEEBDF;
  --ink: #25201B;
  --ink-2: #3E4730;
  --muted: #8D8C7B;
  --rule: #DFD8CA;
  --accent: #C4673A;        /* copper */
  --accent-2: #E8956A;
  --blush: #C9B99E;
  --paper: #FAF8F4;
}

[data-palette="bone"] {
  --bg: #EEEBDF;
  --bg-2: #EAE7DC;
  --ink: #1A1815;
  --ink-2: #3E4730;
  --muted: #8D8C7B;
  --rule: #DFD8CA;
  --accent: #C4673A;
  --accent-2: #E8956A;
  --blush: #C9B99E;
  --paper: #F9F7F4;
}

[data-palette="ink"] {
  --bg: #1A1815;
  --bg-2: #25201B;
  --ink: #F9F7F4;
  --ink-2: #EEEBDF;
  --muted: #C9B99E;
  --rule: #F9F7F41F;
  --accent: #E8956A;
  --accent-2: #C4673A;
  --blush: #C9B99E;
  --paper: #25201B;
}

[data-palette="olive"] {
  --bg: #F9F7F4;
  --bg-2: #EAE7DC;
  --ink: #25201B;
  --ink-2: #3E4730;
  --muted: #8D8C7B;
  --rule: #DFD8CA;
  --accent: #4A5F72;
  --accent-2: #8D8C7B;
  --blush: #C9B99E;
  --paper: #FAF8F4;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: clip; }

body {
  background: var(--bg);
  color: var(--ink-2);
  font-family: "Figtree", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background 360ms ease, color 360ms ease;
}

/* Type system — Newsreader (display serif, light 300) + Figtree (sans) + JetBrains Mono (eyebrow label) */
.serif { font-family: "Newsreader", "Times New Roman", serif; font-weight: 300; letter-spacing: -0.015em; font-optical-sizing: auto; }
.serif-italic { font-family: "Newsreader", serif; font-style: italic; font-weight: 300; letter-spacing: -0.01em; }
.mono { font-family: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }

/* Type pairing B — alternate display family */
[data-type="b"] .serif,
[data-type="b"] .h-display,
[data-type="b"] .h-section,
[data-type="b"] .h-card,
[data-type="b"] .marquee-item,
[data-type="b"] .brand {
  font-family: "Fraunces", "Times New Roman", serif !important;
  font-weight: 360 !important;
}

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

/* Layout primitives */
.container { width: 100%; max-width: 1440px; margin: 0 auto; padding: 0 40px; }
.container-wide { width: 100%; max-width: 1680px; margin: 0 auto; padding: 0 40px; }
.row { display: flex; }
.col { display: flex; flex-direction: column; }
.grid-12 { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; }

hr.rule { border: 0; border-top: 1px solid var(--rule); margin: 0; }

/* NAV */
/* #nav-mount is the wrapper chrome.js injects the nav into. Without
   display:contents, the wrapper forms a containing block exactly the
   height of the nav itself, so position:sticky on .nav has zero range
   to slide (it scrolls away with the wrapper). display:contents removes
   the wrapper from the layout tree, making .nav an effective direct
   child of <body> — sticky now stays pinned for the full page scroll. */
#nav-mount { display: contents; }
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: color-mix(in oklab, var(--bg) 78%, transparent);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 40px;
  max-width: 1680px; margin: 0 auto;
}
.brand {
  font-family: "Newsreader", serif;
  font-weight: 300;
  font-size: 22px;
  letter-spacing: -0.01em;
  display: flex; align-items: baseline; gap: 10px;
}
.brand-logo { align-items: center; gap: 14px; }
.brand-logo img { height: 32px; width: auto; display: block; }
.brand-logo small { transform: translateY(-1px); }
.brand .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); display: inline-block; transform: translateY(-3px); }
.brand small { font-family: "JetBrains Mono", monospace; font-size: 10px; letter-spacing: 0.12em; color: var(--muted); text-transform: uppercase; font-weight: 400; }
.nav-links { display: flex; gap: 36px; align-items: center; }
.nav-links a { font-size: 16px; color: var(--ink-2); position: relative; padding: 6px 0; }
.nav-links a.active::after { content: ""; position: absolute; bottom: 0; left: 0; right: 0; height: 1px; background: var(--ink); }
.nav-links a:hover { color: var(--ink); }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 16px 28px;
  border-radius: 50px;
  font-family: "Figtree", sans-serif;
  font-size: 15px;
  font-weight: 500;
  border: 1px solid #1C2B4A;
  background: #1C2B4A;
  color: #FFF;
  transition: all 220ms ease;
  cursor: pointer;
}
.btn:hover { transform: translateY(-1px); background: #E8956A; border-color: #E8956A; }
/* Hero band + nav CTAs flip the convention — orange at rest, navy on
   hover — so the primary CTAs pop on first paint. Covers desktop nav
   (.nav .btn / .nav-cta) and the mobile drawer (.nav-drawer .btn). */
.hero-band .btn,
.nav .btn,
.nav-drawer .btn { background: #E8956A; border-color: #E8956A; }
.hero-band .btn:hover,
.nav .btn:hover,
.nav-drawer .btn:hover { background: #1C2B4A; border-color: #1C2B4A; }
.btn .arrow { transition: transform 220ms ease; }
.btn:hover .arrow { transform: translate(2px, -2px); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn.ghost:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* Section frames */
section { padding: 120px 0; position: relative; }
section.tight { padding: 80px 0; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-family: "JetBrains Mono", monospace; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 400; }
.eyebrow .num { color: var(--ink); }
.eyebrow::before { content: ""; width: 24px; height: 1px; background: var(--ink); display: inline-block; }

h1, h2, h3 { margin: 0; font-weight: 400; }

.h-display {
  font-family: "Newsreader", serif;
  font-weight: 200;
  font-size: clamp(56px, 8.5vw, 156px);
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--ink);
}
.h-display em { font-style: italic; font-weight: 200; }

.h-section {
  font-family: "Newsreader", serif;
  font-weight: 200;
  font-size: clamp(40px, 5vw, 76px);
  line-height: 1.08;
  letter-spacing: -0.018em;
  color: var(--ink);
}
.h-section em { font-style: italic; font-weight: 200; }

.h-card {
  font-family: "Newsreader", serif;
  font-weight: 300;
  font-size: clamp(26px, 2.2vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.012em;
  color: var(--ink);
}

/* Footer */
footer.site-footer { background: #1C2B4A; color: #F9F7F4; padding: 0 0 30px; }
footer .h-display { font-size: clamp(80px, 14vw, 240px); line-height: 0.9; }
footer hr.rule { border-color: rgba(255,255,255,.12); }
footer a { color: var(--bg); }
footer .muted { color: color-mix(in oklab, var(--bg) 60%, transparent); }
/* Top cream-colored band above the wordmark — full-width inside the navy footer */
footer .footer-top { background: #EEEBDF; color: var(--ink); padding: 100px 0; }
footer .footer-top .muted { color: color-mix(in oklab, var(--ink) 60%, transparent); }
footer .footer-top a:not(.btn) { color: var(--ink); }
/* Wordmark now sits between the columns and the copyright row; spacing
   is handled inline (margin:60px 0). Columns get the 100px top padding
   to give the navy section its own breathing room from the cream band. */
footer .col-links { display: flex; flex-direction: column; gap: 10px; }
footer .col-links a { font-size: 14px; opacity: .7; transition: opacity .2s; }
footer .col-links a:hover { opacity: 1; }

/* Reusable image placeholder */
.imgph {
  position: relative;
  background: var(--bg-2);
  border: 1px solid var(--rule);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
}
.imgph::before {
  content: "";
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(135deg, transparent 0 18px, color-mix(in oklab, var(--ink) 4%, transparent) 18px 19px);
  opacity: .9;
}
.imgph .label {
  position: relative; z-index: 1;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 12px 14px;
}
.imgph.warm { background: color-mix(in oklab, var(--blush) 40%, var(--bg-2)); }
.imgph.dark { background: var(--ink); color: var(--bg); }
.imgph.dark::before { background-image: repeating-linear-gradient(135deg, transparent 0 18px, rgba(255,255,255,.06) 18px 19px); }
.imgph.dark .label { color: color-mix(in oklab, var(--bg) 60%, transparent); }
/* Real photos shouldn't get the placeholder diagonal hatch or border */
.imgph.photo::before { content: none; }
.imgph.photo { border: none; }

/* Marquee */
.marquee { overflow: hidden; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 28px 0; }
.marquee-track { display: flex; gap: 80px; animation: scroll 40s linear infinite; width: max-content; }
.marquee-item { font-family: "Newsreader", serif; font-weight: 300; font-size: 36px; letter-spacing: -0.015em; white-space: nowrap; display: flex; align-items: center; gap: 80px; color: var(--ink); }
.marquee-item::after { content: "✺"; color: var(--accent); font-size: 18px; }
@keyframes scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Reveal-on-scroll */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s ease, transform .9s ease; }
.reveal.in { opacity: 1; transform: none; }

/* Cursor link arrow */
.link-arrow { display: inline-flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--ink); padding-bottom: 4px; transition: gap .2s ease; }
.link-arrow:hover { gap: 14px; }

/* Tweaks panel button */
.palette-swatches { display: flex; gap: 8px; }
.palette-swatch {
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--rule);
  cursor: pointer;
  position: relative;
}
.palette-swatch.active { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Tag */
.tag {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Utility */
.muted { color: var(--muted); }
.lead { font-size: 18px; line-height: 1.65; color: var(--ink-2); max-width: 640px; font-weight: 400; }
.kicker { font-family: "Newsreader", serif; font-style: italic; font-weight: 300; color: var(--accent); }

/* Mobile nav hamburger + drawer (hidden on desktop) */
.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  width: 18px; height: 1.5px;
  background: var(--ink);
  transition: transform .25s ease, opacity .2s ease;
}
.nav-toggle.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile drawer — full-viewport overlay below the nav bar.
   Doesn't push page content; uses position:fixed so the user sees
   the menu floating over the page, not stacked above it. */
.nav-drawer {
  position: fixed;
  top: 56px; /* below the nav bar */
  left: 0; right: 0; bottom: 0;
  z-index: 49;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 32px 28px 48px;
  background: var(--bg);
  overflow-y: auto;
}
/* The HTML `hidden` attribute sets display:none in user-agent styles,
   but our .nav-drawer display:flex above outranks it. Re-assert
   display:none with attribute selector + !important so the drawer is
   actually hidden on load until the hamburger toggles it. */
.nav-drawer[hidden] { display: none !important; }
.nav-drawer a {
  font-family: "Newsreader", serif;
  font-weight: 200;
  font-size: clamp(28px, 7vw, 40px);
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink);
  padding: 10px 0;
  text-align: center;
}
.nav-drawer a.active { color: var(--accent); font-style: italic; }
.nav-drawer a.btn {
  margin-top: 36px;
  font-family: "Figtree", sans-serif;
  font-weight: 500;
  font-size: 16px;
  letter-spacing: 0;
  padding: 18px 36px;
  text-align: center;
  justify-content: center;
}

@media (max-width: 900px) {
  .container, .container-wide, .nav-inner { padding-left: 24px; padding-right: 24px; }
  section { padding: 80px 0; }
  .nav-links, .nav-cta { display: none; }
  .nav-toggle { display: flex; }
  .grid-12 { grid-template-columns: repeat(6, 1fr); }
}

/* Real mobile (phone) — collapse all multi-column inline grids,
   neutralize awkward absolute margins, and stack the footer columns. */
@media (max-width: 700px) {
  /* Any inline-styled grid with 2+ columns -> single column. Catches
     the many grid-template-columns: "1fr 2fr" / "1fr 1.4fr" / etc.
     patterns sprinkled through index, services, contact, and case pages. */
  [style*="grid-template-columns:1fr 2fr"],
  [style*="grid-template-columns: 1fr 2fr"],
  [style*="grid-template-columns:2fr 1fr"],
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns:1fr 1.4fr"],
  [style*="grid-template-columns:1.4fr 1fr"],
  [style*="grid-template-columns:1fr 1.6fr"],
  [style*="grid-template-columns:1.6fr 1fr"],
  [style*="grid-template-columns:1fr 1.3fr"],
  [style*="grid-template-columns:80px 1fr 1.3fr"],
  [style*="grid-template-columns:80px 1.4fr 1fr"],
  [style*="grid-template-columns:repeat(2,1fr)"],
  [style*="grid-template-columns:repeat(2, 1fr)"],
  [style*="grid-template-columns:repeat(3,1fr)"],
  [style*="grid-template-columns:repeat(3, 1fr)"] {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }

  /* Sticky sidebars (services detail "01 Discovery" number column)
     shouldn't be sticky on mobile — they just float awkwardly. */
  [style*="position:sticky"], [style*="position: sticky"] { position: static !important; }

  /* Decorative offsets that look broken on mobile */
  [style*="margin-top:120px"] { margin-top: 0 !important; }
  [style*="margin-top:80px"]:not(.nav-drawer a) { margin-top: 0 !important; }

  /* Footer 3-col → stack on phones */
  footer [style*="2fr 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
  footer [style*="justify-content:space-between"][style*="padding:24px 0 0"] {
    flex-direction: column;
    gap: 8px;
  }

  /* Services index row: stack number + title vertically; hide column-style arrow */
  .service-row {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    padding: 28px 0 !important;
  }
  .service-row:hover {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .service-row .arr { display: none; }

  /* Hero copy padding tightens further on phones */
  .hero-band { min-height: 480px !important; }
  .hero-band-copy { padding: 48px 20px !important; }

  /* Cap the wordmark logo so it doesn't crowd the hamburger */
  .brand-logo img { height: 22px; }
  .nav-inner { padding: 14px 20px; }

  /* Tag row wraps better */
  .tag { font-size: 11px; }
}
