/* Home page styles, shared by the eleven language versions.
   Rules for one language only (line breaking, title size) stay in that page. */

:root {
    color-scheme: light dark;
    --bg: #ffffff;
    --bg-alt: #f5f5f7;
    --fg: #1d1d1f;
    --muted: #6e6e73;
    --accent: #2D7A53;
    --accent-hover: #246844;
    --card-bg: #ffffff;
    --card-border: #e5e5e7;
    --card-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #000000;
        --bg-alt: #1c1c1e;
        --fg: #f5f5f7;
        --muted: #a1a1a6;
        --accent: #52B788;
        --accent-hover: #6BC99A;
        --card-bg: #1c1c1e;
        --card-border: #38383a;
        --card-shadow: 0 1px 3px rgba(0,0,0,0.3);
    }
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", sans-serif;
    background: var(--bg);
    color: var(--fg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Nav */
body > nav {
    padding: 1rem 0;
    border-bottom: 1px solid var(--card-border);
    backdrop-filter: saturate(180%) blur(20px);
    background: rgba(255,255,255,0.72);
    position: sticky;
    top: 0;
    z-index: 10;
}
@media (prefers-color-scheme: dark) {
    body > nav { background: rgba(0,0,0,0.72); }
}
body > nav .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--fg);
    text-decoration: none;
}
.nav-links a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9rem;
    margin-left: 1.5rem;
    transition: color 0.2s;
}
.nav-links a:hover { color: var(--fg); }
@media (max-width: 768px) {
    body > nav { position: static; padding: 0.25rem 0; }
    body > nav .container { flex-wrap: wrap; column-gap: 1rem; }
    .nav-links { display: flex; flex-wrap: wrap; column-gap: 1rem; }
    .nav-links a { margin-left: 0; display: inline-flex; align-items: center; min-height: 44px; }
}

/* Hero */
.hero {
    text-align: center;
    padding: 5rem 1.5rem 4rem;
}
.hero-icon {
    display: block;
    width: 72px;
    height: 72px;
    margin: 0 auto 1.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.12);
}
.hero h1 {
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.1;
    margin-bottom: 1rem;
}
.hero h1 span { color: var(--accent); }
.hero p {
    font-size: 1.2rem;
    color: var(--muted);
    max-width: 520px;
    margin: 0 auto 2rem;
}
.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--fg);
    color: var(--bg);
    padding: 0.85rem 1.75rem;
    border-radius: 100px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: transform 0.2s, opacity 0.2s;
}
.hero-cta:hover { transform: scale(1.03); opacity: 0.9; }
.hero-cta svg { width: 20px; height: 20px; }
.hero p.hero-status {
    font-size: 0.9rem;
    margin: 1rem auto 0;
}
.hero p.hero-requirements {
    font-size: 0.9rem;
    margin: 0.25rem auto 0;
}
.hero-visual {
    width: min(320px, 88vw);
    margin: 3rem auto 0;
}
.hero .step-phone {
    max-width: 240px;
    margin: 0;
    z-index: 1;
}

/* Scroll offset for sticky nav */
[id] { scroll-margin-top: 4rem; }
@media (max-width: 768px) {
    [id] { scroll-margin-top: 0; }
}

/* Features */
.features {
    padding-block: 3rem 4rem;
}
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}
.feature-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: var(--card-shadow);
}
.feature-icon {
    margin-bottom: 0.75rem;
    color: var(--accent);
}
.feature-icon svg {
    width: 28px;
    height: 28px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}
