/* =========================================================================
   Decoder Ring — site styles
   Shared by every page. Design language mirrors the iOS app: 16px radius,
   semantic typography, subtle gradients, automatic light/dark via the OS
   preference. Plain CSS — no preprocessor, no build step.
   ========================================================================= */

:root {
    --bg-start: #fafafa;
    --bg-end: #f1f1f7;
    --surface: rgba(255, 255, 255, 0.8);
    --surface-solid: #ffffff;
    --surface-elevated: #ffffff;
    --border: rgba(0, 0, 0, 0.08);
    --border-strong: rgba(0, 0, 0, 0.12);
    --text-primary: #16161d;
    --text-secondary: #5e5e6b;
    --text-muted: #8d8d9a;
    --accent: #5b6cff;
    --accent-strong: #4452f5;
    --accent-soft: rgba(91, 108, 255, 0.10);
    --accent-secondary: #06b6d4;
    --success: #16a34a;
    --warning: #d97706;
    --shadow-sm: 0 1px 2px rgba(15, 15, 30, 0.04), 0 2px 6px rgba(15, 15, 30, 0.04);
    --shadow-md: 0 4px 16px rgba(15, 15, 30, 0.06), 0 1px 3px rgba(15, 15, 30, 0.04);
    --shadow-lg: 0 24px 48px rgba(15, 15, 30, 0.10), 0 4px 12px rgba(15, 15, 30, 0.06);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 24px;
    --radius-pill: 999px;

    --container-narrow: 720px;
    --container: 1100px;
    --container-wide: 1280px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-start: #08080d;
        --bg-end: #11111c;
        --surface: rgba(22, 22, 30, 0.7);
        --surface-solid: #16161e;
        --surface-elevated: #1c1c26;
        --border: rgba(255, 255, 255, 0.08);
        --border-strong: rgba(255, 255, 255, 0.14);
        --text-primary: #f3f3f7;
        --text-secondary: #a8a8b3;
        --text-muted: #6e6e7c;
        --accent: #818cf8;
        --accent-strong: #a5aef9;
        --accent-soft: rgba(129, 140, 248, 0.16);
        --accent-secondary: #22d3ee;
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.3);
        --shadow-lg: 0 24px 48px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.3);
    }
}

/* -- Reset / base ------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", system-ui, sans-serif;
    background: linear-gradient(180deg, var(--bg-start) 0%, var(--bg-end) 100%);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 3px; }
ul { list-style: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* -- Typography -------------------------------------------------------- */
h1, h2, h3, h4 {
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    font-weight: 700;
}
h1 { font-size: clamp(2.25rem, 4.5vw + 0.5rem, 3.75rem); letter-spacing: -0.025em; }
h2 { font-size: clamp(1.75rem, 2.5vw + 0.5rem, 2.5rem); }
h3 { font-size: clamp(1.25rem, 1vw + 0.875rem, 1.5rem); }
h4 { font-size: 1.125rem; }
p { color: var(--text-secondary); }
.eyebrow {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 6px 12px;
    border-radius: var(--radius-pill);
}
.lede { font-size: 1.2rem; color: var(--text-secondary); max-width: 60ch; }

/* -- Layout ------------------------------------------------------------ */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: var(--container-narrow); }
.container.wide { max-width: var(--container-wide); }
main { flex: 1 0 auto; }
section { padding: 64px 0; }
section.lead { padding: 96px 0 48px; }
@media (min-width: 768px) { section { padding: 96px 0; } section.lead { padding: 128px 0 64px; } }

/* -- Header ------------------------------------------------------------ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.site-header .inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    max-width: var(--container-wide);
    margin: 0 auto;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1.05rem;
    letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; color: var(--text-primary); }
.brand-mark {
    width: 32px; height: 32px;
    border-radius: 8px;
    object-fit: cover;
    display: block;
    box-shadow: var(--shadow-sm);
}
.nav-links {
    display: flex;
    gap: 4px;
    align-items: center;
}
.nav-links a {
    color: var(--text-secondary);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}
.nav-links a:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.nav-links a.active { color: var(--accent); }
.nav-links .cta { color: white; background: var(--accent); padding: 8px 16px; }
.nav-links .cta:hover { background: var(--accent-strong); color: white; }
@media (max-width: 720px) {
    .nav-links a:not(.cta) { display: none; }
}

/* -- Buttons ----------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 22px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 1rem;
    transition: transform 0.1s, background 0.15s, box-shadow 0.15s;
    text-align: center;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--accent); color: white; box-shadow: var(--shadow-md); }
.btn-primary:hover { background: var(--accent-strong); color: white; }
.btn-secondary {
    background: var(--surface-solid);
    color: var(--text-primary);
    border: 1px solid var(--border-strong);
}
.btn-secondary:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.btn-ghost { color: var(--accent); padding: 14px 0; }
.btn-ghost:hover { color: var(--accent-strong); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* -- Signup form ------------------------------------------------------- */
.signup-form {
    display: flex;
    gap: 12px;
    max-width: 480px;
    margin: 0 auto;
    flex-wrap: wrap;
    justify-content: center;
}
.signup-form input[type="email"] {
    flex: 1 1 240px;
    min-width: 0;
    padding: 14px 18px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--surface-elevated);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.signup-form input[type="email"]::placeholder { color: var(--text-muted); }
