/**
 * PiyushVakil.AI — Editorial Architectural Design System v5.0
 * Built from first principles on 2026 executive web best practices:
 * - Warm Editorial Alabaster (Light default) + Deep Matte Obsidian (Dark mode)
 * - High-contrast Newsreader optical serif + Inter grotesque + JetBrains Mono
 * - 1px architectural hairline grids, disciplined whitespace, zero gradient slop
 * - WCAG 2.1 AA/AAA verified ink hierarchy across both themes
 */

:root {
  color-scheme: light;

  /* Editorial Alabaster Light Palette (Default) */
  --bg-canvas: #FAF9F6;
  --bg-elevated: #FFFFFF;
  --bg-subtle: #F3F2EE;
  --bg-muted: #EBE9E3;
  --bg-code: #0F1420;

  /* Compatibility aliases for subpages */
  --navy-950: var(--bg-subtle);
  --navy-900: var(--bg-canvas);
  --navy-800: var(--bg-elevated);
  --navy-700: var(--bg-subtle);
  --navy-600: var(--bg-muted);

  /* Crisp Architectural Surfaces (Subtle Frosted Header, Solid Editorial Sheets) */
  --glass-bg: var(--bg-elevated);
  --glass-bg-strong: var(--bg-elevated);
  --glass-blur: blur(18px) saturate(160%);
  --glass-border: var(--border-subtle);
  --glass-border-hover: var(--border-strong);
  --glass-shadow: 0 1px 2px rgba(12, 18, 34, 0.04), 0 4px 16px rgba(12, 18, 34, 0.03);
  --glass-shadow-hover: 0 4px 12px rgba(12, 18, 34, 0.06), 0 12px 32px rgba(12, 18, 34, 0.05);

  /* 1px Architectural Hairline Borders */
  --border-subtle: rgba(12, 18, 34, 0.09);
  --border-default: rgba(12, 18, 34, 0.16);
  --border-strong: rgba(12, 18, 34, 0.28);
  --border-brass: rgba(125, 88, 27, 0.34);

  /* Primary Ink & Accent System (Restrained Cobalt + Warm Architectural Bronze) */
  --ink-primary: #0C1222;
  --ink-secondary: #344054;
  --ink-muted: #5A667A;
  --ink-inverse: #FFFFFF;
  --ink-on-brass: #FFFFFF;

  --accent-primary: #1D4ED8;
  --accent-primary-hover: #1E40AF;
  --accent-primary-tint: rgba(29, 78, 216, 0.08);
  --accent-bronze: #7D581B;
  --accent-bronze-tint: rgba(125, 88, 27, 0.10);

  /* Token Aliases for Consistent Semantic Usage Across Pages */
  --blue-900: #0C1222;
  --blue-800: #132145;
  --blue-700: #1E40AF;
  --blue-600: #1D4ED8;
  --blue-500: #2563EB;
  --blue-100: rgba(29, 78, 216, 0.09);
  --blue-50: #F3F4F8;

  --brass-300: #8A611E;
  --brass-400: #7D581B;
  --brass-500: #7D581B;
  --brass-600: #644514;
  --brass-tint: rgba(125, 88, 27, 0.10);
  --brass-glow: rgba(125, 88, 27, 0.18);

  --sapphire-300: #1E40AF;
  --sapphire-400: #1D4ED8;
  --sapphire-tint: rgba(29, 78, 216, 0.08);
  --sapphire-glow: rgba(29, 78, 216, 0.16);

  /* Semantic Status Tokens */
  --status-critical: #B42318;
  --status-critical-bar: #D92D20;
  --status-critical-bg: rgba(217, 45, 32, 0.08);
  --status-high: #B54708;
  --status-high-bar: #DC6803;
  --status-high-bg: rgba(220, 104, 3, 0.10);
  --status-medium: #8F641B;
  --status-medium-bar: #B8862D;
  --status-medium-bg: rgba(184, 134, 45, 0.11);
  --status-positive: #067647;
  --status-positive-bar: #079455;
  --status-positive-bg: rgba(7, 148, 85, 0.09);
  --status-info: #1D4ED8;
  --status-info-bar: #2563EB;
  --status-info-bg: rgba(29, 78, 216, 0.08);

  /* Header Surface */
  --header-bg: rgba(250, 249, 246, 0.84);
  --header-bg-scrolled: rgba(250, 249, 246, 0.94);

  /* Button Surfaces */
  --btn-primary-bg: #0C1222;
  --btn-primary-hover: #1E293B;
  --btn-primary-fg: #FFFFFF;

  /* Typography Families */
  --font-serif: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Architectural Geometry & Motion */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(12, 18, 34, 0.05);
  --shadow-md: 0 8px 24px rgba(12, 18, 34, 0.07);
  --shadow-lg: 0 20px 48px rgba(12, 18, 34, 0.12);
  --ease-executive: cubic-bezier(0.22, 1, 0.36, 1);

  /* Layout Rhythm */
  --header-height: 68px;
  --container-max: 1200px;
}

