/* Gainday public site — design tokens mirror the iOS AppColors + typography.
 * Dark theme default (OLED-optimized); light theme via prefers-color-scheme.
 * Single stylesheet covers landing + legal + support pages. */

:root {
    /* Brand — never swaps with trend scheme (iOS rule) */
    --brand-green: #34C759;
    --brand-green-ghost: rgba(52, 199, 89, 0.14);
    --brand-green-border: rgba(52, 199, 89, 0.35);
    --pro-gold: #E6C066;
    --pro-gold-deep: #B68A2E;
    --danger: #FF3B30;

    /* Dark theme surfaces */
    --bg: #000000;
    --surface: #1C1C1E;
    --surface-elevated: #2C2C2E;
    --divider: rgba(84, 84, 88, 0.5);
    --text-primary: #FFFFFF;
    --text-secondary: rgba(235, 235, 245, 0.72);
    --text-tertiary: rgba(235, 235, 245, 0.48);

    /* Typography */
    --font-brand: Georgia, Cambria, "Times New Roman", Times, serif;
    --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, sans-serif;
    --font-mono: "SF Mono", "Menlo", "Consolas", monospace;

    /* Layout */
    --max-content: 960px;
    --max-hero: 1200px;
    --radius-card: 16px;
    --radius-button: 980px; /* pill */
}

@media (prefers-color-scheme: light) {
    :root {
        --bg: #F2F2F7;
        --surface: #FFFFFF;
        --surface-elevated: #F9F9FB;
        --divider: rgba(60, 60, 67, 0.12);
        --text-primary: #1C1C1E;
        --text-secondary: rgba(60, 60, 67, 0.72);
        --text-tertiary: rgba(60, 60, 67, 0.48);
    }
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.55;
    color: var(--text-primary);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; display: block; }
a { color: var(--brand-green); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Header ────────────────────────────────────────────────────────────── */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--divider);
}
@media (prefers-color-scheme: light) {
    .site-header { background: rgba(242, 242, 247, 0.82); }
}
.site-header__inner {
    max-width: var(--max-hero);
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.brand {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    color: var(--text-primary);
    font-family: var(--font-brand);
    font-weight: 700;
    font-size: 22px;
    text-decoration: none;
    background: linear-gradient(90deg, var(--brand-green), rgba(52, 199, 89, 0.75));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.brand__sub {
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    -webkit-text-fill-color: var(--text-secondary);
}
.nav { display: flex; gap: 28px; align-items: center; }
.nav a {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: color .15s;
}
.nav a:hover { color: var(--text-primary); }
.lang-switch {
    display: inline-flex;
    border: 1px solid var(--divider);
    border-radius: var(--radius-button);
    padding: 2px;
    background: var(--surface);
}
.lang-switch a {
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    border-radius: var(--radius-button);
    text-decoration: none;
    transition: background .15s, color .15s;
}
.lang-switch a.active {
    background: var(--brand-green-ghost);
    color: var(--brand-green);
}
.lang-switch a:hover:not(.active) { color: var(--text-primary); }

/* ── Hero ──────────────────────────────────────────────────────────────── */

.hero {
    padding: 96px 24px 64px;
    text-align: center;
    max-width: var(--max-hero);
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: "";
    position: absolute;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--brand-green-ghost) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}
.hero > * { position: relative; z-index: 1; }
.hero__pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-button);
    background: var(--brand-green-ghost);
    border: 1px solid var(--brand-green-border);
    color: var(--brand-green);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    margin-bottom: 24px;
}
.hero h1 {
    font-family: var(--font-brand);
    font-size: clamp(44px, 7vw, 84px);
    line-height: 1.02;
    letter-spacing: -0.03em;
    margin: 0 0 20px;
    font-weight: 700;
}
.hero h1 span {
    background: linear-gradient(135deg, var(--brand-green), var(--pro-gold));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero p.subtitle {
    font-size: clamp(17px, 2vw, 21px);
    color: var(--text-secondary);
    max-width: 620px;
    margin: 0 auto 40px;
    line-height: 1.5;
}

.cta-row {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: var(--radius-button);
    font-weight: 600;
    font-size: 16px;
    font-family: inherit;
    text-decoration: none;
    transition: transform .1s, box-shadow .15s;
    border: none;
    cursor: pointer;
}
.btn-primary {
    background: var(--brand-green);
    color: #FFFFFF;
    box-shadow: 0 4px 18px rgba(52, 199, 89, 0.35);
}
.btn-primary:hover {
    transform: translateY(-1px);
    text-decoration: none;
    box-shadow: 0 6px 24px rgba(52, 199, 89, 0.45);
}
.btn-ghost {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--divider);
}
.btn-ghost:hover {
    border-color: var(--text-secondary);
    text-decoration: none;
}

/* ── Feature grid ──────────────────────────────────────────────────────── */

.features {
    padding: 64px 24px;
    max-width: var(--max-hero);
    margin: 0 auto;
}
.features h2 {
    text-align: center;
    font-size: clamp(30px, 4vw, 44px);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 16px;
}
.features > p.lead {
    text-align: center;
    color: var(--text-secondary);
    font-size: 17px;
    max-width: 620px;
    margin: 0 auto 56px;
}
.feature-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.feature-card {
    background: var(--surface);
    border-radius: var(--radius-card);
    padding: 28px;
    border: 1px solid var(--divider);
    transition: border-color .2s;
}
.feature-card:hover { border-color: var(--brand-green-border); }
.feature-card__icon {
    width: 44px;
    height: 44px;
    border-radius: 11px;
    background: var(--brand-green-ghost);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    color: var(--brand-green);
}
.feature-card__icon svg { width: 22px; height: 22px; }
.feature-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px;
}
.feature-card p {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.55;
    margin: 0;
}
.feature-card.gold .feature-card__icon {
    background: linear-gradient(135deg, rgba(230, 192, 102, 0.25), rgba(182, 138, 46, 0.25));
    color: var(--pro-gold);
}
.feature-card.gold:hover { border-color: rgba(230, 192, 102, 0.45); }