.signup-form input[type="email"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}
.signup-form button {
    flex: 0 0 auto;
    border: none;
    cursor: pointer;
    font-family: inherit;
}
.signup-foot {
    margin-top: 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
@media (max-width: 480px) {
    .signup-form { flex-direction: column; }
    .signup-form button { width: 100%; justify-content: center; }
}

/* -- Hero -------------------------------------------------------------- */
.hero {
    padding: 96px 0 48px;
    text-align: center;
    position: relative;
}
@media (min-width: 768px) { .hero { padding: 128px 0 80px; } }
.hero h1 { margin: 18px auto 24px; max-width: 16ch; }
.hero .lede { margin: 0 auto 32px; }
.hero .btn-row { justify-content: center; }
.hero-mock {
    margin: 64px auto 0;
    max-width: 360px;
    padding: 18px 16px 28px;
    border-radius: 32px;
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    text-align: left;
}
.hero-mock-bar {
    height: 6px;
    width: 64px;
    margin: 0 auto 18px;
    background: var(--border-strong);
    border-radius: var(--radius-pill);
}
.hero-mock-row { padding: 8px 12px; }
.hero-mock-row + .hero-mock-row { border-top: 1px solid var(--border); }
.hero-mock-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.hero-mock-text {
    font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
    font-size: 0.95rem;
    color: var(--text-primary);
}
.hero-mock-text.cipher { color: var(--accent); }

/* -- Screenshots ------------------------------------------------------- */
.screenshot {
    border-radius: 32px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    max-width: 320px;
    width: 100%;
    height: auto;
    margin: 0 auto;
    display: block;
    background: var(--surface-elevated);
}
.screenshot.compact { max-width: 260px; }
.screenshot.gif { border-radius: 24px; max-width: 320px; }

.shot-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: 1fr;
    justify-items: center;
}
@media (min-width: 720px) { .shot-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .shot-grid.cols-4 { grid-template-columns: repeat(4, 1fr); } }
.shot-grid figure { display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 320px; }
.shot-grid figcaption {
    font-size: 0.95rem;
    color: var(--text-secondary);
    text-align: center;
    max-width: 28ch;
}

/* -- Hero demo (videos + center icon) ----------------------------------- */
.hero-demo {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-top: 64px;
}
.hero-demo figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
    max-width: 320px;
}
.hero-demo figcaption {
    font-size: 0.95rem;
    color: var(--text-secondary);
    text-align: center;
}
.hero-demo-icon {
    width: clamp(120px, 18vw, 220px);
    height: auto;
    aspect-ratio: 1 / 1;
    border-radius: 22%;
    box-shadow: var(--shadow-lg);
    flex: 0 0 auto;
}