/* ============================================
   OBSIDIAN DARK MODE (Linear / Editorial Dark)
   ============================================ */
html[data-theme="dark"] {
  color-scheme: dark;

  --bg-canvas: #090B10;
  --bg-elevated: #111520;
  --bg-subtle: #161B29;
  --bg-muted: #1E2536;
  --bg-code: #07090E;

  --border-subtle: rgba(255, 255, 255, 0.09);
  --border-default: rgba(255, 255, 255, 0.15);
  --border-strong: rgba(255, 255, 255, 0.26);
  --border-brass: rgba(212, 168, 83, 0.34);

  --ink-primary: #F3F5F8;
  --ink-secondary: #B8C2D4;
  --ink-muted: #8492A8;
  --ink-inverse: #090B10;
  --ink-on-brass: #090B10;

  --accent-primary: #60A5FA;
  --accent-primary-hover: #93C5FD;
  --accent-primary-tint: rgba(96, 165, 250, 0.12);
  --accent-bronze: #D4A853;
  --accent-bronze-tint: rgba(212, 168, 83, 0.13);

  --blue-900: #F3F5F8;
  --blue-800: #E2E8F0;
  --blue-700: #93C5FD;
  --blue-600: #60A5FA;
  --blue-500: #3B82F6;
  --blue-100: rgba(96, 165, 250, 0.12);
  --blue-50: rgba(255, 255, 255, 0.04);

  --brass-300: #E5C17A;
  --brass-400: #D4A853;
  --brass-500: #D4A853;
  --brass-600: #E5C17A;
  --brass-tint: rgba(212, 168, 83, 0.13);
  --brass-glow: rgba(212, 168, 83, 0.22);

  --sapphire-300: #93C5FD;
  --sapphire-400: #60A5FA;
  --sapphire-tint: rgba(96, 165, 250, 0.12);

  --status-critical: #FCA5A5;
  --status-critical-bar: #F87171;
  --status-critical-bg: rgba(248, 113, 113, 0.13);
  --status-high: #FCD34D;
  --status-high-bar: #F59E0B;
  --status-high-bg: rgba(245, 158, 11, 0.14);
  --status-medium: #E5C17A;
  --status-medium-bar: #D4A853;
  --status-medium-bg: rgba(212, 168, 83, 0.14);
  --status-positive: #6EE7B7;
  --status-positive-bar: #34D399;
  --status-positive-bg: rgba(52, 211, 153, 0.13);
  --status-info: #93C5FD;
  --status-info-bar: #60A5FA;
  --status-info-bg: rgba(96, 165, 250, 0.13);

  --header-bg: rgba(9, 11, 16, 0.80);
  --header-bg-scrolled: rgba(9, 11, 16, 0.94);

  --btn-primary-bg: #F3F5F8;
  --btn-primary-hover: #FFFFFF;
  --btn-primary-fg: #090B10;

  --glass-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 24px rgba(0, 0, 0, 0.22);
  --glass-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(255, 255, 255, 0.12);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.42);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.56);
}

/* ============================================
   BASE RESET & TYPOGRAPHIC FOUNDATION
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--bg-canvas);
}

body {
  position: relative;
  background-color: var(--bg-canvas);
  color: var(--ink-secondary);
  font-family: var(--font-sans);
  font-size: 15.5px;
  line-height: 1.68;
  min-height: 100vh;
  overflow-x: hidden;
  padding-top: var(--header-height);
  transition: background-color 0.25s ease, color 0.25s ease;
}

body.workspace-layout {
  padding-top: 0;
  height: 100%;
  overflow: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.025em;
  color: var(--ink-primary);
}

h1 { font-size: clamp(2.5rem, 4.8vw, 4.1rem); }
h2 { font-size: clamp(1.75rem, 2.9vw, 2.55rem); }
h3 { font-size: clamp(1.22rem, 1.8vw, 1.5rem); }
h4 { font-size: 1.05rem; }

p {
  color: var(--ink-secondary);
  line-height: 1.7;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.18s var(--ease-executive);
}

strong {
  color: var(--ink-primary);
  font-weight: 600;
}

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

.tabular {
  font-variant-numeric: tabular-nums;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 1rem;
  z-index: 2000;
  background: var(--btn-primary-bg);
  color: var(--btn-primary-fg);
  padding: 0.65rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

/* ============================================
   CONTAINERS, SECTIONS & EDITORIAL ACCENTS
   ============================================ */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
}

