/* Smooth anchor scrolling (hero "Start Free Trial" → #signup form) */
html {
    scroll-behavior: smooth;
}

:root {
    /* Colors - Blue SaaS Theme */
    --surface: #f8f9ff;
    --surface-container: #e5eeff;
    --surface-container-low: #eff4ff;
    --surface-container-lowest: #ffffff;
    --on-surface: #0b1c30;
    --on-surface-variant: #434656;
    --primary: #003ec7;
    --primary-container: #0052ff;
    --on-primary: #ffffff;
    --secondary: #495f84;
    --secondary-container: #bcd2fe;
    --on-secondary: #ffffff;
    --tertiary: #464f5b;
    --tertiary-container: #dde6f5;
    --error: #ba1a1a;
    --error-container: #ffdad6;
    --outline: #737688;
    --outline-variant: #c3c5d9;
    
    /* Typography */
    --font-heading: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Spacing */
    --container-margin: 24px;
    --gutter: 16px;
    --unit: 8px;
    --touch-target: 44px;

    /* Width of the blog listing grid. The post detail article uses the same
       token so an article lines up edge-to-edge with the cards on /blog —
       they used to differ (grid 1000px, article full viewport width), which
       made the article look like a different site. */
    --blog-content-width: 1000px;

    /* Footer palette.
       The footer is the one dark surface on an otherwise light page, the way
       most AI/dev-tool sites close their pages: near-black ground, a bright
       primary line, and muted secondary text that still clears WCAG AA by a
       wide margin. Measured against --footer-bg (#08182b):

         --footer-fg        #e8eef7  13.90:1  (large "built with" line, quote)
         --footer-link      #cbd5e1  12.03:1  (nav links at rest)
         --footer-fg-muted  #a3b1c2   8.19:1  (body copy under the quote)
         --footer-fg-subtle #94a3b8   6.97:1  (contact row, fine print)
         --footer-accent    #7dd3fc  10.71:1  (hover / focus)

       Deliberately NOT reused from --surface-container / --on-surface: those
       are page-surface tokens, and the footer has to stay dark even if the
       light palette is retuned. */
    --footer-bg: #08182b;
    --footer-bg-soft: #0d2135;
    --footer-fg: #e8eef7;
    --footer-link: #cbd5e1;
    --footer-fg-muted: #a3b1c2;
    --footer-fg-subtle: #94a3b8;
    --footer-accent: #7dd3fc;
    /* Hairlines and dividers are white at low alpha, not a grey token: over a
       near-black ground a solid grey reads as a bright line. */
    --footer-border: rgba(255, 255, 255, 0.12);
    --footer-border-strong: rgba(255, 255, 255, 0.18);
}

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

body {
    font-family: var(--font-body);
    background: var(--surface);
    color: var(--on-surface);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Top App Bar */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--surface);
    border-bottom: 1px solid var(--outline-variant);
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--container-margin);
}

.site-header .logo {
    display: flex;
    align-items: center;
    gap: var(--unit);
    text-decoration: none;
    color: var(--primary);
    font-weight: 700;
    font-size: 1.25rem;
}

.site-header .logo-icon,
.site-header .logo-mark {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: block;
    flex: 0 0 auto;
}

/* Lang Switcher */
.site-header .lang-switcher {
    display: flex;
    gap: 8px;
}

.site-header .lang-switcher a {
    font-size: 13px;
    font-weight: 500;
    color: var(--on-surface-variant);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.2s;
}

.site-header .lang-switcher a:hover {
    background: var(--surface-container);
}

.site-header .lang-switcher a.active {
    background: var(--primary-container);
    color: var(--on-primary);
}

/* Header HTML Block — constrains images/banners so they don't overflow the header area */
.html-block-header {
    width: 100%;
}
.html-block-header .header-block-inner {
    max-height: 300px;
    overflow: hidden;
    width: 100%;
}
.html-block-header img,
.header-block-inner img {
    max-height: 300px;
    max-width: 100%;
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto;
    object-fit: contain;
}