.feature-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}
.feature-card p {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

/* How it works */
.how-it-works {
    padding-block: 3rem 4rem;
}
.section-title {
    text-align: center;
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 2.5rem;
}
.use-case {
    display: grid;
    grid-template-columns: 1fr 240px;
    gap: 3rem;
    align-items: center;
    max-width: 820px;
    margin: 0 auto 4rem;
}
.use-case:last-child { margin-bottom: 0; }
.use-case:not(.flow-case) { max-width: 680px; }
.use-case.flow-case { grid-template-columns: 1fr auto; }
.use-case .step-phone { max-width: 240px; margin: 0; }
.flow {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.flow .step-phone { width: 200px; }
.flow-arrow {
    width: 28px;
    height: 28px;
    flex: none;
    stroke: var(--accent);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}
.tap {
    position: absolute;
    width: 26px;
    height: 26px;
    margin: -13px 0 0 -13px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--accent) 15%, transparent);
    border: 2px solid var(--accent);
    z-index: 3;
}
@media (max-width: 768px) {
    .use-case,
    .use-case.flow-case { grid-template-columns: 1fr; gap: 1.5rem; }
    .use-case .step-phone { max-width: 220px; margin: 0 auto; }
    .flow { flex-direction: row; gap: 0.375rem; justify-content: center; }
    .flow .step-phone { width: auto; flex: 1 1 0; max-width: 180px; border-width: 5px; border-radius: 26px; }
    .flow .step-phone::after { width: 40%; height: 11px; top: 6px; }
    .flow-arrow { transform: none; width: 20px; height: 20px; }
}
.use-case h3 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.use-case p {
    color: var(--muted);
    font-size: 1rem;
}
.use-case p + p { margin-top: 0.75rem; }
.formats {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.25rem 1.25rem;
    margin: 0 0 1.25rem;
    text-align: left;
}
.formats dt {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.4;
    color: var(--accent);
}
.formats dd { color: var(--muted); }
.formats-block {
    max-width: 40rem;
    margin: 0 auto;
}
.formats-block p { color: var(--muted); }
.section-lead {
    text-align: center;
    color: var(--muted);
    margin: -1.5rem auto 2.5rem;
    max-width: 36rem;
}
.section-note {
    text-align: left;
    color: var(--fg);
    font-weight: 500;
    margin: 1.5rem auto 0;
    max-width: 40rem;
}
.step-phone {
    position: relative;
    max-width: 220px;
    margin: 0 auto 1.25rem;
    border-radius: 36px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0,0,0,0.18), 0 0 0 1px rgba(0,0,0,0.1);
    border: 8px solid #1a1a1c;
    background: #000;
}
@media (prefers-color-scheme: dark) {
    .step-phone {
        box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.08);
        border-color: #2a2a2c;
    }
}
/* Dynamic Island overlay */
.step-phone::after {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 72px;
    height: 20px;
    background: #1a1a1c;
    border-radius: 20px;
    z-index: 2;
}
@media (prefers-color-scheme: dark) {
    .step-phone::after { background: #000; }
}
.step-phone img {
    display: block;
    width: 100%;
    height: auto;
}

/* Privacy callout */
.privacy-callout {
    background: var(--bg-alt);
    border-radius: 20px;
    padding: 3rem 2rem;
    text-align: center;
    margin: 3rem 0 4rem;
}
.privacy-callout h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.privacy-callout p {
    color: var(--muted);
    max-width: 520px;
    margin: 0 auto;
    font-size: 0.95rem;
    text-align: left;
}
.privacy-callout p + p,
.privacy-callout ul + p {
    margin-top: 0.75rem;
}
.privacy-callout ul {
    max-width: 520px;
    margin: 0.75rem auto 0;
    padding-left: 1.25rem;
    text-align: left;
    color: var(--muted);
    font-size: 0.95rem;
}
.privacy-callout li + li { margin-top: 0.4rem; }
@media (max-width: 768px) {
    .privacy-callout { padding: 2rem 1.25rem; }
    .privacy-callout h2 { text-align: left; }
}

/* Footer */
footer {
    border-top: 1px solid var(--card-border);
    padding: 2rem 0;
    text-align: center;
    color: var(--muted);
    font-size: 0.82rem;
}
footer a {
    color: var(--muted);
    text-decoration: none;
}
footer a:hover { text-decoration: underline; }
.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}
.lang-switcher {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem 0.9rem;
    margin-bottom: 1.1rem;
    line-height: 1.9;
}
.lang-switcher a[aria-current="page"] {
    color: var(--fg);
    font-weight: 600;
}

/* ---------- Motion and the interactive parts ----------
   The animations run only under .motion, which the head script sets when the
   reader has not asked to reduce motion. Without it every element is shown in
   its final state. The format picker works with or without motion. */
