/* ==========================================================================
   TabLam Ecosystem — Design System (Light Primary & Dark Switchable)
   ========================================================================== */

/* --------------------------------------------------------------------------
   Light Theme (Primary / Default)
   -------------------------------------------------------------------------- */
:root {
  --theme: light;
  --bg: #f8fafc;
  --bg-gradient: radial-gradient(circle at 50% -10%, #dcfce7 0%, #f8fafc 60%);
  --surface: #ffffff;
  --surface-hover: #f1f5f9;
  --surface-card: #ffffff;
  --surface-elevated: #ffffff;
  --border: #e2e8f0;
  --border-hover: #cbd5e1;
  --border-accent: rgba(5, 150, 105, 0.3);
  
  --text: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;
  
  --green: #059669;
  --green-dark: #047857;
  --green-glow: rgba(5, 150, 105, 0.18);
  
  --header-bg: rgba(255, 255, 255, 0.88);
  --header-border: #e2e8f0;
  
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-card: 0 4px 20px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --shadow-card-hover: 0 20px 35px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --shadow-modal: 0 25px 70px -12px rgba(15, 23, 42, 0.25);
  
  --stage-bg: #f1f5f9;
  --stage-bar-bg: #f8fafc;
  --stage-address-bg: #ffffff;
  --stage-border: #cbd5e1;
  
  --footer-bg: #f1f5f9;
  --footer-border: #e2e8f0;
  --badge-bg: rgba(15, 23, 42, 0.04);
  --code-bg: #f1f5f9;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: 'Plus Jakarta Sans', var(--font-sans);
  --font-mono: 'JetBrains Mono', monospace;
  
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shell: 1280px;
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --------------------------------------------------------------------------
   Dark Theme (Switchable via data-theme="dark")
   -------------------------------------------------------------------------- */
[data-theme="dark"] {
  --theme: dark;
  --bg: #070c14;
  --bg-gradient: radial-gradient(circle at 50% 0%, #0e1e2d 0%, #070c14 70%);
  --surface: #0e1726;
  --surface-hover: #152238;
  --surface-card: #0b1322;
  --surface-elevated: #16243b;
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.2);
  --border-accent: rgba(16, 185, 129, 0.3);
  
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --green: #10b981;
  --green-dark: #059669;
  --green-glow: rgba(16, 185, 129, 0.25);
  
  --header-bg: rgba(7, 12, 20, 0.88);
  --header-border: rgba(255, 255, 255, 0.08);
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.4);
  --shadow-card-hover: 0 20px 35px -5px rgba(0, 0, 0, 0.6);
  --shadow-modal: 0 25px 80px rgba(0, 0, 0, 0.8);
  
  --stage-bg: #050a12;
  --stage-bar-bg: #0c1422;
  --stage-address-bg: rgba(0, 0, 0, 0.4);
  --stage-border: rgba(255, 255, 255, 0.12);
  
  --footer-bg: #04080e;
  --footer-border: rgba(255, 255, 255, 0.08);
  --badge-bg: rgba(255, 255, 255, 0.05);
  --code-bg: rgba(255, 255, 255, 0.05);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.25s ease, color 0.25s ease;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* Logo adaptivity in Dark Mode */
[data-theme="dark"] .brand img {
  filter: brightness(1.2) contrast(1.1) drop-shadow(0 0 1px rgba(255, 255, 255, 0.35));
}

/* ==========================================================================
   Typography & Utilities
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -0.025em;
}

p {
  color: var(--text-muted);
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

button {
  font-family: inherit;
  font-size: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
  transition: var(--transition);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

.shell {
  width: min(var(--shell), calc(100% - 48px));
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: 16px;
  top: -120px;
  z-index: 1000;
  background: var(--green);
  color: #fff;
  padding: 12px 20px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: top 0.2s ease;
}

.skip:focus {
  top: 16px;
}

/* ==========================================================================
   Buttons, Badges & Theme Toggle
   ========================================================================== */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: var(--transition);
}

.button.primary {
  background: var(--green);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--green-glow);
}

.button.primary:hover {
  background: var(--green-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--green-glow);
}

