/* ==========================================================================
   i3Codex Design System — Main Stylesheet
   Implements Two-Voice Rule, Elevation Ladder, Micro-interactions & Responsiveness
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--color-ground);
  background-image: var(--blueprint-bg);
  background-size: var(--blueprint-grid-size) var(--blueprint-grid-size);
  color: var(--color-ink);
  font-family: var(--font-evidence);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --------------------------------------------------------------------------
   Typography: Two-Voice Rule
   Voice: Newsreader (Says) | Evidence: IBM Plex Sans/Mono (Shows)
   -------------------------------------------------------------------------- */

h1, h2, h3, h4, .font-voice {
  font-family: var(--font-voice);
  font-weight: 300;
  color: var(--color-ink);
  margin-top: 0;
  letter-spacing: -0.014em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(38px, 5.5vw, 76px);
  line-height: 1.04;
  margin-bottom: 24px;
}

h2 {
  font-size: clamp(28px, 3.8vw, 42px);
  line-height: 1.12;
  margin-bottom: 16px;
}

h3 {
  font-size: clamp(22px, 2.5vw, 28px);
  font-weight: 400;
  line-height: 1.22;
  letter-spacing: -0.008em;
  margin-bottom: 12px;
}

p {
  color: var(--color-body);
  font-size: 16.5px;
  line-height: 1.68;
  margin: 0 0 1.2em;
}

p.lead {
  font-size: clamp(16px, 1.8vw, 18px);
  max-width: 52ch;
  line-height: 1.66;
}

.mono {
  font-family: var(--font-mono);
  font-feature-settings: "tnum";
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  color: var(--color-muted);
  font-family: var(--font-evidence);
  margin-bottom: 24px;
}

.eyebrow-line {
  display: inline-block;
  width: 32px;
  height: 1px;
  background-color: var(--color-hairline-strong);
}

.tabular-figure {
  font-family: var(--font-voice);
  font-variant-numeric: tabular-nums;
  font-weight: 300;
  line-height: 1;
  color: var(--color-ink);
}

/* --------------------------------------------------------------------------
   Layout & Container
   -------------------------------------------------------------------------- */

.site-container {
  width: 100%;
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(20px, 5vw, 60px);
  padding-right: clamp(20px, 5vw, 60px);
}

/* --------------------------------------------------------------------------
   Brand Lockup & Header
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 76px;
  background-color: rgba(246, 244, 239, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-hairline);
  box-shadow: 0 1px 3px rgba(22, 24, 28, 0.03);
  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  will-change: height, box-shadow;
  transition: height 0.25s cubic-bezier(0.16, 1, 0.3, 1), 
              background-color 0.25s ease, 
              box-shadow 0.25s ease, 
              border-color 0.25s ease;
}

.site-header.scrolled {
  height: 54px;
  background-color: rgba(246, 244, 239, 0.97);
  border-bottom-color: rgba(22, 24, 28, 0.12);
  box-shadow: 0 4px 20px rgba(22, 24, 28, 0.08), 0 1px 0 rgba(255, 255, 255, 0.9);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  text-decoration: none;
  user-select: none;
  transition: transform var(--motion-fast);
}

.brand-logo:hover {
  transform: translateY(-1px);
}

.brand-logo-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 14px;
  border-radius: 5px;
  background: #16181C;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 8px rgba(22, 24, 28, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
  transition: padding 0.25s cubic-bezier(0.16, 1, 0.3, 1), 
              background-color 0.2s ease, 
              border-color 0.2s ease, 
              box-shadow 0.2s ease;
}

.brand-logo-pill:hover {
  background: #0E1013;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 14px rgba(22, 24, 28, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.brand-logo-img {
  height: 22px;
  width: auto;
  display: block;
  object-fit: contain;
  transition: height 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.site-header.scrolled .brand-logo-pill {
  padding: 4px 11px;
}

.site-header.scrolled .brand-logo-img {
  height: 18px;
}

.site-header.scrolled .btn-sm {
  height: 34px;
  padding: 0 14px;
  font-size: 13px;
}

.brand-i3 {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
}

.brand-bracket {
  color: var(--color-technical);
  font-family: var(--font-mono);
  font-weight: 400;
  margin-left: 2px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--color-subtle);
  text-decoration: none;
  padding: 6px 0;
  position: relative;
  transition: color var(--motion-fast);
}

.nav-link:hover {
  color: var(--color-ink);
}

.nav-link.active {
  color: var(--color-ink);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-accent);
}

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

.lang-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-muted);
  letter-spacing: 0.05em;
  padding: 3px 6px;
}

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--color-ink);
  padding: 8px;
  cursor: pointer;
  border-radius: 4px;
}

/* --------------------------------------------------------------------------
   Buttons & Controls
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-evidence);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  border-radius: 3px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform var(--motion-btn), box-shadow var(--motion-btn), background var(--motion-btn), color var(--motion-btn), border-color var(--motion-btn);
  white-space: nowrap;
}

.btn-lg {
  height: 52px;
  padding: 0 28px;
  font-size: 15.5px;
}

.btn-md {
  height: 44px;
  padding: 0 22px;
  font-size: 14.5px;
}

.btn-sm {
  height: 38px;
  padding: 0 16px;
  font-size: 13.5px;
}

.btn-primary {
  background: var(--color-accent);
  color: #FFFFFF;
  box-shadow: var(--shadow-btn-primary);
}

.btn-primary:hover {
  background: var(--color-ink);
  color: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: var(--shadow-btn-primary-hover);
}

.btn-secondary {
  background: #FFFFFF;
  color: var(--color-body);
  border-color: var(--color-hairline-strong);
  box-shadow: var(--shadow-btn-secondary);
}

.btn-secondary:hover {
  background: #FFFFFF;
  color: var(--color-ink);
  border-color: var(--color-ink);
  transform: translateY(-2px);
  box-shadow: var(--shadow-btn-secondary-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--color-body);
}

.btn-ghost:hover {
  background: rgba(22, 24, 28, 0.05);
  color: var(--color-ink);
}

/* --------------------------------------------------------------------------
   Elevation & Cards
   -------------------------------------------------------------------------- */

