/* ==========================================================================
   Photon 2026 Flagship Web System — Aurora Noir / Midnight Slate
   Typography & Density Contract:
   - Marketing display & prose (--font-marketing): Graphik Web (400, 400i, 500, 600)
   - Dense product UI & tables (--font-ui): Whitney Web (400, 500, 600)
   - Small caps (--font-smallcaps): Whitney Web with font-variant-caps: small-caps
   - Metric numerals (--font-metric): DIN Pro (400, 500) with unicode-range for figures/currency
   - Code & wire frames (--font-code): Monument Grotesk Mono (400)
   - Weight discipline: 400 default, 500 emphasis/headings/controls, 600 ONLY on h1.page-title, NEVER 700
   ========================================================================== */

@font-face {
  font-family: "Graphik Web";
  src: url("./fonts/Graphik-Regular-Web.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Graphik Web";
  src: url("./fonts/Graphik-RegularItalic-Web.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Graphik Web";
  src: url("./fonts/Graphik-Medium-Web.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Graphik Web";
  src: url("./fonts/Graphik-Semibold-Web.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Whitney Web";
  src: url("./fonts/whitney-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Whitney Web";
  src: url("./fonts/whitney-medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Whitney Web";
  src: url("./fonts/whitney-semibold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "DIN Pro";
  src: url("./fonts/dinpro-regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0024-0025, U+002B-003B, U+0041-005A, U+0061-007A, U+2013-2014, U+2212;
}

@font-face {
  font-family: "DIN Pro";
  src: url("./fonts/dinpro-medium.woff") format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0024-0025, U+002B-003B, U+0041-005A, U+0061-007A, U+2013-2014, U+2212;
}

@font-face {
  font-family: "Monument Grotesk Mono";
  src: url("./fonts/MonumentGrotesk-Mono.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Graphik Fallback";
  src: local("Helvetica Neue"), local("Arial");
  size-adjust: 100.5%;
  ascent-override: 94%;
  descent-override: 22%;
}

@font-face {
  font-family: "Whitney Fallback";
  src: local("Helvetica Neue"), local("Arial");
  size-adjust: 97.5%;
  ascent-override: 95%;
  descent-override: 23%;
}

@font-face {
  font-family: "DIN Pro Fallback";
  src: local("Helvetica Neue"), local("Arial");
  size-adjust: 99%;
  ascent-override: 96%;
  descent-override: 22%;
}

:root {
  --font-marketing: "Graphik Web", "Graphik Fallback", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-ui: "Whitney Web", "Whitney Fallback", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-smallcaps: "Whitney Web", "Whitney Fallback", sans-serif;
  --font-metric: "DIN Pro", "DIN Pro Fallback", "Whitney Web", sans-serif;
  --font-code: "Monument Grotesk Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Daylight Canonical Theme with Electric Sky & Indigo Accents */
  --bg-canvas: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-elevated: #F1F5F9;
  --bg-pressed: #E2E8F0;
  --bg-glass: rgba(255, 255, 255, 0.90);
  --border-hairline: rgba(15, 23, 42, 0.10);
  --border-key: rgba(51, 65, 85, 0.26);
  --border-active: rgba(2, 132, 199, 0.55);
  --text-primary: #0F172A;
  --text-secondary: #334155;
  --text-muted: #64748B;
  --accent-primary: #0284C7;
  --accent-secondary: #4F46E5;
  --accent-soft: rgba(2, 132, 199, 0.09);
  --status-green: #059669;
  --status-amber: #D97706;
  --status-red: #DC2626;
  --power-accent: #DC2626;

  /* Shared Density & Rhythm Tokens */
  --row-height: 34px;
  --control-height: 32px;
  --control-touch: 44px;
  --panel-pad: 16px;
  --measure-prose: 68ch;
  --measure-dense: 88ch;
}

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

html {
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-marketing);
  font-size: 16px;
  line-height: 1.5;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(1100px 540px at 14% -4%, rgba(2, 132, 199, 0.07), transparent 60%),
    radial-gradient(960px 520px at 86% 2%, rgba(79, 70, 229, 0.06), transparent 62%),
    var(--bg-canvas);
  color: var(--text-primary);
}

a {
  color: var(--accent-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

em {
  font-style: italic;
  font-weight: 400;
}

strong {
  font-weight: 500;
  color: var(--text-primary);
}

/* Typography & Figure Helpers */
.tnum {
  font-variant-numeric: tabular-nums;
}

.metric-num {
  font-family: var(--font-metric);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  line-height: 1;
}

.smallcaps-head {
  font-family: var(--font-smallcaps);
  font-variant-caps: small-caps;
  font-weight: 500;
  letter-spacing: 0.02em;
  font-size: 13px;
  color: var(--text-secondary);
}

.mono-code {
  font-family: var(--font-code);
  font-weight: 400;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.dense-ui {
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.45;
}

/* Structural Shell & Rails */
.shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.rail-frame {
  border-left: 1px solid var(--border-hairline);
  border-right: 1px solid var(--border-hairline);
  background: var(--bg-surface);
}

/* Sticky Top Navigation */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-hairline);
}

.header-bar {
  min-height: 58px;
  height: auto;
  padding: 8px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 17px;
  text-decoration: none;
  white-space: nowrap;
}

.brand-link:hover {
  text-decoration: none;
}

.brand-glyph {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-mark-svg {
  width: 32px;
  height: 32px;
  display: block;
  flex-shrink: 0;
}

.footer-brand-logo {
  height: 44px;
  width: auto;
  max-width: 100%;
  display: block;
  margin-bottom: 12px;
}

.brand-tag {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-primary);
  padding: 2px 8px;
  border: 1px solid var(--border-active);
  background: var(--accent-soft);
  border-radius: 4px;
  white-space: nowrap;
}

nav.primary-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

nav.primary-nav a {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-secondary);
  padding: 6px 4px;
  text-decoration: none;
  white-space: nowrap;
}

nav.primary-nav a:hover,
nav.primary-nav a[aria-current="page"] {
  color: var(--accent-primary);
  font-weight: 500;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Segmented & Dense Controls (Flexible height so wrapped items never overflow) */
.segmented-bar {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border-hairline);
  min-height: var(--control-height);
  height: auto;
  padding: 3px;
  gap: 3px;
  border-radius: 6px;
}

.seg-btn {
  min-height: 28px;
  height: auto;
  padding: 5px 12px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.seg-btn:hover {
  color: var(--text-primary);
}

.seg-btn[aria-pressed="true"],
.seg-btn.active {
  background: var(--bg-surface);
  color: var(--accent-primary);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), inset 0 0 0 1px var(--border-active);
}

/* Marketing Type Scale (16-17px body, 1.5 leading, single 40px Semibold h1, 24px Medium h2) */
h1.page-title {
  font-family: var(--font-marketing);
  font-size: clamp(34px, 3.5vw, 42px);
  line-height: 1.12;
  letter-spacing: -0.015em;
  font-weight: 600;
  color: var(--text-primary);
  max-width: 24ch;
}

h2.section-heading {
  font-family: var(--font-marketing);
  font-size: clamp(22px, 2.2vw, 26px);
  line-height: 1.18;
  letter-spacing: -0.01em;
  font-weight: 500;
  color: var(--text-primary);
}

h3.subsection-heading {
  font-family: var(--font-marketing);
  font-size: 18px;
  line-height: 1.25;
  font-weight: 500;
  color: var(--text-primary);
}

p.prose-lead {
  font-family: var(--font-marketing);
  font-size: 17px;
  line-height: 1.5;
  font-weight: 400;
  color: var(--text-secondary);
  max-width: var(--measure-prose);
}

p.prose-body {
  font-family: var(--font-marketing);
  font-size: 16px;
  line-height: 1.5;
  font-weight: 400;
  color: var(--text-secondary);
  max-width: var(--measure-prose);
}

/* Action Buttons (Touch >= 44px, sentence case, Medium 500) */
.btn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.btn-action-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--control-touch);
  height: auto;
  padding: 8px 20px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #FFFFFF;
  font-family: var(--font-marketing);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
}

.btn-action-primary:hover {
  opacity: 0.94;
  text-decoration: none;
}

.btn-action-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--control-touch);
  height: auto;
  padding: 8px 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border-key);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: var(--font-marketing);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
}

.btn-action-secondary:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  text-decoration: none;
}

/* KPI Strip (Border-first hairline cells, DIN Pro figures) */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--border-hairline);
  border-bottom: 1px solid var(--border-hairline);
  background: var(--bg-elevated);
}

