/* Agave Space — Shared Styles
   Colors aligned with iOS app design tokens:
   packages/shared/src/design-tokens/colors.json
   packages/kio-flow-ios/src/contexts/ThemeContext.tsx (dark mode)
*/
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #2359DD; /* design-tokens-ignore: standalone site token defs, mirror of colors.json */
    --primary-dark: #1E3A6F; /* design-tokens-ignore: standalone site token defs, mirror of colors.json */
    --functional-blue: #4169E1; /* design-tokens-ignore: standalone site token defs, mirror of colors.json */
    --message-blue: #5B7FDE; /* design-tokens-ignore: standalone site token defs, mirror of colors.json */
    --bg: #121212; /* design-tokens-ignore: standalone site token defs, mirror of colors.json */
    --card: #1E1E1E; /* design-tokens-ignore: standalone site token defs, mirror of colors.json */
    --text: #E1E7EF; /* design-tokens-ignore: standalone site token defs, mirror of colors.json */
    --text-secondary: #A1B0C7; /* design-tokens-ignore: standalone site token defs, mirror of colors.json */
    --border: #303742; /* design-tokens-ignore: standalone site token defs, mirror of colors.json */
    --success: #22C55E; /* design-tokens-ignore: standalone site token defs, mirror of colors.json */
    --disabled: #495163; /* design-tokens-ignore: standalone site token defs, mirror of colors.json */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

/* Navigation */
nav.site-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    max-width: 1200px;
    margin: 0 auto;
    border-bottom: 1px solid var(--border);
}
nav.site-nav .logo {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    letter-spacing: 0.05em;
}
nav.site-nav .nav-right {
    display: flex;
    align-items: center;
    gap: 24px;
}
nav.site-nav .nav-links {
    display: flex;
    gap: 24px;
    list-style: none;
}
/* lang-switch sits in nav — drop the standalone bottom margin */
nav.site-nav .lang-switch {
    margin-bottom: 0;
}
nav.site-nav .nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}
nav.site-nav .nav-links a:hover {
    color: var(--text);
}
nav.site-nav .nav-links a.active {
    color: var(--functional-blue);
}

/* Main content container */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 40px 80px;
}

/* Hero */
.hero {
    text-align: center;
    padding: 80px 20px 60px;
}
.hero h1 {
    font-size: 3.2rem;
    font-weight: 300;
    letter-spacing: 0.08em;
    color: var(--text);
    margin-bottom: 16px;
}
.hero .tagline {
    font-size: 1.3rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 40px;
}

/* Section headings */
.section { margin-bottom: 60px; }
.section h2 {
    font-size: 1.8rem;
    font-weight: 400;
    color: var(--text);
    margin-bottom: 20px;
    letter-spacing: 0.03em;
}
.section h3 {
    font-size: 1.2rem;
    color: var(--text);
    margin: 24px 0 12px;
}

/* Feature grid */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 40px;
}
.feature-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 30px;
    transition: border-color 0.2s;
}
.feature-card:hover {
    border-color: var(--functional-blue);
}
.feature-card .icon {
    font-size: 2rem;
    margin-bottom: 16px;
}
.feature-card h3 {
    font-size: 1.1rem;
    color: var(--text);
    margin: 0 0 8px;
}
.feature-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* Pricing cards */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 40px;
}
.pricing-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px 30px;
    text-align: center;
    transition: transform 0.2s, border-color 0.2s;
}
.pricing-card:hover {
    transform: translateY(-4px);
    border-color: var(--functional-blue);
}
.pricing-card.featured {
    border-color: var(--primary);
    background: #1a2340; /* design-tokens-ignore: featured pricing card, standalone site */
}
.pricing-card .plan-name {
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 8px;
}
.pricing-card .price {
    font-size: 2.8rem;
    font-weight: 300;
    color: var(--primary);
    margin-bottom: 4px;
}
.pricing-card .price span {
    font-size: 1rem;
    color: var(--text-secondary);
}
.pricing-card .plan-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}
.pricing-card ul {
    list-style: none;
    text-align: left;
    margin-bottom: 30px;
}
.pricing-card li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
    color: var(--text);
}
.pricing-card li::before {
    content: "\2713  ";
    color: var(--success);
}

/* CTA button */
.cta {
    display: inline-block;
    padding: 12px 32px;
    background: var(--primary);
    border: none;
    border-radius: 8px;
    color: #fff;
    text-decoration: none;
    font-size: 0.95rem;
    transition: background 0.2s;
}
.cta:hover {
    background: var(--functional-blue);
}
.cta.cta-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}
.cta.cta-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Language switcher */
.lang-switch {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 24px;
    font-size: 0.85rem;
}
.lang-switch a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    transition: all 0.2s;
}
.lang-switch a:hover {
    border-color: var(--primary);
    color: var(--text);
}
.lang-switch a.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Legal pages */
.legal h1 {
    font-size: 2rem;
    font-weight: 400;
    color: var(--text);
    margin-bottom: 8px;
}
.legal .last-updated {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
}
.legal h2 {
    font-size: 1.3rem;
    color: var(--text);
    margin: 32px 0 12px;
    font-weight: 500;
}
.legal .content {
    color: var(--text-secondary);
    white-space: pre-line;
    margin-bottom: 16px;
}