/* Main Content */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: calc(var(--container-margin) * 2) var(--container-margin);
    position: relative;
}

/* Atmospheric Background */
main::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: 0.4;
    overflow: hidden;
    pointer-events: none;
}

main::before {
    background: 
        radial-gradient(circle at 80% 10%, var(--secondary-container) 0%, transparent 40%),
        radial-gradient(circle at 20% 90%, var(--primary-container) 0%, transparent 30%);
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--container-margin);
}

/* Hero Section */
.hero {
    text-align: center;
    max-width: 800px;
    margin-bottom: calc(var(--container-margin) * 3);
    position: relative;
}

.lang-switcher {
    font-size: 0.875rem;
}

.lang-switcher a {
    color: var(--on-surface-variant);
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.lang-switcher a:hover {
    color: var(--primary);
    background: var(--surface-variant);
}

.lang-switcher a.active {
    color: var(--on-primary);
    font-weight: 600;
    background: var(--primary-container);
}

.hero h1 {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: var(--gutter);
}

.hero .tagline {
    font-size: 1.125rem;
    color: var(--on-surface-variant);
    max-width: 500px;
    margin: 0 auto;
}

/* Sections */
section {
    padding: calc(var(--container-margin) * 3) 0;
}

section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: calc(var(--container-margin) * 2);
    text-align: center;
}

/* Features Grid */
.programs-section {
    background: var(--surface-container-low);
    width: 100%;
}

.programs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--container-margin);
    max-width: 1000px;
    margin: 0 auto;
}

.program-card {
    background: var(--surface-container-lowest);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: center;
}

.program-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.program-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.program-card .program-content {
    padding: var(--container-margin);
    padding-top: 0;
}

.program-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--unit);
    margin-top: 0.5rem;
}

.program-card p {
    color: var(--on-surface-variant);
    font-size: 0.9375rem;
}

.program-card .feature-icon {
    display: block;
    font-size: 3.5rem;
    color: var(--primary);
    padding: 2rem 1.5rem 0.5rem;
    text-align: center;
    margin: 0 auto;
}

/* Greeting Section */
.greeting-section {
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.greeting-section h1,
.greeting-section h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: var(--container-margin);
}

.greeting-section p {
    color: var(--on-surface-variant);
    margin-bottom: var(--unit);
}

.principal-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--container-margin);
    margin: var(--container-margin) 0;
}

.principal-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

/* News Section */
.news-section {
    text-align: center;
    background: var(--surface-container);
    width: 100%;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--container-margin);
    max-width: var(--blog-content-width);
    margin: 0 auto;
}

.post-card {
    background: var(--surface-container-lowest);
    padding: var(--container-margin);
    border-radius: 12px;
    text-align: left;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.post-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--unit);
}

.post-card .meta {
    color: var(--on-surface-variant);
    font-size: 0.875rem;
    margin-bottom: var(--unit);
}

.post-card .excerpt {
    color: var(--on-surface-variant);
    font-size: 0.9375rem;
    margin-bottom: var(--gutter);
}

.read-more {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
}

.read-more:hover {
    text-decoration: underline;
}

/* ── Blog post detail ─────────────────────────────────────────────────────
   The article shares --blog-content-width with .posts-grid so a post lines
   up with the /blog listing (same left/right edges). It previously had no
   rules at all in this theme: the fragment rendered bare <img>/<p>/<h2> with
   browser defaults inside a 1200px-wide container, while the listing was
   1000px — the two pages looked like different sites. These rules were
   inherited from the verdant theme the markup was copied from, but only the
   markup came across, not the stylesheet. */
.post-detail {
    width: 100%;
    max-width: var(--blog-content-width);
    margin: 0 auto;
}

.post-detail header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--outline-variant);
}

.post-detail h1 {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
    margin-bottom: 1rem;
}