.button.outline {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.button.outline:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.button.secondary {
  background: var(--surface-hover);
  border-color: var(--border);
  color: var(--text-muted);
}

.button.secondary:hover {
  background: var(--surface);
  color: var(--text);
  transform: translateY(-2px);
}

.button.large {
  padding: 14px 24px;
  font-size: 15px;
  border-radius: 10px;
}

.button.small {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
}

/* Theme Toggle Button */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.theme-toggle:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.theme-toggle .sun-icon {
  display: none;
}

.theme-toggle .moon-icon {
  display: block;
}

[data-theme="dark"] .theme-toggle .sun-icon {
  display: block;
  color: #f59e0b;
}

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

.theme-toggle-label {
  font-size: 12px;
  font-weight: 600;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  background: var(--badge-bg);
  color: var(--text-muted);
}

.badge.edge-badge {
  border-color: rgba(249, 115, 22, 0.3);
  color: #ea580c;
  background: rgba(249, 115, 22, 0.1);
}

[data-theme="dark"] .badge.edge-badge {
  color: #fb923c;
}

.badge.oss-badge {
  border-color: rgba(59, 130, 246, 0.3);
  color: #2563eb;
  background: rgba(59, 130, 246, 0.1);
}

[data-theme="dark"] .badge.oss-badge {
  color: #60a5fa;
}

.category-pill {
  padding: 5px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green);
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--header-border);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.nav-wrap {
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

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

.brand {
  display: inline-flex;
  align-items: center;
}

.brand img {
  height: 38px;
  width: auto;
  object-fit: contain;
  transition: filter 0.25s ease;
}

.hub-pill {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(5, 150, 105, 0.1);
  color: var(--green);
  border: 1px solid rgba(5, 150, 105, 0.25);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.back-link:hover {
  color: var(--text);
  border-color: var(--border-hover);
  background: var(--surface-hover);
}

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

nav > a:not(.button) {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

nav > a:not(.button):hover {
  color: var(--text);
}

.menu-toggle {
  display: none;
}

/* ==========================================================================
   Central Platform (Hub) Hero Section
   ========================================================================== */

.hub-hero {
  position: relative;
  padding-block: 84px 60px;
  background: var(--bg-gradient);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  transition: background 0.25s ease;
}

.hub-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 450px;
  background: radial-gradient(ellipse at center, rgba(5, 150, 105, 0.12), transparent 70%);
  pointer-events: none;
}

.hub-hero-inner {
  position: relative;
  max-width: 960px;
  margin-inline: auto;
  text-align: center;
}

.eyebrow-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 9999px;
  background: var(--surface);
  border: 1px solid rgba(5, 150, 105, 0.25);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--green);
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.pulsing-green {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: pulse 2s infinite;
}

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

.hub-hero-title {
  font-size: clamp(38px, 4.8vw, 68px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin-bottom: 24px;
  color: var(--text);
}

.hub-hero-title em {
  font-style: normal;
  background: linear-gradient(135deg, #059669 0%, #2563eb 55%, #7c3aed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="dark"] .hub-hero-title em {
  background: linear-gradient(135deg, #34d399 0%, #60a5fa 50%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hub-hero-desc {
  font-size: clamp(16px, 1.8vw, 19px);
  color: var(--text-muted);
  max-width: 760px;
  margin-inline: auto;
  line-height: 1.65;
  margin-bottom: 36px;
}

.hub-hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

/* Ecosystem Stats Strip */
.ecosystem-stats-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 18px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(12px);
  max-width: 820px;
  margin-inline: auto;
}

.stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.stat-number {
  font-size: 24px;
  font-weight: 800;
  font-family: var(--font-heading);
  color: var(--text);
  letter-spacing: -0.03em;
}

.stat-text {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.stat-sep {
  width: 1px;
  height: 32px;
  background: var(--border);
}

/* ==========================================================================
   Sectors Ribbon
   ========================================================================== */

.sectors-ribbon {
  border-bottom: 1px solid var(--border);
  background: var(--surface-hover);
  padding-block: 16px;
}

.sectors-ribbon-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  overflow-x: auto;
  scrollbar-width: none;
}

.sectors-ribbon-inner::-webkit-scrollbar {
  display: none;
}

.ribbon-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  white-space: nowrap;
}

.sectors-chips {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sector-chip {
  padding: 8px 14px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.sector-chip:hover {
  border-color: var(--border-hover);
  color: var(--text);
  transform: translateY(-1px);
}

.sector-chip.active {
  background: var(--green);
  border-color: var(--green);
  color: #ffffff;
  box-shadow: 0 2px 10px var(--green-glow);
}

/* ==========================================================================
   Section Layouts
   ========================================================================== */

.section {
  padding-block: 84px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 40px;
}

.section-head h2 {
  font-size: clamp(28px, 3.2vw, 42px);
  margin-top: 10px;
  letter-spacing: -0.03em;
  color: var(--text);
}

.section-head p {
  max-width: 440px;
  font-size: 15px;
  color: var(--text-muted);
}

/* ==========================================================================
   Featured Flagship Spotlight
   ========================================================================== */

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

.featured-card {
  position: relative;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  overflow: hidden;
}

.featured-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--card-accent, var(--green));
  opacity: 0.8;
  transition: var(--transition);
}

.featured-card:hover {
  border-color: var(--card-accent, var(--green));
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}

.featured-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.f-category {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.f-icon {
  font-size: 16px;
}

.f-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--badge-bg);
  border: 1px solid var(--border);
  color: var(--text);
}

.f-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.3;
  color: var(--text);
}

