/* Sullivan Acoustics. Brand tokens live here; see brand/index.html. */

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("fonts/schibsted-grotesk-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("fonts/schibsted-grotesk-latin-wght-italic.woff2") format("woff2");
  font-weight: 400 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  --green: #1d3b2e;
  --green-mid: #2f5a45;
  --sage: #e4ebe3;
  --sage-deep: #b9c9bd;
  --paper: #f6f4ee;
  --white: #fffefb;
  --ink: #16211b;
  --muted: #56655c;
  --rule: #d8ddd4;
  --amber: #d9932e;
  --amber-text: #9a5f0c;

  --sans: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --gutter: clamp(16px, 4vw, 40px);
  --section: clamp(64px, 10vw, 128px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(16px, 0.25vw + 15px, 18px);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration-color: var(--amber); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--green-mid); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { margin: 0; line-height: 1.12; letter-spacing: -0.02em; font-weight: 640; }
h1 { font-size: clamp(2.3rem, 5.4vw, 4.4rem); max-width: 17ch; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.85rem, 3.4vw, 2.75rem); letter-spacing: -0.03em; }
h3 { font-size: 1.15rem; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 var(--gutter); }

.skip { position: absolute; left: -999px; top: 8px; background: var(--green); color: var(--paper); padding: 8px 14px; z-index: 10; }
.skip:focus { left: 8px; }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--amber-text);
  margin: 0 0 18px;
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: rgb(246 244 238 / 0.9);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.site-header.scrolled { border-bottom-color: var(--rule); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.logo img { height: 42px; width: auto; }
.site-nav { display: flex; align-items: center; gap: clamp(16px, 2.5vw, 32px); }
.nav { display: flex; align-items: center; gap: clamp(14px, 2.2vw, 28px); list-style: none; margin: 0; padding: 0; font-size: 0.95rem; }
.nav a { text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--green-mid); border-bottom-color: var(--rule); }
.nav a.active { border-bottom-color: var(--amber); }
.nav-contact { display: none; }
.nav-cta { padding: 8px 16px; border-radius: 999px; background: var(--green); color: var(--paper); font-weight: 560; text-decoration: none; font-size: 0.95rem; white-space: nowrap; }
.nav-cta:hover { background: var(--green-mid); color: var(--paper); }
.menu-toggle { display: none; }

