/* AI Switch — design tokens (mirrors app's --aics-* tokens from src/index.css)
 * Light (default) + dark (data-theme="dark"), plus type / spacing / shadow.
 */

:root {
  --aics-bg: #ffffff;
  --aics-bg-grouped: #f2f2f7;
  --aics-bg-elevated: #ffffff;
  --aics-bg-sidebar: rgba(246, 246, 248, 0.85);
  --aics-bg-titlebar: rgba(255, 255, 255, 0.72);
  --aics-bg-hover: rgba(0, 0, 0, 0.04);
  --aics-bg-pressed: rgba(0, 0, 0, 0.07);
  --aics-bg-selected: rgba(0, 113, 227, 0.1);
  --aics-fg: #000000;
  --aics-fg-secondary: rgba(60, 60, 67, 0.66);
  --aics-fg-tertiary: rgba(60, 60, 67, 0.42);
  --aics-fg-on-accent: #ffffff;
  --aics-border: rgba(60, 60, 67, 0.12);
  --aics-border-strong: rgba(60, 60, 67, 0.22);
  --aics-border-focus: rgba(0, 113, 227, 0.45);
  --aics-accent: #0071e3;
  --aics-accent-hover: #0860c2;
  --aics-accent-pressed: #0a52a5;
  --aics-accent-tint: rgba(0, 113, 227, 0.1);
  --aics-success: #34c759;
  --aics-success-tint: rgba(52, 199, 89, 0.14);
  --aics-warn: #ff9f0a;
  --aics-warn-tint: rgba(255, 159, 10, 0.14);
  --aics-danger: #ff3b30;
  --aics-danger-tint: rgba(255, 59, 48, 0.12);

  --aics-claude: #d97757;
  --aics-codex: #19c37d;
  --aics-gemini: #4285f4;

  --aics-shadow-card: 0 0 0 1px var(--aics-border);
  --aics-shadow-hover: 0 0 0 1px var(--aics-border-strong), 0 8px 24px rgba(0, 0, 0, 0.06);
  --aics-shadow-window: 0 30px 80px -10px rgba(0, 0, 0, 0.22), 0 18px 40px -16px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.06);
  --aics-shadow-window-soft: 0 60px 120px -20px rgba(15, 30, 60, 0.18), 0 24px 48px -16px rgba(15, 30, 60, 0.12);

  --aics-font:
    -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Segoe UI Variable Display", "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  --aics-font-mono:
    ui-monospace, "SF Mono", Menlo, Monaco, "JetBrains Mono", Consolas, monospace;

  --aics-radius-sm: 6px;
  --aics-radius: 10px;
  --aics-radius-md: 12px;
  --aics-radius-lg: 18px;
  --aics-radius-xl: 22px;

  --aics-max: 1160px;
}

[data-theme="dark"] {
  --aics-bg: #0e0e10;
  --aics-bg-grouped: #1a1a1c;
  --aics-bg-elevated: #1f1f22;
  --aics-bg-sidebar: rgba(28, 28, 30, 0.92);
  --aics-bg-titlebar: rgba(20, 20, 22, 0.72);
  --aics-bg-hover: rgba(255, 255, 255, 0.06);
  --aics-bg-pressed: rgba(255, 255, 255, 0.1);
  --aics-bg-selected: rgba(10, 132, 255, 0.18);
  --aics-fg: #ffffff;
  --aics-fg-secondary: rgba(235, 235, 245, 0.66);
  --aics-fg-tertiary: rgba(235, 235, 245, 0.38);
  --aics-fg-on-accent: #ffffff;
  --aics-border: rgba(120, 120, 128, 0.28);
  --aics-border-strong: rgba(140, 140, 148, 0.42);
  --aics-border-focus: rgba(10, 132, 255, 0.55);
  --aics-accent: #0a84ff;
  --aics-accent-hover: #2b95ff;
  --aics-accent-pressed: #006ee0;
  --aics-accent-tint: rgba(10, 132, 255, 0.18);
  --aics-success: #30d158;
  --aics-success-tint: rgba(48, 209, 88, 0.18);
  --aics-warn: #ffa00a;
  --aics-warn-tint: rgba(255, 159, 10, 0.18);
  --aics-danger: #ff453a;
  --aics-danger-tint: rgba(255, 69, 58, 0.18);

  --aics-shadow-card: 0 0 0 1px var(--aics-border);
  --aics-shadow-hover: 0 0 0 1px var(--aics-border-strong), 0 8px 24px rgba(0, 0, 0, 0.5);
  --aics-shadow-window: 0 36px 90px -10px rgba(0, 0, 0, 0.7), 0 18px 40px -16px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06);
  --aics-shadow-window-soft: 0 60px 120px -20px rgba(0, 0, 0, 0.7), 0 24px 48px -16px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--aics-font);
  background: var(--aics-bg);
  color: var(--aics-fg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
  text-rendering: optimizeLegibility;
  transition: background-color 0.25s ease, color 0.25s ease;
}