.card {
  background: var(--color-surface);
  border-radius: 5px;
  box-shadow: var(--elevation-e2);
  transition: transform var(--motion-card), box-shadow var(--motion-card);
  position: relative;
  overflow: hidden;
}

.card:hover, .card-lift:hover {
  transform: translateY(-5px);
  box-shadow: var(--elevation-e3);
}

.hero-panel {
  background: var(--color-surface);
  border-radius: 5px;
  box-shadow: var(--elevation-e4);
  overflow: hidden;
  transition: transform var(--motion-panel), box-shadow var(--motion-panel);
}

.hero-panel:hover {
  transform: translateY(-4px);
  box-shadow: 0 46px 78px -26px rgba(22,24,28,.32), 0 14px 26px -14px rgba(22,24,28,.16), inset 0 1px 0 rgba(255,255,255,.95), 0 0 0 1px rgba(22,24,28,.06);
}

/* --------------------------------------------------------------------------
   Hero Section & 3D Stage
   -------------------------------------------------------------------------- */

.hero-section {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.75) 0%, rgba(255, 255, 255, 0) 100%);
  padding: clamp(50px, 8vw, 92px) 0 clamp(90px, 12vw, 140px);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(30px, 5vw, 60px);
  align-items: center;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 36px;
}

/* 3D Canvas Stage */
.stage-3d-wrapper {
  position: relative;
  height: 420px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stage-3d-canvas {
  width: 100%;
  height: 100%;
  outline: none;
  cursor: grab;
}

.stage-3d-canvas:active {
  cursor: grabbing;
}

.stage-3d-controls {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid var(--color-hairline);
  box-shadow: 0 2px 6px rgba(22, 24, 28, 0.06);
  z-index: 5;
}

.stage-ctrl-btn {
  background: transparent;
  border: none;
  color: var(--color-subtle);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 3px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
}

.stage-ctrl-btn:hover, .stage-ctrl-btn.active {
  background: var(--color-ground);
  color: var(--color-ink);
}

/* --------------------------------------------------------------------------
   Product Telemetry Panel (Main.dc.html breakout)
   -------------------------------------------------------------------------- */

.telemetry-breakout {
  position: relative;
  z-index: 10;
  margin-top: -80px;
  margin-bottom: 70px;
}

.panel-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 46px;
  padding: 0 20px;
  border-bottom: 1px solid var(--color-hairline-subtle);
  background: linear-gradient(180deg, #FDFCFA, #F7F5F0);
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 3px;
  background: var(--color-good-bg);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-good-text);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-chart-good);
  animation: pulseDot 2.4s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.telemetry-body-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
}

