/*
 * Azhian Sazeh — dual-theme layer
 * Dark is the production default. Light uses blueprint paper, limestone,
 * warm concrete, graphite and safety yellow; it is not a color inversion.
 */

:root {
  --theme-canvas: #050505;
  --theme-surface: #111111;
  --theme-surface-2: #181818;
  --theme-text: #f2efe8;
  --theme-muted: #b7b2a9;
  --theme-quiet: #96928a;
  --theme-line: #343434;
  --theme-accent: #f7b900;
  --theme-accent-ink: #f7b900;
  --theme-focus: #f7b900;
  --theme-shadow: rgba(0, 0, 0, .34);
  color-scheme: dark;
}

html[data-theme="light"] {
  --theme-canvas: #f4f1e8;
  --theme-surface: #fffdf8;
  --theme-surface-2: #e9e3d8;
  --theme-text: #191816;
  --theme-muted: #5c574e;
  --theme-quiet: #756e63;
  --theme-line: #cac2b5;
  --theme-accent: #f1b600;
  --theme-accent-ink: #6b4e00;
  --theme-focus: #7a5700;
  --theme-shadow: rgba(49, 42, 31, .14);
  color-scheme: light;
}

html,
body,
.site-header,
.mobile-nav,
.site-footer,
.theme-toggle {
  transition: background-color .22s ease, color .22s ease, border-color .22s ease, box-shadow .22s ease;
}

:focus-visible { outline-color: var(--theme-focus); }

/* Header integration. The injected button remains a progressive enhancement. */
.header-inner--themed { grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 16px; }

.theme-toggle {
  position: relative;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  display: grid;
  place-items: center;
  flex: 0 0 48px;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 50%;
  color: var(--theme-text);
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  isolation: isolate;
  touch-action: manipulation;
}

.theme-toggle::after { display: none; }

.theme-toggle__media {
  position: relative;
  width: 42px;
  height: 42px;
  display: block;
  overflow: hidden;
  border-radius: 50%;
  background: transparent;
  transition: filter .2s ease, transform .2s ease;
}

.theme-toggle__icon {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  transition: opacity .2s ease, transform .22s ease;
}

/* Show the destination-state artwork: glow in Dark, concrete in Light. */
.theme-toggle__icon--dark { opacity: 0; transform: scale(.82); }
.theme-toggle__icon--light { opacity: 1; transform: scale(1); }

html[data-theme="light"] .theme-toggle__icon--dark { opacity: 1; transform: scale(1); }
html[data-theme="light"] .theme-toggle__icon--light { opacity: 0; transform: scale(.82); }

