/* ==========================================================================
   Shiftify Design System V2 — Style Sheet
   ========================================================================== */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  height: 100vh;
}

/* --- Design Tokens --- */
:root {
  /* Core palette */
  --black: #000000;
  --white: #FFFFFF;

  /* Six pillars */
  --detect: #00D9FF;
  --prevent: #FF0040;
  --forecast: #FFD700;
  --stabilize: #00FF41;
  --verify: #FF00FF;
  --monitor: #0080FF;

  /* Neutral scale */
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;
  --gray-950: #030712;

  /* Organization theme (white bg) */
  --bg: #FFFFFF;
  --bg-surface: var(--gray-50);
  --bg-surface-2: var(--gray-100);
  --bg-surface-3: var(--gray-200);
  --text-primary: var(--gray-900);
  --text-secondary: var(--gray-600);
  --text-tertiary: var(--gray-400);
  --border-color: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.15);
  --accent: var(--black);
  --accent-text: var(--white);

  /* Spacing (4px base) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;
  --sp-20: 80px;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* Typography scale */
  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 0.875rem;
  --text-md: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;

  /* Layout */
  --header-h: 56px;
  --sidebar-w: 272px;
}

/* --- Skip Link --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--sp-4);
  background: var(--accent);
  color: var(--accent-text);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  z-index: 10000;
  text-decoration: none;
}
.skip-link:focus {
  top: var(--sp-2);
}

/* --- Header --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 var(--sp-6);
  z-index: 100;
  gap: var(--sp-4);
}
.header-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  text-decoration: none;
  color: var(--text-primary);
  flex-shrink: 0;
}
.header-logo svg {
  height: 24px;
  width: auto;
}
.header-tag {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-surface);
  padding: 2px var(--sp-2);
  border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid var(--border-color);
}
.header-spacer { flex: 1; }
.header-search {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  cursor: pointer;
  transition: border-color var(--duration-fast) var(--ease-out);
  min-width: 200px;
}
.header-search:hover { border-color: var(--border-strong); }
.header-search kbd {
  font-family: 'Inter', sans-serif;
  font-size: var(--text-xs);
  background: var(--bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1px 5px;
  margin-left: auto;
}

/* Hamburger */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--sp-2);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  transition: background var(--duration-fast) var(--ease-out);
}
.hamburger-btn:hover { background: var(--bg-surface); }
.hamburger-btn svg { display: block; }

/* --- Layout --- */
.site-layout {
  display: flex;
  margin-top: var(--header-h);
  height: calc(100vh - var(--header-h));
}

/* --- Sidebar --- */
.site-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: var(--sp-4) 0;
  background: var(--bg);
  transition: transform var(--duration-normal) var(--ease-out);
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 49;
}

/* Sidebar navigation */
.sidebar-section {
  margin-bottom: var(--sp-1);
}
.sidebar-section-header {
  display: flex;
  align-items: center;
  width: 100%;
  padding: var(--sp-2) var(--sp-6);
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-primary);
  text-align: left;
  transition: background var(--duration-fast) var(--ease-out);
  gap: var(--sp-2);
  letter-spacing: -0.01em;
}
.sidebar-section-header:hover {
  background: var(--bg-surface);
}
.sidebar-section-header .chevron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transition: transform var(--duration-fast) var(--ease-out);
  color: var(--text-tertiary);
}
.sidebar-section.open > .sidebar-section-header .chevron {
  transform: rotate(90deg);
}
.sidebar-children {
  display: none;
  padding: 0 0 var(--sp-2) 0;
}
.sidebar-section.open > .sidebar-children {
  display: block;
}
.sidebar-link {
  display: block;
  padding: 6px var(--sp-6) 6px 44px;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-out);
  border-right: 2px solid transparent;
  line-height: 1.4;
}
.sidebar-link:hover {
  color: var(--text-primary);
  background: var(--bg-surface);
}
.sidebar-link.active {
  color: var(--text-primary);
  font-weight: 500;
  background: var(--bg-surface);
  border-right-color: var(--black);
}

/* Sidebar sub-groups */
.sidebar-subgroup-label {
  display: block;
  padding: var(--sp-3) var(--sp-6) var(--sp-1) 44px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Overview link (no children) */
.sidebar-overview {
  display: block;
  padding: var(--sp-2) var(--sp-6);
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-primary);
  text-decoration: none;
  transition: background var(--duration-fast) var(--ease-out);
  letter-spacing: -0.01em;
  border-right: 2px solid transparent;
}
.sidebar-overview:hover {
  background: var(--bg-surface);
}
.sidebar-overview.active {
  background: var(--bg-surface);
  border-right-color: var(--black);
}

/* --- Content Area --- */
.site-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: var(--sp-8) var(--sp-10);
  max-width: 100%;
}
.content-inner {
  max-width: 960px;
  margin: 0 auto;
}