/* The featured cover sits directly under the title, full article width.
   object-fit: cover crops a portrait photo instead of stretching it, which
   is what the inline style on the <img> requests. */
.post-detail > img {
    display: block;
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border: 1px solid var(--outline-variant);
    border-radius: 12px;
}

.post-detail .meta {
    font-size: 0.875rem;
    color: var(--on-surface-variant);
}

.post-detail .tag {
    display: inline-block;
    margin-right: 0.4rem;
    padding: 0.15rem 0.6rem;
    border: 1px solid var(--outline-variant);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--on-surface-variant);
    background: var(--surface-container-lowest);
}

/* Article body — the prose itself. */
.post-detail .content {
    font-size: 1.0625rem;
    line-height: 1.75;
    color: var(--on-surface);
    margin-top: 2rem;
}

.post-detail .content > *:first-child {
    margin-top: 0;
}

.post-detail .content p {
    margin-bottom: 1.25rem;
}

.post-detail .content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
    margin-top: 2.5rem;
    margin-bottom: 0.85rem;
}

.post-detail .content h3 {
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.35;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.post-detail .content a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.post-detail .content ul,
.post-detail .content ol {
    margin: 0 0 1.25rem 1.5rem;
}

.post-detail .content li {
    margin-bottom: 0.5rem;
}

.post-detail .content img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 1.5rem 0;
    border-radius: 8px;
}

.post-detail .content blockquote {
    margin: 1.5rem 0;
    padding: 0.25rem 0 0.25rem 1.25rem;
    border-left: 3px solid var(--secondary-container);
    color: var(--on-surface-variant);
}

.post-detail .content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
    line-height: 1.55;
}

.post-detail .content thead th {
    text-align: left;
    background: var(--surface-container-low);
    padding: 0.7rem 0.6rem;
    border-bottom: 1px solid var(--outline-variant);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.post-detail .content tbody td {
    padding: 0.7rem 0.6rem;
    border-bottom: 1px solid var(--outline-variant);
    vertical-align: top;
}

.post-detail .back-link {
    display: inline-block;
    margin-top: 2.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary);
    text-decoration: none;
}

.post-detail .back-link:hover {
    text-decoration: underline;
}

/* Static pages (post_type='page') — same reading column as an article so
   /terms, /privacy and a blog post don't jump between widths. */
.static-page {
    width: 100%;
    max-width: var(--blog-content-width);
    margin: 0 auto;
}

.static-page h1 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.static-page .page-content {
    font-size: 1.0625rem;
    line-height: 1.75;
}

.static-page .page-content p {
    margin-bottom: 1.25rem;
}

.static-page .page-content h2 {
    font-size: 1.5rem;
    margin-top: 2.5rem;
    margin-bottom: 0.85rem;
}

.static-page .page-content h3 {
    font-size: 1.2rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.static-page .page-content a {
    color: var(--primary);
}

.static-page .page-content ul,
.static-page .page-content ol {
    margin: 0 0 1.25rem 1.5rem;
}

@media (max-width: 768px) {
    .post-detail h1 {
        font-size: 1.875rem;
    }

    .post-detail .content {
        font-size: 1rem;
    }

    .static-page h1 {
        font-size: 1.75rem;
    }
}

/* CTA Button */
.button {
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--primary);
    color: var(--on-primary);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: none;
    cursor: pointer;
}

.button:hover {
    background: var(--primary-container);
    transform: scale(1.02);
}

.button:active {
    transform: scale(0.98);
}

/* Hero Section */
.hero-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: transparent;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(10, 37, 64, 0.18);
}

.hero-icon img {
    width: 80px;
    height: 80px;
    display: block;
    border-radius: 20px;
}

/* CTA Section */
.cta-section {
    text-align: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-container) 100%);
    color: var(--on-primary);
    width: 100%;
    padding: 4rem var(--container-margin);
}