@media (max-width: 900px) {
  .site-nav { gap: 10px; }
  .menu-toggle {
    display: inline-flex; align-items: center; gap: 8px;
    min-height: 40px; padding: 0 14px; border-radius: 999px;
    border: 1.5px solid var(--green); background: transparent; color: var(--green);
    font: inherit; font-size: 0.95rem; font-weight: 560; cursor: pointer;
  }
  .menu-icon, .menu-icon::before, .menu-icon::after { display: block; width: 16px; height: 2px; background: currentColor; border-radius: 1px; transition: transform 0.2s, opacity 0.2s; }
  .menu-icon { position: relative; }
  .menu-icon::before, .menu-icon::after { content: ""; position: absolute; left: 0; }
  .menu-icon::before { top: -5px; }
  .menu-icon::after { top: 5px; }
  .menu-toggle[aria-expanded="true"] .menu-icon { background: transparent; }
  .menu-toggle[aria-expanded="true"] .menu-icon::before { transform: translateY(5px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] .menu-icon::after { transform: translateY(-5px) rotate(-45deg); }

  .nav {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--rule);
    padding: 8px var(--gutter) 20px; font-size: 1.15rem;
    box-shadow: 0 16px 24px rgb(22 33 27 / 0.08);
  }
  .nav.open { display: flex; }
  .nav li { border-top: 1px solid var(--rule); }
  .nav li:first-child { border-top: 0; }
  .nav a { display: block; padding: 14px 0; border-bottom: 0; }
  .nav a.active { color: var(--amber-text); }
  .nav-contact { display: block; }
}
@media (max-width: 760px) {
  .logo img { height: 38px; }
}
@media (max-width: 420px) {
  .nav + .nav-cta { display: none; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 24px; border-radius: 999px;
  font: inherit; font-weight: 580; text-decoration: none; cursor: pointer;
  border: 1.5px solid var(--green);
  transition: background 0.15s, color 0.15s;
}
.btn-primary { background: var(--green); color: var(--paper); }
.btn-primary:hover { background: var(--green-mid); border-color: var(--green-mid); color: var(--paper); }
.btn-ghost { background: transparent; color: var(--green); }
.btn-ghost:hover { background: var(--green); color: var(--paper); }

/* Hero */
.hero { padding-top: clamp(48px, 9vw, 112px); }
.lede { font-size: clamp(1.08rem, 0.6vw + 0.95rem, 1.3rem); color: var(--muted); max-width: 40em; margin: 28px 0 36px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

.trace { --h: clamp(90px, 12vw, 150px); margin: clamp(40px, 7vw, 80px) 0 0; position: relative; }
.trace svg { width: 100%; height: var(--h); overflow: visible; }
.trace-limit { stroke: var(--amber); stroke-width: 2; stroke-dasharray: 7 7; vector-effect: non-scaling-stroke; }
.trace-line {
  fill: none; stroke: var(--green); stroke-width: 1.8; stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
@media (prefers-reduced-motion: no-preference) {
  .trace-line { clip-path: inset(0 100% 0 0); animation: reveal 2.6s 0.2s cubic-bezier(.3,.6,.3,1) forwards; }
}
@keyframes reveal { to { clip-path: inset(0 0 0 0); } }
.trace figcaption {
  position: absolute; top: calc(var(--h) * 40 / 140); left: 0; right: 0;
  transform: translateY(calc(-100% - 4px));
  font-family: var(--mono); font-size: 0.75rem; color: var(--amber-text);
  text-align: right;
}
.trace figcaption span { text-transform: uppercase; letter-spacing: 0.06em; margin-right: 6px; }
.trace figcaption sub { font-size: 0.7em; }

.facts {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 640px; margin: 0; border-top: 1px solid var(--ink);
}
.facts > div { padding: 20px 20px 4px 0; }
.facts > div + div { padding-left: 20px; border-left: 1px solid var(--rule); }
.facts dt { font-size: clamp(1.6rem, 2.6vw, 2.2rem); font-weight: 640; letter-spacing: -0.03em; line-height: 1.1; }
.facts dd { margin: 6px 0 0; color: var(--muted); font-size: 0.92rem; line-height: 1.4; }

/* Sections */
.section { padding: var(--section) 0; }
.section-tint { background: var(--sage); }
.section-dark { background: var(--green); color: var(--paper); }
.section-dark .eyebrow { color: var(--amber); }
.section-dark a { color: var(--white); }

.section-head p:not(.eyebrow) { color: var(--muted); margin-top: 20px; }
.section-dark .section-head p:not(.eyebrow) { color: var(--sage-deep); }
.section-head-wide { max-width: 44em; margin-bottom: clamp(40px, 6vw, 64px); }

.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(40px, 7vw, 96px); align-items: start; }
.split .section-head { position: sticky; top: 108px; }
@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
  .split .section-head { position: static; }
}

.prose { max-width: 38em; }
.section-dark .prose { color: #dfe7df; }

/* Services */
.services { list-style: none; margin: 0; padding: 0; counter-reset: svc; }
.services li { counter-increment: svc; display: grid; grid-template-columns: 3.2rem 1fr; padding: 26px 0; border-top: 1px solid var(--rule); }
.services li:last-child { border-bottom: 1px solid var(--rule); }
.services li::before { content: counter(svc, decimal-leading-zero); font-family: var(--mono); font-size: 0.85rem; color: var(--amber-text); padding-top: 4px; grid-row: span 2; }
.services p { color: var(--muted); margin: 8px 0 0; }

/* Automation flow */
.flow { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 28px 0; font-family: var(--mono); font-size: 0.85rem; }
.flow span { border: 1px solid rgb(246 244 238 / 0.35); border-radius: 6px; padding: 8px 12px; color: var(--paper); }
.flow i { width: 28px; height: 2px; background: var(--amber); position: relative; }
.flow i::after { content: ""; position: absolute; right: -1px; top: -4px; border: 5px solid transparent; border-left: 7px solid var(--amber); border-right: 0; }

/* Projects */
.projects { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 clamp(24px, 3vw, 40px); }
.projects li { border-top: 1px solid var(--ink); padding: 22px 0 36px; }
.projects .meta { font-family: var(--mono); font-size: 0.78rem; color: var(--amber-text); margin: 10px 0 12px; line-height: 1.5; }
.projects p:last-child { color: var(--muted); margin: 0; font-size: 0.97rem; }
.group-title { font-family: var(--mono); font-size: 0.8rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 14px; }
.projects + .group-title { margin-top: 32px; }
.projects-recent { grid-template-columns: repeat(2, 1fr); }
.projects-recent h3 { font-size: 1.35rem; }
.footnote { color: var(--muted); font-size: 0.92rem; max-width: 52em; margin: 8px 0 0; }
@media (max-width: 900px) { .projects { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .projects, .projects-recent { grid-template-columns: 1fr; } .projects li { padding-bottom: 28px; } }

/* Columns */
.columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 4vw, 48px); }
.columns > div { border-top: 3px solid var(--green); padding-top: 20px; }
.columns p { color: var(--muted); margin: 10px 0 0; }
@media (max-width: 760px) { .columns { grid-template-columns: 1fr; } }

/* About */
.about { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(40px, 7vw, 96px); align-items: start; }
.about h2 { margin-bottom: 24px; }
.portrait img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 4px; }
.credentials { list-style: none; margin: 32px 0 0; padding: 0; border-top: 1px solid var(--rule); }
.credentials li { padding: 12px 0 12px 26px; border-bottom: 1px solid var(--rule); position: relative; font-size: 0.97rem; }
.credentials li::before { content: ""; position: absolute; left: 2px; top: 22px; width: 12px; height: 2px; background: var(--amber); }
@media (max-width: 760px) {
  .about { grid-template-columns: 1fr; }
  .portrait { width: 160px; }
}