/* --- Page Header --- */
.page-header {
  margin-bottom: var(--sp-8);
  padding-bottom: var(--sp-6);
  border-bottom: 1px solid var(--border-color);
}
.page-header h1 {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: var(--text-3xl);
  color: var(--text-primary);
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin-bottom: var(--sp-2);
}
.page-header p {
  font-family: 'Poppins', sans-serif;
  font-weight: 400;
  font-size: var(--text-md);
  color: var(--text-secondary);
  max-width: 65ch;
  line-height: 1.6;
}

/* --- Sub-Tabs --- */
.sub-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: var(--sp-8);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.sub-tab {
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--duration-fast) var(--ease-out);
}
.sub-tab:hover {
  color: var(--text-primary);
}
.sub-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--black);
}
.sub-tab-content {
  display: none;
  animation: fadeIn var(--duration-normal) var(--ease-out);
}
.sub-tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* --- Section styles --- */
.doc-section {
  margin-bottom: var(--sp-10);
}
.doc-section h2 {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: var(--text-xl);
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-4);
}
.doc-section h3 {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: var(--text-lg);
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin-bottom: var(--sp-3);
  margin-top: var(--sp-6);
}
.doc-section h4 {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--text-primary);
  margin-bottom: var(--sp-2);
  margin-top: var(--sp-5);
}
.doc-section p {
  font-family: 'Poppins', sans-serif;
  font-weight: 400;
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: var(--sp-4);
  max-width: 70ch;
}
.doc-section ul, .doc-section ol {
  font-family: 'Poppins', sans-serif;
  font-weight: 400;
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: var(--sp-4);
  padding-left: var(--sp-6);
  max-width: 70ch;
}
.doc-section li {
  margin-bottom: var(--sp-1);
}
.doc-section li strong {
  color: var(--text-primary);
}

/* --- Color Swatches --- */
.swatch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
}
.swatch {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-color);
}
.swatch-color {
  height: 72px;
  position: relative;
}
.swatch-info {
  padding: var(--sp-3);
  background: var(--bg);
}
.swatch-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.swatch-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

/* Large pillar swatches */
.pillar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}
.pillar-swatch {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-color);
}
.pillar-color {
  height: 100px;
  display: flex;
  align-items: flex-end;
  padding: var(--sp-3);
}
.pillar-color span {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,0.25);
  color: white;
}
.pillar-info {
  padding: var(--sp-4);
}
.pillar-name {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--text-primary);
  margin-bottom: var(--sp-1);
}
.pillar-desc {
  font-family: 'Poppins', sans-serif;
  font-weight: 400;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.5;
}

/* --- Code Blocks --- */
.code-block {
  position: relative;
  margin-bottom: var(--sp-6);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-color);
}
.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-2) var(--sp-4);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  font-weight: 500;
}
.copy-btn {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-1) var(--sp-2);
  background: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--text-xs);
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  transition: all var(--duration-fast) var(--ease-out);
}
.copy-btn:hover {
  background: var(--bg-surface-2);
  color: var(--text-primary);
}
.copy-btn.copied {
  color: var(--stabilize);
  border-color: var(--stabilize);
}
.code-content {
  padding: var(--sp-4);
  background: var(--gray-950);
  overflow-x: auto;
}
.code-content pre {
  margin: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-sm);
  line-height: 1.6;
  color: #e5e7eb;
  white-space: pre;
  tab-size: 2;
}
.code-content .tag { color: #FF7B72; }
.code-content .attr { color: #79C0FF; }
.code-content .str { color: #A5D6FF; }
.code-content .comment { color: #6B7280; }
.code-content .keyword { color: #FF7B72; }
.code-content .prop { color: #D2A8FF; }
.code-content .val { color: #79C0FF; }

/* Inline code */
code:not(pre code) {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em;
  background: var(--bg-surface-2);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}

/* --- Component Preview --- */
.component-preview {
  padding: var(--sp-8);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: var(--sp-6);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  align-items: center;
  justify-content: center;
}
.component-preview.dark-bg {
  background: var(--gray-900);
}
.component-preview.align-start {
  justify-content: flex-start;
  align-items: flex-start;
}
.component-preview.column {
  flex-direction: column;
  align-items: stretch;
}
.component-preview.full-width {
  display: block;
}

/* --- Live component styles --- */
/* Buttons */
.sf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: var(--text-sm);
  padding: 8px var(--sp-5);
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}
.sf-btn-primary {
  background: var(--black);
  color: var(--white);
  border: 2px solid var(--black);
}
.sf-btn-primary:hover { background: var(--gray-800); border-color: var(--gray-800); }
.sf-btn-primary:active { background: var(--gray-700); transform: scale(0.98); }
.sf-btn-primary:disabled { background: var(--gray-300); border-color: var(--gray-300); cursor: not-allowed; }
.sf-btn-primary:focus-visible { border-color: var(--white); outline: none; }

.sf-btn-secondary {
  background: var(--white);
  color: var(--black);
  border: 2px solid var(--gray-300);
}
.sf-btn-secondary:hover { background: var(--gray-50); border-color: var(--gray-500); }
.sf-btn-secondary:active, .sf-btn-secondary.active { background: var(--gray-100); border-color: var(--black); transform: scale(0.98); }
.sf-btn-secondary:focus-visible { border-color: var(--black); outline: none; }

.sf-btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border: 2px solid transparent;
}
.sf-btn-ghost:hover { background: var(--bg-surface); border-color: var(--border-color); }
.sf-btn-ghost:focus-visible { border-color: var(--black); outline: none; }

.sf-btn-destructive {
  background: var(--prevent);
  color: var(--white);
  border: 2px solid var(--prevent);
}
.sf-btn-destructive:hover { background: #e00038; border-color: #e00038; }
.sf-btn-destructive:focus-visible { border-color: var(--white); outline: none; }

.sf-btn-sm { padding: 4px var(--sp-3); font-size: var(--text-xs); }
.sf-btn-lg { padding: 12px var(--sp-6); font-size: var(--text-md); }

/* Global button focus override — remove double outline */
.sf-btn:focus-visible {
  outline: none;
}

/* Inputs */
.sf-input {
  font-family: 'Inter', sans-serif;
  font-size: var(--text-base);
  padding: 10px var(--sp-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text-primary);
  width: 100%;
  max-width: 320px;
  transition: all var(--duration-fast) var(--ease-out);
  outline: none;
}
.sf-input:focus {
  border-color: var(--black);
  box-shadow: none;
}
.sf-input::placeholder { color: var(--text-tertiary); }
.sf-input:disabled { background: var(--bg-surface); color: var(--text-tertiary); cursor: not-allowed; }
.sf-input.error { border-color: var(--prevent); }
.sf-input.error:focus { box-shadow: none; }

.sf-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: var(--sp-1);
}
.sf-hint {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-top: var(--sp-1);
}
.sf-error-text {
  font-size: var(--text-xs);
  color: var(--prevent);
  margin-top: var(--sp-1);
}

/* Checkbox */
.sf-checkbox-wrap {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  cursor: pointer;
}
.sf-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--black);
  cursor: pointer;
}
.sf-checkbox-label {
  font-size: var(--text-sm);
  color: var(--text-primary);
  user-select: none;
}

/* Switch / Toggle */
.sf-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--gray-300);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out);
  border: none;
  padding: 0;
}
.sf-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: var(--white);
  border-radius: 50%;
  transition: transform var(--duration-fast) var(--ease-out);
  box-shadow: var(--shadow-sm);
}
.sf-switch.on {
  background: var(--black);
}
.sf-switch.on::after {
  transform: translateX(20px);
}

