/* ============================================================
   LibreWin OS — Website Stylesheet
   Design system: Geist, #2c5282 accent, dark-first
   ============================================================ */

/* ── Dark theme (default) ── */
:root {
  --accent:        #2c5282;
  --accent-hover:  #1a3a5c;
  --bg:            #0a0a0b;
  --surface:       #111113;
  --surface-alt:   #0e0e10;
  --surface-2:     #16161a;
  --surface-3:     #1e1e22;
  --border:        #1e1e22;
  --border-subtle: #2a2a30;
  --text:          #d4d4d8;
  --text-secondary:#b4b4b8;
  --text-muted:    #71717a;
  --text-faint:    #52525b;
  --text-heading:  #fafafa;
  /* System A aliases (used by productivity / creators / education) */
  --bg-raised:     #111113;
  --bg-stripe:     #0e0e10;
  --border-mid:    #2a2a30;
  --text-dim:      #71717a;
  --text-head:     #fafafa;
  --mono:          'Geist Mono', monospace;
  --sans:          'Geist', system-ui, sans-serif;
  --accent-fg:     #ffffff;
  /* Misc */
  --success:       #34d399;
  --nav-blur-bg:   rgba(0, 0, 0, 0.9);
  --hero-glow:     rgba(44, 82, 130, 0.15);
  --font:          'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Cantarell, sans-serif;
  --radius:        12px;
  --radius-sm:     6px;
  --radius-md:     8px;
  --nav-height:    60px;
}

/* ── Light theme tokens ── */
[data-theme="light"],
[data-theme="auto"]:where(html) {
  color-scheme: light;
}
[data-theme="dark"],
[data-theme="auto"]:where(html) {
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  [data-theme="auto"] {
    --bg:            #ffffff;
    --surface:       #f4f4f5;
    --surface-alt:   #f8f8f9;
    --surface-2:     #f4f4f5;
    --surface-3:     #e4e4e7;
    --border:        #e4e4e7;
    --border-subtle: #d4d4d8;
    --text:          #3f3f46;
    --text-secondary:#27272a;
    --text-muted:    #71717a;
    --text-faint:    #a1a1aa;
    --text-heading:  #09090b;
    --bg-raised:     #f4f4f5;
    --bg-stripe:     #f8f8f9;
    --border-mid:    #d4d4d8;
    --text-dim:      #71717a;
    --text-head:     #09090b;
    --success:       #059669;
    --nav-blur-bg:   rgba(255, 255, 255, 0.9);
    --hero-glow:     rgba(44, 82, 130, 0.08);
  }
}

[data-theme="light"] {
  --bg:            #ffffff;
  --surface:       #f4f4f5;
  --surface-alt:   #f8f8f9;
  --surface-2:     #f4f4f5;
  --surface-3:     #e4e4e7;
  --border:        #e4e4e7;
  --border-subtle: #d4d4d8;
  --text:          #3f3f46;
  --text-secondary:#27272a;
  --text-muted:    #71717a;
  --text-faint:    #a1a1aa;
  --text-heading:  #09090b;
  --bg-raised:     #f4f4f5;
  --bg-stripe:     #f8f8f9;
  --border-mid:    #d4d4d8;
  --text-dim:      #71717a;
  --text-head:     #09090b;
  --success:       #059669;
  --nav-blur-bg:   rgba(255, 255, 255, 0.9);
  --hero-glow:     rgba(44, 82, 130, 0.08);
}

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

/* ── Theme crossfade (only active during the switch) ── */
html.theme-transitioning,
html.theme-transitioning *,
html.theme-transitioning *::before,
html.theme-transitioning *::after {
  transition: background-color 300ms ease, box-shadow 300ms ease !important;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* ── Layout ── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font);
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 150ms, color 150ms, border-color 150ms, opacity 150ms;
  white-space: nowrap;
}

.btn-sm  { padding: 6px 14px; font-size: 13px; }
.btn-md  { padding: 9px 18px; font-size: 14px; }
.btn-lg  { padding: 12px 24px; font-size: 15px; }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover { color: var(--text); }

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-subtle);
}
.btn-outline:hover { border-color: var(--text-muted); }

