/* ==========================================================================
   macKali Showcase Design System
   Craft-inspired editorial elegance & responsive precision for Kali Linux GNOME
   ========================================================================== */

/* --------------------------------------------------------------------------
   Design Tokens & Craft.do Theming
   -------------------------------------------------------------------------- */
:root,
html[data-theme="light"],
[data-theme="light"] {
  /* Typography - Sofia Sans as Primary */
  --font-sans: 'Sofia Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  /* Craft Palette - Light Mode Default (Warm Editorial Paper) */
  --bg-page: #fbf9f5;
  --bg-subtle: #f4efe6;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-surface-hover: #f7f4ee;
  --bg-nav: rgba(255, 255, 255, 0.85);

  --border-light: rgba(0, 0, 0, 0.07);
  --border-medium: rgba(0, 0, 0, 0.12);
  --border-focus: #111113;

  --text-main: #111113;
  --text-muted: #5e5e66;
  --text-faint: #8a8a93;
  --text-inverse: #ffffff;

  --accent-primary: #111113;
  --accent-primary-hover: #2a2a30;
  --accent-blue: #0969da;
  --accent-blue-subtle: rgba(9, 105, 218, 0.08);

  --badge-bg: #ece7de;
  --badge-text: #2c2c34;

  --success: #1a7f37;
  --success-bg: rgba(26, 127, 55, 0.1);
  --warning: #9a6700;
  --warning-bg: rgba(154, 103, 0, 0.1);
  --info: #0969da;
  --info-bg: rgba(9, 105, 218, 0.1);

  --traffic-red: #ff5f56;
  --traffic-yellow: #ffbd2e;
  --traffic-green: #27c93f;

  /* Radii */
  --radius-pill: 9999px;
  --radius-card: 24px;
  --radius-sm: 10px;
  --radius-md: 16px;

  /* Craft Soft Shadows */
  --shadow-nav: 0 4px 20px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 8px 30px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);
  --shadow-elevated: 0 18px 48px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.03);

  /* Layout */
  --container-max: 1120px;
  --nav-max: 1140px;
}

/* Craft Palette - Dark Mode Overrides */
html[data-theme="dark"],
[data-theme="dark"] {
  --bg-page: #0d0e12;
  --bg-subtle: #14161c;
  --bg-surface: #191b22;
  --bg-surface-elevated: #20232c;
  --bg-surface-hover: #222630;
  --bg-nav: rgba(22, 24, 30, 0.85);

  --border-light: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.15);
  --border-focus: #55a5ff;

  --text-main: #f5f5f7;
  --text-muted: #9a9ba4;
  --text-faint: #6e707b;
  --text-inverse: #111113;

  --accent-primary: #ffffff;
  --accent-primary-hover: #e0e0e5;
  --accent-blue: #55a5ff;
  --accent-blue-subtle: rgba(85, 165, 255, 0.12);

  --badge-bg: #222530;
  --badge-text: #dcdde2;

  --success: #3fb950;
  --success-bg: rgba(63, 185, 80, 0.14);
  --warning: #d29922;
  --warning-bg: rgba(210, 153, 34, 0.14);
  --info: #58a6ff;
  --info-bg: rgba(88, 166, 255, 0.14);

  --shadow-nav: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-card: 0 8px 30px rgba(0, 0, 0, 0.35);
  --shadow-elevated: 0 18px 48px rgba(0, 0, 0, 0.55);
}

/* --------------------------------------------------------------------------
   Reset & Viewport Containment (Strict Anti-Break Rules)
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.55;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  background-color: var(--bg-page);
}

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

a {
  color: inherit;
  text-decoration: none;
}

code, pre {
  font-family: var(--font-mono);
}

code {
  font-family: var(--font-mono);
  font-size: 0.84em;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 1px 5px;
  color: var(--text-main);
  word-break: break-all;
  overflow-wrap: anywhere;
  display: inline;
  max-width: 100%;
}

kbd {
  font-family: var(--font-mono);
  font-size: 0.82em;
  background: var(--bg-subtle);
  border: 1px solid var(--border-medium);
  border-bottom: 2px solid var(--border-medium);
  border-radius: 6px;
  padding: 2px 6px;
  color: var(--text-main);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Keyboard accessibility */
:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 20px;
  background: var(--accent-primary);
  color: var(--text-inverse);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  z-index: 9999;
  font-weight: 600;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 16px;
}

/* Safe Fluid Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(16px, 4vw, 32px);
  padding-right: clamp(16px, 4vw, 32px);
}

/* --------------------------------------------------------------------------
   Craft-Style Floating Pill Navigation
   -------------------------------------------------------------------------- */