.container-narrow {
  max-width: 920px;
  margin: 0 auto;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
}

.section {
  padding-block: clamp(4.25rem, 7.5vw, 6.5rem);
}

.section-surface {
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.section-deep {
  background: var(--bg-canvas);
  border-top: 1px solid var(--border-subtle);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-bronze);
}

.eyebrow::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 1px;
  background: var(--accent-bronze);
  flex-shrink: 0;
}

.eyebrow-centered {
  justify-content: center;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header .eyebrow {
  margin-bottom: 0.85rem;
}

.section-title {
  margin-bottom: 0.75rem;
}

.section-subtitle {
  color: var(--ink-muted);
  font-size: 0.98rem;
  max-width: 58ch;
  margin: 0 auto;
}

.page-masthead {
  text-align: center;
  padding-block: clamp(3.25rem, 6vw, 4.75rem) clamp(2.25rem, 4vw, 3.25rem);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: clamp(2.25rem, 4vw, 3.25rem);
}

.page-masthead .eyebrow {
  margin-bottom: 1rem;
}

.page-masthead h1 {
  margin-bottom: 1rem;
}

.page-masthead .lead {
  font-size: 1.06rem;
  color: var(--ink-secondary);
  max-width: 62ch;
  margin: 0 auto;
  line-height: 1.7;
}

/* Pure Editorial Italic (No rainbow gradient fill!) */
.accent-italic {
  font-style: italic;
  color: var(--accent-primary);
}

.text-brass {
  color: var(--accent-bronze);
}

.text-muted {
  color: var(--ink-muted);
}

/* ============================================
   MINIMALIST ARCHITECTURAL HEADER
   ============================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 500;
  height: var(--header-height);
  background: var(--header-bg);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color 0.22s ease, border-color 0.22s ease;
}

.site-header.scrolled {
  background: var(--header-bg-scrolled);
  border-bottom-color: var(--border-default);
}

.scroll-progress-bar {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 1.5px;
  width: 0%;
  background: var(--accent-primary);
  pointer-events: none;
  transition: width 0.08s linear;
}

.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink-primary);
  flex-shrink: 0;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 2px;
  border-radius: 9px;
  background: #FFFFFF;
  border: 1px solid var(--border-default);
  transition: transform 0.22s var(--ease-executive), border-color 0.22s ease;
  overflow: hidden;
  flex-shrink: 0;
}

.brand-link:hover .brand-mark {
  transform: translateY(-1px);
  border-color: var(--accent-bronze);
}

.brand-emblem {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand-wordmark {
  font-family: var(--font-serif);
  font-size: 1.24rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink-primary);
}

.brand-wordmark span {
  color: var(--ink-primary);
}

.brand-wordmark .brand-tld {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent-bronze);
  margin-left: 1px;
}

/* Unboxed Architectural Navigation */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
}

.nav-menu > a,
.nav-dropdown-trigger {
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  position: relative;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  transition: color 0.18s ease, background-color 0.18s ease;
}

.nav-menu > a:hover,
.nav-menu > a.active,
.nav-dropdown-trigger:hover,
.nav-dropdown-trigger.active {
  color: var(--ink-primary);
  background: var(--bg-subtle);
}

.nav-menu > a.active::after,
.nav-dropdown-trigger.active::after {
  content: '';
  position: absolute;
  left: 0.85rem;
  right: 0.85rem;
  bottom: 2px;
  height: 1.5px;
  background: var(--accent-primary);
}

/* Dropdown */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-trigger {
  background: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-dropdown-trigger svg {
  transition: transform 0.2s var(--ease-executive);
}

.nav-dropdown.open .nav-dropdown-trigger svg {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  min-width: 286px;
  padding: 0.45rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, transform 0.18s var(--ease-executive), visibility 0.18s;
  z-index: 600;
}

.nav-dropdown.open .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.nav-dropdown-menu a {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--ink-secondary);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-dropdown-menu a:hover,
.nav-dropdown-menu a.active {
  background: var(--bg-subtle);
  color: var(--ink-primary);
}

.dd-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--ink-primary);
  flex-shrink: 0;
  margin-top: 1px;
}

.dd-label {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--ink-primary);
  line-height: 1.25;
}

.dd-desc {
  font-size: 0.73rem;
  color: var(--ink-muted);
  line-height: 1.35;
  margin-top: 2px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border-default);
  color: var(--ink-secondary);
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, background-color 0.18s ease;
}