/* ── Nav ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: var(--nav-blur-bg);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  letter-spacing: -0.01em;
}

.logo-icon {
  color: var(--accent);
  font-size: 12px;
}

.nav-links {
  display: flex;
  gap: 24px;
  margin-left: auto;
}

.nav-links a {
  font-size: 14px;
  color: var(--text-muted);
  transition: color 150ms;
}
.nav-links a:hover { color: var(--text); }
.nav-link-casebook { color: #3399ff !important; font-weight: 600; }
.nav-link-casebook:hover { color: #55aaff !important; }

.nav-right {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.cb-byline {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-faint);
  margin-left: 6px;
  letter-spacing: 0;
}

/* ── Theme toggle button ── */
.theme-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text-faint);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  transition: color 150ms, border-color 150ms, background 150ms;
}
.theme-btn:hover {
  color: var(--text-muted);
  border-color: var(--border-subtle);
  background: var(--surface-2);
}
.theme-icon { font-size: 13px; line-height: 1; }

/* ── Hero ── */
.hero {
  position: relative;
  padding: 100px 0 80px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, var(--hero-glow) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 80% 60%, rgba(124, 58, 237, 0.07) 0%, transparent 60%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(0, 102, 204, 0.15);
  border: 1px solid rgba(0, 102, 204, 0.3);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
  color: #60a5fa;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.hero-title {
  font-size: clamp(72px, 12vw, 120px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: #808080;
  margin-bottom: 20px;
  text-wrap: balance;
}

.hero-subtitle {
  font-size: 18px;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 600px;
  margin: 0 auto 36px;
  text-wrap: balance;
}

.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.hero-note {
  font-size: 13px;
  color: var(--text-faint);
}

/* ── Strip ── */
.strip {
  background: var(--surface-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
}

.strip-items {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.strip-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

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

.strip-divider {
  width: 1px;
  height: 16px;
  background: var(--border-subtle);
}

/* ── Sections ── */
.section { padding: 88px 0; }

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 56px;
}

.section-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text-heading);
  margin-bottom: 14px;
  text-wrap: balance;
}

.section-subtitle {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.6;
  text-wrap: balance;
}

/* ── Features grid ── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.feature-card {
  background: var(--surface);
  border-radius: 0;
  padding: 28px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transition: background 200ms;
}
.feature-card:hover { background: var(--surface-2); }
.feature-card:nth-child(3n) { border-right: none; }
.feature-card:nth-child(n+4) { border-bottom: none; }

.feature-icon {
  font-size: 24px;
  margin-bottom: 14px;
}

.feature-card h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

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

/* ── Agent section ── */
.agent-section {
  background: var(--surface-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 88px 0;
}

.agent-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.agent-text h2 {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-heading);
  margin-bottom: 20px;
  margin-top: 12px;
  text-wrap: balance;
}

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

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

.agent-note {
  font-size: 14px !important;
  color: var(--text-faint) !important;
  font-style: italic;
}

/* ── Terminal mockup ── */
.terminal-window {
  background: #0d1117;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 2px 8px rgba(0,0,0,0.3);
}

.terminal-bar {
  background: var(--surface-2);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--border);
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-subtle);
}

.terminal-title {
  margin-left: auto;
  margin-right: auto;
  font-size: 12px;
  color: var(--text-faint);
}

.terminal-body {
  padding: 20px;
  font-size: 13px;
  font-family: 'SF Mono', 'Fira Code', 'Menlo', monospace;
  line-height: 1.7;
}

.terminal-line { display: flex; align-items: baseline; gap: 8px; }
.t-gap { height: 8px; display: block; }

.t-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-faint);
  min-width: 44px;
  text-align: right;
  flex-shrink: 0;
}

.t-agent {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  min-width: 44px;
  text-align: right;
  flex-shrink: 0;
}

.t-muted { color: var(--text-faint); padding-left: 52px; font-size: 12px; }

.t-success {
  color: var(--success);
  padding-left: 52px;
  font-size: 13px;
  font-weight: 500;
}

/* ── Casebook mockup ── */
.casebook-window {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 2px 8px rgba(0,0,0,0.3);
}

.casebook-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.cb-tab {
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-faint);
  cursor: default;
  border-bottom: 2px solid transparent;
  transition: color 150ms;
}
.cb-tab-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.cb-tab-ghost { color: var(--text-faint); opacity: 0.7; }
.cb-lock {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-faint);
  padding: 8px 4px;
}