.nav-outer-wrap {
  position: sticky;
  top: clamp(12px, 2.5vw, 24px);
  z-index: 1000;
  width: 100%;
  padding: 0 clamp(12px, 3vw, 24px);
  pointer-events: none;
}

.site-nav-pill {
  position: relative;
  pointer-events: auto;
  max-width: var(--nav-max);
  width: 100%;
  margin: 0 auto;
  background: var(--bg-nav);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-nav);
  padding: 6px 12px 6px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: all 0.25s ease;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  flex-shrink: 0;
}

.brand-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
}

.nav-links {
  display: flex;
  align-items: center;
  list-style: none;
  gap: clamp(8px, 1.2vw, 16px);
  margin: 0;
  padding: 0;
  flex-wrap: nowrap;
}

.nav-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color 0.18s ease;
  padding: 4px 2px;
}

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

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

.btn-icon {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-icon:hover {
  color: var(--text-main);
  border-color: var(--border-medium);
  background: var(--bg-surface-hover);
}

.btn-pill-cta {
  background: var(--accent-primary);
  color: var(--text-inverse);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-pill-cta:hover {
  background: var(--accent-primary-hover);
  transform: translateY(-1px);
}

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 6px;
  line-height: 1;
}

/* --------------------------------------------------------------------------
   Hero Section (Editorial & Human)
   -------------------------------------------------------------------------- */
.hero-section {
  padding: clamp(50px, 8vw, 90px) 0 clamp(40px, 6vw, 70px);
  text-align: center;
}

.hero-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  background: var(--badge-bg);
  color: var(--badge-text);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 24px;
}

.hero-title {
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: var(--text-main);
  max-width: 880px;
  margin: 0 auto 20px;
}

.hero-subtitle {
  font-size: clamp(1.1rem, 2.2vw, 1.35rem);
  color: var(--text-muted);
  line-height: 1.5;
  font-weight: 400;
  max-width: 680px;
  margin: 0 auto clamp(28px, 4vw, 40px);
}

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

.hero-quick-command {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-pill);
  padding: 6px 8px 6px 18px;
  box-shadow: var(--shadow-card);
  max-width: 100%;
  margin: 0 auto clamp(32px, 5vw, 54px);
  gap: 12px;
}

.hero-quick-code {
  font-family: var(--font-mono);
  font-size: clamp(0.78rem, 1.3vw, 0.88rem);
  color: var(--text-main);
  overflow-x: auto;
  white-space: nowrap;
}

