@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=JetBrains+Mono:wght@700&display=swap');

:root {
  /* Colors — Light Theme (White/Grey main, Electric Blue accent) */
  --bg: #ffffff;                /* white base */
  --surface: #f5f5f5;           /* light card / panel */
  --surface-2: #eeeeee;         /* slightly darker light */
  --text: #0d0d0d;              /* near-black text */
  --text-dim: #6b7280;          /* muted grey */
  --border: #e5e5e5;            /* light border */
  --primary: #2563eb;           /* electric blue */
  --primary-dark: #1d4ed8;      /* deeper blue for hover */
  --primary-glow: rgba(37, 99, 235, 0.15);
  
  /* Layout & Spacing */
  --radius: 12px;
  --radius-lg: 20px;
  
  /* Fonts */
  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

/* Reset & Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Typography Utility */
h1, h2, h3, h4, h5, h6 {
  color: var(--text);
  font-weight: 700;
  margin: 0;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-dark);
}

/* Layout Utilities */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Focus outline for accessibility */
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
}

/* Reduced motion support */
@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;
  }
}

/* ==========================================================================
   NAV
   ========================================================================== */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 60px;
  /* transparent by default; glass kicks in on scroll via JS */
  background: transparent;
  transition: background 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
  border-bottom: 1px solid transparent;
}

/* Scrolled state — frosted glass (white) */
.nav--scrolled {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--border);
}

.nav__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4% 0 2%; /* fluid padding to align with screen corners */
  max-width: 100%; /* allow full width span on large viewports */
  margin: 0 auto;
}

/* --- Brand --- */
.nav__brand {
  display: flex;
  align-items: center;
  gap: 10px; /* adjusted gap for slightly larger brand mark */
  text-decoration: none;
  flex-shrink: 0;
}

.nav__logo {
  font-family: var(--font-mono);
  font-size: 25px; /* made bigger to stand out and feel polished */
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.nav__wordmark {
  font-family: var(--font-sans);
  font-size: 20px; /* made bigger and matching modern font scaling */
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

/* --- Links --- */
.nav__links {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
  text-decoration: none;
  border-radius: 6px;
  transition: color 0.2s ease;
}

.nav__link:hover {
  color: var(--text);
}

/* Animated underline — slides in from left on hover */
.nav__link::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 12px;
  right: 12px;
  height: 1.5px;
  background: var(--primary);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.25s ease;
}

.nav__link:hover::after {
  transform: scaleX(1);
}

/* GitHub icon alignment */
.nav__github-icon {
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.nav__link--github:hover .nav__github-icon {
  opacity: 1;
}

/* Nudge body down so content isn't hidden behind fixed nav */
body {
  padding-top: 60px;
}

/* ==========================================================================
   KEYFRAMES
   ========================================================================== */

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes blobFloat {
  from { transform: translateY(0px); }
  to   { transform: translateY(-28px); }
}

/* ==========================================================================
   SHARED BUTTON STYLES
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
  position: relative;
  overflow: hidden;
}

/* Primary — filled blue */
.btn--primary {
  background: var(--primary);
  color: #fff;
  border: none;
}

.btn--primary:hover {
  background: var(--primary-dark);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 0 28px rgba(59, 130, 246, 0.40), 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Shimmer sweep on hover */
.btn--primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
  transform: skewX(-20deg);
  transition: left 0.45s ease;
}

.btn--primary:hover::before {
  left: 160%;
}

/* Ghost — text link with border */
.btn--ghost {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--border);
}

.btn--ghost:hover {
  border-color: var(--primary);
  color: var(--text);
  transform: translateY(-1px);
}

/* Arrow nudge on ghost CTA */
.btn__arrow {
  display: inline-block;
  transition: transform 0.2s ease;
}

.btn--ghost:hover .btn__arrow {
  transform: translateX(4px);
}

/* ==========================================================================
   HERO
   ========================================================================== */

.hero {
  position: relative;
  min-height: min(820px, calc(100vh - 60px));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 48px 0 80px;
}

/* --- Ambient blobs --- */
.hero__blob {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  animation: blobFloat 20s ease-in-out infinite alternate;
}

.hero__blob--top {
  width: 600px;
  height: 600px;
  top: -120px;
  right: -100px;
  background: rgba(37, 99, 235, 0.05);
  filter: blur(100px);
  animation-delay: 0s;
}

.hero__blob--bottom {
  width: 480px;
  height: 480px;
  bottom: -80px;
  left: -80px;
  background: rgba(99, 102, 241, 0.04);
  filter: blur(90px);
  animation-delay: -10s;
}

/* --- Radial glow --- */
.hero__glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(ellipse 800px 600px at 50% 85%, rgba(37, 99, 235, 0.06) 0%, transparent 70%);
}