.telemetry-main {
  padding: 24px 28px;
  border-right: 1px solid var(--color-hairline-subtle);
}

.telemetry-sidebar {
  padding: 24px 22px;
  background: var(--color-surface-subtle);
}

/* --------------------------------------------------------------------------
   Practices Tabs
   -------------------------------------------------------------------------- */

.practices-section {
  padding: 40px 0 80px;
}

.tabs-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  height: 42px;
  padding: 0 18px;
  border-radius: 3px;
  border: 1px solid #DAD4C9;
  background: rgba(255, 255, 255, 0.6);
  color: var(--color-subtle);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--motion-fast);
}

.tab-btn:hover {
  color: var(--color-ink);
  border-color: #B4ADA0;
  transform: translateY(-1px);
}

.tab-btn.active {
  color: var(--color-ink);
  background: #FFFFFF;
  border-color: var(--color-ink);
  box-shadow: 0 4px 10px -4px rgba(22, 24, 28, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.tab-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 3px;
  background: #F5F2EC;
  box-shadow: inset 0 0 0 1px #E7E2D9;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-subtle);
}

/* --------------------------------------------------------------------------
   Four Layers Architecture Section
   -------------------------------------------------------------------------- */

.layers-section {
  padding: 80px 0;
}

.layers-grid {
  display: grid;
  grid-template-columns: 1fr 440px;
  gap: 52px;
  align-items: center;
}

.layer-item {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 18px;
  align-items: baseline;
  padding: 14px 0;
  border-top: 1px solid var(--color-hairline);
  cursor: pointer;
  transition: background var(--motion-fast);
}

.layer-item:last-child {
  border-bottom: 1px solid var(--color-hairline);
}

.layer-item:hover, .layer-item.active {
  background: rgba(255, 255, 255, 0.4);
}

.layer-item.active .layer-slug {
  color: var(--color-accent);
}

.layer-slug {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--color-body);
}

/* Interactive 3D Stack Canvas */
.stack-3d-box {
  position: relative;
  width: 100%;
  height: 400px;
  border-radius: 5px;
  overflow: hidden;
  background: transparent;
}

/* --------------------------------------------------------------------------
   Proof & Metric Cards
   -------------------------------------------------------------------------- */

.proof-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 60px 0;
}

.proof-card {
  padding: 26px 24px;
  border-radius: 5px;
  background: #FFFFFF;
  box-shadow: var(--elevation-e2);
  transition: transform var(--motion-card), box-shadow var(--motion-card);
}

.proof-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--elevation-e3);
}

.proof-card:hover .proof-idx {
  color: var(--color-technical);
}

.proof-idx {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-muted);
  margin-bottom: 16px;
  transition: color var(--motion-fast);
}

/* --------------------------------------------------------------------------
   Team Photo & Testimonial Section
   -------------------------------------------------------------------------- */

.team-story-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
  margin: 60px 0;
  align-items: stretch;
}

.photo-slot {
  position: relative;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: var(--elevation-e2);
  min-height: 340px;
}

.photo-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.photo-slot:hover img {
  transform: scale(1.02);
}

.photo-caption-tag {
  position: absolute;
  bottom: 14px;
  left: 14px;
  padding: 5px 12px;
  border-radius: 3px;
  background: rgba(22, 24, 28, 0.82);
  backdrop-filter: blur(8px);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.testimonial-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 34px 32px;
  background: #FFFFFF;
  border-radius: 5px;
  box-shadow: var(--elevation-e2);
}

/* --------------------------------------------------------------------------
   Architecture Review Call-To-Action Strip
   -------------------------------------------------------------------------- */

.cta-strip {
  position: relative;
  margin-top: 80px;
  padding: 64px 0 54px;
  border-top: 1px solid var(--color-hairline);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0));
}

.cta-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 50px;
  align-items: center;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--color-hairline);
  background: rgba(251, 250, 247, 0.8);
  padding: 54px 0 32px;
  margin-top: auto;
}

.footer-columns {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}

.footer-col h5 {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--color-muted);
  text-transform: lowercase;
  margin: 0 0 16px;
  letter-spacing: 0.05em;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-link {
  font-size: 14.5px;
  color: var(--color-body);
  text-decoration: none;
  transition: color var(--motion-fast);
}

.footer-link:hover {
  color: var(--color-ink);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid var(--color-hairline);
  font-size: 13px;
  color: var(--color-muted);
}