/* Chip */
.sf-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 4px var(--sp-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  border: 1px solid var(--border-color);
  background: var(--bg);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}
.sf-chip:hover { background: var(--bg-surface); }
.sf-chip.selected {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

/* Avatar */
.sf-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-surface-2);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: var(--text-sm);
  overflow: hidden;
  flex-shrink: 0;
}
.sf-avatar-sm { width: 32px; height: 32px; font-size: var(--text-xs); }
.sf-avatar-md { width: 40px; height: 40px; }
.sf-avatar-lg { width: 48px; height: 48px; font-size: var(--text-md); }
.sf-avatar-xl { width: 64px; height: 64px; font-size: var(--text-lg); }

/* Card */
.sf-card {
  background: var(--bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  transition: box-shadow var(--duration-fast) var(--ease-out);
}
.sf-card.hoverable:hover {
  box-shadow: var(--shadow-md);
}
.sf-card-title {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--text-primary);
  margin-bottom: var(--sp-2);
}
.sf-card-text {
  font-family: 'Poppins', sans-serif;
  font-weight: 400;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Badge / Status */
.sf-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--sp-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 600;
}
.sf-badge-neutral { background: var(--bg-surface-2); color: var(--text-secondary); }
.sf-badge-success { background: #dcfce7; color: #166534; }
.sf-badge-warning { background: #fef9c3; color: #854d0e; }
.sf-badge-error { background: #fee2e2; color: #991b1b; }

/* Divider */
.sf-divider {
  height: 1px;
  background: var(--border-color);
  margin: var(--sp-6) 0;
  border: none;
}

/* Snackbar */
.sf-snackbar {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--gray-900);
  color: var(--white);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  box-shadow: var(--shadow-lg);
}
.sf-snackbar-action {
  font-weight: 600;
  color: var(--detect);
  background: none;
  border: none;
  cursor: pointer;
  font-size: var(--text-sm);
  font-family: 'Inter', sans-serif;
}

/* Modal (for preview) */
.sf-modal-preview {
  background: var(--bg);
  border-radius: var(--radius-xl);
  padding: var(--sp-6);
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
}
.sf-modal-title {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: var(--text-lg);
  margin-bottom: var(--sp-2);
}
.sf-modal-body {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--sp-6);
  line-height: 1.6;
}
.sf-modal-actions {
  display: flex;
  gap: var(--sp-3);
  justify-content: flex-end;
}

/* Progress Spinner */
.sf-spinner {
  width: 24px;
  height: 24px;
  border: 2.5px solid var(--border-color);
  border-top-color: var(--black);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.sf-spinner-lg { width: 40px; height: 40px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Table */
.sf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.sf-table th {
  text-align: left;
  padding: var(--sp-3) var(--sp-4);
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 2px solid var(--border-strong);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.sf-table td {
  padding: var(--sp-3) var(--sp-4);
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
}
.sf-table tr:hover td {
  background: var(--bg-surface);
}
.sf-table .mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
}

/* Segmented control */
.sf-segmented {
  display: inline-flex;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 2px;
  gap: 2px;
}
.sf-segmented-item {
  padding: 6px var(--sp-4);
  font-size: var(--text-sm);
  font-weight: 500;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 6px;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  transition: all var(--duration-fast) var(--ease-out);
}
.sf-segmented-item.active {
  background: var(--bg);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* Select */
.sf-select {
  font-family: 'Inter', sans-serif;
  font-size: var(--text-base);
  padding: 10px var(--sp-8) 10px var(--sp-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg) url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236B7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 12px center no-repeat;
  color: var(--text-primary);
  appearance: none;
  min-width: 180px;
  outline: none;
  cursor: pointer;
}
.sf-select:focus { border-color: var(--black); box-shadow: none; }

/* Textarea */
.sf-textarea {
  font-family: 'Inter', sans-serif;
  font-size: var(--text-base);
  padding: var(--sp-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text-primary);
  width: 100%;
  max-width: 480px;
  min-height: 100px;
  resize: vertical;
  outline: none;
  line-height: 1.6;
}
.sf-textarea:focus { border-color: var(--black); box-shadow: none; }

/* List item */
.sf-list-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border-color);
  font-size: var(--text-sm);
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out);
}
.sf-list-item:hover { background: var(--bg-surface); }
.sf-list-item-text { flex: 1; }
.sf-list-item-secondary { font-size: var(--text-xs); color: var(--text-tertiary); }
.sf-list-item-icon {
  color: var(--text-tertiary);
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Dropdown */
.sf-dropdown {
  background: var(--bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-1) 0;
  min-width: 200px;
}
.sf-dropdown-item {
  display: block;
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--text-sm);
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: 'Inter', sans-serif;
}
.sf-dropdown-item:hover { background: var(--bg-surface); }

/* Critical Banner */
.sf-banner-critical {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: #991b1b;
}
.sf-banner-info {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: #1e40af;
}

/* Popover */
.sf-popover {
  background: var(--bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-4);
  max-width: 280px;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.5;
}
.sf-popover-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--sp-1);
}