/* --- Inner content wrapper --- */
.hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 28px;
}

/* --- Fade-up animation utility --- */
.fade-up {
  animation: fadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--delay, 0s);
}

/* --- Badge pill --- */
.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

.hero__badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  box-shadow: 0 0 8px var(--primary-glow);
}

/* --- Headline --- */
.hero__headline {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.hero__headline-line1 {
  color: var(--text);
  font-weight: 400;
}

/* Gradient blue second line */
.hero__headline-line2 {
  font-weight: 700;
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Sub-headline --- */
.hero__sub {
  max-width: 600px;
  margin: 0;
  font-size: 18px;
  color: var(--text-dim);
  line-height: 1.65;
  font-weight: 400;
}

/* --- CTAs row --- */
.hero__ctas {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

/* --- Social proof strip --- */
.hero__proof {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 0;
  font-size: 13px;
  color: var(--text-dim);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 640px) {
  .hero {
    padding: 40px 0 60px; /* tightened on mobile as well */
  }

  .hero__headline {
    font-size: clamp(34px, 10vw, 52px);
  }

  .hero__sub {
    font-size: 16px;
  }

  .hero__ctas {
    flex-direction: column;
    width: 100%;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .hero__blob--top {
    width: 340px;
    height: 340px;
    right: -60px;
  }

  .hero__blob--bottom {
    width: 260px;
    height: 260px;
    left: -40px;
  }
}

/* ==========================================================================
   PHASE 4 — DOT-GRID BACKGROUND TEXTURE
   ========================================================================== */

/* Subtle dot grid layered on top of the light background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(
    circle,
    rgba(0, 0, 0, 0.045) 1px,
    transparent 1px
  );
  background-size: 28px 28px;
}

/* Make sure main content sits above the dot grid */
#app, .nav {
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   PHASE 4 — SHOWCASE (APP WINDOW STAGE)
   ========================================================================== */

@keyframes ringRotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes windowFloat {
  from { transform: translateY(0px); }
  to   { transform: translateY(-10px); }
}

/* Outer showcase wrapper — centers the floating window */
.showcase {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 48px auto 0;
  padding: 3px; /* leaves room for the gradient ring border */
  border-radius: 16px;
}

/* === Mouse-tracked interactive glow behind the window === */
.showcase__glow {
  position: absolute;
  inset: -80px;
  z-index: 0;
  pointer-events: none;
  /* initial state — JS overrides on mousemove */
  background: radial-gradient(
    ellipse 600px 500px at 50% 50%,
    rgba(37, 99, 235, 0.10) 0%,
    transparent 70%
  );
  border-radius: 50%;
  transition: background 0.1s linear;
}

/* === Spinning gradient ring border === */
.showcase__ring {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  z-index: 1;
  pointer-events: none;
  /* Conic gradient ring using a pseudo trick:
     We use a wrapper with overflow hidden and a spinning child */
  overflow: hidden;
}

.showcase__ring::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200%;
  height: 200%;
  transform: translate(-50%, -50%);
  background: conic-gradient(
    from 0deg,
    transparent 0%,
    rgba(37, 99, 235, 0.5) 20%,
    rgba(99, 102, 241, 0.4) 40%,
    transparent 60%,
    rgba(59, 130, 246, 0.35) 80%,
    transparent 100%
  );
  animation: ringRotate 6s linear infinite;
}

/* Inner cutout that hides most of the ring — creates a thin border effect */
.showcase__ring::after {
  content: '';
  position: absolute;
  inset: 1.5px;
  border-radius: 15px;
  background: var(--bg);
}

/* === App window frame (populated in Phase 5) === */
.showcase__window {
  position: relative;
  z-index: 2;
  border-radius: 13px;
  overflow: hidden;
  background: #f5f5f5;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.08),
    0 24px 60px rgba(0, 0, 0, 0.12),
    0 8px 32px rgba(37, 99, 235, 0.08);
  min-height: 340px;
  animation: windowFloat 6s ease-in-out infinite alternate;
}

/* ==========================================================================
   RESPONSIVE — SHOWCASE
   ========================================================================== */

@media (max-width: 768px) {
  .showcase {
    margin-top: 32px;
    padding: 2px;
  }

  .showcase__window {
    min-height: 200px;
  }

  .showcase__glow {
    inset: -40px;
  }
}

/* ==========================================================================
   PHASE 5 — APP WINDOW MOCKUP
   ========================================================================== */

/* Override Phase 4 placeholder min-height; real content sets the height */
.showcase__window {
  min-height: unset !important;
  height: 400px;
  display: flex;
  flex-direction: column;
}

/* --- Titlebar --- */
.win__bar {
  position: relative;
  height: 36px;
  background: #f0f0f0;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  padding: 0 14px;
  flex-shrink: 0;
}

.win__dots {
  display: flex;
  gap: 7px;
  align-items: center;
  z-index: 1;
}

.win__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.win__dot--r { background: #ff5f57; }
.win__dot--y { background: #ffbd2e; }
.win__dot--g { background: #28c840; }

.win__title-wrap {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

.win__title {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #9ca3af;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

/* --- Three-panel body --- */
.win__panels {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ==========================================================================
   LEFT SIDEBAR — File Explorer
   ========================================================================== */

.win__sidebar {
  width: 16%;
  min-width: 108px;
  background: #f7f7f8;
  border-right: 1px solid #e5e5e5;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
}

.win__sidebar-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: #9ca3af;
  letter-spacing: 0.09em;
  padding: 10px 12px 6px;
  user-select: none;
}

.win__tree {
  padding: 2px 4px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.win__tree-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #374151;
  cursor: default;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.win__tree-row--indent {
  padding-left: 22px;
}

.win__tree-row--active {
  background: rgba(37, 99, 235, 0.10);
  color: #1d4ed8;
}

.win__tree-row--folder {
  color: #4b5563;
}

/* ==========================================================================
   CENTER PANEL — Terminal
   ========================================================================== */

.win__terminal {
  width: 40%;
  background: #ffffff;
  border-right: 1px solid #e5e5e5;
  padding: 14px 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0;
  flex-shrink: 0;
}

.win__term-line {
  display: flex;
  align-items: baseline;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.75;
  flex-shrink: 0;
  flex-wrap: nowrap;
}

.tc-spacer {
  height: 8px;
  flex-shrink: 0;
}

/* Token colours — light terminal */
.tc-dir    { color: #6b7280; }
.tc-prompt { color: #2563eb; font-weight: 700; user-select: none; }
.tc-cmd    { color: #111827; }
.tc-ok     { color: #16a34a; font-weight: 700; flex-shrink: 0; }
.tc-text   { color: #374151; }
.tc-muted  { color: #9ca3af; }
.tc-done   { color: #16a34a; font-weight: 700; }

/* Blinking block cursor */
@keyframes termBlink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.win__cursor {
  color: #2563eb;
  animation: termBlink 1.1s step-start infinite;
  line-height: 1;
  font-size: 13px;
}

/* ==========================================================================
   RIGHT PANEL — Code Editor
   ========================================================================== */

.win__editor {
  flex: 1;
  background: #fafafa;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* Tab bar */
.win__tabs {
  display: flex;
  background: #f0f0f0;
  border-bottom: 1px solid #e5e5e5;
  flex-shrink: 0;
}

.win__tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #9ca3af;
  border-right: 1px solid #e5e5e5;
  cursor: default;
  white-space: nowrap;
}

.win__tab--active {
  background: #fafafa;
  color: #1f2937;
  position: relative;
}

/* Thin top accent line on active tab */
.win__tab--active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--primary);
}

/* Unsaved dot (orange) */
.win__tab-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f97316;
  flex-shrink: 0;
}

/* Code area */
.win__code {
  flex: 1;
  padding: 10px 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.win__line {
  display: flex;
  align-items: baseline;
  padding: 0 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.75;
  white-space: pre;
  flex-shrink: 0;
}

/* Active (highlighted) line */
.win__line--active {
  background: rgba(37, 99, 235, 0.06);
}

/* Line numbers */
.syn-ln {
  display: inline-block;
  min-width: 22px;
  margin-right: 16px;
  color: #d1d5db;
  text-align: right;
  user-select: none;
  font-size: 10.5px;
  flex-shrink: 0;
}

/* Syntax token colours — VSCode Light+ inspired */
.syn-kw      { color: #0000ff; } /* keyword   — blue        */
.syn-fn      { color: #795e26; } /* function  — brown/gold  */
.syn-str     { color: #a31515; } /* string    — dark red    */
.syn-comment { color: #008000; } /* comment   — green       */
.syn-plain   { color: #333333; } /* code      — near-black  */
.syn-num     { color: #098658; } /* number    — teal        */

/* ==========================================================================
   RESPONSIVE — Hide sidebar on small screens
   ========================================================================== */

@media (max-width: 768px) {
  .showcase__window {
    height: 320px;
  }

  .win__sidebar {
    display: none;
  }

  .win__terminal {
    width: 45%;
  }

  .win__term-line {
    font-size: 10px;
  }

  .win__line {
    font-size: 10px;
  }
}

@media (max-width: 520px) {
  .showcase__window {
    height: 260px;
  }

  .win__terminal {
    display: none;
  }

  .win__editor {
    width: 100%;
  }
}

/* ==========================================================================
   PHASE 6 — FEATURES SECTION
   ========================================================================== */

.features {
  padding: 100px 0 80px;
  position: relative;
  z-index: 1;
}

/* --- Section header --- */
.features__header {
  text-align: center;
  margin-bottom: 56px;
}

.features__eyebrow {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
}

.features__heading {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.18;
  letter-spacing: -0.025em;
  color: var(--text);
  margin: 0;
}

.features__heading-accent {
  color: var(--primary);
}

/* --- 2×2 Card grid --- */
.features__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

/* --- Individual feature card --- */
.feat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 32px 36px;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;

  /* Scroll-reveal starting state */
  opacity: 0;
  transform: translateY(20px);
}

/* Revealed state (added by IntersectionObserver) */
.feat-card--visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.55s ease, transform 0.55s ease,
              box-shadow 0.25s ease, border-color 0.25s ease;
}

/* Stagger each card using nth-child */
.feat-card:nth-child(1) { transition-delay: 0s; }
.feat-card:nth-child(2) { transition-delay: 0.1s; }
.feat-card:nth-child(3) { transition-delay: 0.2s; }
.feat-card:nth-child(4) { transition-delay: 0.3s; }

.feat-card:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary), 0 8px 32px rgba(37, 99, 235, 0.08);
  transform: translateY(-3px);
}

/* Subtle inner top-left gradient shine */
.feat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.feat-card:hover::before {
  opacity: 1;
}

/* --- Icon wrapper --- */
.feat-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary);
  margin-bottom: 20px;
  transition: background 0.2s ease, transform 0.2s ease;
}

.feat-card:hover .feat-card__icon {
  background: rgba(37, 99, 235, 0.15);
  transform: scale(1.08);
}

/* --- Text --- */
.feat-card__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}

.feat-card__body {
  margin: 0;
  font-size: 15px;
  color: var(--text-dim);
  line-height: 1.7;
}

/* ==========================================================================
   PHASE 6 — DOWNLOAD CTA STRIP
   ========================================================================== */

.cta-strip {
  margin: 0 24px 48px;
  border-radius: var(--radius-lg);
  background: var(--primary);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

/* Decorative inner glow */
.cta-strip::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -60px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.cta-strip::after {
  content: '';
  position: absolute;
  bottom: -60px;
  left: 40px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.cta-strip__inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 48px 56px;
}

.cta-strip__heading {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}

.cta-strip__sub {
  margin: 0;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.75);
}

/* White button variant inside the blue strip */
.cta-strip__btn {
  background: #ffffff !important;
  color: var(--primary) !important;
  border: none !important;
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 15px;
}

.cta-strip__btn:hover {
  background: #f0f4ff !important;
  color: var(--primary-dark) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.20) !important;
}

/* ==========================================================================
   PHASE 6 — FOOTER
   ========================================================================== */

.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  position: relative;
  z-index: 1;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

/* Brand */
.footer__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.footer__logo {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 700;
  color: var(--primary);
}

.footer__wordmark {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

/* Copyright */
.footer__copy {
  margin: 0;
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
}

/* Nav links */
.footer__links {
  display: flex;
  gap: 20px;
}

.footer__link {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer__link:hover {
  color: var(--primary);
}

/* ==========================================================================
   RESPONSIVE — PHASE 6
   ========================================================================== */

@media (max-width: 768px) {
  body {
    padding-top: 100px;
  }

  .nav {
    height: auto;
    min-height: 60px;
    padding: 8px 0;
  }

  .nav__inner {
    padding: 0 16px; 
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
  }

  .nav__links {
    flex-wrap: wrap;
    justify-content: center;
  }

  .nav__link {
    padding: 6px 8px;
    font-size: 13px;
  }

  .features {
    padding: 72px 0 60px;
  }

  .features__grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .cta-strip {
    margin: 0 16px 40px;
  }

  .cta-strip__inner {
    flex-direction: column;
    text-align: center;
    padding: 40px 32px;
  }

  .cta-strip__btn {
    width: 100%;
    justify-content: center;
  }

  .footer__inner {
    flex-direction: column;
    text-align: center;
  }

  .footer__links {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .feat-card {
    padding: 24px 22px 28px;
  }
}

/* ==========================================================================
   PHASE 7 — ACCESSIBILITY & POLISH
   ========================================================================== */

/* --- Skip link (keyboard only) --- */
.skip-link {
  position: fixed;
  top: -100px;          /* hidden off-screen by default */
  left: 16px;
  z-index: 9999;
  padding: 10px 20px;
  background: var(--primary);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  border-radius: 999px;
  text-decoration: none;
  transition: top 0.2s ease;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
}

/* Slide in when focused by keyboard Tab */
.skip-link:focus {
  top: 16px;
  outline: 2px solid #fff;
  outline-offset: 3px;
}

/* --- Reduce motion: ensure feat-cards are always visible --- */
@media (prefers-reduced-motion: reduce) {
  /* Show cards immediately without JS animation */
  .feat-card {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  /* Stop the window float */
  .showcase__window {
    animation: none !important;
  }

  /* Stop the ring spin */
  .showcase__ring::before {
    animation: none !important;
  }

  /* Stop blob drift */
  .hero__blob {
    animation: none !important;
  }

  /* Stop fade-up on load */
  .fade-up {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  /* Stop blinking cursor */
  .win__cursor {
    animation: none !important;
    opacity: 1 !important;
  }
}

/* --- Focus-visible polish: extra contrast on light background --- */
.nav__link:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
  border-radius: 4px;
  color: var(--text);
}

.footer__link:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
  border-radius: 2px;
}

/* --- Print media: strip decorative elements --- */
@media print {
  .nav,
  .hero__blob,
  .hero__glow,
  .showcase__glow,
  .showcase__ring,
  .cta-strip::before,
  .cta-strip::after,
  body::before {
    display: none !important;
  }

  body {
    background: #fff !important;
    color: #000 !important;
  }

  .btn--primary {
    background: #2563eb !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* Button styling reset for help link trigger */
button.nav__link {
  background: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}

/* ==========================================================================
   MODAL DIALOG (HELP GUIDE OVERLAY)
   ========================================================================== */

.modal {
  border: none;
  padding: 0;
  background: transparent;
  max-width: 100vw;
  max-height: 100vh;
  outline: none;
}

/* Backdrop blur overlay */
.modal::backdrop {
  background: rgba(13, 13, 13, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeInBackdrop 0.3s ease forwards;
}

.modal__container {
  position: fixed;
  inset: 40px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 
    0 24px 64px rgba(0, 0, 0, 0.16),
    0 8px 32px rgba(37, 99, 235, 0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalScaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  z-index: 1000;
}

.modal__close {
  position: absolute;
  top: 16px;
  right: 20px;
  z-index: 1010;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal__close:hover {
  background: var(--surface-2);
  color: var(--text);
  transform: scale(1.05);
}

.modal__iframe {
  border: none;
  width: 100%;
  height: 100%;
  background: var(--bg);
}

/* Animations */
@keyframes fadeInBackdrop {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes modalScaleUp {
  from { transform: scale(0.95); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* Responsive modal offsets */
@media (max-width: 768px) {
  .modal__container {
    inset: 12px;
    border-radius: var(--radius);
  }
  
  .modal__close {
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
  }
}

/* Ensure modal is hidden in printing */
@media print {
  .modal {
    display: none !important;
  }
}

/* ==========================================================================
   LANG TOGGLE
   ========================================================================== */

.lang-toggle {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  color: var(--text-dim);
  transition: color 0.2s ease;
}

.lang-toggle:hover {
  color: var(--text);
}

.lang-toggle__opt {
  padding: 0 2px;
  letter-spacing: 0.04em;
  transition: color 0.2s ease;
}

.lang-toggle__opt--active {
  color: var(--primary);
  font-weight: 700;
}

.lang-toggle__divider {
  margin: 0 3px;
  color: var(--border);
  font-weight: 400;
  user-select: none;
}

/* ==========================================================================
   THAI FONT — system stack, zero network requests
   ========================================================================== */

:lang(th) body {
  font-family: 'Leelawadee UI', Leelawadee, Tahoma, sans-serif;
}

/* ==========================================================================
   HOME REBUILD — WHY / LEARN / COMING sections + shared bits
   (soft-sell repositioning; matches feature-card visual language)
   ========================================================================== */

/* --- Section shells --- */
.why,
.learn,
.coming {
  padding: 88px 0 72px;
  position: relative;
  z-index: 1;
}

.learn {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* Sub-line under a section heading */
.why__sub {
  margin: 18px auto 0;
  max-width: 560px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-dim);
}

/* Inline text link (under a card group) */
.text-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
}
.text-link:hover { color: var(--primary-dark); }

.why__link-wrap {
  text-align: center;
  margin: 36px 0 0;
}

/* --- 3-up card grid (why + coming) --- */
.why__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.why-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px 28px 32px;
  position: relative;
  transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

/* On the light-surface Learn/Coming bands, cards read better as white */
.learn .why-card,
.coming .why-card {
  background: var(--bg);
}

.why-card:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary), 0 8px 32px rgba(37, 99, 235, 0.08);
  transform: translateY(-3px);
}

.why-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  margin-bottom: 16px;
  color: var(--primary);
  background: var(--primary-glow);
}

.why-card__title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text);
}

.why-card__body {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-dim);
  margin: 0;
}

/* Coming-soon variant */
.why-card--soon {
  border-style: dashed;
}

.soon-badge {
  display: inline-block;
  margin-bottom: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-glow);
}

/* --- Learn chips --- */
.learn__chips {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 760px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.learn-chip {
  display: inline-flex;
  align-items: center;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.learn-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.1);
}

/* --- Responsive --- */
@media (max-width: 880px) {
  .why__grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

@media (max-width: 720px) {
  .why,
  .learn,
  .coming {
    padding: 64px 0 52px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .why-card,
  .learn-chip {
    transition: none !important;
  }
}

/* ==========================================================================
   SHARED PAGE HERO (why-cli, eazycli, start hub) + comparison + fair note
   ========================================================================== */

.page-hero {
  padding: 120px 0 56px;
  text-align: center;
  position: relative;
}

.page-hero__inner {
  max-width: 760px;
}

.page-hero__title {
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin: 8px 0 0;
  color: var(--text);
}

.page-hero__sub {
  margin: 20px auto 0;
  max-width: 640px;
  font-size: 17px;
  line-height: 1.65;
  color: var(--text-dim);
}

.container--narrow {
  max-width: 720px;
}

.nav__link--active {
  color: var(--primary);
}

/* --- Comparison table --- */
.compare-sec {
  padding: 24px 0 72px;
}

.compare {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg);
}

.compare__row {
  display: grid;
  grid-template-columns: 0.8fr 1.1fr 1.1fr;
  border-bottom: 1px solid var(--border);
}
.compare__row:last-child { border-bottom: none; }

.compare__row--head {
  background: var(--surface);
}

.compare__label,
.compare__col {
  padding: 18px 20px;
  font-size: 15px;
  line-height: 1.55;
}

.compare__label {
  font-weight: 700;
  color: var(--text);
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
}

.compare__col {
  color: var(--text-dim);
  border-right: 1px solid var(--border);
}
.compare__col:last-child { border-right: none; }

.compare__row--head .compare__col {
  font-weight: 700;
  color: var(--text);
}

.compare__col--b {
  background: var(--primary-glow);
  color: var(--text);
}
.compare__row--head .compare__col--b {
  color: var(--primary);
}

.compare__note {
  margin: 20px auto 0;
  max-width: 720px;
  text-align: center;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-dim);
}

/* --- Fair-balance note --- */
.fair {
  text-align: center;
}
.fair__title {
  font-size: clamp(24px, 3.5vw, 34px);
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  color: var(--text);
}
.fair__body {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-dim);
  margin: 0;
}

@media (max-width: 720px) {
  .page-hero { padding: 96px 0 40px; }
  .compare__row {
    grid-template-columns: 1fr;
  }
  .compare__label {
    border-right: none;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
  }
  .compare__col {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .compare__row:last-child .compare__col:last-child { border-bottom: none; }
  /* Hide the empty head row on mobile; the bold aspect label leads each group */
  .compare__row--head { display: none; }
  /* Language-neutral cue: the eazycli/CLI column keeps its highlight + accent border */
  .compare__col--b {
    border-left: 3px solid var(--primary);
  }
}

/* ==========================================================================
   /eazycli APP TOUR — split layout, mini-explorer, setup checklist
   ========================================================================== */

.app-sec { padding: 64px 0; }

.page-hero__cta { margin-top: 28px; }

.app-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}

.app-split--reverse .app-split__text { order: 2; }
.app-split--reverse .app-split__visual { order: 1; }

.app-sec__title {
  font-size: clamp(24px, 3.2vw, 32px);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 16px;
  color: var(--text);
}

.app-sec__body {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-dim);
  margin: 0;
}

.app-sec__note {
  margin: 14px 0 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-dim);
  font-style: italic;
}

/* --- Mini file explorer mock --- */
.mini-explorer {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
  max-width: 360px;
}

.mini-explorer__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  padding: 4px 8px 12px;
}

.mini-explorer__row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--text);
}

.mini-explorer__row--indent { margin-left: 16px; }

.mini-explorer__row--active {
  background: var(--primary-glow);
  color: var(--primary);
}

.mini-explorer__ico { font-size: 14px; }

/* --- Setup checklist --- */
.setup-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.setup-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.check-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #16a34a;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

@media (max-width: 820px) {
  .app-split {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .app-split--reverse .app-split__text { order: 1; }
  .app-split--reverse .app-split__visual { order: 2; }
  .mini-explorer, .setup-list { max-width: none; }
}

/* ==========================================================================
   /start HUB cards + guide-page content
   ========================================================================== */

.start-sec { padding: 16px 0 72px; }

.start-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  counter-reset: none;
}

.start-card {
  display: flex;
  gap: 18px;
  height: 100%;
  padding: 26px 26px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

.start-card:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary), 0 8px 32px rgba(37, 99, 235, 0.08);
  transform: translateY(-3px);
}

.start-card__num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
}

.start-card__body { display: flex; flex-direction: column; }

.start-card__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.start-card__desc {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.start-card__cta {
  margin-top: auto;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
}

/* --- Guide article body --- */
.guide-body { padding: 8px 0 64px; }

.guide-block { margin-bottom: 38px; }

.guide-block h2 {
  font-size: 22px;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
  color: var(--text);
}

.guide-block p {
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-dim);
  margin: 0 0 12px;
}

.guide-block ul {
  margin: 0 0 12px;
  padding-left: 22px;
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1.7;
}
.guide-block li { margin-bottom: 6px; }

.code-line {
  display: block;
  font-family: var(--font-mono);
  font-size: 14px;
  background: #1e293b;
  color: #e2e8f0;
  padding: 13px 16px;
  border-radius: var(--radius);
  margin: 14px 0;
  overflow-x: auto;
  white-space: pre;
}

.icode {
  font-family: var(--font-mono);
  font-size: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 7px;
  color: var(--primary);
}

.tip {
  border-left: 3px solid var(--primary);
  background: var(--primary-glow);
  padding: 14px 18px;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  margin: 16px 0;
}
.tip strong { color: var(--text); }

.guide-next {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  border-top: 1px solid var(--border);
  padding-top: 24px;
  margin-top: 8px;
}
.guide-next a { font-size: 16px; font-weight: 700; }

@media (max-width: 720px) {
  .start-grid { grid-template-columns: 1fr; gap: 16px; }
}