::selection {
  background: var(--aics-accent-tint);
  color: var(--aics-fg);
}

/* type ramp */
.t-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--aics-fg-tertiary);
}
.t-display {
  font-size: clamp(40px, 6.2vw, 64px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.05;
  text-wrap: balance;
}
.t-h1 {
  font-size: clamp(28px, 3.6vw, 42px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.12;
  text-wrap: balance;
}
.t-h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.2;
}
.t-h3 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.3;
}
.t-body {
  font-size: 15px;
  line-height: 1.55;
  color: var(--aics-fg-secondary);
}
.t-caption {
  font-size: 13px;
  line-height: 1.45;
  color: var(--aics-fg-secondary);
}
.t-micro {
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--aics-fg-tertiary);
}
.t-mono { font-family: var(--aics-font-mono); }

/* container */
.container {
  max-width: var(--aics-max);
  margin: 0 auto;
  padding: 0 28px;
}
@media (max-width: 640px) {
  .container { padding: 0 20px; }
}

/* section spacing */
.section { padding: 96px 0; }
.section-lg { padding: 128px 0; }
.section-sm { padding: 64px 0; }
@media (max-width: 768px) {
  .section { padding: 64px 0; }
  .section-lg { padding: 80px 0; }
  .section-sm { padding: 48px 0; }
}

/* card */
.card {
  background: var(--aics-bg-elevated);
  border-radius: var(--aics-radius-md);
  box-shadow: var(--aics-shadow-card);
  transition:
    box-shadow 260ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 320ms cubic-bezier(0.22, 1, 0.36, 1),
    border-color 240ms ease;
  will-change: transform;
}
.card.hoverable:hover {
  box-shadow: var(--aics-shadow-hover);
  transform: translateY(-3px);
}

/* button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
  padding: 14px 22px;
  cursor: pointer;
  transition:
    background 200ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 240ms cubic-bezier(0.22, 1, 0.36, 1),
    color 180ms ease;
  user-select: none;
  white-space: nowrap;
  text-decoration: none;
  position: relative;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.985); transition-duration: 90ms; }
.btn-lg { padding: 18px 28px; font-size: 16px; }
.btn-sm { padding: 9px 14px; font-size: 13px; }
.btn-primary {
  background: var(--aics-accent);
  color: var(--aics-fg-on-accent);
  box-shadow: 0 6px 18px -6px rgba(0, 113, 227, 0.55);
}
.btn-primary:hover {
  background: var(--aics-accent-hover);
  box-shadow: 0 10px 28px -6px rgba(0, 113, 227, 0.55);
}
.btn-secondary {
  background: var(--aics-bg-grouped);
  color: var(--aics-fg);
  box-shadow: inset 0 0 0 1px var(--aics-border);
}
.btn-secondary:hover {
  background: var(--aics-bg-hover);
  box-shadow: inset 0 0 0 1px var(--aics-border-strong);
}
.btn-ghost {
  background: transparent;
  color: var(--aics-fg);
}
.btn-ghost:hover { background: var(--aics-bg-hover); }
.btn-link {
  background: transparent;
  color: var(--aics-accent);
  padding: 4px 0;
  border-radius: 4px;
  text-decoration: none;
  white-space: nowrap;
  font-family: inherit;
  font-weight: 500;
  font-size: 13.5px;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn-link:hover { color: var(--aics-accent-hover); }

/* tag / pill */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--aics-bg-grouped);
  color: var(--aics-fg-secondary);
  box-shadow: inset 0 0 0 1px var(--aics-border);
}
.tag.success { background: var(--aics-success-tint); color: var(--aics-success); box-shadow: none; }
.tag.warn { background: var(--aics-warn-tint); color: var(--aics-warn); box-shadow: none; }
.tag.accent { background: var(--aics-accent-tint); color: var(--aics-accent); box-shadow: none; }