/* FAQ Section */
.faq-section {
    width: 100%;
    padding: 4rem var(--container-margin);
    background: var(--surface);
}
.faq-section h2 {
    text-align: center;
    color: var(--on-surface);
}
.faq-section .section-subtitle {
    text-align: center;
    color: var(--on-surface-variant);
    max-width: 60ch;
    margin: 0 auto 2rem;
}
.faq-list {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.faq-item {
    background: var(--surface-container-lowest);
    border: 1px solid var(--outline-variant);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    transition: box-shadow 160ms ease, border-color 160ms ease;
}
.faq-item[open] {
    border-color: var(--secondary);
    box-shadow: 0 4px 16px rgba(10, 37, 64, 0.08);
}
.faq-item summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--on-surface);
    list-style: none;
    padding-right: 1.5rem;
    position: relative;
    line-height: 1.4;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: '+';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.4rem;
    color: var(--secondary);
    line-height: 1;
    transition: transform 160ms ease;
}
.faq-item[open] summary::after {
    content: '\2212';
    transform: translateY(-50%) rotate(0deg);
}
.faq-item p {
    margin: 0.75rem 0 0;
    color: var(--on-surface-variant);
    line-height: 1.55;
}

/* In-page links inside FAQ answers (e.g. the price answer → #pricing). */
.faq-item p a {
    color: var(--secondary);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.faq-item p a:hover {
    text-decoration-thickness: 2px;
}

/* Footer CTA — last block above the site footer. Deliberately lighter than
   the blue .cta-section above the FAQ: the form already screamed once, this
   is a calm last reminder with a single link back up to #signup. */
.footer-cta-section {
    width: 100%;
    padding: 3.5rem var(--container-margin);
    background: var(--surface-container);
    border-top: 1px solid var(--outline-variant);
    text-align: center;
}
.footer-cta-section .container {
    max-width: 720px;
}
.footer-cta-eyebrow {
    margin: 0 0 0.5rem;
    color: var(--secondary);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.footer-cta-title {
    margin: 0 0 0.75rem;
    color: var(--on-surface);
    font-size: clamp(1.4rem, 3vw, 1.9rem);
    line-height: 1.3;
    text-wrap: balance;
}
.footer-cta-text {
    margin: 0 auto 1.5rem;
    max-width: 52ch;
    color: var(--on-surface-variant);
    line-height: 1.6;
}
.footer-cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}
.footer-cta-button span {
    transition: transform 160ms ease;
}
.footer-cta-button:hover span {
    transform: translateX(3px);
}
.footer-cta-note {
    margin: 1rem 0 0;
    color: var(--on-surface-variant);
    font-size: 0.85rem;
}

.cta-section h2 {
    color: var(--on-primary);
}

.cta-section p {
    max-width: 500px;
    margin: 0 auto 2rem;
    opacity: 0.9;
}

.cta-section .button {
    background: white;
    color: var(--primary);
}

.cta-section .button:hover {
    background: var(--surface-container-lowest);
    transform: scale(1.05);
}

/* Embedded beta-signup form (moved from the /beta-signup page).
   Sits on the blue gradient, so it uses a white card with dark inputs
   (the inverse of the valid form's glass card on a light surface). */
#signup {
    scroll-margin-top: 2rem;   /* headroom when button/anchor scrolls here */
}

.signup-form-card {
    background: rgba(255, 255, 255, 0.92);
    border-radius: 12px;
    padding: 1.5rem 1.25rem;
    max-width: 640px;
    margin: 0 auto;
    box-shadow: 0 8px 24px rgba(0, 27, 61, 0.18);
    color: var(--on-surface);
    text-align: left;
}

.signup-form-card .signup-form-title {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--on-surface);
    margin: 0 0 1rem;
    text-align: center;
}

