/* ─────────────────────────────────────────────────────────────────────────
   Ciao Verbs, global styles

   Tokens mirror `lib/core/theme/app_colors.dart` and `tokens.dart` so the
   site and the app stay visually the same product. Every colour here is
   copied from that file; do not invent new hexes in component rules.
   ───────────────────────────────────────────────────────────────────────── */

:root {
    /* Brand. Italian flag green deepened to #00794A so it clears WCAG AA
       (5.30:1) as body text on white. The flag's own #008C45 only hits
       4.20:1 and fails. */
    --green: #00794a;
    --green-bright: #1b9e63;
    --green-dark: #005f3a;
    --green-tint: #e8f4ee;

    --sunny: #f4c545;
    --sunny-deep: #b88407;
    --coral: #ff6b6b;

    /* Surfaces: cool neutrals, matching the app's light theme. */
    --surface: #ffffff;
    --surface-container: #f4f6f9;
    --surface-high: #e9edf3;
    --outline: #dce1e8;

    --ink: #10161d;
    --ink-muted: #4b5563;
    --ink-faint: #6b7280;

    /* Spacing scale, AppSpacing.xs → xxl. */
    --sp-xs: 0.25rem;
    --sp-sm: 0.5rem;
    --sp-md: 1rem;
    --sp-lg: 1.5rem;
    --sp-xl: 2rem;
    --sp-xxl: 3rem;

    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 20px;
    --r-full: 999px;

    --shadow-sm: 0 1px 2px rgba(16, 22, 29, 0.06);
    --shadow-md: 0 4px 16px rgba(16, 22, 29, 0.08);
    --shadow-lg: 0 12px 32px rgba(16, 22, 29, 0.12);

    --maxw: 1120px;
    --maxw-prose: 720px;
}

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

html {
    scroll-behavior: smooth;
}

/* Respect the OS "reduce motion" setting everywhere, including smooth
   scrolling. Vestibular disorders are triggered by scroll animation, not
   just by transitions. */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

body {
    margin: 0;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        sans-serif;
    font-size: 17px;
    line-height: 1.65;
    color: var(--ink);
    background: var(--surface);
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin: 0 0 var(--sp-md);
    font-weight: 800;
}

h1 {
    font-size: clamp(2rem, 5vw, 3.1rem);
}
h2 {
    font-size: clamp(1.5rem, 3.4vw, 2.1rem);
}
h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

p {
    margin: 0 0 var(--sp-md);
}

a {
    color: var(--green);
    text-underline-offset: 3px;
}

a:hover {
    color: var(--green-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* Backticks in authored prose mark a run of ITALIAN inside English text, not
   code. Rendering them monospace on a grey chip made every example sentence
   look like a shell command. Italic + a hairline tint reads as "other
   language", which is what it is. Real code doesn't appear on this site. */
code,
.prose code,
[lang="it"] {
    font-family: inherit;
    font-style: italic;
    font-size: inherit;
    background: none;
    padding: 0;
    color: var(--green-dark);
}

/* A conjugated form called out inside prose ({{form}} in the source). */
.form {
    font-style: normal;
    font-weight: 700;
    color: var(--green-dark);
}

.container {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 var(--sp-lg);
}

.prose {
    max-width: var(--maxw-prose);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* Keyboard-only skip target. Visible the moment it receives focus. */
.skip-link {
    position: absolute;
    left: var(--sp-md);
    top: -3rem;
    z-index: 100;
    background: var(--green);
    color: #fff;
    padding: var(--sp-sm) var(--sp-md);
    border-radius: var(--r-sm);
    transition: top 0.15s ease;
}

.skip-link:focus {
    top: var(--sp-md);
    color: #fff;
}

:focus-visible {
    outline: 3px solid var(--green-bright);
    outline-offset: 2px;
}

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

.header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--outline);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-md);
    min-height: 64px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-sm);
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--ink);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.logo-img {
    width: 32px;
    height: 32px;
    border-radius: var(--r-sm);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--sp-lg);
}