/* ── Pricing ───────────────────────────────────────────────────────────── */

.pricing {
    padding: 64px 24px;
    max-width: var(--max-content);
    margin: 0 auto;
}
.pricing h2 {
    text-align: center;
    font-size: clamp(30px, 4vw, 44px);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 16px;
}
.pricing > p.lead {
    text-align: center;
    color: var(--text-secondary);
    margin: 0 0 48px;
}
.tier-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.tier {
    background: var(--surface);
    border: 1px solid var(--divider);
    border-radius: var(--radius-card);
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.tier--gold {
    background: linear-gradient(180deg, rgba(230, 192, 102, 0.08), transparent 40%), var(--surface);
    border-color: rgba(230, 192, 102, 0.4);
}
.tier__name {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-secondary);
}
.tier--gold .tier__name { color: var(--pro-gold); }
.tier__price {
    font-family: var(--font-brand);
    font-size: 40px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
}
.tier__price small {
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-tertiary);
}
.tier__yearly {
    margin-top: -6px;
    font-size: 13px;
    color: var(--text-tertiary);
    font-weight: 500;
}
.tier__yearly strong {
    color: var(--text-secondary);
    font-weight: 600;
}
.tier__save {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 10px;
    background: var(--brand-green-ghost);
    color: var(--brand-green);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
}
.tier--gold .tier__save {
    background: rgba(230, 192, 102, 0.18);
    color: var(--pro-gold);
}
.tier__features {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.tier__features li {
    padding-left: 26px;
    position: relative;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.4;
}
.tier__features li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 3px;
    width: 16px;
    height: 16px;
    background: var(--brand-green-ghost);
    border-radius: 50%;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%2334C759' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='3.5 8 6.5 11 12.5 5'/></svg>");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 12px;
}
.tier--gold .tier__features li::before {
    background-color: rgba(230, 192, 102, 0.18);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23E6C066' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='3.5 8 6.5 11 12.5 5'/></svg>");
}

/* ── Long-form (legal / support) ───────────────────────────────────────── */

.prose {
    max-width: var(--max-content);
    margin: 0 auto;
    padding: 48px 24px 96px;
}
.prose h1 {
    font-family: var(--font-brand);
    font-size: clamp(36px, 5vw, 52px);
    letter-spacing: -0.02em;
    margin: 0 0 8px;
}
.prose > .meta {
    color: var(--text-tertiary);
    font-size: 14px;
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--divider);
}
.prose h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 56px 0 16px;
    letter-spacing: -0.01em;
}
.prose h3 {
    font-size: 17px;
    font-weight: 700;
    margin: 32px 0 12px;
    color: var(--text-primary);
}
.prose p { margin: 0 0 16px; color: var(--text-secondary); }
.prose ul, .prose ol { color: var(--text-secondary); padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose strong { color: var(--text-primary); font-weight: 600; }
.prose code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--surface-elevated);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--text-primary);
}
.prose table {
    border-collapse: collapse;
    width: 100%;
    margin: 16px 0;
    font-size: 14px;
}
.prose th, .prose td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--divider);
    color: var(--text-secondary);
}
.prose th { color: var(--text-primary); font-weight: 600; }
.prose blockquote {
    margin: 24px 0;
    padding: 12px 18px;
    border-left: 3px solid var(--brand-green);
    background: var(--surface);
    border-radius: 0 8px 8px 0;
    color: var(--text-secondary);
}

/* Language sections for legal docs — show/hide via :target + nav tabs */
.lang-section {
    display: none;
}
.lang-section.active { display: block; }

/* ── FAQ ───────────────────────────────────────────────────────────────── */

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
}
.faq-item {
    background: var(--surface);
    border: 1px solid var(--divider);
    border-radius: 12px;
    overflow: hidden;
}
.faq-item summary {
    padding: 18px 22px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-primary);
    font-size: 15px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: "+";
    font-size: 22px;
    font-weight: 300;
    color: var(--text-tertiary);
    transition: transform .2s;
}
.faq-item[open] summary::after {
    content: "−";
    transform: rotate(0);
    color: var(--brand-green);
}
.faq-item .body {
    padding: 0 22px 20px;
    color: var(--text-secondary);
    font-size: 14.5px;
    line-height: 1.6;
}
.faq-item .body p { margin: 0 0 10px; }
.faq-item .body p:last-child { margin-bottom: 0; }

/* ── Footer ────────────────────────────────────────────────────────────── */

.site-footer {
    border-top: 1px solid var(--divider);
    padding: 40px 24px 64px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 13px;
    max-width: var(--max-hero);
    margin: 0 auto;
}
.site-footer nav {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.site-footer nav a {
    color: var(--text-secondary);
    text-decoration: none;
}
.site-footer nav a:hover { color: var(--text-primary); }

/* ── Responsive tweaks ─────────────────────────────────────────────────── */

@media (max-width: 640px) {
    .site-header__inner { padding: 12px 16px; gap: 12px; }
    .nav { display: none; } /* simplify mobile; language switch stays */
    .hero { padding: 64px 16px 48px; }
    .features, .pricing, .prose { padding-left: 16px; padding-right: 16px; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
    html { scroll-behavior: auto; }
}