.signup-form-card .form-alert {
    display: none;
    padding: 0.65rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.signup-form-card .form-alert--show {
    display: block;
}

.signup-form-card .form-alert--success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.signup-form-card .form-alert--error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Plan pre-select chip — shown after a pricing card CTA is clicked. */
.form-plan-chip {
    padding: 0.65rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
    background: #eef3ff;
    color: var(--primary, #003ec7);
    border: 1px solid #c9d8ff;
}

.signup-form-card .form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.signup-form-card .form-field {
    flex: 1 1 0;
    min-width: 0;
}

.signup-form-card .form-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--on-surface-variant);
    margin-bottom: 0.35rem;
}

.signup-form-card .form-field input {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    background: var(--surface);
    border: 1px solid var(--outline-variant);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--on-surface);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.signup-form-card .form-field input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 62, 199, 0.12);
}

.signup-form-card .form-field input.error {
    border-color: var(--error);
}

/* Optional attribution block — collapsed by default so the form still looks
   like the two required fields. Styled as a quiet disclosure, not a step. */
.signup-form-card .signup-optional {
    margin: 0 0 1rem;
    border-top: 1px dashed var(--outline-variant);
    padding-top: 0.75rem;
}

.signup-form-card .signup-optional > summary {
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--secondary);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
}

.signup-form-card .signup-optional > summary::-webkit-details-marker {
    display: none;
}

.signup-form-card .signup-optional > summary::before {
    content: '+';
    font-size: 1rem;
    line-height: 1;
    font-weight: 700;
    color: var(--primary);
}

.signup-form-card .signup-optional[open] > summary::before {
    content: '\2212'; /* minus sign */
}

.signup-form-card .signup-optional[open] > summary {
    margin-bottom: 0.75rem;
}

.signup-form-card .signup-optional .form-row:last-child {
    margin-bottom: 0;
}

.signup-form-card .form-field select {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    background: var(--surface);
    border: 1px solid var(--outline-variant);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--on-surface);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--outline) 50%),
                      linear-gradient(135deg, var(--outline) 50%, transparent 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.signup-form-card .form-field select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 62, 199, 0.12);
}

.signup-form-card .signup-submit {
    width: 100%;
    height: 48px;
    background: var(--primary);
    color: var(--on-primary);
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 62, 199, 0.25);
    transition: background 0.2s, transform 0.2s;
}

.signup-form-card .signup-submit:hover {
    background: var(--primary-container);
    transform: scale(1.01);
}

.signup-form-card .signup-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.signup-form-card .signup-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--on-surface-variant);
    margin: 0.9rem auto 0;
    opacity: 1;
    max-width: none;
}

.signup-form-card .signup-note .material-symbols-outlined {
    font-size: 16px;
}

/* Consent line above the note: the signup form must disclose the terms
   before submission (payment-processor / app-store requirement). */
.signup-form-card .signup-consent {
    font-size: 0.78rem;
    line-height: 1.55;
    color: var(--on-surface-variant);
    text-align: center;
    margin: 0.9rem auto 0;
    max-width: 46ch;
}

.signup-form-card .signup-consent a {
    color: var(--secondary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

@media (max-width: 600px) {
    /* Every section already pads its sides by --container-margin; the nested
       .container adds a second 24px level (48px/side = 96px total), which
       left ~279px of content on a 375px phone — the pricing grid's
       minmax(300px) track overflowed and cards read as "too tight".
       Keep a single padding level on mobile. */
    .container {
        padding-left: 0;
        padding-right: 0;
    }

    .pricing-card {
        padding: 1.4rem 1.2rem;
    }

    .signup-form-card .form-row {
        flex-direction: column;
        gap: 0.75rem;
    }
}

/* Pain Points Section */
.pain-section {
    padding: calc(var(--container-margin) * 2.5) var(--container-margin);
    background: var(--surface);
    text-align: center;
}

.pain-section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--on-surface);
}

.pain-section .section-subtitle {
    color: var(--on-surface-variant);
    font-size: 1rem;
    margin-bottom: 2rem;
}

