/* Antiquant: Swiss editorial stylesheet (light and ink-indigo dark themes) */

:root {
  color-scheme: light;
  --paper: #F4F1EA;
  --paper-tint: #EDE9DF;
  --header-bg: rgba(244, 241, 234, 0.94);
  --ink: #121212;
  --ink-secondary: #3D3C38;
  --ink-muted: #5E5C56;
  --rule: rgba(18, 18, 18, 0.14);
  --rule-strong: rgba(18, 18, 18, 0.28);
  --accent: #1F2A8A;
  --accent-underline: rgba(31, 42, 138, 0.42);
  --hero-fallback-ring: rgba(31, 42, 138, 0.045);
  --hero-ring-rgb: 31, 42, 138;
  --hero-veil-rgb: 244, 241, 234;
  --hero-ring-alpha: 0.14;
  --hero-wave-base: 0.045;
  --hero-wave-edge: 0.055;
  --deep: #161E54;
  --deep-ink: #F4F1EA;
  --deep-secondary: #D8DDF0;
  --deep-muted: #B6C0E4;
  --deep-rule: rgba(244, 241, 234, 0.22);
  --deep-stroke: #F4F1EA;
  --deep-stroke-soft: #9AA7DE;
  --svg-line: #1F2A8A;
  --svg-ink: #121212;
  --svg-muted: #5E5C56;
  --svg-rule: rgba(18, 18, 18, 0.16);
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Cambria, Georgia, serif;
  --font-body: "Segoe UI", "Gill Sans", "Gill Sans MT", Calibri, sans-serif;
  --container: 1120px;
  --gutter: clamp(1.25rem, 4.5vw, 3.5rem);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #0B0E24;
    --paper-tint: #101536;
    --header-bg: rgba(11, 14, 36, 0.94);
    --ink: #F4F1EA;
    --ink-secondary: #D5DAF0;
    --ink-muted: #A6B1DC;
    --rule: rgba(244, 241, 234, 0.15);
    --rule-strong: rgba(244, 241, 234, 0.28);
    --accent: #A9B8FF;
    --accent-underline: rgba(169, 184, 255, 0.45);
    --hero-fallback-ring: rgba(169, 184, 255, 0.06);
    --hero-ring-rgb: 169, 184, 255;
    --hero-veil-rgb: 11, 14, 36;
    --hero-ring-alpha: 0.17;
    --hero-wave-base: 0.055;
    --hero-wave-edge: 0.07;
    --deep: #1B256B;
    --deep-ink: #F4F1EA;
    --deep-secondary: #DCE1F7;
    --deep-muted: #BDC7EE;
    --deep-rule: rgba(244, 241, 234, 0.24);
    --deep-stroke: #F4F1EA;
    --deep-stroke-soft: #B4C0F2;
    --svg-line: #A9B8FF;
    --svg-ink: #F4F1EA;
    --svg-muted: #A6B1DC;
    --svg-rule: rgba(244, 241, 234, 0.16);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0B0E24;
  --paper-tint: #101536;
  --header-bg: rgba(11, 14, 36, 0.94);
  --ink: #F4F1EA;
  --ink-secondary: #D5DAF0;
  --ink-muted: #A6B1DC;
  --rule: rgba(244, 241, 234, 0.15);
  --rule-strong: rgba(244, 241, 234, 0.28);
  --accent: #A9B8FF;
  --accent-underline: rgba(169, 184, 255, 0.45);
  --hero-fallback-ring: rgba(169, 184, 255, 0.06);
  --hero-ring-rgb: 169, 184, 255;
  --hero-veil-rgb: 11, 14, 36;
  --hero-ring-alpha: 0.17;
  --hero-wave-base: 0.055;
  --hero-wave-edge: 0.07;
  --deep: #1B256B;
  --deep-ink: #F4F1EA;
  --deep-secondary: #DCE1F7;
  --deep-muted: #BDC7EE;
  --deep-rule: rgba(244, 241, 234, 0.24);
  --deep-stroke: #F4F1EA;
  --deep-stroke-soft: #B4C0F2;
  --svg-line: #A9B8FF;
  --svg-ink: #F4F1EA;
  --svg-muted: #A6B1DC;
  --svg-rule: rgba(244, 241, 234, 0.16);
}

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