.feature-row {
    display: grid;
    gap: 40px;
    align-items: center;
    margin-bottom: 80px;
}
.feature-row:last-child { margin-bottom: 0; }
@media (min-width: 880px) {
    .feature-row { grid-template-columns: 1fr 1fr; gap: 80px; }
    .feature-row.reverse .feature-row-text { order: 2; }
}
.feature-row h3 { font-size: 1.75rem; margin-bottom: 16px; }
.feature-row .feature-row-text > .eyebrow { margin-bottom: 16px; }
.feature-row p { margin-bottom: 16px; font-size: 1.05rem; }
.feature-row ul { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.feature-row ul li {
    display: flex;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 1rem;
}
.feature-row ul li::before {
    content: "";
    flex-shrink: 0;
    width: 18px; height: 18px;
    margin-top: 4px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b6cff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
    background-repeat: no-repeat;
    background-position: center;
}

/* -- Cards / grids ----------------------------------------------------- */
.card {
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.card-hover:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.card .icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--accent);
    display: grid;
    place-items: center;
    font-size: 1.4rem;
}
.card .badge {
    align-self: flex-start;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.card .badge.coming-soon { background: var(--warning); color: white; opacity: 0.92; }
.card .price { font-size: 1.6rem; font-weight: 700; color: var(--text-primary); margin-top: 4px; }
.card .price small { font-size: 0.9rem; color: var(--text-secondary); font-weight: 500; }
.card ul { display: flex; flex-direction: column; gap: 8px; }
.card ul li {
    display: flex;
    gap: 10px;
    font-size: 0.95rem;
    color: var(--text-secondary);
}
.card ul li::before {
    content: "";
    flex-shrink: 0;
    width: 18px; height: 18px;
    margin-top: 3px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b6cff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
    background-repeat: no-repeat;
    background-position: center;
}

.grid { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid.cols-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid.cols-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 960px) { .grid.cols-4 { grid-template-columns: repeat(4, 1fr); } }

/* -- Section heading --------------------------------------------------- */
.section-head { text-align: center; margin-bottom: 48px; }
.section-head h2 { margin: 12px 0 12px; }
.section-head p { max-width: 60ch; margin: 0 auto; font-size: 1.1rem; }

/* -- How-it-works ------------------------------------------------------ */
.steps { counter-reset: step; }
.steps .card { position: relative; padding-top: 56px; }
.steps .card::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    top: 22px; left: 28px;
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    display: grid; place-items: center;
    font-size: 0.85rem;
    font-weight: 700;
}

/* -- Comparison table -------------------------------------------------- */
.compare-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table.compare {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface-solid);
    min-width: 720px;
}
table.compare th, table.compare td {
    padding: 14px 16px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}
table.compare th {
    background: var(--surface-elevated);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
}
table.compare td:first-child, table.compare th:first-child {
    text-align: left;
    color: var(--text-primary);
    font-weight: 500;
}
table.compare td.yes { color: var(--success); font-weight: 700; }
table.compare td.no  { color: var(--text-muted); }
table.compare tbody tr:last-child td { border-bottom: none; }

/* -- Callout ----------------------------------------------------------- */
.callout {
    background: linear-gradient(135deg, var(--accent-soft), transparent);
    border: 1px solid var(--accent-soft);
    border-radius: var(--radius);
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
@media (min-width: 720px) { .callout { flex-direction: row; align-items: center; justify-content: space-between; gap: 32px; } }
.callout h3 { color: var(--text-primary); }
.callout p { margin-top: 4px; }

/* -- Prose pages (privacy / terms / support) -------------------------- */
.prose {
    max-width: var(--container-narrow);
    margin: 0 auto;
}
.prose h2 { margin-top: 40px; margin-bottom: 12px; font-size: 1.5rem; }
.prose h3 { margin-top: 28px; margin-bottom: 8px; font-size: 1.15rem; color: var(--text-primary); }
.prose p { margin-bottom: 16px; }
.prose ul { margin: 0 0 16px 24px; list-style: disc; }
.prose ul li { color: var(--text-secondary); margin-bottom: 6px; }
.prose strong { color: var(--text-primary); font-weight: 600; }
.prose .meta {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

/* -- FAQ --------------------------------------------------------------- */
.faq { display: flex; flex-direction: column; gap: 16px; max-width: var(--container-narrow); margin: 0 auto; }
.faq details {
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.faq details[open] { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.faq summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text-primary);
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
    content: "+";
    font-size: 1.4rem;
    font-weight: 300;
    color: var(--text-muted);
    transition: transform 0.2s;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin-top: 12px; color: var(--text-secondary); }

/* -- Footer ------------------------------------------------------------ */
.site-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 48px 0 32px;
    margin-top: 96px;
}
.site-footer .inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}
@media (min-width: 720px) {
    .site-footer .inner { flex-direction: row; justify-content: space-between; align-items: flex-start; }
}
.site-footer h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 12px; font-weight: 600; }
.site-footer ul { display: flex; flex-direction: column; gap: 8px; }
.site-footer a { color: var(--text-secondary); font-size: 0.95rem; }
.site-footer a:hover { color: var(--accent); }
.site-footer .legal {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
}
.site-footer .disclaimer {
    margin-top: 8px;
    font-style: italic;
    color: var(--text-muted);
    font-size: 0.85rem;
}