.casebook-body {
  display: flex;
  height: 220px;
}

.cb-sidebar {
  width: 170px;
  flex-shrink: 0;
  padding: 12px 10px;
  border-right: 1px solid var(--border);
  background: var(--surface-2);
  overflow: hidden;
}

.cb-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 4px;
  padding-left: 4px;
}

.cb-item {
  font-size: 11px;
  color: var(--text-muted);
  padding: 4px 6px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: default;
}
.cb-item-active {
  background: rgba(0, 102, 204, 0.1);
  color: var(--accent);
}

.cb-main {
  flex: 1;
  padding: 16px;
  overflow: hidden;
}

.cb-doc-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}

.cb-doc-line {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  margin-bottom: 7px;
  opacity: 0.8;
}
.cb-doc-line-short { width: 55%; }
.cb-doc-line-med   { width: 75%; }

.cb-highlight {
  position: relative;
  margin-bottom: 7px;
}
.cb-highlight-bar {
  position: absolute;
  left: -4px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #f59e0b;
  border-radius: 2px;
}
.cb-doc-highlight-line {
  height: 8px;
  background: rgba(245, 158, 11, 0.25);
  border-radius: 4px;
  margin: 0;
  width: 88%;
}

.cb-annotation {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 7px;
}
.cb-annotation-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.cb-annotation-text {
  font-size: 10px;
  color: var(--accent);
  font-style: italic;
}

.casebook-cta { margin-top: 24px; }

/* ── Big app name above mockup ── */
.casebook-app-name {
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-heading);
  margin-bottom: 16px;
  line-height: 1;
  text-align: center;
}

/* ── Apps list ── */
.apps-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.apps-list-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 14px 20px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.apps-list-item:nth-child(2n) { border-right: none; }
.apps-list-item:nth-last-child(-n+2) { border-bottom: none; }

.apps-list-icon { font-size: 14px; flex-shrink: 0; }
.apps-list-name { font-weight: 600; color: var(--text-heading); }

/* ── Compatibility ── */
.compat-section { background: var(--bg); }

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

.compat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.compat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.compat-icon {
  font-size: 16px;
  font-weight: 700;
}
.compat-yes .compat-icon { color: var(--success); }
.compat-no .compat-icon { color: #f87171; }
.compat-extra .compat-icon { color: #fbbf24; }

.compat-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-heading);
}

.compat-card ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.compat-card li {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  padding-left: 16px;
  position: relative;
}
.compat-card li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--text-faint);
}

/* ── Download ── */
.download-section {
  background: var(--surface-alt);
  border-top: 1px solid var(--border);
  padding: 88px 0;
}

.download-inner {
  text-align: center;
  max-width: 540px;
  margin: 0 auto;
}

.download-inner h2 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-heading);
  margin-bottom: 12px;
  text-wrap: balance;
}

.download-inner > p {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 36px;
}

.download-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.download-note {
  font-size: 13px;
  color: var(--text-faint);
  text-wrap: balance;
}
.download-note a {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.download-note a:hover { color: var(--text); }

/* ── Footer ── */
.footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 40px 0 28px;
}

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

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.footer-tagline {
  font-size: 13px;
  color: var(--text-faint);
}

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

.footer-links a {
  font-size: 13px;
  color: var(--text-muted);
  transition: color 150ms;
}
.footer-links a:hover { color: var(--text); }

.footer-bottom p {
  font-size: 12px;
  color: var(--text-faint);
}

/* ── Light mode shadow softening ── */
@media (prefers-color-scheme: light) {
  [data-theme="auto"] .terminal-window,
  [data-theme="auto"] .casebook-window { box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06); }
}
[data-theme="light"] .terminal-window,
[data-theme="light"] .casebook-window { box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06); }
[data-theme="light"] .terminal-window { background: #f8fafc; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .nav-links { display: none; }

  .agent-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }

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

  .strip-divider { display: none; }

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

  .footer-brand { flex-direction: column; align-items: flex-start; gap: 4px; }
}

@media (max-width: 480px) {
  .hero-cta { flex-direction: column; align-items: center; }
  .download-buttons { flex-direction: column; align-items: center; }
}