/* --------------------------------------------------------------------------
   Forms & Interactive Inputs
   -------------------------------------------------------------------------- */

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--color-body);
  margin-bottom: 8px;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  height: 48px;
  padding: 0 15px;
  border-radius: 3px;
  border: none;
  background: #FCFBF8;
  box-shadow: inset 0 0 0 1px #DED9CF;
  font-family: var(--font-evidence);
  font-size: 15px;
  color: var(--color-ink);
  transition: box-shadow var(--motion-fast), background var(--motion-fast);
  outline: none;
}

.form-textarea {
  height: 120px;
  padding: 12px 15px;
  resize: vertical;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  background: #FFFFFF;
  box-shadow: inset 0 0 0 2px var(--color-accent), 0 0 0 3px rgba(27, 95, 184, 0.14);
}

.form-input.error {
  box-shadow: inset 0 0 0 2px var(--color-chart-alert);
}

.chips-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 16px;
  border-radius: 3px;
  background: #FCFBF8;
  box-shadow: inset 0 0 0 1px #DED9CF;
  font-size: 14px;
  color: var(--color-body);
  cursor: pointer;
  user-select: none;
  transition: all var(--motion-fast);
}

.chip:hover {
  box-shadow: inset 0 0 0 1px #B4ADA0;
  color: var(--color-ink);
}

.chip.active {
  background: var(--color-accent-subtle);
  box-shadow: inset 0 0 0 1.5px var(--color-accent);
  color: var(--color-accent);
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   Modal: Book an Architecture Review
   -------------------------------------------------------------------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(22, 24, 28, 0.52);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  background: #FFFFFF;
  border-radius: 5px;
  box-shadow: 0 30px 60px -15px rgba(22, 24, 28, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 0 0 1px rgba(22, 24, 28, 0.08);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.98);
  transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.3, 1);
  padding: 36px 40px;
  position: relative;
}

.modal-backdrop.open .modal-dialog {
  transform: translateY(0) scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 36px;
  height: 36px;
  border-radius: 4px;
  border: 1px solid var(--color-hairline);
  background: #FFFFFF;
  color: var(--color-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--motion-fast);
}

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

/* Toast notification */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1100;
  background: #16181C;
  color: #FFFFFF;
  padding: 14px 22px;
  border-radius: 4px;
  box-shadow: 0 10px 25px -5px rgba(22, 24, 28, 0.4);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  transform: translateY(100px);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.3, 1), opacity 0.35s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* --------------------------------------------------------------------------
   Layout Grid Utilities (Responsive by design)
   -------------------------------------------------------------------------- */

.contact-layout-grid {
  display: grid;
  grid-template-columns: 1fr 500px;
  gap: clamp(36px, 5vw, 72px);
  align-items: start;
}

.form-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.offices-layout-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.services-hero-grid {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 60px;
  align-items: end;
}

.practice-card-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: clamp(30px, 5vw, 60px);
  align-items: start;
}

.case-hero-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 60px;
  align-items: end;
  padding-bottom: 30px;
}

.case-body-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 60px;
  align-items: start;
}

.case-shift-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.about-hero-grid {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 60px;
  align-items: end;
}

.principles-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 24px;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 2px solid var(--color-ink);
  padding-top: 26px;
}

.careers-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 48px;
  align-items: center;
}

/* --------------------------------------------------------------------------
   Responsive Adaptations (Per MobileHome.dc.html & MobileContact.dc.html)
   -------------------------------------------------------------------------- */

@media (max-width: 980px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: left;
  }
  
  .stage-3d-wrapper {
    height: 320px;
  }

  .telemetry-body-grid {
    grid-template-columns: 1fr;
  }
  
  .telemetry-main {
    border-right: none;
    border-bottom: 1px solid var(--color-hairline-subtle);
  }

  .layers-grid {
    grid-template-columns: 1fr;
  }

  .team-story-grid {
    grid-template-columns: 1fr;
  }

  .cta-grid {
    grid-template-columns: 1fr;
  }

  .footer-columns {
    grid-template-columns: 1fr 1fr;
  }

  .contact-layout-grid {
    grid-template-columns: 1fr;
    gap: 44px;
  }

  .services-hero-grid {
    grid-template-columns: 1fr;
    gap: 24px;
    align-items: start;
  }

  .practice-card-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .case-hero-grid {
    grid-template-columns: 1fr;
    gap: 32px;
    align-items: start;
  }

  .case-body-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .about-hero-grid {
    grid-template-columns: 1fr;
    gap: 24px;
    align-items: start;
  }

  .team-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }

  .careers-grid {
    grid-template-columns: 1fr;
    gap: 28px;
    align-items: start;
  }
}