.theme-toggle-btn:hover {
  border-color: var(--border-strong);
  color: var(--ink-primary);
  background: var(--bg-subtle);
}

.theme-toggle-btn .icon-sun { display: none; }
.theme-toggle-btn .icon-moon { display: block; }
html[data-theme="dark"] .theme-toggle-btn .icon-sun { display: block; }
html[data-theme="dark"] .theme-toggle-btn .icon-moon { display: none; }

.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border-default);
  color: var(--ink-primary);
  cursor: pointer;
}

.mobile-nav-actions {
  display: none;
}

/* ============================================
   BUTTONS (High-Contrast Ink & Crisp Outline)
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.78rem 1.35rem;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s var(--ease-executive);
}

.btn:disabled {
  opacity: 0.52;
  cursor: not-allowed;
  transform: none;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn-sm {
  padding: 0.48rem 0.92rem;
  font-size: 0.76rem;
}

.btn-icon {
  padding: 0.48rem;
  min-width: 34px;
  min-height: 34px;
}

.btn-primary {
  background: var(--btn-primary-bg);
  border-color: var(--btn-primary-bg);
  color: var(--btn-primary-fg);
}

.btn-primary:hover:not(:disabled) {
  background: var(--btn-primary-hover);
  border-color: var(--btn-primary-hover);
  color: var(--btn-primary-fg);
  transform: translateY(-1px);
}

.btn-ghost {
  background: var(--bg-elevated);
  border-color: var(--border-default);
  color: var(--ink-primary);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-subtle);
  border-color: var(--border-strong);
  color: var(--ink-primary);
  transform: translateY(-1px);
}

.btn-subtle {
  background: var(--bg-subtle);
  border-color: var(--border-subtle);
  color: var(--ink-secondary);
}

.btn-subtle:hover:not(:disabled) {
  background: var(--bg-muted);
  border-color: var(--border-default);
  color: var(--ink-primary);
}

.btn-danger {
  background: var(--status-critical-bg);
  border-color: rgba(217, 45, 32, 0.28);
  color: var(--status-critical);
}

.btn-danger:hover:not(:disabled) {
  background: rgba(217, 45, 32, 0.16);
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--accent-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.link-btn:hover {
  color: var(--accent-primary-hover);
}

/* ============================================
   CARDS & PILLS (Crisp Architectural Precision)
   ============================================ */
.card {
  position: relative;
  overflow: hidden;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  box-shadow: var(--glass-shadow);
  transition: border-color 0.2s ease, transform 0.22s var(--ease-executive), box-shadow 0.22s ease;
}

.card-interactive:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--glass-shadow-hover);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.62rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.pill-brass {
  background: var(--accent-bronze-tint);
  color: var(--accent-bronze);
  border: 1px solid var(--border-brass);
}

.pill-sapphire {
  background: var(--accent-primary-tint);
  color: var(--accent-primary);
  border: 1px solid rgba(29, 78, 216, 0.22);
}

html[data-theme="dark"] .pill-sapphire {
  border-color: rgba(96, 165, 250, 0.28);
}

.pill-neutral {
  background: var(--bg-subtle);
  color: var(--ink-secondary);
  border: 1px solid var(--border-subtle);
}

.pill-positive {
  background: var(--status-positive-bg);
  color: var(--status-positive);
}

.pill-critical {
  background: var(--status-critical-bg);
  color: var(--status-critical);
}

.pill-high {
  background: var(--status-high-bg);
  color: var(--status-high);
}

.pill-medium {
  background: var(--status-medium-bg);
  color: var(--status-medium);
}

.severity-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.severity-dot.critical { background: var(--status-critical-bar); }
.severity-dot.high { background: var(--status-high-bar); }
.severity-dot.medium { background: var(--status-medium-bar); }
.severity-dot.low { background: var(--status-positive-bar); }

/* ============================================
   FORMS & INPUTS
   ============================================ */
.form-group {
  margin-bottom: 1.05rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

.form-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.4rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.72rem 0.9rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  outline: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--ink-muted);
  opacity: 0.75;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-tint);
}

.form-input.invalid {
  border-color: var(--status-critical-bar);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2.35rem;
  cursor: pointer;
}

.form-textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.55;
}

.form-error {
  color: var(--status-critical);
  font-size: 0.76rem;
  margin-top: 0.35rem;
  min-height: 1em;
}

.form-status {
  padding: 0.75rem 0.95rem;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  margin-top: 0.75rem;
  line-height: 1.5;
}

.form-status.success {
  background: var(--status-positive-bg);
  border: 1px solid rgba(7, 148, 85, 0.3);
  color: var(--status-positive);
}