.f-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 18px;
  flex: 1;
}

.f-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.mini-tag {
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--code-bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.featured-card-foot {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ==========================================================================
   Directory & Projects Grid
   ========================================================================== */

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

.directory-head {
  align-items: center;
}

.directory-filter-bar {
  display: flex;
  align-items: center;
  gap: 16px;
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-wrap svg {
  position: absolute;
  left: 14px;
  color: var(--text-dim);
  pointer-events: none;
}

.search-wrap input {
  width: 320px;
  padding: 10px 16px 10px 42px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.search-wrap input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.search-wrap input::placeholder {
  color: var(--text-dim);
}

.project-count-badge {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

.project-count-badge span {
  color: var(--green);
  font-weight: 700;
}

.directory-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--border);
}

.dir-tab {
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: var(--transition);
}

.dir-tab:hover {
  color: var(--text);
  background: var(--surface);
}

.dir-tab.active {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
}

/* Projects Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.project-card {
  position: relative;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  overflow: hidden;
}

.project-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--p-accent, var(--green));
  opacity: 0.7;
  transition: var(--transition);
}

.project-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
}

.project-card:hover::before {
  opacity: 1;
  height: 3px;
}

.p-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.p-category {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.p-icon {
  font-size: 15px;
}

.p-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--badge-bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.p-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.35;
}

.p-title a {
  color: var(--text);
}

.p-title a:hover {
  color: var(--green);
}

.p-tagline {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
  flex: 1;
}

.p-tech-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 18px;
}

.p-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.card-link {
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.card-link.primary {
  color: var(--green);
}

.card-link.primary:hover {
  color: var(--green-dark);
}

.external-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.icon-link:hover {
  color: var(--text);
  border-color: var(--border-hover);
  background: var(--surface-hover);
}

.icon-link.quick-btn {
  font-size: 12px;
  padding: 4px 6px;
}

.no-results {
  text-align: center;
  padding: 60px 20px;
}

.no-results.hidden {
  display: none;
}

.no-results p {
  font-size: 16px;
  margin-bottom: 20px;
}

/* ==========================================================================
   Architectural Overview Section
   ========================================================================== */

.arch-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.arch-card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
}

.arch-icon {
  font-size: 28px;
  margin-bottom: 16px;
}

.arch-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
}

.arch-card p {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 18px;
  flex: 1;
  color: var(--text-muted);
}

.arch-tag {
  align-self: flex-start;
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(5, 150, 105, 0.1);
  color: var(--green);
  border: 1px solid rgba(5, 150, 105, 0.25);
}

/* ==========================================================================
   Project Dedicated Page Styles
   ========================================================================== */

.project-page {
  background: var(--bg);
}

.project-hero {
  padding-block: 50px 40px;
  background: radial-gradient(circle at 80% 20%, var(--project-glow, rgba(5, 150, 105, 0.15)), transparent 50%), var(--bg);
  border-bottom: 1px solid var(--border);
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 24px;
}

.breadcrumbs a:hover {
  color: var(--green);
}

.bc-sep {
  color: var(--border-hover);
}

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

.project-hero-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 40px;
  align-items: center;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.project-title {
  font-size: clamp(34px, 4vw, 54px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin-bottom: 16px;
  color: var(--text);
}

.project-tagline {
  font-size: clamp(16px, 1.8vw, 19px);
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 28px;
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

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

.tech-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tech-pill {
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 9999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  box-shadow: var(--shadow-sm);
}

/* Hero Metrics Card */
.metrics-card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow-card);
}

.metrics-card h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 20px;
  font-weight: 700;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.metric-item {
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-hover);
  border: 1px solid var(--border);
}

.m-val {
  font-size: 20px;
  font-weight: 800;
  font-family: var(--font-heading);
  color: var(--text);
  letter-spacing: -0.02em;
}

.m-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

.metrics-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--green);
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse 2s infinite;
}

/* ==========================================================================
   Live Stage Preview Section
   ========================================================================== */