/* 1. Hero: the route of a sample workout draws itself, with its figures below */
.hero { position: relative; }
@media (min-width: 900px) {
    .hero {
        display: grid;
        grid-template-columns: 1fr 300px;
        column-gap: 4rem;
        align-items: center;
        max-width: 960px;
        margin: 0 auto;
        padding: 4.5rem 1.5rem 4rem;
        text-align: left;
    }
    .hero > * { grid-column: 1; justify-self: start; }
    .hero .hero-icon { margin: 0 0 1.5rem; }
    .hero p,
    .hero p.hero-status,
    .hero p.hero-requirements { margin-left: 0; margin-right: 0; }
    .hero .hero-visual {
        grid-column: 2;
        grid-row: 1 / span 6;
        justify-self: stretch;
        width: 100%;
        margin: 0;
    }
}
.hero-route {
    display: block;
    width: min(280px, 64vw);
    margin: 0 auto;
    height: auto;
    overflow: visible;
}
.hero-route .line,
.hero-route .track {
    fill: none;
    stroke: var(--accent);
    stroke-width: 14;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.hero-route .track { opacity: 0.14; }
.hero-route .head { display: none; }
.hero-route .dot { fill: var(--accent); stroke: var(--bg); stroke-width: 8; }
.hero-route .ring {
    fill: none;
    stroke: var(--accent);
    stroke-width: 3;
    opacity: 0;
    transform-box: fill-box;
    transform-origin: center;
}
.motion .hero-route .head { display: inline; }
.motion .hero-route .line { stroke-dasharray: 1; stroke-dashoffset: 1; }
.motion .hero-route.draw .line { animation: route-draw 3.2s cubic-bezier(.6,.1,.3,1) .6s forwards; }
.motion .hero-route.draw .ring { animation: ring 2.4s ease-out 3.8s infinite; }
@keyframes route-draw { to { stroke-dashoffset: 0; } }
@keyframes ring {
    0%   { opacity: .7; transform: scale(1); }
    100% { opacity: 0;  transform: scale(3.2); }
}
.motion .hero > * { animation: rise .8s cubic-bezier(.2,.8,.2,1) both; }
.motion .hero > :nth-child(2) { animation-delay: .08s; }
.motion .hero > :nth-child(3) { animation-delay: .18s; }
.motion .hero > :nth-child(4) { animation-delay: .26s; }
.motion .hero > :nth-child(5),
.motion .hero > :nth-child(6) { animation-delay: .32s; }
.motion .hero > :nth-child(7) { animation-delay: .4s; }
@keyframes rise {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: none; }
}

.route-stats {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.25rem;
    text-align: center;
}
.route-stats div { display: flex; flex-direction: column-reverse; flex: 1; }
.route-stats dd {
    font-size: 1.15rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: var(--fg);
}
.route-stats dt { font-size: 0.8rem; color: var(--muted); }
.motion .route-stats { opacity: 0; transition: opacity .6s ease .4s; }
.motion .hero-route.draw + .route-stats { opacity: 1; }

/* 2. The hero icon docks next to the brand once it reaches the nav */
.nav-brand { display: inline-flex; align-items: center; }
.nav-icon-slot { display: none; }
.dock .nav-icon-slot {
    display: block;
    flex: none;
    width: 0;
    height: 28px;
    transition: width .45s cubic-bezier(.2,.8,.2,1);
}
.nav-icon {
    display: block;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    visibility: hidden;
    transform-origin: 0 0;
}
.docked .nav-icon-slot { width: 38px; }
.docked .nav-icon { visibility: visible; }
.docked .hero-icon { visibility: hidden; }
.hero-icon { transform-origin: 0 0; }
/* On the way back it starts inside the nav, so it must paint above it. */
.dock .hero-icon { position: relative; z-index: 11; }