.theme-toggle__state {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.theme-toggle:hover { background: transparent; transform: translateY(-1px); }
.theme-toggle:hover .theme-toggle__media { filter: brightness(1.08); transform: scale(1.035); }
.theme-toggle:active { transform: scale(.96); }
.theme-toggle:focus-visible { outline: 3px solid var(--theme-focus); outline-offset: 3px; }

html[data-theme="light"] .theme-toggle {
  border: 0;
  color: var(--theme-text);
  background: transparent;
  box-shadow: none;
}

/* Main site: warm construction-paper light mode. */
html[data-theme="light"],
html[data-theme="light"] body {
  background: var(--theme-canvas);
  color: var(--theme-text);
}

html[data-theme="light"] body::selection {
  color: #191816;
  background: #f1b600;
}

html[data-theme="light"] .skip-link {
  color: #191816;
  background: #f1b600;
}

html[data-theme="light"] .site-header {
  border-bottom-color: #d5cec1;
  background: rgba(244, 241, 232, .96);
  box-shadow: 0 10px 30px rgba(49, 42, 31, .055);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

html[data-theme="light"] .brand-copy strong { color: var(--theme-text); }
html[data-theme="light"] .brand-copy small { color: var(--theme-muted); }
html[data-theme="light"] .desktop-nav a { color: #4d4942; }
html[data-theme="light"] .desktop-nav .is-active,
html[data-theme="light"] .desktop-nav a:focus-visible,
html[data-theme="light"] .desktop-nav a:hover { color: var(--theme-accent-ink); }

html[data-theme="light"] .header-cta {
  border-color: #8a6500;
  color: #6b4e00;
}

html[data-theme="light"] .header-cta:focus-visible,
html[data-theme="light"] .header-cta:hover {
  color: #191816;
  background: #f1b600;
}

html[data-theme="light"] .menu-toggle {
  border-color: #8a6500;
  background: #fffdf8;
}
html[data-theme="light"] .menu-toggle i { background: #6b4e00; }
html[data-theme="light"] .mobile-nav { background: #fffdf8; }
html[data-theme="light"] .mobile-nav.is-open { border-bottom-color: #8a6500; }
html[data-theme="light"] .mobile-nav a { border-bottom-color: #d8d1c5; color: var(--theme-text); }
html[data-theme="light"] .mobile-nav .mobile-contact { border-color: #8a6500; color: #6b4e00; }

html[data-theme="light"] .monument-hero {
  color: var(--theme-text);
  background-color: var(--theme-canvas);
  background-image:
    linear-gradient(rgba(25, 24, 22, .065) 1px, transparent 0),
    linear-gradient(90deg, rgba(25, 24, 22, .065) 1px, transparent 0);
}

html[data-theme="light"] .monument-hero::after {
  background: linear-gradient(90deg, transparent, rgba(241, 182, 0, .10));
}

html[data-theme="light"] .monument-hero__visual {
  background: #ded8cd;
  box-shadow: 18px 18px 0 rgba(107, 78, 0, .10);
}

html[data-theme="light"] .monument-hero__visual::before {
  background:
    linear-gradient(90deg, rgba(244, 241, 232, .97), rgba(244, 241, 232, .76) 45%, transparent 80%),
    linear-gradient(0deg, rgba(244, 241, 232, .52), transparent 42%);
}

html[data-theme="light"] .monument-hero__visual img {
  content: url("/assets/hero-concrete-frame-light.v1.webp");
  filter: none;
}

html[data-theme="light"] .monument-hero h1 span:first-child,
html[data-theme="light"] .page-hero h1 { color: var(--theme-text); }
html[data-theme="light"] .monument-hero h1 em,
html[data-theme="light"] .monument-hero h1 span:nth-child(2),
html[data-theme="light"] .eyebrow,
html[data-theme="light"] .project-location,
html[data-theme="light"] .section-heading h2 em,
html[data-theme="light"] .company-section h2 em,
html[data-theme="light"] .contact-stage h2 em,
html[data-theme="light"] .future-section h2 em,
html[data-theme="light"] .governance-section h2 em { color: var(--theme-accent-ink); }

html[data-theme="light"] .company-section .eyebrow,
html[data-theme="light"] .company-section h2 em,
html[data-theme="light"] .future-section h2 em { color: #191816; }

html[data-theme="light"] .monument-hero__lead,
html[data-theme="light"] .section-heading > p,
html[data-theme="light"] .section-heading--split > p { color: var(--theme-muted); }
html[data-theme="light"] .monument-hero__visual figcaption { color: var(--theme-text); }
html[data-theme="light"] .hero-facts { border-color: #b8b0a3; }
html[data-theme="light"] .hero-facts div { border-color: #b8b0a3; }
html[data-theme="light"] .hero-facts dt { color: var(--theme-muted); }
html[data-theme="light"] .hero-facts dd { color: var(--theme-text); }
html[data-theme="light"] .action--wire { border-color: #8f877a; color: var(--theme-text); background: rgba(255, 253, 248, .72); }
html[data-theme="light"] .action--wire:focus-visible,
html[data-theme="light"] .action--wire:hover { border-color: #6b4e00; color: #6b4e00; }
html[data-theme="light"] .action--yellow { box-shadow: 6px 6px 0 rgba(25, 24, 22, .16); }

html[data-theme="light"] .proof-strip {
  border-color: var(--theme-line);
  color: var(--theme-text);
  background: var(--theme-surface-2);
}
html[data-theme="light"] .proof-strip__inner,
html[data-theme="light"] .proof-strip__inner div { border-color: var(--theme-line); }
html[data-theme="light"] .proof-strip dt { color: var(--theme-accent-ink); }
html[data-theme="light"] .proof-strip dd { color: var(--theme-text); }

html[data-theme="light"] .active-projects,
html[data-theme="light"] .project-archive,
html[data-theme="light"] .governance-section,
html[data-theme="light"] .contact-stage,
html[data-theme="light"] .content-page {
  color: var(--theme-text);
  background: var(--theme-canvas);
}

html[data-theme="light"] .section-heading--dark { color: var(--theme-text); }
html[data-theme="light"] .section-heading--split h2 em { color: var(--theme-accent-ink); }

html[data-theme="light"] .active-card,
html[data-theme="light"] .archive-card,
html[data-theme="light"] .catalog-card,
html[data-theme="light"] .contact-stage__action,
html[data-theme="light"] .contact-page__action,
html[data-theme="light"] .project-service-links,
html[data-theme="light"] .certificate-card,
html[data-theme="light"] .related-card {
  border-color: var(--theme-line);
  background: var(--theme-surface);
  box-shadow: 8px 8px 0 rgba(107, 78, 0, .10);
}

html[data-theme="light"] .active-card h3,
html[data-theme="light"] .archive-card h3,
html[data-theme="light"] .catalog-card h2,
html[data-theme="light"] .board-list strong,
html[data-theme="light"] .related-card h3,
html[data-theme="light"] .certificate-card h3 { color: var(--theme-text); }

html[data-theme="light"] .active-card p,
html[data-theme="light"] .archive-card__scope,
html[data-theme="light"] .catalog-card p,
html[data-theme="light"] .catalog-intro,
html[data-theme="light"] .contact-stage__action p,
html[data-theme="light"] .contact-page__action p,
html[data-theme="light"] .contact-map-section__copy p,
html[data-theme="light"] .certificate-section__heading > p,
html[data-theme="light"] .project-video-section__copy > p:last-child,
html[data-theme="light"] .related-card p,
html[data-theme="light"] .certificate-card p { color: var(--theme-muted); }

html[data-theme="light"] .active-card dt,
html[data-theme="light"] .archive-card__client,
html[data-theme="light"] .catalog-card__meta,
html[data-theme="light"] .board-list small { color: var(--theme-quiet); }
html[data-theme="light"] .active-card dd { color: var(--theme-text); }
html[data-theme="light"] .active-card dl div,
html[data-theme="light"] .board-list,
html[data-theme="light"] .board-list li { border-color: var(--theme-line); }

html[data-theme="light"] .capability-section,
html[data-theme="light"] .catalog-page--light { color: var(--theme-text); background: var(--theme-canvas); }
html[data-theme="light"] .future-section { color: var(--theme-text); background: var(--theme-surface-2); }
html[data-theme="light"] .capability-grid { border-color: var(--theme-line); background: var(--theme-line); }
html[data-theme="light"] .capability-card { background: var(--theme-surface); }
html[data-theme="light"] .capability-card p,
html[data-theme="light"] .catalog-page--light .catalog-intro,
html[data-theme="light"] .catalog-page--light .catalog-card p { color: var(--theme-muted); }
html[data-theme="light"] .future-section .eyebrow { color: var(--theme-accent-ink); }
html[data-theme="light"] .future-section ul,
html[data-theme="light"] .future-section li { border-color: #9e9587; }
html[data-theme="light"] .future-section li span { color: var(--theme-accent-ink); }

html[data-theme="light"] .page-hero {
  border-color: var(--theme-line);
  background: var(--theme-surface-2);
}
html[data-theme="light"] .page-hero::before {
  background-image:
    linear-gradient(rgba(25, 24, 22, .06) 1px, transparent 0),
    linear-gradient(90deg, rgba(25, 24, 22, .06) 1px, transparent 0);
}
html[data-theme="light"] .page-hero__lead,
html[data-theme="light"] .breadcrumbs { color: var(--theme-muted); }
html[data-theme="light"] .breadcrumbs span[aria-hidden="true"] { color: var(--theme-quiet); }
html[data-theme="light"] .page-copy h2,
html[data-theme="light"] .section-title { color: var(--theme-text); }
html[data-theme="light"] .page-copy p,
html[data-theme="light"] .page-copy li,
html[data-theme="light"] .page-aside__item,
html[data-theme="light"] .page-aside p { color: var(--theme-muted); }
html[data-theme="light"] .page-copy li a,
html[data-theme="light"] .page-aside a { color: var(--theme-text); }
html[data-theme="light"] .page-aside,
html[data-theme="light"] .page-aside a,
html[data-theme="light"] .page-aside__item,
html[data-theme="light"] .process-list,
html[data-theme="light"] .process-list li,
html[data-theme="light"] .project-story__section { border-color: var(--theme-line); }
html[data-theme="light"] .process-list li { color: var(--theme-text); }
html[data-theme="light"] .project-note,
html[data-theme="light"] .service-guide { background: var(--theme-surface-2); color: var(--theme-muted); }

html[data-theme="light"] .project-gallery-section,
html[data-theme="light"] .related-section,
html[data-theme="light"] .project-video-section,
html[data-theme="light"] .contact-map-section,
html[data-theme="light"] .certificate-section {
  border-color: var(--theme-line);
  color: var(--theme-text);
  background: var(--theme-surface-2);
}
html[data-theme="light"] .gallery figure { border-color: var(--theme-line); background: var(--theme-surface); }
html[data-theme="light"] .gallery figcaption { color: var(--theme-muted); }
html[data-theme="light"] .project-video-section__media,
html[data-theme="light"] .contact-map-section__frame { border-color: #9f9689; box-shadow: 8px 8px 0 rgba(107, 78, 0, .14); }
html[data-theme="light"] .certificate-card > div { border-color: var(--theme-line); }

html[data-theme="light"] .site-footer {
  border-color: var(--theme-line);
  color: var(--theme-text);
  background: #e8e1d5;
}
html[data-theme="light"] .footer-bottom { border-color: #bfb6a8; }
html[data-theme="light"] .footer-company p,
html[data-theme="light"] .footer-bottom p { color: var(--theme-muted); }
html[data-theme="light"] .footer-contact a,
html[data-theme="light"] .footer-nav a { color: #4f4a42; }
html[data-theme="light"] .footer-contact h2,
html[data-theme="light"] .footer-nav h2,
html[data-theme="light"] .footer-contact a:focus-visible,
html[data-theme="light"] .footer-contact a:hover,
html[data-theme="light"] .footer-nav a:focus-visible,
html[data-theme="light"] .footer-nav a:hover { color: var(--theme-accent-ink); }

/* Coverage corrections from the full 33-page selector audit. */
html[data-theme="light"] .page-main,
html[data-theme="light"] .catalog-page,
html[data-theme="light"] .content-panel:not(.content-panel--yellow) {
  color: var(--theme-text);
  background: var(--theme-canvas);
}
html[data-theme="light"] .page-kicker,
html[data-theme="light"] .breadcrumbs a,
html[data-theme="light"] .page-copy h3,
html[data-theme="light"] .inline-content-link,
html[data-theme="light"] .catalog-card__link,
html[data-theme="light"] .card-detail-link,
html[data-theme="light"] .page-aside h2,
html[data-theme="light"] .process-list span,
html[data-theme="light"] .active-card__number,
html[data-theme="light"] .project-location { color: var(--theme-accent-ink); }
html[data-theme="light"] .page-copy li::before,
html[data-theme="light"] .page-aside__item::before { background: var(--theme-accent); }
html[data-theme="light"] .catalog-card__status {
  color: var(--theme-text);
  background: var(--theme-accent);
}
html[data-theme="light"] .content-panel--yellow,
html[data-theme="light"] .facts-band,
html[data-theme="light"] .statement-band,
html[data-theme="light"] .company-section {
  color: var(--theme-text);
  background-color: var(--theme-accent);
}
html[data-theme="light"] .content-panel--yellow *,
html[data-theme="light"] .company-section .eyebrow,
html[data-theme="light"] .company-section h2 em { color: var(--theme-text); }
html[data-theme="light"] .certificate-card > a,
html[data-theme="light"] .capability-card__image { background: var(--theme-surface-2); }
html[data-theme="light"] .mobile-contact-dock {
  border-color: var(--theme-focus);
  background: var(--theme-line);
}
html[data-theme="light"] .mobile-contact-dock__call {
  color: var(--theme-text);
  background: var(--theme-accent);
}
html[data-theme="light"] .mobile-contact-dock__map {
  color: var(--theme-accent-ink);
  background: var(--theme-surface);
}
html[data-theme="light"] .mobile-contact-dock a:focus-visible {
  outline: 3px solid var(--theme-focus);
  outline-offset: -5px;
}
html[data-theme="light"] .next-error-h1 { border-color: var(--theme-line) !important; }

@media (max-width: 800px) {
  html[data-theme="light"] .hero-facts {
    border: 1px solid rgba(122, 87, 0, .36);
    background: rgba(255, 253, 248, .82);
    backdrop-filter: blur(8px);
  }
}

/* Privacy page contains legacy inline light styles; harmonize both modes. */
html[data-theme="light"] .pp-page { background: var(--theme-canvas); color: var(--theme-text); }
html[data-theme="light"] .pp-card,
html[data-theme="light"] .pp-hero { border-color: var(--theme-line); background: var(--theme-surface); box-shadow: 8px 8px 0 rgba(107, 78, 0, .10); }
html[data-theme="dark"] .pp-page { background: #050505; color: #f2efe8; }
html[data-theme="dark"] .pp-card,
html[data-theme="dark"] .pp-hero { border-color: #343434; background: #111; color: #f2efe8; }
html[data-theme="dark"] .pp-page p,
html[data-theme="dark"] .pp-meta { color: #b7b2a9; }

/* Static blog has a separate visual system. Bring it under the same switch. */
.az-nav--themed { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.az-nav--themed .az-brand { grid-column: 1; grid-row: 1; }
.az-nav--themed .theme-toggle { grid-column: 2; grid-row: 1; justify-self: end; }
.az-nav--themed .az-links { grid-column: 1 / -1; }

html[data-theme="light"] body:has(.az-header) { background: var(--theme-canvas); color: var(--theme-text); }
html[data-theme="light"] .az-header { border-color: #8a6500; background: #fffdf8; color: var(--theme-text); }
html[data-theme="light"] .az-brand__copy small { color: var(--theme-muted); }
html[data-theme="light"] .az-links a:hover,
html[data-theme="light"] .az-links a[aria-current="page"] { border-color: #8a6500; color: var(--theme-accent-ink); }
html[data-theme="light"] .az-section--black { background: var(--theme-surface-2); color: var(--theme-text); }
html[data-theme="light"] .az-post-card,
html[data-theme="light"] .az-register { background: var(--theme-surface); color: var(--theme-text); }
html[data-theme="light"] .az-footer { background: #e8e1d5; color: var(--theme-text); }
html[data-theme="light"] .az-footer h2 { color: var(--theme-accent-ink); }
html[data-theme="light"] .az-footer__bottom { border-color: #bfb6a8; color: var(--theme-muted); }

html[data-theme="dark"] body:has(.az-header) { background: #050505; color: #f2efe8; }
html[data-theme="dark"] .az-header { background: #050505; color: #f2efe8; }
html[data-theme="dark"] .az-brand__copy small { color: #b7b2a9; }
html[data-theme="dark"] .az-links a:hover,
html[data-theme="dark"] .az-links a[aria-current="page"] { color: #f7b900; }
html[data-theme="dark"] .az-section:not(.az-section--black),
html[data-theme="dark"] .az-article-grid { background: #0d0d0d; color: #f2efe8; }
html[data-theme="dark"] .az-post-card,
html[data-theme="dark"] .az-register { background: #151515; color: #f2efe8; }
html[data-theme="dark"] .az-post-card__body > p,
html[data-theme="dark"] .az-heading p,
html[data-theme="dark"] .az-body p,
html[data-theme="dark"] .az-body li { color: #d2cec6; }
html[data-theme="dark"] .az-toc,
html[data-theme="dark"] .az-callout,
html[data-theme="dark"] .az-body blockquote { color: #191816; }
html[data-theme="dark"] .az-footer { background: #050505; color: #f2efe8; }

/* The Nginx-injected assistant loads its CSS later; !important is intentional. */
#site-assistant { bottom: max(16px, env(safe-area-inset-bottom)); }
html[data-theme="light"] #site-assistant { color: #191816 !important; }
html[data-theme="light"] #site-assistant .sa-launcher,
html[data-theme="light"] #site-assistant .sa-panel { border-color: #cac2b5 !important; background: #fffdf8 !important; color: #191816 !important; box-shadow: 0 16px 42px rgba(49, 42, 31, .18) !important; }
html[data-theme="light"] #site-assistant .sa-panel header,
html[data-theme="light"] #site-assistant .sa-form { border-color: #d9d2c6 !important; }
html[data-theme="light"] #site-assistant .sa-messages { background: #f4f1e8 !important; }
html[data-theme="light"] #site-assistant .sa-messages p { background: #e9e3d8 !important; color: #191816 !important; }
html[data-theme="light"] #site-assistant .sa-messages .sa-user,
html[data-theme="light"] #site-assistant .sa-form button { background: #f1b600 !important; color: #191816 !important; }
html[data-theme="light"] #site-assistant .sa-form input { border-color: #aaa091 !important; background: #fffdf8 !important; color: #191816 !important; }

html[data-theme="dark"] #site-assistant { color: #f2efe8 !important; }
html[data-theme="dark"] #site-assistant .sa-launcher,
html[data-theme="dark"] #site-assistant .sa-panel { border-color: #444 !important; background: #111 !important; color: #f2efe8 !important; }
html[data-theme="dark"] #site-assistant .sa-panel header,
html[data-theme="dark"] #site-assistant .sa-form { border-color: #343434 !important; }
html[data-theme="dark"] #site-assistant .sa-close { color: #b7b2a9 !important; }
html[data-theme="dark"] #site-assistant .sa-messages { background: #0d0d0d !important; }
html[data-theme="dark"] #site-assistant .sa-messages p { background: #1f1f1f !important; color: #f2efe8 !important; }
html[data-theme="dark"] #site-assistant .sa-messages .sa-user,
html[data-theme="dark"] #site-assistant .sa-form button { background: #f7b900 !important; color: #050505 !important; }
html[data-theme="dark"] #site-assistant .sa-form input { border-color: #555 !important; background: #181818 !important; color: #f2efe8 !important; }

@media (min-width: 800px) {
  .az-nav--themed { grid-template-columns: auto minmax(0, 1fr) auto; }
  .az-nav--themed .az-brand { grid-column: 1; }
  .az-nav--themed .az-links { grid-column: 2; grid-row: 1; }
  .az-nav--themed .theme-toggle { grid-column: 3; }
}

@media (max-width: 1050px) {
  .header-inner--themed {
    display: flex;
    flex-direction: row;
    direction: rtl;
    justify-content: flex-start;
    gap: 6px;
  }
  .header-inner--themed .brand {
    direction: rtl;
    margin-left: auto;
  }
  .header-inner--themed .theme-toggle {
    margin: 0;
    direction: ltr;
  }
}

@media (max-width: 480px) {
  .theme-toggle { width: 48px; height: 48px; min-width: 48px; min-height: 48px; }
  #site-assistant { bottom: calc(68px + env(safe-area-inset-bottom)) !important; }
}

@media (max-width: 370px) {
  .header-inner--themed { gap: 4px; }
  .theme-toggle { width: 44px; min-width: 44px; }
  .theme-toggle__media { width: 40px; height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  html,
  body,
  .site-header,
  .mobile-nav,
  .site-footer,
  .theme-toggle,
  .theme-toggle__icon { transition: none !important; }
  .theme-toggle:hover { transform: none; }
}