.live-stage-section {
  padding-block: 40px 60px;
  background: var(--stage-bg);
  border-bottom: 1px solid var(--border);
}

.stage-frame {
  background: var(--surface-card);
  border: 1px solid var(--stage-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card-hover);
}

.stage-toolbar {
  height: 44px;
  background: var(--stage-bar-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: 16px;
  gap: 16px;
}

.window-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.window-controls .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot.red { background: #ef4444; }
.dot.yellow { background: #f59e0b; }
.dot.green { background: #10b981; }

.stage-address {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--stage-address-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  max-width: 500px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.device-toggles {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  padding: 2px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.view-btn {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 13px;
  opacity: 0.6;
  transition: var(--transition);
}

.view-btn:hover {
  opacity: 1;
}

.view-btn.active {
  background: var(--surface-hover);
  opacity: 1;
}

.stage-viewport {
  width: 100%;
  height: 680px;
  background: #ffffff;
  margin-inline: auto;
  transition: width 0.3s ease;
  overflow: hidden;
}

[data-theme="dark"] .stage-viewport {
  background: #02060d;
}

.stage-viewport.desktop { width: 100%; }
.stage-viewport.tablet { width: 768px; }
.stage-viewport.mobile { width: 375px; }

.stage-viewport iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.stage-caption {
  padding: 12px 18px;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--stage-bar-bg);
  border-top: 1px solid var(--border);
}

.stage-caption a {
  color: var(--green);
  text-decoration: underline;
}

/* ==========================================================================
   Case Study Detailed Section
   ========================================================================== */

.case-study-section {
  padding-block: 80px;
}

.case-study-header {
  margin-bottom: 48px;
}

.case-study-header h2 {
  font-size: clamp(30px, 3.5vw, 46px);
  margin-block: 10px 14px;
  color: var(--text);
}

.lead-text {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 840px;
  line-height: 1.6;
}

.case-grid.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-bottom: 50px;
}

.case-card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow-card);
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
}

.case-card h3 {
  font-size: 20px;
  margin-bottom: 12px;
  color: var(--text);
}

.case-card p {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-muted);
}

.case-block {
  margin-bottom: 50px;
}

.case-block-head {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 28px;
}

.step-num {
  font-size: 14px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--green);
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(5, 150, 105, 0.1);
  border: 1px solid rgba(5, 150, 105, 0.25);
}

.case-block-head h3 {
  font-size: 24px;
  margin-bottom: 4px;
  color: var(--text);
}

.case-block-head p {
  font-size: 14px;
  color: var(--text-dim);
}

/* Architecture block */
.arch-content {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 28px;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow-card);
}

.arch-text p {
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 20px;
  color: var(--text-muted);
}

.arch-bullets {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bullet-item {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.55;
  padding-left: 16px;
  border-left: 2px solid var(--green);
}

.bullet-item strong {
  color: var(--text);
}

.arch-box {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
}

.arch-box-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--green);
  margin-bottom: 14px;
}

.specs-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
}

.specs-list li {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.specs-list span {
  color: var(--text-dim);
}

.specs-list strong {
  color: var(--text);
}

/* Features Detailed Grid */
.features-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.feature-detail-card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.feature-detail-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.f-num {
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--green);
}

.feature-detail-head h4 {
  font-size: 17px;
  color: var(--text);
}

.feature-detail-card p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
}

/* Design System block */
.design-system-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.ds-card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow-card);
}

.ds-card h4 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.ds-vibe-text {
  font-size: 16px;
  font-style: italic;
  color: var(--text);
  margin-bottom: 20px;
}

.ds-swatches {
  display: flex;
  gap: 12px;
}