/* Footer */
footer.site-footer {
    border-top: 1px solid var(--border);
    padding: 30px 40px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--disabled);
    max-width: 1200px;
    margin: 0 auto;
}
footer.site-footer a {
    color: var(--text-secondary);
    text-decoration: none;
    margin: 0 12px;
}
footer.site-footer a:hover { color: var(--primary); }
footer.site-footer .links { margin-bottom: 12px; }

/* Mobile responsive */
@media (max-width: 768px) {
    nav.site-nav { padding: 16px 20px; flex-direction: column; gap: 12px; }
    nav.site-nav .nav-right { flex-direction: column; gap: 12px; }
    nav.site-nav .nav-links { gap: 16px; }
    .hero h1 { font-size: 2.2rem; }
    .hero .tagline { font-size: 1.1rem; }
    .container { padding: 20px 20px 60px; }
    .pricing-card .price { font-size: 2.2rem; }
}

/* ─────────────────────────────────────────────
   /flow landing: voice demo, focus, reduced-motion
   (appended — reuses the shared color tokens above)
   ───────────────────────────────────────────── */

/* Accessible focus ring for keyboard users */
a:focus-visible,
.cta:focus-visible {
    outline: 2px solid var(--functional-blue);
    outline-offset: 3px;
    border-radius: 4px;
}

/* 44px minimum touch targets (iOS HIG) */
nav.site-nav .nav-links a,
.lang-switch a,
.cta {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}
.cta { justify-content: center; }

/* Voice demo panel */
.voice-demo {
    display: flex;
    justify-content: center;
    padding: 0 20px 48px;
}
.demo-animation {
    display: grid;
    width: 100%;
    max-width: 480px;
    min-height: 168px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px 28px;
    overflow: hidden;
}
.demo-stage {
    grid-area: 1 / 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    text-align: center;
    opacity: 0;
    transform: translateY(8px);
    animation-duration: 8s;
    animation-iteration-count: infinite;
}
.demo-listening { animation-name: demo-listening; }
.demo-transcript { animation-name: demo-transcript; }
.demo-polished { animation-name: demo-polished; }
.demo-label {
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-secondary);
}
.demo-text {
    font-size: 1.15rem;
    line-height: 1.5;
    max-width: 360px;
    color: var(--text-secondary);
}
.demo-polished .demo-text {
    color: var(--text);
    font-weight: 500;
}
.demo-waveform {
    display: flex;
    align-items: center;
    gap: 5px;
    height: 44px;
}
.demo-waveform span {
    display: block;
    width: 4px;
    height: 100%;
    border-radius: 2px;
    background: var(--functional-blue);
    transform: scaleY(0.25);
    animation: demo-wave 1.1s ease-in-out infinite;
}
.demo-waveform span:nth-child(1) { animation-delay: -1.0s; }
.demo-waveform span:nth-child(2) { animation-delay: -0.8s; }
.demo-waveform span:nth-child(3) { animation-delay: -0.6s; }
.demo-waveform span:nth-child(4) { animation-delay: -0.4s; }
.demo-waveform span:nth-child(5) { animation-delay: -0.6s; }
.demo-waveform span:nth-child(6) { animation-delay: -0.8s; }
.demo-waveform span:nth-child(7) { animation-delay: -1.0s; }

@keyframes demo-wave {
    0%, 100% { transform: scaleY(0.25); }
    50% { transform: scaleY(1); }
}
@keyframes demo-listening {
    0%, 28% { opacity: 1; transform: none; }
    34%, 100% { opacity: 0; transform: translateY(-8px); }
}
@keyframes demo-transcript {
    0%, 28%, 66%, 100% { opacity: 0; transform: translateY(8px); }
    34%, 60% { opacity: 1; transform: none; }
}
@keyframes demo-polished {
    0%, 60%, 100% { opacity: 0; transform: translateY(8px); }
    66%, 94% { opacity: 1; transform: none; }
}

/* Small phones: no horizontal overflow at 320px */
@media (max-width: 400px) {
    .hero { padding: 56px 16px 40px; }
    .hero h1 { font-size: 2rem; }
    .voice-demo { padding: 0 12px 36px; }
    .demo-animation { padding: 24px 18px; }
    .demo-text { font-size: 1.05rem; }
}

/* Respect reduced-motion: freeze on the polished result */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
    .demo-listening, .demo-transcript { display: none; }
    .demo-polished { opacity: 1; transform: none; }
}