.nav-links a {
    color: var(--ink-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-links a:hover {
    color: var(--green);
}

.nav-cta {
    background: var(--green);
    color: #fff !important;
    padding: 0.5rem 1rem;
    border-radius: var(--r-full);
    font-weight: 600;
}

.nav-cta:hover {
    background: var(--green-dark);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: 0;
    cursor: pointer;
    padding: var(--sp-sm);
}

.nav-toggle span {
    width: 22px;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
}

@media (max-width: 860px) {
    .nav-toggle {
        display: flex;
    }
    .nav-links {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: var(--surface);
        border-bottom: 1px solid var(--outline);
        padding: var(--sp-sm) var(--sp-lg) var(--sp-lg);
        box-shadow: var(--shadow-md);
    }
    .nav-links.nav-open {
        display: flex;
    }
    .nav-links a {
        padding: var(--sp-md) 0;
        border-bottom: 1px solid var(--outline);
    }
    .nav-cta {
        text-align: center;
        margin-top: var(--sp-md);
        border-bottom: 0 !important;
    }
}

/* ─── Buttons ─────────────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-sm);
    padding: 0.8rem 1.5rem;
    border-radius: var(--r-full);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    border: 2px solid transparent;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

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

.btn-primary:hover {
    background: var(--green-dark);
    color: #fff;
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    color: var(--green);
    border-color: var(--outline);
}

.btn-secondary:hover {
    border-color: var(--green);
    background: var(--green-tint);
}

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

.hero {
    padding: var(--sp-xxl) 0 var(--sp-xxl);
    background: linear-gradient(180deg, var(--green-tint) 0%, #fff 70%);
}

.hero-inner {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: var(--sp-xxl);
    align-items: center;
}

@media (max-width: 860px) {
    .hero-inner {
        grid-template-columns: 1fr;
        gap: var(--sp-xl);
    }
}

.hero h1 {
    margin-bottom: var(--sp-md);
}

.hero .lede {
    font-size: 1.15rem;
    color: var(--ink-muted);
    max-width: 34em;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-xs);
    background: #fff;
    border: 1px solid var(--outline);
    color: var(--green-dark);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.35rem 0.75rem;
    border-radius: var(--r-full);
    margin-bottom: var(--sp-md);
}

/* ─── Sections ────────────────────────────────────────────────────────── */

.section {
    padding: var(--sp-xxl) 0;
}

.section--tinted {
    background: var(--surface-container);
}

.section-head {
    max-width: var(--maxw-prose);
    margin-bottom: var(--sp-xl);
}

.section-head p {
    color: var(--ink-muted);
    font-size: 1.05rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--sp-lg);
}

.card {
    background: var(--surface);
    border: 1px solid var(--outline);
    border-radius: var(--r-lg);
    padding: var(--sp-lg);
    box-shadow: var(--shadow-sm);
}

.card h3 {
    margin-bottom: var(--sp-sm);
}

.card p {
    color: var(--ink-muted);
    margin-bottom: 0;
    font-size: 0.97rem;
}

.card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--r-md);
    background: var(--green-tint);
    color: var(--green-dark);
    font-size: 1.35rem;
    margin-bottom: var(--sp-md);
}

/* Link card: a whole card that is one destination. */
a.card {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease,
        transform 0.15s ease;
}

a.card:hover {
    border-color: var(--green);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    color: inherit;
}

/* ─── Waitlist form ───────────────────────────────────────────────────── */

.waitlist {
    background: var(--surface);
    border: 1px solid var(--outline);
    border-radius: var(--r-lg);
    padding: var(--sp-lg);
    box-shadow: var(--shadow-md);
    max-width: 480px;
}

.waitlist--wide {
    max-width: 620px;
    margin: 0 auto;
}

.waitlist__heading {
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: var(--sp-md);
}

.waitlist__fields {
    display: flex;
    gap: var(--sp-sm);
}

@media (max-width: 520px) {
    .waitlist__fields {
        flex-direction: column;
    }
}

.waitlist__email {
    flex: 1;
    min-width: 0;
    padding: 0.75rem 1rem;
    font: inherit;
    font-size: 1rem;
    color: var(--ink);
    background: var(--surface-container);
    border: 1px solid var(--outline);
    border-radius: var(--r-md);
}

.waitlist__email:focus {
    background: #fff;
    border-color: var(--green);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 121, 74, 0.15);
}

.waitlist__submit {
    padding: 0.75rem 1.4rem;
    font: inherit;
    font-weight: 700;
    color: #fff;
    background: var(--green);
    border: 0;
    border-radius: var(--r-md);
    cursor: pointer;
    white-space: nowrap;
}

.waitlist__submit:hover:not(:disabled) {
    background: var(--green-dark);
}

.waitlist__submit:disabled {
    opacity: 0.7;
    cursor: progress;
}

.waitlist__platform {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-md);
    border: 0;
    margin: var(--sp-md) 0 0;
    padding: 0;
}

.waitlist__platform-legend {
    padding: 0;
    font-size: 0.85rem;
    color: var(--ink-faint);
}

.waitlist__radio {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-xs);
    font-size: 0.92rem;
    color: var(--ink-muted);
    cursor: pointer;
}