.btn-sm-copy {
  background: var(--bg-subtle);
  color: var(--text-main);
  border: 1px solid var(--border-light);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.btn-sm-copy:hover {
  background: var(--accent-primary);
  color: var(--text-inverse);
  border-color: var(--accent-primary);
}

.btn-sm-copy.copied {
  background: var(--success);
  color: #ffffff;
  border-color: var(--success);
}

.btn-lg-primary {
  background: var(--accent-primary);
  color: var(--text-inverse);
  font-size: 1.02rem;
  font-weight: 700;
  padding: 13px 28px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  transition: all 0.2s ease;
}

.btn-lg-primary:hover {
  background: var(--accent-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

.btn-lg-secondary {
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-medium);
  font-size: 1.02rem;
  font-weight: 700;
  padding: 13px 26px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-lg-secondary:hover {
  background: var(--bg-surface-hover);
  border-color: var(--text-main);
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   Responsive Terminal Window (Zero Fixed ASCII - Perfectly Wraps)
   -------------------------------------------------------------------------- */
.terminal-window {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-elevated);
  max-width: 860px;
  margin: 0 auto;
  overflow: hidden;
  text-align: left;
}

.terminal-topbar {
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-light);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.traffic-dots {
  display: flex;
  gap: 8px;
  align-items: center;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.dot-red { background: var(--traffic-red); }
.dot-yellow { background: var(--traffic-yellow); }
.dot-green { background: var(--traffic-green); }

.terminal-title {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-faint);
  letter-spacing: -0.01em;
}

.terminal-content {
  padding: clamp(16px, 3vw, 28px);
  font-family: var(--font-mono);
  font-size: clamp(0.8rem, 1.4vw, 0.92rem);
  line-height: 1.6;
  background: var(--bg-surface);
  color: var(--text-main);
}

.term-card-row {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.term-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 700;
}
.tag-ready { background: var(--success-bg); color: var(--success); }
.tag-verified { background: var(--info-bg); color: var(--info); }
.tag-optin { background: var(--warning-bg); color: var(--warning); }

/* --------------------------------------------------------------------------
   Content Sections (Craft Spacing & Restraint)
   -------------------------------------------------------------------------- */
.section {
  padding: clamp(60px, 8vw, 100px) 0;
  position: relative;
}

.section-subtle {
  background-color: var(--bg-subtle);
}

.section-heading-wrap {
  text-align: center;
  max-width: 680px;
  margin: 0 auto clamp(36px, 5vw, 56px);
}

.section-label {
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-blue);
  margin-bottom: 8px;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
  margin-bottom: 14px;
}

.section-desc {
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  color: var(--text-muted);
  line-height: 1.55;
}

/* --------------------------------------------------------------------------
   Capabilities (Craft Modular Cards)
   -------------------------------------------------------------------------- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(16px, 2.5vw, 24px);
  width: 100%;
  max-width: 100%;
}

.card-span-7 { grid-column: span 7; }
.card-span-5 { grid-column: span 5; }
.card-span-6 { grid-column: span 6; }
.card-span-4 { grid-column: span 4; }
.card-span-12 { grid-column: span 12; }

.craft-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-card);
  padding: clamp(20px, 3.5vw, 36px);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  transition: all 0.25s ease;
}

.craft-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-focus);
}

.card-pill-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  margin-bottom: 20px;
}

.card-pill-icon svg {
  width: 22px;
  height: 22px;
}

.card-title {
  font-size: clamp(1.2rem, 2vw, 1.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin-bottom: 10px;
}

.card-body-text {
  font-size: 0.98rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 20px;
}

.card-feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
  border-top: 1px solid var(--border-light);
  padding-top: 18px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
}

.feature-bullet-item {
  display: block;
  position: relative;
  padding-left: 18px;
  line-height: 1.55;
  word-break: break-word;
  overflow-wrap: anywhere;
  min-width: 0;
}

.feature-bullet-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-primary);
}

/* App-Specific Traffic Lights Card Optimization */
#app-setup .craft-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  height: 100%;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

#app-setup .card-title {
  word-break: break-word;
  overflow-wrap: break-word;
}

#app-setup .card-body-text {
  margin-bottom: 16px;
  min-height: 48px;
  word-break: break-word;
  overflow-wrap: anywhere;
}

#app-setup .card-feature-list {
  margin-top: 0;
  border-top: 1px solid var(--border-light);
  padding-top: 16px;
  gap: 12px;
  flex-grow: 1;
}

/* --------------------------------------------------------------------------
   Visual Showcase & Wallpaper Switcher
   -------------------------------------------------------------------------- */
.showcase-block {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-card);
  padding: clamp(20px, 3.5vw, 36px);
  box-shadow: var(--shadow-card);
}

.segmented-pill-bar {
  display: inline-flex;
  background: var(--bg-subtle);
  padding: 4px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-light);
  margin-bottom: 24px;
}

.segment-pill-btn {
  background: transparent;
  border: none;
  font-family: var(--font-sans);
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 700;
  padding: 8px 22px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s ease;
}

.segment-pill-btn.active {
  background: var(--bg-surface);
  color: var(--text-main);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.image-frame {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-light);
  background: var(--bg-subtle);
  margin-bottom: 20px;
}

.showcase-wallpaper {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  transition: opacity 0.2s ease;
}

.cursor-preview-grid {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
}

.cursor-img-wrap {
  flex: 1 1 340px;
  max-width: 480px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  overflow: hidden;
}

.authentic-note {
  background: var(--bg-subtle);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-top: 24px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.authentic-note svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--text-main);
}

/* --------------------------------------------------------------------------
   Presets Grid (Minimal, Balanced, Full)
   -------------------------------------------------------------------------- */
.presets-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 2.5vw, 24px);
}

.preset-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-card);
  padding: clamp(24px, 3vw, 32px);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all 0.2s ease;
}

.preset-box.recommended {
  border-color: var(--text-main);
  box-shadow: var(--shadow-elevated);
}

.badge-recommended {
  position: absolute;
  top: -12px;
  left: 28px;
  background: var(--accent-primary);
  color: var(--text-inverse);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
}

.preset-heading {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.preset-summary {
  font-size: 0.94rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 24px;
  min-height: 48px;
}

.preset-check-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
  flex-grow: 1;
  font-size: 0.92rem;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--text-main);
}

.check-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--success);
  margin-top: 2px;
}

.check-item.optional svg {
  color: var(--info);
}

.preset-code-badge {
  margin-top: auto;
  border-top: 1px solid var(--border-light);
  padding-top: 18px;
}