/* ─── Reveal-on-scroll + load-time entry animations ─────────────────────────
 * Each .reveal element ships visible by default; once observed, the .in class
 * fires a quick translate→0. Children of .reveal-stagger get an additional
 * 60ms delay per index via --r-i (set inline in JSX).
 * On first load the hero uses .hero-entry > * with stair-stepped delays so
 * the page lands with a deliberate sequence rather than slamming in at once.
 */
.reveal {
  opacity: 1;
  transform: translateY(12px);
  transition: opacity 540ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 540ms cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--r-delay, 0ms);
  will-change: transform, opacity;
}
.reveal.in {
  opacity: 1;
  transform: none;
}

.reveal-stagger > * {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 600ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(var(--r-i, 0) * 70ms);
}
.reveal-stagger.in > * {
  opacity: 1;
  transform: none;
}

/* Hero entry — each child fades up on page load with a small stagger.
 * Uses a one-shot @keyframes (rather than a transition) so it runs even if
 * the iframe is throttled at mount time; ends with the natural opacity:1
 * baked into the keyframe's `to` step.
 */
.hero-fade {
  opacity: 0;
  transform: translateY(14px);
  animation: aics-hero-fade 720ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.hero-fade[data-i="0"] { animation-delay:  60ms; }
.hero-fade[data-i="1"] { animation-delay: 140ms; }
.hero-fade[data-i="2"] { animation-delay: 220ms; }
.hero-fade[data-i="3"] { animation-delay: 320ms; }
.hero-fade[data-i="4"] { animation-delay: 440ms; }
@keyframes aics-hero-fade {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* Subtle floating idle for the hero mockup — sits inside its own wrapper so
   the page-load translate animation doesn't fight the loop. */
.float-y {
  animation: aics-float-y 7s ease-in-out infinite;
}
@keyframes aics-float-y {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

/* Pulsing accent glow behind the hero. */
.glow-pulse {
  animation: aics-glow-pulse 11s ease-in-out infinite;
}
@keyframes aics-glow-pulse {
  0%, 100% { opacity: 0.7; transform: translateX(-50%) scale(1); }
  50%      { opacity: 1.0; transform: translateX(-50%) scale(1.04); }
}

/* Shimmer for the version pill in the hero. */
@keyframes aics-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-stagger > *, .hero-entry > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }
  .float-y, .glow-pulse { animation: none !important; }
  html { scroll-behavior: auto; }
}

/* utility */
.flex { display: flex; }
.center { display: flex; align-items: center; justify-content: center; }
.col { display: flex; flex-direction: column; }
.grow { flex: 1; }
.divider {
  height: 1px;
  background: var(--aics-border);
  width: 100%;
}

/* nav */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  height: 56px;
  display: flex;
  align-items: center;
  transition: background-color 220ms ease, backdrop-filter 220ms ease, border-color 220ms ease;
  background: transparent;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: var(--aics-bg-titlebar);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom-color: var(--aics-border);
}
.nav .inner {
  width: 100%;
  max-width: var(--aics-max);
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav .links {
  display: flex;
  gap: 28px;
  flex: 1;
  justify-content: center;
}
.nav .links a {
  color: var(--aics-fg-secondary);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  position: relative;
  padding: 4px 0;
  transition: color 200ms ease;
}
.nav .links a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -2px;
  width: 0;
  height: 1.5px;
  background: var(--aics-accent);
  border-radius: 2px;
  transform: translateX(-50%);
  transition: width 240ms cubic-bezier(0.22, 1, 0.36, 1);
}
.nav .links a:hover {
  color: var(--aics-fg);
}
.nav .links a:hover::after {
  width: 100%;
}
@media (max-width: 768px) {
  .nav .links { display: none; }
  .nav .inner { padding: 0 20px; gap: 16px; }
}