/* Promo Card */
.sf-promo-card {
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: linear-gradient(135deg, var(--gray-50), var(--gray-100));
}
.sf-promo-card-body {
  padding: var(--sp-6);
}
.sf-promo-card-title {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: var(--text-lg);
  margin-bottom: var(--sp-2);
}
.sf-promo-card-text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--sp-4);
}

/* Section Header */
.sf-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: var(--sp-4);
}
.sf-section-header-title {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--text-primary);
}
.sf-section-header-action {
  font-size: var(--text-sm);
  color: var(--monitor);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}

/* Summary */
.sf-summary {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.sf-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-sm);
}
.sf-summary-label { color: var(--text-secondary); }
.sf-summary-value { font-weight: 600; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.sf-summary-total {
  border-top: 1px solid var(--border-color);
  padding-top: var(--sp-3);
  font-weight: 600;
}

/* Nudge */
.sf-nudge {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-4);
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  color: #92400E;
}
.sf-nudge-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

/* Screen loader */
.sf-screen-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  padding: var(--sp-16) 0;
}
.sf-screen-loader-text {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

/* Search input */
.sf-search-input-wrap {
  position: relative;
  max-width: 320px;
}
.sf-search-input {
  font-family: 'Inter', sans-serif;
  font-size: var(--text-base);
  padding: 10px var(--sp-3) 10px 36px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text-primary);
  width: 100%;
  outline: none;
}
.sf-search-input:focus { border-color: var(--black); box-shadow: none; }
.sf-search-icon {
  position: absolute;
  left: var(--sp-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  width: 16px;
  height: 16px;
}

/* Upload */
.sf-upload-zone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: var(--sp-8);
  text-align: center;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}
.sf-upload-zone:hover {
  border-color: var(--black);
  background: var(--bg-surface);
}
.sf-upload-zone-text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
.sf-upload-zone-text strong {
  color: var(--monitor);
  font-weight: 600;
}

/* Navigation Option */
.sf-nav-option {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}
.sf-nav-option:hover { background: var(--bg-surface); color: var(--text-primary); }
.sf-nav-option.active { background: var(--bg-surface-2); color: var(--text-primary); font-weight: 500; }

/* Date picker (simplified) */
.sf-date-picker {
  background: var(--bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-4);
  width: 280px;
}
.sf-date-picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-3);
  font-weight: 600;
  font-size: var(--text-sm);
}
.sf-date-picker-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
  font-size: var(--text-xs);
}
.sf-date-picker-day {
  padding: 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out);
}
.sf-date-picker-day:hover { background: var(--bg-surface); }
.sf-date-picker-day.selected { background: var(--black); color: var(--white); }
.sf-date-picker-day.today { font-weight: 700; }
.sf-date-picker-day.muted { color: var(--text-tertiary); }
.sf-date-picker-dow {
  font-weight: 600;
  color: var(--text-tertiary);
  padding: 6px;
  font-size: 11px;
}