@media (max-width: 860px) {
  .principles-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 768px) {
  :root {
    --blueprint-grid-size: 32px;
  }

  .site-container {
    padding-left: 20px;
    padding-right: 20px;
  }

  .site-header {
    height: 60px;
  }

  .site-header.scrolled {
    height: 48px;
  }

  .site-header.scrolled .brand-logo-pill {
    padding: 3px 10px;
  }

  .site-header.scrolled .brand-logo-img {
    height: 16px;
  }

  .nav-links, .lang-badge {
    display: none;
  }

  .mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-right: -8px;
  }

  .stage-3d-wrapper {
    height: 280px;
  }

  .telemetry-breakout {
    margin-top: -20px;
    margin-bottom: 48px;
  }

  .proof-grid {
    grid-template-columns: 1fr;
    margin: 40px 0;
  }

  .offices-layout-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .stats-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 20px;
  }

  .stats-strip > div {
    border-left: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .case-shift-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .footer-columns {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    width: 100%;
    height: 52px;
  }

  .modal-dialog {
    padding: 24px 18px;
    max-width: 94vw;
  }
}

@media (max-width: 580px) {
  .nav-actions .btn-primary {
    display: none;
  }

  .form-row-2col {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .team-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .chips-group {
    flex-direction: column;
  }

  .chip {
    width: 100%;
    justify-content: flex-start;
  }

  .stats-strip {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* Mobile drawer navigation */
.mobile-nav-drawer {
  position: fixed;
  inset: 0;
  background: rgba(22, 24, 28, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-nav-drawer.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-drawer-content {
  width: 320px;
  max-width: 85vw;
  height: 100%;
  background: var(--color-ground);
  background-image: var(--blueprint-bg);
  background-size: 32px 32px;
  padding: 30px 24px;
  box-shadow: -10px 0 30px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.mobile-nav-drawer.open .mobile-drawer-content {
  transform: translateX(0);
}

.mobile-drawer-links {
  list-style: none;
  margin: 30px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mobile-drawer-link {
  font-size: 18px;
  font-weight: 500;
  color: var(--color-ink);
  text-decoration: none;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-hairline);
  display: block;
}

/* ==========================================================================
   Careers Page Components & Layout
   ========================================================================== */

.careers-hero-badges {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.careers-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.filter-btn {
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-body);
  background: var(--color-surface);
  border: 1px solid var(--color-hairline);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-evidence);
}

.filter-btn:hover {
  border-color: var(--color-hairline-strong);
  color: var(--color-ink);
}

.filter-btn.active {
  background: #16181C;
  color: #FFFFFF;
  border-color: #16181C;
}

.jobs-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 60px;
}

.job-card {
  padding: 32px;
  border-radius: 4px;
  background: var(--color-surface);
  border: 1px solid var(--color-hairline);
  box-shadow: var(--elevation-e1);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.25s ease,
              border-color 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.job-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--elevation-e3);
  border-color: var(--color-hairline-strong);
}

.job-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.job-title {
  font-size: 22px;
  font-weight: 500;
  color: var(--color-ink);
  margin: 0;
  font-family: var(--font-voice);
}

.job-meta-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.job-meta-pill {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 3px;
  background: var(--color-ground);
  color: var(--color-body);
  border: 1px solid var(--color-hairline-subtle);
}

.job-meta-pill.salary {
  background: var(--color-accent-subtle);
  color: var(--color-accent);
  border-color: var(--color-accent-border);
  font-weight: 500;
}

.job-desc {
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--color-body);
  margin: 0;
}

.job-skills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.job-skill-tag {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--color-subtle);
  background: rgba(22, 24, 28, 0.04);
  padding: 3px 8px;
  border-radius: 3px;
}

.job-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--color-hairline-subtle);
  flex-wrap: wrap;
  gap: 16px;
}

.benefits-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.benefit-card {
  padding: 30px;
  background: var(--color-surface);
  border: 1px solid var(--color-hairline);
  border-radius: 4px;
  box-shadow: var(--elevation-e0);
}

