/* Woodward Construction Management — site styles
   Tokens follow design/README.md (Handoff). Light is the base; dark overrides. */

:root {
  --bg: #f7f3ea;
  --bg-glow: color-mix(in srgb, #eadfc6 90%, transparent);
  --band: #ece3d0;
  --band-glow: color-mix(in srgb, #d9c69b 65%, transparent);
  --text: #262115;
  --text-muted: color-mix(in srgb, #262115 72%, transparent);
  --text-faint: color-mix(in srgb, #262115 52%, transparent);
  --nav-link: color-mix(in srgb, #262115 62%, transparent);
  --gold: #8a6a33;
  --gold-line: #a8843f;
  --gold-strong: #6f5426;
  --frame-border: #ddd2bc;
  --frame-inset: color-mix(in srgb, #f7f3ea 75%, transparent);
  --photo-opacity: 1;
  --gutter: 64px;
  --font-display: "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  color-scheme: light;
}

/* Dark palette — applied by the toggle, or by the OS when nothing is stored. */
.always-dark,
:root[data-theme="dark"] {
  --bg: #111015;
  --bg-glow: color-mix(in srgb, #3a2c14 80%, transparent);
  --band: #1c1610;
  --band-glow: color-mix(in srgb, #8a6a33 50%, transparent);
  --text: #ece7dd;
  --text-muted: color-mix(in srgb, #ece7dd 72%, transparent);
  --text-faint: color-mix(in srgb, #ece7dd 50%, transparent);
  --nav-link: color-mix(in srgb, #ece7dd 65%, transparent);
  --gold: #ddc493;
  --gold-line: #c9a259;
  --gold-strong: #c9a259;
  --frame-border: #2e2a22;
  --frame-inset: color-mix(in srgb, #c9a259 55%, transparent);
  --photo-opacity: 0.88;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111015;
    --bg-glow: color-mix(in srgb, #3a2c14 80%, transparent);
    --band: #1c1610;
    --band-glow: color-mix(in srgb, #8a6a33 50%, transparent);
    --text: #ece7dd;
    --text-muted: color-mix(in srgb, #ece7dd 72%, transparent);
    --text-faint: color-mix(in srgb, #ece7dd 50%, transparent);
    --nav-link: color-mix(in srgb, #ece7dd 65%, transparent);
    --gold: #ddc493;
    --gold-line: #c9a259;
    --gold-strong: #c9a259;
    --frame-border: #2e2a22;
    --frame-inset: color-mix(in srgb, #c9a259 55%, transparent);
    --photo-opacity: 0.88;
    color-scheme: dark;
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

/* ---------- fade-through navigation (see lib/platform/anchor_scroll.dart) ---------- */
/* Same-page section jumps: the old view fades out, the new one fades in and settles. */
::view-transition-old(root) { animation: 180ms ease-in both wcm-fade-out; }
::view-transition-new(root) { animation: 280ms ease-out both wcm-fade-in; }
@keyframes wcm-fade-out { to { opacity: 0; } }
@keyframes wcm-fade-in { from { opacity: 0; transform: translateY(10px); } }
/* Page-to-page moves (Home <-> The Work) get the same crossfade in browsers that support it. */
@view-transition { navigation: auto; }
/* Fallback for browsers without view transitions. */
.page { transition: opacity 180ms ease-in; }
.page.is-fading { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  .page { transition: none; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.page {
  min-height: 100vh;
  background: radial-gradient(1200px 800px at 50% -220px, var(--bg-glow), transparent 62%);
}
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  margin: 0;
  letter-spacing: 0;
}
h1 em, h2 em, h3 em { font-style: italic; font-weight: 400; color: var(--gold); }
p { margin: 0; }
a { color: var(--gold); text-underline-offset: 3px; }
img { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }
button { font: inherit; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--gold-line); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--gold-line) 30%, transparent); }
[id] { scroll-margin-top: 24px; }

/* ---------- ornaments ---------- */
.label {
  font-size: 12.5px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
}
.hero-label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 16px;
  margin: 0;
}
.hero-label .gem { width: 5px; height: 5px; background: var(--gold-line); transform: rotate(45deg); }

.caption {
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-faint);
  line-height: 1.6;
  font-feature-settings: "tnum" 1;
}
.caption.gold { color: var(--gold); }

.diamond {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 1232px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.diamond .line { flex: 1; height: 1px; background: linear-gradient(to left, color-mix(in srgb, var(--gold-line) 50%, transparent), transparent); }
.diamond .line + .gem + .line { background: linear-gradient(to right, color-mix(in srgb, var(--gold-line) 50%, transparent), transparent); }
.diamond .gem { flex: 0 0 6px; width: 6px; height: 6px; background: var(--gold-line); transform: rotate(45deg); }

.numeral {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1;
  color: var(--gold-line);
}

.photo { position: relative; }
.photo img { width: 100%; object-fit: cover; opacity: var(--photo-opacity); }
.photo .frame { position: absolute; inset: 18px; border: 1px solid var(--frame-inset); pointer-events: none; }
.photo.grid .frame { inset: 14px; }

/* logo — one file per theme, swapped by CSS */
.logo { max-width: 100%; height: auto; }
.logo-dark { display: none; }
:root[data-theme="dark"] .logo-light, .always-dark .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark, .always-dark .logo-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none; }
  :root:not([data-theme="light"]) .logo-dark { display: block; }
}
.logo-wrap { display: inline-block; }

/* ---------- buttons ---------- */
.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.3;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}
.btn-primary { border-color: var(--gold-line); color: var(--gold-strong); }
.btn-primary:hover { background: color-mix(in srgb, var(--gold-line) 12%, transparent); }
.btn-primary:active { background: color-mix(in srgb, var(--gold-line) 22%, transparent); }
.btn-ghost { color: var(--text-muted); }
.btn-ghost:hover { background: color-mix(in srgb, var(--gold-line) 10%, transparent); color: var(--text); }
.btn-ghost:active { background: color-mix(in srgb, var(--gold-line) 18%, transparent); }

/* ---------- nav ---------- */
.nav {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 28px var(--gutter) 20px;
}
.nav::after {
  content: "";
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, color-mix(in srgb, var(--gold-line) 45%, transparent) 48px calc(100% - 48px), transparent);
}
.nav-left, .nav-right {
  display: flex;
  align-items: center;
  gap: 32px;
  font-size: 12.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1.4;
}
.nav-right { justify-content: flex-end; }
.nav a, .nav .current, .theme-toggle { white-space: nowrap; }
.nav a { color: var(--nav-link); text-decoration: none; transition: color 150ms ease; }
.nav a:hover { color: var(--gold); }
.nav .phone, .nav .current { color: var(--gold); }
.theme-toggle {
  padding: 0;
  border: 0;
  background: none;
  color: var(--nav-link);
  font-size: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  line-height: inherit;
  cursor: pointer;
  transition: color 150ms ease;
}
.theme-toggle:hover { color: var(--gold); }
.theme-toggle .when-dark { display: none; }
:root[data-theme="dark"] .theme-toggle .when-light { display: none; }
:root[data-theme="dark"] .theme-toggle .when-dark { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .when-light { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .when-dark { display: inline; }
}

/* ---------- homepage ---------- */
.hero {
  padding: 44px var(--gutter) 72px;
  text-align: center;
}
.hero .logo { width: min(440px, 62vw); }
.hero .logo[width="300"] { width: min(300px, 56vw); }
.hero .hero-label { margin: 22px 0 28px; }
.hero h1 {
  font-size: clamp(48px, 7.2vw, 88px);
  line-height: 1.06;
  max-width: 18ch;
  margin: 0 auto 24px;
}
.hero .lede {
  font-size: 16px;
  line-height: 1.75;
  max-width: 54ch;
  margin: 0 auto 36px;
  color: var(--text-muted);
}

.featured { padding: 0 var(--gutter) 88px; max-width: 1360px; margin: 0 auto; }
.featured .photo img { height: clamp(240px, 41vw, 560px); }
.featured .caption { text-align: center; margin-top: 16px; }

.services { padding: 88px var(--gutter); }
.services .label, .process .label, .testimonials .label { display: block; text-align: center; }
.services .label { margin-bottom: 56px; }
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 72px;
  max-width: 1232px;
  margin: 0 auto;
  text-align: center;
}
.services h3 { font-size: 30px; line-height: 1.2; margin: 14px 0 14px; }
.services p { font-size: 14.5px; line-height: 1.75; color: var(--text-muted); max-width: 36ch; margin: 0 auto; }

.process {
  background: radial-gradient(900px 460px at 50% -60%, var(--band-glow), transparent 70%), var(--band);
  padding: 76px var(--gutter);
}
.process .label { margin-bottom: 52px; }
.process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 56px;
  max-width: 1232px;
  margin: 0 auto;
  text-align: center;
}
.process .numeral { font-size: 20px; }
.process h3 { font-size: 24px; line-height: 1.2; margin: 12px 0 12px; }
.process p { font-size: 13.5px; line-height: 1.7; color: var(--text-muted); max-width: 30ch; margin: 0 auto; }

.about { padding: 96px var(--gutter); }
.about-grid {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 88px;
  align-items: center;
  max-width: 1232px;
  margin: 0 auto;
}
.portrait { position: relative; }
.portrait img { width: 100%; aspect-ratio: 840 / 870; object-fit: cover; opacity: var(--photo-opacity); }
.portrait .frame { position: absolute; inset: -14px 14px 14px -14px; border: 1px solid var(--frame-inset); pointer-events: none; }
:root[data-theme="dark"] .portrait .frame { border-color: color-mix(in srgb, #c9a259 55%, transparent); }
.about h2 { font-size: clamp(34px, 4.4vw, 46px); line-height: 1.15; margin: 14px 0 20px; }
.about .bio { font-size: 15.5px; line-height: 1.85; max-width: 56ch; color: var(--text-muted); }
.signature {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 19px;
  color: var(--gold);
  margin-top: 20px;
}

.testimonials { padding: 88px var(--gutter); }
.testimonials .label { margin-bottom: 48px; }
.featured-quote { max-width: 62ch; margin: 0 auto; text-align: center; }
.featured-quote p {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(24px, 3.2vw, 34px);
  line-height: 1.4;
  margin: 0 0 18px;
}
.quote-grid {
  columns: 2;
  column-gap: 88px;
  max-width: 1040px;
  margin: 72px auto 0;
}
.quote { break-inside: avoid; margin: 0 0 40px; }
.quote p {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.6;
  margin: 0 0 10px;
}
.quote .caption, .featured-quote .caption { font-size: 11.5px; letter-spacing: 0.2em; }

.close {
  background: radial-gradient(900px 460px at 50% -60%, color-mix(in srgb, #8a6a33 40%, transparent), transparent 70%), #14120e;
  color: var(--text);
  padding: 80px var(--gutter);
  text-align: center;
}
.close .logo { width: 208px; }
.close h3 { font-size: clamp(30px, 4vw, 38px); line-height: 1.15; margin: 28px 0 16px; }
.close .address { font-size: 14.5px; line-height: 1.8; color: var(--text-muted); margin-bottom: 28px; }
.close .address a { color: inherit; text-decoration: none; }
.close .address a:hover { color: var(--gold); }
.close .actions { margin-bottom: 32px; }
.footer-line { font-size: 11.5px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--text-faint); line-height: 1.7; font-feature-settings: "tnum" 1; }

/* ---------- the work ---------- */
.work-head { padding: 40px var(--gutter) 64px; text-align: center; }
.work-head .logo { width: min(300px, 56vw); }
.work-head .hero-label { margin: 16px 0 26px; }
.work-head h1 { font-size: clamp(48px, 7vw, 84px); line-height: 1.06; margin: 0 auto 24px; }
.work-head .lede { font-size: 15.5px; line-height: 1.8; max-width: 52ch; margin: 0 auto; color: var(--text-muted); }

.work-wrap { max-width: 1232px; margin: 0 auto; padding: 0 var(--gutter); }
.work-featured .photo img { height: clamp(240px, 42vw, 580px); }
.work-full { margin-top: 72px; }
.work-full .photo img { height: clamp(220px, 38vw, 520px); }
.project-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 24px;
  margin-top: 22px;
}
.project-title h2 { font-size: 32px; line-height: 1.2; }
.project-title .caption { font-size: 12px; }
.project-desc { font-size: 14.5px; line-height: 1.75; max-width: 62ch; margin-top: 12px; color: var(--text-muted); }
.work-diamond { margin: 48px auto; }
.pair {
  display: grid;
  gap: 72px;
  align-items: start;
}
.pair-a { grid-template-columns: 7fr 5fr; }
.pair-b { grid-template-columns: 5fr 7fr; margin-top: 72px; }
.pair .offset { padding-top: 96px; }
.pair .photo img { aspect-ratio: 3 / 2; }
.pair .photo.four-three img { aspect-ratio: 4 / 3; }
.pair .project-title { margin-top: 18px; }
.pair .project-title h2 { font-size: 28px; }
.pair .project-title .caption { font-size: 11.5px; }

.work-close {
  background: radial-gradient(900px 460px at 50% -60%, var(--band-glow), transparent 70%), var(--band);
  margin-top: 96px;
  padding: 72px var(--gutter);
  text-align: center;
}
.work-close h3 { font-size: clamp(30px, 4vw, 38px); line-height: 1.15; margin: 0 0 16px; }
.work-close .lede { font-size: 14.5px; line-height: 1.8; margin: 0 0 28px; color: var(--text-muted); }
.work-close .actions { margin-bottom: 32px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .process-grid { grid-template-columns: repeat(2, 1fr); gap: 48px 40px; }
  .services-grid { gap: 48px; }
}
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; gap: 56px; }
  .about-grid .portrait { max-width: 420px; margin: 0 auto; width: 100%; }
  .about .about-copy { text-align: center; }
  .about .bio, .about h2 { margin-left: auto; margin-right: auto; }
  .quote-grid { columns: 1; }
  .pair-a, .pair-b { grid-template-columns: 1fr; gap: 56px; }
  .pair .offset { padding-top: 0; }
  .pair-b { margin-top: 56px; }
}
@media (max-width: 1000px) {
  .nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 22px;
    padding: 22px var(--gutter) 18px;
  }
  .nav-left, .nav-right { flex-wrap: wrap; justify-content: center; gap: 12px 22px; }
  .nav-center { display: none; }
}
@media (max-width: 768px) {
  :root { --gutter: 24px; }
  body { font-size: 15px; }
  .hero { padding: 36px var(--gutter) 56px; }
  .hero .hero-label { margin: 18px 0 22px; }
  .label { letter-spacing: 0.22em; font-size: 11.5px; }
  .featured { padding-bottom: 64px; }
  .photo .frame { inset: 12px; }
  .photo.grid .frame { inset: 10px; }
  .services { padding: 64px var(--gutter); }
  .services .label { margin-bottom: 40px; }
  .services-grid { grid-template-columns: 1fr; gap: 40px; }
  .process { padding: 60px var(--gutter); }
  .process .label { margin-bottom: 36px; }
  .process-grid { grid-template-columns: 1fr; gap: 36px; }
  .about { padding: 64px var(--gutter); }
  .portrait .frame { inset: -10px 10px 10px -10px; }
  .testimonials { padding: 64px var(--gutter); }
  .quote-grid { margin-top: 48px; }
  .close { padding: 64px var(--gutter); }
  .work-head { padding: 32px var(--gutter) 48px; }
  .work-diamond { margin: 36px auto; }
  .work-full { margin-top: 56px; }
  .work-close { margin-top: 64px; padding: 56px var(--gutter); }
  .project-title h2 { font-size: 26px; }
  .pair .project-title h2 { font-size: 24px; }
}
@media (max-width: 420px) {
  .nav-left, .nav-right { gap: 10px 16px; font-size: 11.5px; }
  .btn { padding: 10px 18px; }
}