html {
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background-color: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

main {
  flex: 1 0 auto;
  width: 100%;
  min-width: 0;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.24em;
  text-decoration-color: var(--accent-underline);
  transition: color 180ms ease, border-color 180ms ease, background-color 180ms ease, text-decoration-color 180ms ease;
}

a:hover {
  color: var(--ink);
  text-decoration-color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.section-deep :focus-visible {
  outline-color: var(--deep-ink);
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background: var(--accent);
  color: var(--paper);
  font-size: 0.875rem;
  text-decoration: none;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* Container */
.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--header-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}

.site-header-inner {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  min-height: 74px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
  margin-right: auto;
}

.brand:hover {
  color: var(--accent);
}

.brand-mark {
  width: 2.4rem;
  height: 2.4rem;
  fill: currentColor;
  flex-shrink: 0;
}

.brand-wordmark {
  font-family: var(--font-serif);
  font-size: 1.32rem;
  font-weight: 400;
  font-variant-caps: small-caps;
  letter-spacing: 0.16em;
  line-height: 1;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--ink-secondary);
  text-decoration: none;
  letter-spacing: 0.02em;
  padding-bottom: 0.15rem;
  border-bottom: 1px solid transparent;
}

.site-nav a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-secondary);
  font-family: var(--font-serif);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 180ms ease, border-color 180ms ease;
}

.theme-toggle[hidden] {
  display: none;
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.theme-icon {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

/* Editorial typography */
.kicker {
  margin: 0 0 0.9rem;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.98rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--accent);
}

.section-deep .kicker {
  color: var(--deep-muted);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 400;
  color: var(--ink);
}

h1 {
  font-size: clamp(2.5rem, 5.2vw, 4.35rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
}

h2 {
  font-size: clamp(1.8rem, 3.1vw, 2.6rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.3rem;
  line-height: 1.3;
}

p {
  margin: 0;
  color: var(--ink-secondary);
}

/* Quiet CTA styles */
.pill-link {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.72rem 1.75rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: transparent;
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: 1rem;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.pill-link:hover {
  background: var(--accent);
  color: var(--paper);
  text-decoration: none;
}

.pill-link svg {
  width: 14px;
  height: 14px;
  transition: transform 180ms ease;
}

.pill-link:hover svg {
  transform: translateX(3px);
}

@media (prefers-reduced-motion: reduce) {
  .pill-link svg,
  .theme-toggle,
  a {
    transition: none;
  }
  .pill-link:hover svg {
    transform: none;
  }
}

/* Hero (centred editorial composition) */
.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--rule);
  background:
    repeating-radial-gradient(circle at 14% 52%, var(--hero-fallback-ring) 0 1px, transparent 1px 46px),
    repeating-radial-gradient(circle at 86% 48%, var(--hero-fallback-ring) 0 1px, transparent 1px 46px),
    var(--paper);
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 760px;
  margin-inline: auto;
  text-align: center;
  padding-block: clamp(5rem, 11.5vh, 8.25rem) clamp(4.75rem, 10.5vh, 7.75rem);
}

.hero-title {
  margin-bottom: 0;
}

.hero-rule {
  width: 52px;
  height: 1px;
  margin: 1.85rem auto;
  background: var(--accent);
  opacity: 0.5;
  border: 0;
}

.hero-lead {
  font-size: clamp(1.0625rem, 1.45vw, 1.2rem);
  line-height: 1.72;
  color: var(--ink-secondary);
  max-width: 50ch;
  margin: 0 auto 2.35rem;
}

.hero-actions {
  display: flex;
  justify-content: center;
}

/* Sections */
.section {
  padding-block: clamp(3.75rem, 6vw, 5.25rem);
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: 74px;
}

.section-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 1.4rem 4rem;
  align-items: start;
  margin-bottom: clamp(2.25rem, 3.6vw, 3rem);
}

.section-intro {
  font-size: 1.03125rem;
  line-height: 1.72;
  max-width: 52ch;
  padding-top: 0.35rem;
}

/* Factory 4-step thin-line diagram */
.factory-diagram-frame {
  margin: 0;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
}

.factory-svg-desktop {
  width: 100%;
  height: auto;
}

.factory-svg-mobile {
  display: none;
  width: 100%;
  max-width: 350px;
  height: auto;
  margin-inline: auto;
}

/* Full-bleed indigo coordination section (most intense band in both themes) */
.section-deep {
  background-color: var(--deep);
  color: var(--deep-ink);
  border-bottom: 1px solid var(--deep-rule);
}

.section-deep h2,
.section-deep h3 {
  color: var(--deep-ink);
}

.section-deep p {
  color: var(--deep-secondary);
}

/* Scientific atlas plates: crisp, concise benefit plates */
.atlas-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(2.5rem, 5vw, 4.75rem);
  border-top: 1px solid var(--deep-rule);
}