/* Testimonials */
.quotes { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 64px); }
.quotes figure { margin: 0; }
.quotes blockquote { margin: 0; font-size: clamp(1.15rem, 1vw + 0.9rem, 1.45rem); line-height: 1.45; letter-spacing: -0.01em; position: relative; }
.quotes blockquote::before { content: "\201C"; display: block; font-size: 3.5rem; line-height: 0.8; color: var(--amber); height: 0.5em; margin-bottom: 8px; }
.quotes figcaption { margin-top: 16px; color: var(--muted); font-size: 0.95rem; }
.quotes figcaption strong { color: var(--ink); display: block; font-weight: 600; }
@media (max-width: 760px) { .quotes { grid-template-columns: 1fr; } }

/* Contact */
.contact { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(40px, 7vw, 96px); }
.contact h2 + p { color: var(--muted); margin-top: 20px; }
.contact-list { margin: 32px 0 0; }
.contact-list > div { display: grid; grid-template-columns: 5.5rem 1fr; gap: 12px; padding: 14px 0; border-top: 1px solid var(--rule); }
.contact-list dt { font-family: var(--mono); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding-top: 3px; }
.contact-list dd { margin: 0; }
.contact-list a { font-weight: 560; }
@media (max-width: 900px) { .contact { grid-template-columns: 1fr; } }

.form { background: var(--white); border: 1px solid var(--rule); border-radius: 8px; padding: clamp(20px, 4vw, 36px); display: grid; gap: 18px; align-content: start; }
.form label { display: grid; gap: 6px; font-weight: 560; font-size: 0.95rem; }
.optional { font-weight: 400; color: var(--muted); }
.form input, .form textarea {
  font: inherit; font-weight: 400; color: var(--ink);
  background: var(--paper); border: 1px solid var(--rule); border-radius: 6px;
  padding: 12px 14px; width: 100%;
}
.form textarea { resize: vertical; min-height: 130px; }
.form input:focus, .form textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgb(29 59 46 / 0.15); }
.form .btn { justify-self: start; }
.form .small { font-size: 0.85rem; color: var(--muted); margin: 0; }
.hp { position: absolute; left: -9999px; }
.form-status { margin: 0; font-size: 0.95rem; }
.form-status.ok { color: var(--green-mid); font-weight: 560; }
.form-status.err { color: #a3361f; }

/* Footer */
.site-footer { background: var(--green); color: var(--sage-deep); padding: 48px 0; font-size: 0.88rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 24px; }
.footer-inner img { height: 44px; width: auto; }
.footer-inner p { margin: 0; line-height: 1.7; }
.site-footer a { color: var(--paper); }

/* Simple pages (privacy, 404) */
.page { padding: clamp(48px, 8vw, 96px) 0 var(--section); }
.page .prose { max-width: 42em; }
.page h1 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 32px; }
.page h2 { font-size: 1.35rem; margin: 40px 0 12px; letter-spacing: -0.015em; }
.page ul { padding-left: 1.2em; }