.swatch {
  flex: 1;
  height: 70px;
  border-radius: var(--radius-sm);
  padding: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.swatch code {
  font-family: var(--font-mono);
  font-size: 10px;
}

.font-preview {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.font-item {
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.font-role {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  margin-right: 8px;
}

.font-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.font-sample {
  font-size: 16px;
  margin-top: 6px;
  color: var(--text-muted);
}

.font-sample.font-mono {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--green);
}

/* Project Tour Navigation */
.project-tour-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  margin-top: 50px;
}

.tour-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tour-item.next {
  text-align: right;
}

.tour-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.tour-link {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.tour-link:hover {
  color: var(--green);
}

/* ==========================================================================
   Final CTA Banner
   ========================================================================== */

.final-wrap {
  padding-bottom: 60px;
}

.final-cta {
  background: radial-gradient(ellipse at 95% 10%, #059669 0%, #064e3b 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  color: #ffffff;
  box-shadow: var(--shadow-card-hover);
}

.final-cta h2 {
  font-size: clamp(28px, 3.2vw, 42px);
  margin-top: 10px;
  color: #ffffff;
}

.final-cta p {
  font-size: 16px;
  max-width: 500px;
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.85);
}

.final-cta .eyebrow {
  color: #a7f3d0;
}

.cta-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.cta-button {
  background: #ffffff;
  color: #064e3b;
  font-weight: 700;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.15);
}

.cta-button:hover {
  background: #f1f5f9;
  transform: translateY(-2px);
}

/* ==========================================================================
   Footer & Sitemap
   ========================================================================== */

.footer {
  background: var(--footer-bg);
  border-top: 1px solid var(--footer-border);
  padding-block: 60px 30px;
  transition: background-color 0.25s ease;
}

.footer-top {
  display: grid;
  grid-template-columns: 1fr 2.5fr;
  gap: 50px;
  margin-bottom: 40px;
}

.footer-about .brand img {
  height: 38px;
  width: auto;
  margin-bottom: 16px;
}

.footer-desc {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 320px;
  margin-bottom: 18px;
}

.footer-socials {
  display: flex;
  gap: 12px;
}

.social-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
}

.social-link:hover {
  color: var(--green);
}

.footer-sitemap {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 20px;
}

.sitemap-col h4 {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text);
  margin-bottom: 14px;
}

.sitemap-col a {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sitemap-col a:hover {
  color: var(--green);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 30px;
}

.footer-brand {
  max-width: 380px;
}

.footer-brand p {
  font-size: 13px;
  line-height: 1.6;
  margin-top: 12px;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 40px;
}

.footer-col h4 {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text);
  margin-bottom: 12px;
}

.footer-col a {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.footer-col a:hover {
  color: var(--green);
}

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

.text-link {
  color: var(--green);
  font-weight: 600;
}

.text-link:hover {
  color: var(--green-dark);
}

/* ==========================================================================
   Quick View Modal (Dialog)
   ========================================================================== */

dialog.quick-modal {
  width: min(720px, calc(100% - 32px));
  max-height: 85vh;
  background: var(--surface);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  padding: 0;
  color: var(--text);
  box-shadow: var(--shadow-modal);
  margin: auto;
}

dialog.quick-modal::backdrop {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
}

.modal-dialog-inner {
  display: flex;
  flex-direction: column;
}

.modal-head {
  padding: 24px 28px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.modal-head h2 {
  font-size: 22px;
  margin-top: 6px;
  color: var(--text);
}

.close-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  font-size: 14px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
}

.close-btn:hover {
  background: var(--border);
  color: var(--text);
}

.modal-body {
  padding: 24px 28px;
  overflow-y: auto;
  max-height: calc(85vh - 160px);
}

.modal-tagline {
  font-size: 16px;
  color: var(--text);
  margin-bottom: 20px;
  line-height: 1.5;
}

.modal-meta {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
  padding: 16px;
  background: var(--surface-hover);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.modal-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.modal-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
}

.modal-foot {
  padding: 18px 28px;
  border-top: 1px solid var(--border);
  background: var(--surface-hover);
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (max-width: 1100px) {
  .featured-grid,
  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  
  .arch-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .footer-sitemap {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .shell {
    width: calc(100% - 32px);
  }

  .nav-wrap {
    height: 66px;
  }

  .menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 9px;
  }

  .menu-toggle span {
    height: 2px;
    width: 100%;
    background: var(--text);
    border-radius: 2px;
  }

  nav {
    display: none;
    position: absolute;
    top: 66px;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 20px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  }

  nav.open {
    display: flex;
  }

  .hub-hero {
    padding-block: 50px 40px;
  }

  .ecosystem-stats-strip {
    flex-wrap: wrap;
    gap: 16px;
  }

  .stat-sep {
    display: none;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .directory-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .directory-filter-bar {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .search-wrap input {
    width: 100%;
  }

  .project-hero-grid,
  .case-grid.two-col,
  .arch-content,
  .features-detail-grid,
  .design-system-grid {
    grid-template-columns: 1fr;
  }

  .stage-viewport {
    height: 480px;
  }

  .final-cta {
    flex-direction: column;
    align-items: flex-start;
    padding: 32px 24px;
  }

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

@media (max-width: 580px) {
  .featured-grid,
  .projects-grid,
  .arch-cards-grid {
    grid-template-columns: 1fr;
  }

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

  .project-tour-nav {
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
  }

  .tour-item.next {
    text-align: left;
  }

  .modal-metrics {
    grid-template-columns: repeat(2, 1fr);
  }
}

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