/* hero */
.hero {
  position: relative;
  padding-top: 140px;
  padding-bottom: 64px;
  overflow: hidden;
}
.hero-glow {
  position: absolute;
  top: -10%;
  left: 50%;
  width: 1200px;
  height: 700px;
  transform: translateX(-50%);
  background:
    radial-gradient(ellipse at 50% 40%, var(--aics-accent-tint) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
  opacity: 0.9;
}
[data-theme="dark"] .hero-glow { opacity: 0.7; }

/* macOS-window mockup */
.osw {
  position: relative;
  background: var(--aics-bg-elevated);
  border-radius: 14px;
  box-shadow: var(--aics-shadow-window), var(--aics-shadow-window-soft);
  overflow: hidden;
}
.osw-titlebar {
  height: 36px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 8px;
  background: var(--aics-bg-titlebar);
  border-bottom: 1px solid var(--aics-border);
}
.osw-dot { width: 12px; height: 12px; border-radius: 50%; }
.osw-dot.r { background: #ff5f57; }
.osw-dot.y { background: #febc2e; }
.osw-dot.g { background: #28c840; }
.osw-title {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: var(--aics-fg-tertiary);
  font-weight: 500;
  margin-right: 50px; /* offset for traffic lights */
}

/* feature grid icon tile */
.feat-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--aics-bg-grouped);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--aics-fg);
}
.feat-icon.accent {
  background: var(--aics-accent-tint);
  color: var(--aics-accent);
}

/* faq accordion */
.faq-item {
  border-top: 1px solid var(--aics-border);
  transition: background 220ms ease;
}
.faq-item:hover {
  background: var(--aics-bg-hover);
}
.faq-item:last-child { border-bottom: 1px solid var(--aics-border); }
.faq-q {
  width: 100%;
  background: transparent;
  border: 0;
  text-align: left;
  padding: 22px 4px;
  font-family: inherit;
  font-size: 17px;
  font-weight: 600;
  color: var(--aics-fg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: color 200ms ease;
}
.faq-q .chev {
  transition: transform 360ms cubic-bezier(0.22, 1, 0.36, 1);
  color: var(--aics-fg-tertiary);
  flex-shrink: 0;
}
.faq-item.open .faq-q .chev { transform: rotate(180deg); color: var(--aics-accent); }
.faq-item.open .faq-q { color: var(--aics-fg); }
.faq-a {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition:
    max-height 420ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 280ms ease;
}
.faq-item.open .faq-a {
  max-height: 600px;
  opacity: 1;
  transition:
    max-height 520ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 320ms ease 80ms;
}
.faq-a-inner {
  padding: 0 4px 22px 4px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--aics-fg-secondary);
  max-width: 680px;
}

/* anti-counterfeit banner */
.alert-strip {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  background: var(--aics-warn-tint);
  border: 1px solid rgba(255, 159, 10, 0.32);
  border-radius: 12px;
  font-size: 14px;
  color: var(--aics-fg);
}

/* footer */
footer {
  padding: 56px 0 40px;
  border-top: 1px solid var(--aics-border);
  background: var(--aics-bg-grouped);
  color: var(--aics-fg-secondary);
  font-size: 13.5px;
}