/* 3. Format picker */
.format-picker { margin-bottom: 1.5rem; }
.format-tabs {
    position: relative;
    display: flex;
    width: fit-content;
    margin: 0 auto 1.75rem;
    padding: 4px;
    border-radius: 100px;
    background: var(--bg-alt);
}
.format-tabs button {
    position: relative;
    z-index: 1;
    min-height: 44px;
    padding: 0 1.6rem;
    border: 0;
    border-radius: 100px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: color .25s;
}
.format-tabs button[aria-pressed="true"] { color: var(--accent); }
.format-tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.format-thumb {
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 0;
    border-radius: 100px;
    background: var(--card-bg);
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}
@media (prefers-color-scheme: dark) { .format-thumb { background: #3a3a3c; } }
.format-rows { list-style: none; border-top: 1px solid var(--card-border); }
.format-rows li {
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 0.9rem;
    align-items: start;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--card-border);
}
.row-text { display: flex; flex-direction: column; }
.row-label { color: var(--fg); transition: color .3s; }
.row-note { font-size: 0.85rem; color: var(--muted); }
.row-note:empty { display: none; }
.mark {
    position: relative;
    width: 22px;
    height: 22px;
    margin-top: 1px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    background: var(--accent);
    transition: background-color .3s, border-color .3s;
}
/* Tick for yes, half fill for part, short dash for no. */
.mark::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 45%;
    width: 5px;
    height: 9px;
    border: solid var(--bg);
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -50%) rotate(45deg);
}
[data-state="part"] .mark { background: linear-gradient(90deg, var(--accent) 50%, transparent 50%); }
[data-state="part"] .mark::after { display: none; }
[data-state="no"] .mark { background: transparent; border-color: var(--card-border); }
[data-state="no"] .mark::after {
    top: 50%;
    width: 8px;
    height: 0;
    border-width: 0 0 2px 0;
    border-color: var(--muted);
    transform: translate(-50%, -50%);
}
[data-state="no"] .row-label { color: var(--muted); }
.format-desc { color: var(--muted); margin-top: 1.25rem; min-height: 6em; }
.picker-ready .formats { display: none; }
@media (prefers-reduced-motion: no-preference) {
    .format-thumb { transition: transform .4s cubic-bezier(.2,.8,.2,1), width .4s cubic-bezier(.2,.8,.2,1); }
    .format-rows li.changed .mark { animation: mark-pop .45s cubic-bezier(.2,.8,.2,1) both; animation-delay: var(--d, 0s); }
    .format-desc.changed { animation: desc-in .4s ease both; }
}
@keyframes mark-pop {
    0%   { transform: scale(.5); }
    60%  { transform: scale(1.15); }
    100% { transform: scale(1); }
}
@keyframes desc-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

/* 4. Flows: tap, arrow, next screen */
.motion .flow .tap { opacity: 0; }
.motion .flow .tap::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    opacity: 0;
}
.motion .flow.play .tap { animation: tap-press .9s ease .4s forwards; }
.motion .flow.play .tap::after { animation: tap-ripple .8s ease-out .62s; }
.motion .flow .flow-arrow > * {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    transition: stroke-dashoffset .45s ease;
}
.motion .flow.play .flow-arrow line { stroke-dashoffset: 0; transition-delay: 1.15s; }
.motion .flow.play .flow-arrow polyline { stroke-dashoffset: 0; transition-delay: 1.45s; }
.motion .flow .step-phone:last-child {
    opacity: 0;
    transform: translateX(-28px) scale(.95);
    transition: opacity .6s ease, transform .7s cubic-bezier(.2,.8,.2,1);
}
.motion .flow.play .step-phone:last-child {
    opacity: 1;
    transform: none;
    transition-delay: 1.65s;
}
@keyframes tap-press {
    0%   { opacity: 0; transform: scale(1.9); }
    35%  { opacity: 1; transform: scale(.8); }
    60%  { transform: scale(1.05); }
    100% { opacity: 1; transform: scale(1); }
}
@keyframes tap-ripple {
    0%   { opacity: .8; transform: scale(1); }
    100% { opacity: 0;  transform: scale(2.6); }
}

/* 5. Sections rise as they enter the screen */
.motion .reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity .7s ease, transform .8s cubic-bezier(.2,.8,.2,1);
    transition-delay: var(--d, 0s);
}
.motion .reveal.in { opacity: 1; transform: none; }