/* --- Theme Previews --- */
.theme-preview {
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  border: 1px solid var(--border-color);
  margin-bottom: var(--sp-4);
}
.theme-preview.org {
  background: #FFFFFF;
  color: #111827;
}
.theme-preview.pro {
  background: #000000;
  color: #FFFFFF;
}
.theme-preview.platform {
  background: #FDFAF5;
  color: #4D3C17;
}
.theme-preview h4 {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  margin-bottom: var(--sp-2);
  color: inherit;
}
.theme-preview p {
  font-size: var(--text-sm);
  opacity: 0.8;
  color: inherit;
}

/* --- Typography Specimen --- */
.type-specimen {
  margin-bottom: var(--sp-6);
}
.type-specimen-row {
  display: flex;
  align-items: baseline;
  gap: var(--sp-6);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--border-color);
}
.type-specimen-label {
  flex-shrink: 0;
  width: 120px;
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}
.type-specimen-example {
  flex: 1;
}

/* --- Token Table --- */
.token-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--sp-6);
}
.token-table th {
  text-align: left;
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--border-strong);
}
.token-table td {
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}
.token-table .token-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  color: var(--text-primary);
  font-weight: 500;
}
.token-visual {
  display: inline-block;
  background: var(--black);
  border-radius: 2px;
}

/* --- Spacing Visual --- */
.spacing-visual {
  display: flex;
  align-items: flex-end;
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
}
.spacing-bar {
  background: var(--detect);
  opacity: 0.3;
  border-radius: 2px;
}

/* --- Overview Quick Links --- */
.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-8);
}
.quick-link-card {
  display: flex;
  flex-direction: column;
  padding: var(--sp-5);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text-primary);
  transition: all var(--duration-fast) var(--ease-out);
  cursor: pointer;
}
.quick-link-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}
.quick-link-card-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  margin-bottom: var(--sp-3);
  font-size: 18px;
}
.quick-link-card-title {
  font-weight: 600;
  font-size: var(--text-sm);
  margin-bottom: var(--sp-1);
}
.quick-link-card-desc {
  font-family: 'Poppins', sans-serif;
  font-weight: 400;
  font-size: var(--text-xs);
  color: var(--text-secondary);
  line-height: 1.4;
}

/* --- Do/Don't blocks --- */
.do-dont {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}
.do-block, .dont-block {
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  border: 1px solid var(--border-color);
}
.do-block { border-top: 3px solid var(--stabilize); }
.dont-block { border-top: 3px solid var(--prevent); }
.do-block h4, .dont-block h4 {
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--sp-2);
  margin-top: 0;
}
.do-block h4 { color: #166534; }
.dont-block h4 { color: #991b1b; }
.do-block p, .dont-block p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.5;
}

/* --- Icon grid --- */
.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
}
.icon-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3);
  border-radius: var(--radius-md);
  transition: background var(--duration-fast) var(--ease-out);
  cursor: pointer;
}
.icon-item:hover { background: var(--bg-surface); }
.icon-item svg { width: 24px; height: 24px; color: var(--text-primary); }
.icon-item span { font-size: 10px; color: var(--text-tertiary); text-align: center; }

/* --- Radius visual --- */
.radius-grid {
  display: flex;
  gap: var(--sp-4);
  flex-wrap: wrap;
  margin-bottom: var(--sp-6);
}
.radius-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
}
.radius-box {
  width: 72px;
  height: 72px;
  border: 2px solid var(--text-primary);
  background: var(--bg-surface);
}
.radius-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

/* --- Focus ring demo --- */
.focus-demo-btn {
  padding: 10px var(--sp-5);
  background: var(--black);
  color: var(--white);
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  outline: none;
}
.focus-demo-btn:focus-visible {
  outline: none;
  border-color: var(--black);
}

/* --- Transition demo --- */
.transition-demo {
  display: flex;
  gap: var(--sp-4);
  align-items: center;
  margin-bottom: var(--sp-6);
}
.transition-box {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  background: var(--detect);
  transition: transform 0.4s var(--ease-out);
}
.transition-box:hover { transform: scale(1.1); }
.transition-box.slide:hover { transform: translateX(16px); }
.transition-box.up:hover { transform: translateY(-16px); }

/* --- Pattern preview containers --- */
.pattern-preview {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  margin-bottom: var(--sp-6);
  overflow: hidden;
}
.pattern-preview.dark {
  background: var(--gray-900);
  color: var(--white);
}

/* --- Accessibility info box --- */
.a11y-box {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  margin-bottom: var(--sp-6);
}
.a11y-box h4 {
  font-size: var(--text-sm);
  font-weight: 600;
  color: #0c4a6e;
  margin-bottom: var(--sp-2);
  margin-top: 0;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.a11y-box ul {
  font-size: var(--text-sm);
  color: #0c4a6e;
  padding-left: var(--sp-5);
  margin: 0;
}
.a11y-box li { margin-bottom: var(--sp-1); }

/* --- Usage guidelines --- */
.usage-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}
.usage-item {
  padding: var(--sp-4);
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
}
.usage-item h4 {
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--sp-2);
  margin-top: 0;
  color: var(--text-primary);
}
.usage-item p, .usage-item ul {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}
.usage-item ul { padding-left: var(--sp-5); }