.atlas-plate {
  padding-block: clamp(1.6rem, 2.5vw, 2.15rem);
  border-bottom: 1px solid var(--deep-rule);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.atlas-plate-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
}

.atlas-plate h3 {
  font-size: 1.45rem;
  line-height: 1.2;
}

.atlas-figure {
  width: 132px;
  height: 52px;
  flex-shrink: 0;
}

.atlas-benefit {
  font-size: 1.015rem;
  line-height: 1.65;
  color: var(--deep-secondary);
  max-width: 48ch;
}

.classical-note {
  margin-top: 1.85rem;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--deep-muted);
  max-width: 74ch;
}

/* Handover editorial columns */
.handover-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.85rem, 3.2vw, 2.5rem) clamp(2rem, 4vw, 3.25rem);
}

.handover-item {
  padding-top: 1.15rem;
  border-top: 1px solid var(--rule-strong);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.handover-item h3 {
  font-size: 1.22rem;
}

.handover-item p {
  font-size: 0.96875rem;
  line-height: 1.66;
}

.handover-closing {
  margin-top: 2.2rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--rule);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.125rem;
  color: var(--ink);
  max-width: 64ch;
}

/* Principles editorial ledger */
.principles-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--rule-strong);
}

.principles-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 0.65rem 3.5rem;
  align-items: baseline;
  padding-block: clamp(1.25rem, 2.2vw, 1.75rem);
  border-bottom: 1px solid var(--rule);
}

.principles-title {
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 1.7vw, 1.4rem);
  font-weight: 400;
  line-height: 1.3;
  color: var(--ink);
}

.principles-desc {
  font-size: 0.96875rem;
  line-height: 1.68;
  color: var(--ink-secondary);
}

/* Contact band */
.contact-section {
  padding-block: clamp(3.75rem, 6vw, 5.25rem);
  border-bottom: 1px solid var(--rule);
  background: var(--paper-tint);
  scroll-margin-top: 74px;
}

.contact-inner {
  max-width: 600px;
  margin-inline: auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.15rem;
}

.contact-inner .kicker {
  margin-bottom: 0;
}

.contact-copy {
  font-size: 1.03125rem;
  line-height: 1.68;
  max-width: 44ch;
}

.contact-action {
  margin-top: 0.45rem;
}

.contact-location {
  margin-top: 0.25rem;
  font-family: var(--font-serif);
  font-variant-caps: small-caps;
  font-size: 0.95rem;
  letter-spacing: 0.16em;
  color: var(--ink-muted);
}

/* Subpages (Legal, News, 404) */
.page-hero {
  padding-block: clamp(3.5rem, 6.5vw, 5.25rem) clamp(2.25rem, 3.8vw, 3rem);
  border-bottom: 1px solid var(--rule);
}