.pain-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    max-width: 1100px;
    margin: 0 auto;
}

.pain-card {
    background: var(--surface-container-lowest);
    border: 1px solid var(--outline-variant);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: left;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.pain-card .pain-icon {
    font-size: 1.75rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.pain-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
    color: var(--on-surface);
}

.pain-card p {
    color: var(--on-surface-variant);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Demo Section */
.demo-section {
    padding: calc(var(--container-margin) * 2.5) var(--container-margin);
    background: linear-gradient(180deg, var(--surface) 0%, var(--surface-container-low) 100%);
    text-align: center;
}

.demo-section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--on-surface);
}

.demo-section .section-subtitle {
    color: var(--on-surface-variant);
    font-size: 1rem;
    margin-bottom: 1.75rem;
}

.demo-video-wrapper {
    max-width: 900px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 62, 199, 0.08);
    border: 1px solid var(--outline-variant);
    background: var(--surface-container-lowest);
}

.demo-video-wrapper video {
    width: 100%;
    height: auto;   /* neutralize the literal height="720" attribute — without
                       this the box is 375px wide × 720px tall on phones and the
                       16:9 content letterboxes inside with big black bars */
    display: block;
    aspect-ratio: 16 / 9;
    background: #000;
}

/* Mobile: let the demo video go edge-to-edge (bypass the container's side
   padding) so it fills the viewport width — inside the padded container it
   renders ~330px wide × ~185px tall, which reads as "too small" on phones. */
@media (max-width: 600px) {
    .demo-video-wrapper {
        width: calc(100% + (var(--container-margin) * 2));
        margin-left: calc(-1 * var(--container-margin));
        margin-right: calc(-1 * var(--container-margin));
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
}

.demo-placeholder {
    aspect-ratio: 16 / 9;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top, rgba(0,82,255,0.08), transparent 60%), var(--surface-container-low);
    color: var(--on-surface-variant);
    padding: 1rem;
}

.demo-placeholder .demo-play {
    font-size: 3rem;
    color: var(--primary);
}

/* Pricing Section */
.pricing-section {
    padding: calc(var(--container-margin) * 2.5) var(--container-margin);
    text-align: center;
}

.pricing-section .section-subtitle {
    margin-bottom: 0;
}

/* Monthly / yearly billing switch */
.billing-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin: 1.5rem auto 0;
    padding: 0.25rem;
    background: var(--surface-container);
    border: 1px solid var(--outline-variant);
    border-radius: 999px;
}

.billing-toggle__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--on-surface-variant);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1;
    padding: 0.55rem 1.05rem;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.billing-toggle__btn:hover {
    color: var(--on-surface);
}

.billing-toggle__btn.is-active {
    background: var(--primary);
    color: var(--on-primary);
}

.billing-toggle__save {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: var(--secondary);
    color: var(--on-secondary);
    white-space: nowrap;
}

/* Both billing periods are rendered in the card; CSS shows one. With JS
   disabled the section keeps data-billing-mode="monthly", so a price is
   always visible. */
.pricing-section [data-billing-for="yearly"] {
    display: none;
}

.pricing-section[data-billing-mode="yearly"] [data-billing-for="monthly"] {
    display: none;
}

.pricing-section[data-billing-mode="yearly"] [data-billing-for="yearly"] {
    display: inline;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.25rem;
    max-width: 860px;
    margin: 2.5rem auto 0;
    align-items: stretch;
    text-align: left;
}

.pricing-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--surface-container-lowest);
    border: 1px solid var(--outline-variant);
    border-radius: 16px;
    padding: 1.75rem 1.5rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.pricing-card--featured {
    border: 2px solid var(--secondary);
    box-shadow: 0 8px 30px rgba(0, 82, 255, 0.10);
}

.pricing-badge {
    position: absolute;
    top: -0.85rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--secondary);
    color: var(--on-secondary);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.25rem 0.85rem;
    border-radius: 999px;
    white-space: nowrap;
}