/* --- Footer --- */
.site-footer {
  padding: var(--sp-8) var(--sp-6);
  border-top: 1px solid var(--border-color);
  text-align: center;
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-top: var(--sp-16);
}
.site-footer a {
  color: var(--text-tertiary);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.site-footer a:hover { color: var(--text-secondary); }

/* --- Responsive --- */
@media (max-width: 1024px) {
  .site-content {
    padding: var(--sp-6);
  }
  .header-search { display: none; }
}

@media (max-width: 768px) {
  .hamburger-btn { display: flex; }
  .site-sidebar {
    position: fixed;
    top: var(--header-h);
    left: 0;
    bottom: 0;
    z-index: 50;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  .site-sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.visible {
    display: block;
  }
  .site-content {
    padding: var(--sp-4);
  }
  .page-header h1 {
    font-size: var(--text-2xl);
  }
  .do-dont, .usage-grid {
    grid-template-columns: 1fr;
  }
  .pillar-grid {
    grid-template-columns: 1fr;
  }
  .quick-links {
    grid-template-columns: 1fr;
  }
  .sub-tabs {
    gap: 0;
  }
  .sub-tab {
    padding: var(--sp-2) var(--sp-3);
    font-size: var(--text-xs);
  }
  .component-preview {
    padding: var(--sp-4);
  }
  .type-specimen-row {
    flex-direction: column;
    gap: var(--sp-2);
  }
  .type-specimen-label { width: auto; }
}

/* Focus visible — links and non-button elements only */
a:focus-visible {
  outline: 2px solid var(--black);
  outline-offset: 2px;
}
/* Remove outlines from all button-like elements */
button:focus-visible,
.sf-btn:focus-visible,
.sf-circular-btn:focus-visible,
.sf-icon-btn:focus-visible,
.sf-segmented-item:focus-visible,
.sf-switch:focus-visible,
.sub-tab:focus-visible,
.sf-snackbar-action:focus-visible,
.sf-dropdown-item:focus-visible,
.home-nav-search:focus-visible,
.home-btn:focus-visible {
  outline: none;
}

/* Scrollbar styling */
.site-sidebar::-webkit-scrollbar,
.site-content::-webkit-scrollbar {
  width: 6px;
}
.site-sidebar::-webkit-scrollbar-track,
.site-content::-webkit-scrollbar-track {
  background: transparent;
}
.site-sidebar::-webkit-scrollbar-thumb,
.site-content::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 3px;
}
.site-sidebar::-webkit-scrollbar-thumb:hover,
.site-content::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Bottom sheet preview */
.sf-bottom-sheet {
  background: var(--bg);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: var(--sp-4) var(--sp-6) var(--sp-6);
  box-shadow: var(--shadow-lg);
  max-width: 400px;
  width: 100%;
}
.sf-bottom-sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--gray-300);
  border-radius: 2px;
  margin: 0 auto var(--sp-4);
}
.sf-bottom-sheet-title {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: var(--text-lg);
  margin-bottom: var(--sp-3);
}

/* Circular button */
.sf-circular-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}
.sf-circular-btn:focus-visible { outline: none; border-color: var(--black); }
.sf-circular-btn-primary {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}
.sf-circular-btn-primary:hover { background: var(--gray-800); border-color: var(--gray-800); }
.sf-circular-btn-primary:focus-visible { border-color: var(--white); outline: none; }
.sf-circular-btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 2px solid var(--border-color);
}
.sf-circular-btn-secondary:hover { background: var(--bg-surface-2); }

/* Icon button */
.sf-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid transparent;
  background: transparent;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--duration-fast) var(--ease-out);
}
.sf-icon-btn:hover { background: var(--bg-surface); color: var(--text-primary); }
.sf-icon-btn:focus-visible { outline: none; border-color: var(--black); }

/* Action Prompt / Info Prompt */
.sf-prompt {
  display: flex;
  gap: var(--sp-4);
  padding: var(--sp-5);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  align-items: flex-start;
}
.sf-prompt-action { background: var(--bg-surface); }
.sf-prompt-info { background: #f0f9ff; border-color: #bae6fd; }
.sf-prompt-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
}
.sf-prompt-content { flex: 1; }
.sf-prompt-title {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: var(--text-sm);
  margin-bottom: var(--sp-1);
}
.sf-prompt-text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--sp-3);
}

/* Instruction */
.sf-instruction {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  padding: var(--sp-4);
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
}
.sf-instruction-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--black);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 700;
  flex-shrink: 0;
}
.sf-instruction-text {
  font-size: var(--text-sm);
  color: var(--text-primary);
  line-height: 1.6;
  padding-top: 3px;
}