.page-hero h1 {
  font-size: clamp(2.15rem, 4vw, 3.3rem);
}

.page-meta {
  margin-top: 0.9rem;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.98rem;
  color: var(--ink-muted);
}

.prose-section {
  padding-block: clamp(3rem, 5.5vw, 4.5rem);
}

.prose-stack {
  max-width: 64ch;
  display: flex;
  flex-direction: column;
  gap: 2.75rem;
}

.prose-block {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  scroll-margin-top: 88px;
}

.prose-block h2 {
  font-size: clamp(1.45rem, 2.2vw, 1.85rem);
}

.prose-block p {
  font-size: 1.03125rem;
  line-height: 1.75;
}

.placeholder-note {
  padding: 1.15rem 1.4rem;
  border-left: 2px solid var(--accent);
  background: var(--paper-tint);
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--ink);
}

.error-section {
  padding-block: clamp(5rem, 12vh, 8.5rem);
}

.error-stack {
  max-width: 54ch;
  margin-inline: auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.35rem;
}

/* Footer */
.site-footer {
  padding-block: 2rem;
  background: var(--paper);
}

.site-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  font-family: var(--font-serif);
  font-size: 0.92rem;
  color: var(--ink-muted);
}

.site-footer p {
  color: var(--ink-muted);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 1.65rem;
}

.footer-links a {
  color: var(--ink-muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* Responsive breakpoints */
@media (max-width: 960px) {
  .section-header {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }

  .section-intro {
    padding-top: 0;
  }

  .handover-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .principles-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.45rem;
  }
}

@media (max-width: 760px) {
  .factory-svg-desktop {
    display: none;
  }

  .factory-svg-mobile {
    display: block;
  }

  .atlas-grid,
  .handover-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .site-header-inner {
    flex-wrap: wrap;
    padding-block: 0.85rem;
    gap: 0.65rem 1rem;
    min-height: 0;
  }

  .brand {
    order: 1;
  }

  .theme-toggle {
    order: 2;
    padding: 0.24rem 0.62rem;
    font-size: 0.8rem;
  }

  .site-nav {
    order: 3;
    width: 100%;
  }

  .site-nav ul {
    gap: 0.35rem 1.05rem;
  }

  .site-nav a {
    font-size: 0.875rem;
  }

  .hero-content {
    padding-block: 3.5rem 3.25rem;
  }

  h1 {
    font-size: 2.25rem;
  }

  h2 {
    font-size: 1.6rem;
  }

  .section {
    padding-block: 2.75rem;
  }

  .section-header {
    margin-bottom: 1.65rem;
  }

  .atlas-plate {
    padding-block: 1.35rem;
    gap: 0.65rem;
  }

  .atlas-plate-head {
    align-items: center;
    gap: 0.75rem;
  }

  .atlas-plate h3 {
    font-size: 1.28rem;
  }

  .atlas-figure {
    width: 96px;
    height: 38px;
  }

  .atlas-benefit,
  .handover-item p,
  .principles-desc {
    font-size: 0.9375rem;
    line-height: 1.62;
  }

  .handover-grid {
    gap: 1.35rem;
  }

  .handover-item {
    padding-top: 1rem;
  }

  .principles-row {
    padding-block: 1.05rem;
  }

  .contact-section {
    padding-block: 3rem;
  }
}

/* Why Antiquant */
.philosophy-inner {
  max-width: 44rem;
  text-align: center;
}

.philosophy h2 {
  margin-bottom: 1.75rem;
}

.philosophy p {
  margin: 0 auto 1.25rem;
  color: var(--ink-secondary);
  line-height: 1.75;
}

.philosophy .philosophy-lede {
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  line-height: 1.45;
  color: var(--ink);
  text-wrap: balance;
}

.philosophy .philosophy-name {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--accent);
  margin-top: 2rem;
}