.kpi-cell {
  padding: 18px 22px;
  border-right: 1px solid var(--border-hairline);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kpi-cell:last-child {
  border-right: none;
}

.kpi-figure {
  font-family: var(--font-metric);
  font-size: 26px;
  font-weight: 500;
  line-height: 1;
  color: var(--accent-primary);
  font-variant-numeric: tabular-nums;
}

.kpi-unit {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 400;
  color: var(--accent-primary);
  margin-left: 3px;
}

.kpi-label {
  font-family: var(--font-ui);
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--text-secondary);
}

/* Dense 34px Table System (Operator / CRM.me shared contract) */
.dense-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-hairline);
  background: var(--bg-surface);
}

table.dense-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}

table.dense-table thead tr {
  min-height: var(--row-height);
  height: var(--row-height);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-hairline);
}

table.dense-table th {
  padding: 6px 12px;
  text-align: left;
  font-family: var(--font-smallcaps);
  font-variant-caps: small-caps;
  font-weight: 500;
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
}

table.dense-table tbody tr {
  min-height: var(--row-height);
  border-bottom: 1px solid var(--border-hairline);
}

table.dense-table tbody tr:last-child {
  border-bottom: none;
}

table.dense-table tbody tr:hover {
  background: rgba(2, 132, 199, 0.04);
}