.waitlist__fineprint {
    margin: var(--sp-md) 0 0;
    font-size: 0.83rem;
    color: var(--ink-faint);
}

.waitlist__error {
    margin-top: var(--sp-sm);
    font-size: 0.9rem;
    color: #b3261e;
}

.waitlist-success {
    background: var(--green-tint);
    border: 1px solid var(--green-bright);
    border-radius: var(--r-lg);
    padding: var(--sp-lg);
    max-width: 480px;
    text-align: center;
}

.waitlist-success--wide {
    max-width: 620px;
    margin: 0 auto;
}

.waitlist-success__icon {
    width: 44px;
    height: 44px;
    margin: 0 auto var(--sp-sm);
    display: grid;
    place-items: center;
    border-radius: var(--r-full);
    background: var(--green);
    color: #fff;
    font-size: 1.3rem;
}

.waitlist-success__title {
    margin-bottom: var(--sp-xs);
}

.waitlist-success p {
    margin: 0;
    color: var(--ink-muted);
}

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

.footer {
    background: var(--surface-container);
    border-top: 1px solid var(--outline);
    padding: var(--sp-xxl) 0 var(--sp-xl);
    margin-top: var(--sp-xxl);
}

.footer-content {
    display: grid;
    grid-template-columns: 1.2fr 2fr;
    gap: var(--sp-xl);
}

@media (max-width: 720px) {
    .footer-content {
        grid-template-columns: 1fr;
    }
}

.footer-brand p {
    color: var(--ink-faint);
    font-size: 0.9rem;
    margin: var(--sp-sm) 0 0;
}

.footer-logo {
    width: 40px;
    height: 40px;
    border-radius: var(--r-sm);
}

.footer-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--sp-lg);
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: var(--sp-sm);
}

.footer-col__title {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin: 0;
}

.footer-col a {
    color: var(--ink-muted);
    text-decoration: none;
    font-size: 0.93rem;
}

.footer-col a:hover {
    color: var(--green);
}

/* ─── Breadcrumbs ─────────────────────────────────────────────────────── */

.breadcrumbs {
    font-size: 0.88rem;
    color: var(--ink-faint);
    margin-bottom: var(--sp-md);
}

.breadcrumbs a {
    color: var(--ink-muted);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--green);
    text-decoration: underline;
}

.breadcrumbs span[aria-hidden] {
    margin: 0 var(--sp-xs);
    color: var(--outline);
}

/* ─── Long-form prose (blog posts, guides, legal) ─────────────────────── */

.page-header {
    padding: var(--sp-xl) 0 var(--sp-md);
}

.prose h2 {
    margin-top: var(--sp-xl);
}

.prose h3 {
    margin-top: var(--sp-lg);
}

.prose ul,
.prose ol {
    padding-left: 1.3em;
    margin: 0 0 var(--sp-md);
}

.prose li {
    margin-bottom: var(--sp-xs);
}

.prose blockquote {
    margin: var(--sp-lg) 0;
    padding: var(--sp-md) var(--sp-lg);
    border-left: 4px solid var(--green-bright);
    background: var(--green-tint);
    border-radius: 0 var(--r-md) var(--r-md) 0;
    color: var(--ink-muted);
}

.prose blockquote p:last-child {
    margin-bottom: 0;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--sp-lg) 0;
    font-size: 0.95rem;
}

.prose th,
.prose td {
    text-align: left;
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid var(--outline);
}

.prose th {
    background: var(--surface-container);
    font-weight: 700;
}

.post-meta {
    color: var(--ink-faint);
    font-size: 0.9rem;
    margin-bottom: var(--sp-lg);
}

.post-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--sp-lg);
    list-style: none;
    padding: 0;
    margin: 0;
}

.post-list__excerpt {
    color: var(--ink-muted);
    font-size: 0.95rem;
    margin-bottom: 0;
}

/* Callouts inside guides. `tip` is the default; `warning` is the trap the
   learner is about to fall into. Amber, not red: "most people get this
   wrong" is guidance, not a failure state. */
.callout {
    display: flex;
    gap: var(--sp-md);
    padding: var(--sp-md) var(--sp-lg);
    border-radius: var(--r-md);
    background: var(--green-tint);
    border: 1px solid rgba(0, 121, 74, 0.2);
    margin: var(--sp-lg) 0;
}

.callout--warning {
    background: #f8f1dd;
    border-color: rgba(184, 132, 7, 0.35);
}

.callout p:last-child {
    margin-bottom: 0;
}

.callout__icon {
    font-size: 1.2rem;
    line-height: 1.4;
}