.form-status.error {
  background: var(--status-critical-bg);
  border: 1px solid rgba(217, 45, 32, 0.3);
  color: var(--status-critical);
}

.hp-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
  pointer-events: none;
}

/* ============================================
   MODALS
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(9, 11, 16, 0.56);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 1.85rem;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(10px);
  transition: transform 0.22s var(--ease-executive);
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.modal-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--ink-primary);
}

.modal-close {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--ink-muted);
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.modal-close:hover {
  border-color: var(--border-default);
  color: var(--ink-primary);
}

.modal-subtitle {
  font-size: 0.87rem;
  color: var(--ink-muted);
  margin-bottom: 1.35rem;
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.35rem;
}

.modal-actions .btn {
  flex: 1;
}

/* ============================================
   ACCESS GATE & LOADING / EMPTY STATES
   ============================================ */
.access-gate {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-canvas);
  padding: 1.25rem;
}

.access-gate.hidden {
  display: none;
}

.gate-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2rem;
  max-width: 390px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.gate-mark {
  width: 48px;
  height: 48px;
  margin: 0 auto 1.1rem;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border-default);
  color: var(--ink-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.gate-title {
  font-size: 1.45rem;
  margin-bottom: 0.45rem;
}

.gate-subtitle {
  color: var(--ink-muted);
  font-size: 0.86rem;
}

.gate-spinner,
.loading-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-default);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 1.15rem auto 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.gate-back {
  margin-top: 1.35rem;
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.gate-back a:hover {
  color: var(--accent-primary);
}

.loading-state,
.empty-state {
  text-align: center;
  padding: 3.25rem 1.5rem;
  color: var(--ink-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.loading-state p,
.empty-state p {
  margin-top: 0.85rem;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

/* ============================================
   EDITORIAL FOOTER
   ============================================ */
.site-footer {
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-subtle);
  padding: 3.75rem 0 2.5rem;
  text-align: center;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.footer-seal-frame {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  padding: 5px;
  background: #FFFFFF;
  border: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.15rem;
}

.footer-seal {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.footer-brand {
  font-family: var(--font-serif);
  font-size: 1.42rem;
  font-weight: 500;
  color: var(--ink-primary);
  margin-bottom: 0.3rem;
}

.footer-brand span {
  color: var(--ink-primary);
}

.footer-tagline {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-bronze);
  margin-bottom: 1.65rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem 2rem;
  margin-bottom: 1.75rem;
}

.footer-links a {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--ink-secondary);
}

.footer-links a:hover {
  color: var(--ink-primary);
}

.footer-rule {
  width: 56px;
  height: 1px;
  background: var(--border-strong);
  margin-bottom: 1.5rem;
}

.footer-legal {
  font-size: 0.75rem;
  color: var(--ink-muted);
  max-width: 780px;
  line-height: 1.65;
  margin-bottom: 1rem;
}

.footer-legal strong {
  color: var(--ink-primary);
}

.footer-copy {
  font-size: 0.74rem;
  color: var(--ink-muted);
}

/* ============================================
   RESTRAINED SCROLL REVEAL & REDUCED MOTION
   ============================================ */
.fade-up {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.45s var(--ease-executive), transform 0.45s var(--ease-executive);
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.delay-1 { transition-delay: 0.04s; }
.delay-2 { transition-delay: 0.08s; }
.delay-3 { transition-delay: 0.12s; }
.delay-4 { transition-delay: 0.16s; }
.delay-5 { transition-delay: 0.20s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fade-up { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */
@media (max-width: 960px) {
  .nav-menu,
  .nav-actions {
    display: none;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .nav-menu.open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-default);
    padding: 1rem 1.5rem 1.35rem;
    box-shadow: var(--shadow-lg);
  }

  .nav-menu.open > a,
  .nav-menu.open .nav-dropdown-trigger {
    width: 100%;
    padding: 0.72rem 0.6rem;
    justify-content: space-between;
  }

  .nav-menu.open > a.active::after,
  .nav-menu.open .nav-dropdown-trigger.active::after {
    display: none;
  }

  .nav-menu.open .nav-dropdown-menu {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    box-shadow: none;
    border: 1px solid var(--border-subtle);
    background: var(--bg-subtle);
    margin: 0.25rem 0 0.5rem;
    display: none;
  }

  .nav-menu.open .nav-dropdown.open .nav-dropdown-menu {
    display: block;
  }

  .mobile-nav-actions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 0.85rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--border-subtle);
  }

  .mobile-nav-actions .btn {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .modal {
    padding: 1.4rem;
  }
}