.code-pill {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-main);
  display: block;
  overflow-x: auto;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Dynamic Compatibility Matrix (Mobile-Safe Scrollable Table)
   -------------------------------------------------------------------------- */
.table-scroll-container {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  margin-bottom: 32px;
}

.craft-table {
  width: 100%;
  min-width: 640px; /* guarantees layout never breaks or squishes on small screens */
  border-collapse: collapse;
  text-align: left;
}

.craft-table th, .craft-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
}

.craft-table th {
  background: var(--bg-subtle);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
}

.craft-table tr:last-child td {
  border-bottom: none;
}

/* --------------------------------------------------------------------------
   Installation Section
   -------------------------------------------------------------------------- */
.install-block {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-card);
  padding: clamp(24px, 4vw, 40px);
  box-shadow: var(--shadow-elevated);
  max-width: 860px;
  margin: 0 auto;
}

.command-bar {
  background: var(--bg-subtle);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 28px;
}

.command-text {
  font-family: var(--font-mono);
  font-size: clamp(0.82rem, 1.4vw, 0.94rem);
  color: var(--text-main);
  overflow-x: auto;
  white-space: nowrap;
  padding-right: 6px;
}

.btn-copy {
  background: var(--accent-primary);
  color: var(--text-inverse);
  border: none;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.btn-copy:hover {
  background: var(--accent-primary-hover);
}

.btn-copy.copied {
  background: var(--success);
  color: #ffffff;
}

.steps-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.step-item {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.step-badge {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--accent-blue);
  margin-bottom: 8px;
}

.step-name {
  font-size: 0.94rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.step-info {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* --------------------------------------------------------------------------
   Documentation Hub
   -------------------------------------------------------------------------- */
.docs-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(14px, 2vw, 20px);
}

.doc-tile {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 22px;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.doc-tile:hover {
  border-color: var(--text-main);
  transform: translateY(-2px);
}

.doc-tile-title {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.doc-tile-title svg {
  width: 16px;
  height: 16px;
  opacity: 0.6;
}

.doc-tile:hover .doc-tile-title svg {
  opacity: 1;
}

.doc-tile-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   FAQ Section (Accordion)
   -------------------------------------------------------------------------- */
.faq-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 820px;
  margin: 0 auto;
}

.faq-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.faq-card:hover {
  border-color: var(--border-focus);
}

.faq-question {
  width: 100%;
  background: transparent;
  border: none;
  padding: 18px 22px;
  text-align: left;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.faq-question svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform 0.25s ease;
  color: var(--text-muted);
}

.faq-card.open .faq-question svg {
  transform: rotate(180deg);
  color: var(--text-main);
}

.faq-answer {
  display: none;
  padding: 0 22px 20px;
  font-size: 0.94rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.faq-card.open .faq-answer {
  display: block;
}

/* --------------------------------------------------------------------------
   Site Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-light);
  padding: clamp(40px, 6vw, 64px) 0 32px;
  margin-top: auto;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 32px;
  margin-bottom: 40px;
}

.footer-nav-groups {
  display: flex;
  gap: clamp(24px, 5vw, 56px);
  flex-wrap: wrap;
}

.footer-group-title {
  font-size: 0.84rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  margin-bottom: 12px;
}

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

.footer-links-list a:hover {
  color: var(--text-main);
}

.footer-baseline {
  border-top: 1px solid var(--border-light);
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.84rem;
}

/* --------------------------------------------------------------------------
   Responsive Layout Rules (Guarantees Nothing Breaks on Resizing)
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Large Tablet / Small Desktop Breakpoint (Under 1080px) */
@media (max-width: 1080px) {
  .nav-links {
    gap: 8px;
  }
  .nav-link {
    font-size: 0.84rem;
  }
}

/* Tablet & Mobile Nav Drawer Breakpoint (Under 1040px) */
@media (max-width: 1040px) {
  .nav-links {
    display: none;
  }
  .nav-links.active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-elevated);
    padding: 20px 24px;
    gap: 12px;
    z-index: 1001;
  }
  .nav-links.active .nav-link {
    font-size: 1rem;
    padding: 8px 0;
    display: block;
    width: 100%;
    border-bottom: 1px solid var(--border-light);
  }
  .nav-links.active li:last-child .nav-link {
    border-bottom: none;
  }
  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* Medium Tablet & Stack Breakpoint (Under 920px) */
@media (max-width: 920px) {
  .cards-grid {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
  }

  .craft-card,
  .card-span-7, .card-span-5, .card-span-6, .card-span-4, .card-span-12 {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  #app-setup .card-body-text {
    min-height: 0;
  }

  .presets-grid {
    grid-template-columns: 1fr;
    max-width: 480px;
    margin: 0 auto;
  }

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

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

/* Smartphone Breakpoint (Under 640px) */
@media (max-width: 640px) {
  .container {
    padding-left: 14px;
    padding-right: 14px;
  }

  .craft-card {
    padding: 18px 14px;
    border-radius: var(--radius-md);
  }

  .card-pill-icon {
    width: 38px;
    height: 38px;
    margin-bottom: 14px;
  }

  .card-pill-icon svg {
    width: 18px;
    height: 18px;
  }

  .card-title {
    font-size: 1.15rem;
  }

  .card-body-text {
    font-size: 0.92rem;
    margin-bottom: 12px;
  }

  .card-feature-list {
    padding-top: 12px;
    gap: 10px;
    font-size: 0.86rem;
  }

  .feature-bullet-item {
    padding-left: 15px;
    font-size: 0.86rem;
    line-height: 1.5;
  }

  .feature-bullet-item::before {
    top: 7px;
    width: 5px;
    height: 5px;
  }

  code {
    font-size: 0.8em;
    padding: 1px 4px;
  }

  .steps-row {
    grid-template-columns: 1fr;
  }

  .docs-row {
    grid-template-columns: 1fr;
  }

  .command-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-copy {
    width: 100%;
    justify-content: center;
  }

  .footer-inner {
    flex-direction: column;
  }

  .footer-nav-groups {
    flex-direction: column;
    gap: 24px;
  }
}

/* Extra Small Phone Breakpoint (Under 480px) */
@media (max-width: 480px) {
  .site-nav-pill {
    padding: 6px 10px 6px 14px;
  }

  .brand span {
    font-size: 0.98rem;
  }

  .btn-pill-cta span {
    display: none;
  }

  .btn-pill-cta {
    padding: 6px 10px;
  }

  .craft-card {
    padding: 16px 12px;
  }
}

/* ==============================================================================
   macOS-Inspired System Preloader / Loading Screen
   ============================================================================== */
.system-preloader {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background-color: var(--bg-primary, #fbf9f5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform, visibility;
  user-select: none;
  pointer-events: all;
}

[data-theme="dark"] .system-preloader {
  background-color: #0c0d12;
}

.system-preloader.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(1.02);
}

.preloader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 22px;
  animation: preloader-fade-in 0.4s ease-out;
}

.preloader-logo-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preloader-logo {
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.12));
  animation: preloader-pulse 2.2s infinite ease-in-out;
}

[data-theme="dark"] .preloader-logo {
  filter: drop-shadow(0 10px 30px rgba(0, 122, 255, 0.25));
}

.preloader-glow {
  position: absolute;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 113, 227, 0.22) 0%, rgba(0, 113, 227, 0) 70%);
  z-index: 1;
  pointer-events: none;
  animation: preloader-glow-pulse 2.2s infinite ease-in-out;
}