.pricing-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--on-surface);
}

.plan-tag {
    color: var(--on-surface-variant);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.plan-price-row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0.75rem 0 0.25rem;
}

.plan-price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.01em;
}

.plan-price-unit {
    font-size: 0.85rem;
    color: var(--on-surface-variant);
}

.plan-regular {
    color: var(--on-surface-variant);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.plan-regular s {
    opacity: 0.75;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
    display: grid;
    gap: 0.55rem;
}

.plan-features li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.95rem;
    color: var(--on-surface);
}

.plan-features li .plan-check {
    font-size: 1.1rem;
    color: var(--secondary);
    flex: none;
    margin-top: 3px;
}

.pricing-cta {
    margin-top: auto;
    display: block;
    text-align: center;
    background: var(--primary);
    color: var(--on-primary);
    font-weight: 700;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    text-decoration: none;
    transition: opacity 0.15s ease;
}

.pricing-cta:hover {
    opacity: 0.88;
}

.pricing-card--featured .pricing-cta {
    background: var(--secondary);
}

/* Footer
   Dark ground on a light page. The rest of the site is a light blue surface,
   so the footer is the visual full stop — same idea as the closing blocks on
   most AI/dev-tool sites. All foreground colours are chosen against
   --footer-bg and clear WCAG AA (4.5:1) with margin; see the token block at
   the top of this file for the measured ratios. */
.site-footer {
    background: var(--footer-bg);
    /* Set the inherited colour too, not just the child rules: any element
       added inside the footer later (the nav wrapper included) would
       otherwise inherit body's dark on-surface colour and become invisible
       on this ground. */
    color: var(--footer-fg-muted);
    padding: calc(var(--container-margin) * 2.5) var(--container-margin) calc(var(--container-margin) * 2);
    text-align: center;
    border-top: 1px solid var(--footer-border);
}

.site-footer p {
    color: var(--footer-fg-muted);
    font-size: 0.9375rem;
}

.site-footer .footer-quote {
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--footer-fg);
}

.site-footer .footer-built {
    margin-top: calc(var(--container-margin) * 1.5);
    padding-top: calc(var(--container-margin) * 1.25);
    border-top: 1px solid var(--footer-border);
    font-family: var(--font-heading);
    font-size: clamp(1.75rem, 5vw, 3.5rem);
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1.2;
    color: var(--footer-fg);
    /* Was opacity: 0.85 over a light ground. On a dark ground a transparent
       white drops the ratio fast, so the value is set explicitly instead. */
    opacity: 1;
}

.site-footer .footer-built .footer-heart {
    color: #fca5a5;
    font-size: 0.9em;
}

/* Footer navigation + business contact (policy pages must be reachable
   from every page, not just the homepage) */
.site-footer .footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    justify-content: center;
    margin-top: calc(var(--container-margin) * 1.25);
}

.site-footer .footer-nav a {
    color: var(--footer-link);
    font-size: 0.9375rem;
    text-decoration: underline;
    text-decoration-color: var(--footer-border-strong);
    text-underline-offset: 3px;
    transition: color 160ms ease, text-decoration-color 160ms ease;
}

.site-footer .footer-nav a:hover,
.site-footer .footer-nav a:focus-visible {
    color: var(--footer-accent);
    text-decoration-color: currentColor;
}

.site-footer .footer-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    justify-content: center;
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: var(--footer-fg-subtle);
}

.site-footer .footer-contact a {
    color: var(--footer-fg-subtle);
    text-decoration: underline;
    text-decoration-color: var(--footer-border-strong);
    text-underline-offset: 3px;
    transition: color 160ms ease;
}

.site-footer .footer-contact a:hover,
.site-footer .footer-contact a:focus-visible {
    color: var(--footer-accent);
}

/* Legal documents (Terms / Privacy / Refund) */
.legal-section {
    padding: calc(var(--container-margin) * 2.5) 0;
}