table.dense-table td {
  padding: 7px 12px;
  color: var(--text-secondary);
  font-weight: 400;
  vertical-align: middle;
}

table.dense-table td.cell-primary {
  color: var(--text-primary);
  font-weight: 500;
}

table.dense-table td.cell-metric,
table.dense-table th.cell-metric {
  text-align: right;
  font-family: var(--font-metric);
  font-variant-numeric: tabular-nums;
}

table.dense-table td.cell-code {
  font-family: var(--font-code);
  font-size: 12px;
  color: var(--text-primary);
}

/* Status Pills & Chips (12px meta floor, never clips) */
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  height: auto;
  padding: 3px 9px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
  border-radius: 4px;
  border: 1px solid var(--border-hairline);
  background: var(--bg-elevated);
  color: var(--text-primary);
  white-space: nowrap;
}

.status-chip.ok {
  color: var(--status-green);
  border-color: rgba(5, 150, 105, 0.30);
  background: rgba(5, 150, 105, 0.08);
}

.status-chip.warn {
  color: var(--status-amber);
  border-color: rgba(217, 119, 6, 0.32);
  background: rgba(217, 119, 6, 0.09);
}

.status-chip.err {
  color: var(--status-red);
  border-color: rgba(220, 38, 38, 0.30);
  background: rgba(220, 38, 38, 0.08);
}

.dot-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* Section Layout */
.section-band {
  padding: 56px 0;
  border-bottom: 1px solid var(--border-hairline);
}

.section-header-grid {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

/* Footer */
footer.site-footer {
  padding: 44px 0 56px;
  border-top: 1px solid var(--border-hairline);
  background: var(--bg-surface);
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--text-muted);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border-hairline);
  margin-bottom: 20px;
}

.footer-col-title {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.footer-nav-list {
  list-style: none;
  display: grid;
  gap: 6px;
}

.footer-nav-list a {
  color: var(--text-secondary);
  font-size: 13px;
}

@media (max-width: 960px) {
  .header-bar {
    padding: 8px 0 6px;
    gap: 8px 12px;
  }
  .header-bar > div:first-child {
    order: 1;
  }
  .header-controls {
    order: 2;
    margin-left: auto;
  }
  nav.primary-nav {
    order: 3;
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 14px;
    padding: 6px 0 2px;
    border-top: 1px solid var(--border-hairline);
  }
  nav.primary-nav::-webkit-scrollbar {
    display: none;
  }
  nav.primary-nav a {
    font-size: 13px;
    padding: 4px 2px;
    flex-shrink: 0;
  }
  .kpi-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .kpi-cell:nth-child(2) {
    border-right: none;
  }
  .kpi-cell:nth-child(1),
  .kpi-cell:nth-child(2) {
    border-bottom: 1px solid var(--border-hairline);
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 640px) {
  html,
  body {
    overflow-x: hidden;
  }
  .shell {
    padding: 0 14px;
  }
  .rail-frame {
    border-left: none;
    border-right: none;
  }
  h1.page-title {
    font-size: clamp(26px, 7vw, 31px);
    line-height: 1.14;
    max-width: 100%;
  }
  h2.section-heading {
    font-size: 20px;
    line-height: 1.2;
  }
  p.prose-lead,
  p.prose-body {
    font-size: 15px;
    line-height: 1.48;
  }
  .btn-row {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    gap: 8px;
  }
  .btn-row > .btn-action-primary,
  .btn-row > .btn-action-secondary {
    width: 100%;
    justify-content: center;
  }
  .segmented-bar {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .segmented-bar::-webkit-scrollbar {
    display: none;
  }
  .kpi-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .kpi-cell {
    padding: 14px;
  }
  .kpi-figure {
    font-size: 22px;
  }
  .section-band {
    padding: 32px 0;
  }
  .section-header-grid {
    gap: 12px;
    margin-bottom: 18px;
  }
}