/* Password input */
.sf-password-wrap {
  position: relative;
  max-width: 320px;
}
.sf-password-toggle {
  position: absolute;
  right: var(--sp-3);
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-tertiary);
  padding: var(--sp-1);
}

/* Upload input */
.sf-upload-input {
  display: flex;
  gap: var(--sp-3);
  align-items: center;
}

/* Expressive input */
.sf-expressive-input {
  font-family: 'Poppins', sans-serif;
  font-size: var(--text-2xl);
  font-weight: 600;
  border: none;
  border-bottom: 2px solid var(--border-strong);
  background: transparent;
  color: var(--text-primary);
  padding: var(--sp-2) 0;
  width: 100%;
  max-width: 480px;
  outline: none;
}
.sf-expressive-input:focus {
  border-bottom-color: var(--black);
}
.sf-expressive-input::placeholder {
  color: var(--text-tertiary);
}

/* ==========================================================================
   HOME PAGE
   ========================================================================== */

/* When home is active, hide sidebar + header, show full-bleed */
body.home-active {
  background: #FFFFFF;
  transition: background-color 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: auto;
}
body.home-active.home-dark {
  background: #000000;
}
body.home-active .site-header {
  display: none;
}
body.home-active .site-sidebar {
  display: none;
}
body.home-active .sidebar-overlay {
  display: none;
}
body.home-active .site-layout {
  grid-template-columns: 1fr;
  margin-top: 0;
  height: 100vh;
}
body.home-active .site-content {
  margin-left: 0;
  padding: 0;
}
body.home-active .content-inner {
  max-width: 100%;
  padding: 0;
}

/* Home page container */
.home-page {
  height: 100vh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: visible;
  background: #000000;
  transition: background-color 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light phase (white bg, dark text) */
.home-page.light-phase {
  background: #FFFFFF;
}
.home-page.light-phase .home-nav-link {
  color: rgba(0, 0, 0, 0.5);
}
.home-page.light-phase .home-nav-link:hover {
  color: #000000;
}
.home-page.light-phase .home-nav-search {
  color: rgba(0, 0, 0, 0.4);
}
.home-page.light-phase .home-nav-search:hover {
  color: #000000;
}
.home-page.light-phase .home-brandmark-card {
  background: var(--black);
}
.home-page.light-phase .home-footer p {
  color: rgba(0, 0, 0, 0.25);
}
.home-page.light-phase .home-footer a {
  color: rgba(0, 0, 0, 0.35);
}
.home-page.light-phase .home-footer a:hover {
  color: rgba(0, 0, 0, 0.6);
}

/* Dark phase (black bg, white text) */
.home-page.dark-phase {
  background: #000000;
}
.home-page.dark-phase .home-nav-link {
  color: rgba(255, 255, 255, 0.6);
}
.home-page.dark-phase .home-nav-link:hover {
  color: #FFFFFF;
}
.home-page.dark-phase .home-nav-search {
  color: rgba(255, 255, 255, 0.5);
}
.home-page.dark-phase .home-nav-search:hover {
  color: #FFFFFF;
}

/* Home top bar with lockup + nav */
.home-topbar {
  display: flex;
  align-items: center;
  padding: 32px 40px;
  position: relative;
  z-index: 10;
  min-height: 72px;
}

/* Horizontal lockup top-left */
.home-lockup {
  position: absolute;
  left: 40px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.home-lockup svg {
  height: 24px;
  width: auto;
  transition: fill 0.6s ease;
}
.home-lockup a {
  display: flex;
  align-items: center;
  text-decoration: none;
}
.home-page.light-phase .home-lockup svg {
  fill: #000000;
}
.home-page.dark-phase .home-lockup svg,
.home-lockup svg {
  fill: #FFFFFF;
}

/* Home navigation bar */
.home-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  width: 100%;
}

.home-nav-link {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  transition: color 0.6s ease;
  letter-spacing: 0.01em;
}
.home-nav-link:hover {
  color: #FFFFFF;
}

.home-nav-search {
  background: none;
  border: none;
  padding: 6px;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: color 0.6s ease;
  outline: none;
}
.home-nav-search:hover {
  color: #FFFFFF;
}

/* Home hero area */
.home-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  gap: 0;
  position: relative;
}