.legal-section .container {
    max-width: 760px;
}

.legal-siblings {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.75rem;
    font-size: 0.875rem;
}

.legal-sibling {
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--outline-variant);
    border-radius: 999px;
    color: var(--on-surface-variant);
    text-decoration: none;
    white-space: nowrap;
}

a.legal-sibling:hover {
    border-color: var(--secondary);
    color: var(--on-surface);
}

.legal-sibling.is-current {
    background: var(--on-surface);
    border-color: var(--on-surface);
    color: #fff;
}

.legal-sibling--lang {
    margin-left: auto;
    border-style: dashed;
}

.legal-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    line-height: 1.2;
    margin: 0 0 0.5rem;
}

.legal-subtitle {
    color: var(--on-surface-variant);
    font-size: 0.975rem;
    line-height: 1.6;
    margin: 0 0 2rem;
}

.legal-toc {
    display: grid;
    gap: 0.3rem;
    padding: 1rem 1.25rem;
    margin-bottom: 2.25rem;
    background: var(--surface-container);
    border: 1px solid var(--outline-variant);
    border-radius: 8px;
    font-size: 0.9rem;
}

.legal-toc a {
    color: var(--on-surface-variant);
    text-decoration: none;
}

.legal-toc a:hover {
    color: var(--on-surface);
    text-decoration: underline;
}

.legal-block {
    margin-bottom: 1.9rem;
    scroll-margin-top: 1.5rem;
}

.legal-block h2 {
    font-size: 1.15rem;
    line-height: 1.35;
    margin: 0 0 0.6rem;
}

.legal-block p,
.legal-block li {
    font-size: 0.975rem;
    line-height: 1.75;
    color: var(--on-surface-variant);
}

.legal-block p {
    margin: 0 0 0.85rem;
}

.legal-block ul {
    margin: 0 0 0.85rem;
    padding-left: 1.25rem;
    display: grid;
    gap: 0.4rem;
}

.legal-block a {
    color: var(--secondary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.legal-foot {
    margin-top: 2.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--outline-variant);
    font-size: 0.9rem;
    color: var(--on-surface-variant);
}

.legal-foot a {
    color: var(--secondary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Cookie / analytics consent banner.
   Fixed to the bottom, above the footer, and only shown after JS decides there
   is no stored choice (the element ships with the `hidden` attribute so a
   no-JS visitor never sees a control that cannot work). */
.consent-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    background: var(--on-surface);
    color: #fff;
    padding: 1rem var(--container-margin);
    box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.18);
}

.consent-banner[hidden] {
    display: none !important;
}

.consent-banner__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.9rem 1.5rem;
    max-width: 1100px;
    margin: 0 auto;
}

.consent-banner__text {
    flex: 1 1 380px;
    min-width: 0;
}

.consent-banner__text p {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.88);
}

.consent-banner__text .consent-banner__title {
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.2rem;
}

.consent-banner__text a {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.consent-banner__actions {
    display: flex;
    gap: 0.6rem;
    flex: 0 0 auto;
}

.consent-btn {
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.6rem 1.1rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    background: transparent;
    color: #fff;
    cursor: pointer;
    white-space: nowrap;
}

.consent-btn:hover {
    border-color: #fff;
}

.consent-btn--accept {
    background: var(--secondary);
    border-color: var(--secondary);
    color: #fff;
}

.consent-btn--accept:hover {
    filter: brightness(1.08);
}

@media (max-width: 600px) {
    .consent-banner__actions {
        width: 100%;
    }

    .consent-btn {
        flex: 1 1 auto;
        text-align: center;
    }
}

/* Utility */
.text-center { text-align: center; }
.mt-4 { margin-top: var(--container-margin); }
.mt-8 { margin-top: calc(var(--container-margin) * 2); }

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .pain-grid,
    .pricing-grid,
    .programs-grid,
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    .site-header nav {
        display: none;
    }
}