.preloader-bar-wrap {
  width: 180px;
  height: 5px;
  background-color: rgba(120, 120, 128, 0.16);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .preloader-bar-wrap {
  background-color: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}

.preloader-bar {
  height: 100%;
  width: 35%;
  background: linear-gradient(90deg, #0071e3, #38bdf8);
  border-radius: 999px;
  animation: preloader-indeterminate 1.4s infinite ease-in-out;
  box-shadow: 0 0 10px rgba(0, 113, 227, 0.45);
}

.preloader-status-text {
  font-family: 'Sofia Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-tertiary, #6e6e73);
  transition: opacity 0.2s ease;
}

[data-theme="dark"] .preloader-status-text {
  color: #86868b;
}

@keyframes preloader-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes preloader-pulse {
  0%, 100% { transform: scale(1); opacity: 0.95; }
  50% { transform: scale(1.04); opacity: 1; }
}

@keyframes preloader-glow-pulse {
  0%, 100% { transform: scale(0.85); opacity: 0.4; }
  50% { transform: scale(1.25); opacity: 0.85; }
}

@keyframes preloader-indeterminate {
  0% {
    transform: translateX(-100%);
    width: 25%;
  }
  50% {
    width: 65%;
  }
  100% {
    transform: translateX(350%);
    width: 25%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .system-preloader,
  .system-preloader.loaded,
  .preloader-content,
  .preloader-logo,
  .preloader-glow,
  .preloader-bar {
    animation: none !important;
    transition: none !important;
  }
  .system-preloader.loaded {
    display: none !important;
  }
}