/* Brandmark centering wrapper — absolutely centered */
.home-brandmark-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.home-brandmark-center > * {
  pointer-events: auto;
}
.home-brandmark-center.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Hero content (wordmark + tagline + subtitle + CTA) — also centered */
.home-hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.home-hero-content.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Brandmark card */
.home-brandmark-card {
  background: var(--black);
  border: none;
  border-radius: var(--radius-lg);
  padding: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 250px;
  height: 250px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              height 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              padding 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              background-color 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.home-page.dark-phase .home-brandmark-card {
  background: var(--black);
}
.home-brandmark-card.expanded {
  width: auto;
  height: 250px;
  padding: 48px 64px;
}
.home-brandmark-card.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Stage for brandmark phases */
.home-brandmark-stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Phase overlays */
.home-phase {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}
.home-phase.active {
  opacity: 1;
  pointer-events: auto;
}

/* Brandmark SVGs */
.home-mark {
  height: 120px;
  width: auto;
}

.home-wordmark {
  height: 250px;
  width: auto;
  max-width: 90vw;
}

/* Standalone wordmark inside hero-content */
.home-wordmark-standalone {
  display: flex;
  align-items: center;
  justify-content: center;
}
.home-wordmark-standalone svg {
  height: 250px;
  width: auto;
  max-width: 90vw;
}
@media (max-width: 768px) {
  .home-wordmark-standalone svg {
    height: 180px;
  }
}

/* Tagline */
.home-tagline {
  text-align: center;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.home-hero-content.visible .home-tagline {
  opacity: 1;
  transform: translateY(0);
}
.home-tagline-text {
  font-family: 'Poppins', sans-serif;
  font-size: 32px;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -0.025em;
}

/* Subtitle */
.home-subtitle {
  text-align: center;
  max-width: 520px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease 0.3s, transform 0.5s ease 0.3s;
}
.home-hero-content.visible .home-subtitle {
  opacity: 1;
  transform: translateY(0);
}
.home-subtitle p {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.6;
  margin: 0;
}

/* CTA buttons */
.home-cta {
  display: flex;
  gap: 16px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease 0.5s, transform 0.5s ease 0.5s;
}
.home-hero-content.visible .home-cta {
  opacity: 1;
  transform: translateY(0);
}

.home-btn {
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: 8px;
}
.home-btn.sf-btn-primary {
  background: #FFFFFF;
  color: #000000;
  border: none;
}
.home-btn.sf-btn-primary:hover {
  background: rgba(255, 255, 255, 0.9);
}
.home-btn-secondary {
  background: transparent;
  color: #FFFFFF;
  border: 2px solid rgba(255, 255, 255, 0.3);
}
.home-btn-secondary:hover {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.05);
  color: #FFFFFF;
}

/* Home footer */
.home-footer {
  text-align: center;
  padding: 16px 40px;
  transition: color 0.8s ease;
}
.home-page.light-phase .home-footer {
  /* light phase footer */
}
.home-footer p {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.3);
  margin: 0 0 4px;
  transition: color 0.8s ease;
}
.home-footer a {
  color: rgba(255, 255, 255, 0.4);
  text-decoration: none;
  transition: color 0.6s ease;
}
.home-footer a:hover {
  color: rgba(255, 255, 255, 0.7);
}

/* Home hamburger button — hidden on desktop */
.home-hamburger {
  display: none;
  position: absolute;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-md);
  transition: color 0.3s ease;
  z-index: 10;
}
.home-hamburger:hover {
  color: #FFFFFF;
}
.home-page.light-phase .home-hamburger {
  color: rgba(0, 0, 0, 0.5);
}
.home-page.light-phase .home-hamburger:hover {
  color: #000000;
}

/* Home mobile overlay */
.home-mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 199;
}
.home-mobile-overlay.visible {
  display: block;
}

/* Home mobile slide-out menu */
.home-mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 280px;
  background: #FFFFFF;
  z-index: 200;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  padding: 0;
}
.home-mobile-menu.open {
  transform: translateX(0);
}
.home-mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 20px 24px;
}
.home-mobile-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--gray-400);
  border-radius: var(--radius-md);
  transition: color 0.2s ease;
}
.home-mobile-close:hover {
  color: var(--gray-900);
}
.home-mobile-nav {
  display: flex;
  flex-direction: column;
  padding: 0 24px;
  gap: 0;
}
.home-mobile-nav-link {
  font-family: 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 500;
  color: var(--gray-700);
  text-decoration: none;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
  transition: color 0.2s ease;
}
.home-mobile-nav-link:hover {
  color: var(--gray-900);
}

/* Tablet adjustments for home (≤1024px) */
@media (max-width: 1024px) {
  .home-nav {
    display: none;
  }
  .home-hamburger {
    display: flex;
  }
  .home-lockup svg {
    height: 32px;
  }
  .home-topbar {
    padding: 24px 32px;
  }
  .home-lockup {
    left: 32px;
  }
  .home-hamburger {
    right: 32px;
  }
}

/* Mobile adjustments for home */
@media (max-width: 768px) {
  .home-hero {
    padding: 24px 20px;
  }
  .home-topbar {
    padding: 24px 20px;
    min-height: 64px;
  }
  .home-lockup {
    left: 20px;
  }
  .home-lockup svg {
    height: 28px;
  }
  .home-hamburger {
    right: 20px;
  }
  .home-brandmark-card {
    width: 180px;
    height: 180px;
    padding: 24px;
  }
  .home-brandmark-card.expanded {
    height: 180px;
    padding: 24px 32px;
  }
  .home-mark {
    height: 80px;
  }
  .home-wordmark {
    height: 180px;
  }
  .home-tagline-text {
    font-size: 24px;
  }
  .home-subtitle p {
    font-size: 14px;
  }
  .home-cta {
    flex-direction: column;
    width: 100%;
    max-width: 280px;
  }
  .home-btn {
    text-align: center;
  }
}