.benefit-num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-accent);
  margin-bottom: 14px;
  letter-spacing: 0.05em;
}

.process-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  position: relative;
}

.process-step {
  padding: 28px;
  background: var(--color-surface);
  border: 1px solid var(--color-hairline);
  border-radius: 4px;
  box-shadow: var(--elevation-e0);
  display: flex;
  flex-direction: column;
}

.process-step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #16181C;
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 18px;
}

@media (max-width: 900px) {
  .benefits-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .process-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .benefits-grid {
    grid-template-columns: 1fr;
  }
  .process-grid {
    grid-template-columns: 1fr;
  }
  .job-card {
    padding: 24px 20px;
  }
}

/* ==========================================================================
   i3Codex Preloader & Cinematic Intro Animation
   ========================================================================== */

.site-preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-ground, #F6F4EF);
  background-image: var(--blueprint-bg);
  background-size: var(--blueprint-grid-size, 48px) var(--blueprint-grid-size, 48px);
  overflow: hidden;
  pointer-events: auto;
  transition: transform 0.75s cubic-bezier(0.76, 0, 0.24, 1),
              opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.75s ease;
  will-change: transform, opacity;
}

.preloader-backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.preloader-ambient-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 520px;
  height: 520px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(8, 196, 222, 0.22) 0%, rgba(40, 122, 237, 0.10) 38%, rgba(246, 244, 239, 0) 72%);
  filter: blur(44px);
  animation: preloaderGlowPulse 2.4s ease-in-out infinite alternate;
  pointer-events: none;
}

.preloader-grid-lines {
  display: none;
}

.preloader-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}

.preloader-logo-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 18px 42px;
  border-radius: 12px;
  background: #16181C;
  border: 1px solid rgba(8, 196, 222, 0.45);
  box-shadow: 0 16px 40px rgba(22, 24, 28, 0.22),
              0 0 35px rgba(8, 196, 222, 0.25),
              inset 0 1px 0 rgba(255, 255, 255, 0.2);
  overflow: hidden;
  animation: preloaderLogoEntrance 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.preloader-logo-img {
  height: 42px;
  width: auto;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 2px 10px rgba(8, 196, 222, 0.4));
}

.preloader-shimmer {
  position: absolute;
  top: 0;
  left: -150%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    105deg,
    transparent 20%,
    rgba(255, 255, 255, 0.08) 35%,
    rgba(8, 196, 222, 0.5) 50%,
    rgba(255, 255, 255, 0.3) 55%,
    transparent 70%
  );
  transform: skewX(-20deg);
  animation: preloaderShimmerSweep 1.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  animation-delay: 0.35s;
  pointer-events: none;
}

/* Keyframes */
@keyframes preloaderLogoEntrance {
  0% {
    opacity: 0;
    transform: scale(0.85) translateY(12px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes preloaderGlowPulse {
  0% {
    opacity: 0.6;
    transform: translate(-50%, -50%) scale(0.9);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.15);
  }
}

@keyframes preloaderShimmerSweep {
  0% {
    left: -150%;
  }
  100% {
    left: 200%;
  }
}

/* Exit / Page Reveal State */
body.page-loaded .site-preloader {
  opacity: 0;
  transform: translateY(-100%);
  pointer-events: none;
  visibility: hidden;
}

body.page-loaded .preloader-content {
  opacity: 0;
  transform: translateY(-24px) scale(0.96);
}

/* Smooth Stagger Entrance for Page Header and Main Content */
.site-header,
main,
.page-hero,
.hero-section {
  transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

body:not(.page-loaded) .site-header {
  opacity: 0;
  transform: translateY(-12px);
}

body:not(.page-loaded) main {
  opacity: 0;
  transform: translateY(18px);
}

body.page-loaded .site-header {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.12s;
}

body.page-loaded main {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.22s;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .preloader-logo-pill {
    padding: 14px 28px;
  }
  .preloader-logo-img {
    height: 32px;
  }
  .preloader-ambient-glow {
    width: 320px;
    height: 320px;
  }
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .site-preloader {
    transition: opacity 0.3s ease;
  }
  body.page-loaded .site-preloader {
    transform: none;
  }
  .preloader-ambient-glow,
  .preloader-shimmer,
  .preloader-logo-pill {
    animation: none;
  }
  .site-header,
  main {
    transition: none;
    opacity: 1;
    transform: none;
  }
}

