/* R4K Industries — shared site styles */

/* ---------- Tokens ---------- */
:root {
    color-scheme: light dark;

    --bg: #fafafa;
    --surface: #ffffff;
    --surface-hover: #f4f4f5;
    --border: #e4e4e7;
    --border-strong: #d4d4d8;
    --text: #18181b;
    --text-dim: #52525b;
    --text-faint: #a1a1aa;

    --accent-brand: #c2410c;
    --accent-foundation: #c2410c;
    --accent-sunny16: #b45309;

    --glow-strength: 10%;
    --shadow-card: 0 1px 2px rgb(0 0 0 / 0.04);
    --shadow-icon: 0 4px 16px rgb(0 0 0 / 0.12);

    --w-page: 860px;
    --w-prose: 42rem;
    --radius-card: 18px;
    --radius-pill: 999px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0c0c0e;
        --surface: #151518;
        --surface-hover: #1b1b1f;
        --border: #26262c;
        --border-strong: #34343c;
        --text: #f2f2f4;
        --text-dim: #a0a0a8;
        --text-faint: #5b5b64;

        --accent-brand: #ff6a00;
        --accent-foundation: #ff6a00;
        --accent-sunny16: #ff9500;

        --glow-strength: 14%;
        --shadow-card: none;
        --shadow-icon: 0 10px 40px rgb(0 0 0 / 0.55), 0 0 0 1px rgb(255 255 255 / 0.06);
    }
}

body                   { --accent: var(--accent-brand); }
body.accent-foundation { --accent: var(--accent-foundation); }
body.accent-sunny16    { --accent: var(--accent-sunny16); }

/* ---------- Reset & base ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

img { display: block; max-width: 100%; }

::selection { background: rgb(255 140 60 / 0.25); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Layout ---------- */
.glow {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(600px 400px at 50% -10%, rgb(255 140 60 / 0.10), transparent 70%);
    background: radial-gradient(600px 400px at 50% -10%, color-mix(in srgb, var(--accent) var(--glow-strength), transparent), transparent 70%);
    z-index: 0;
}

.container {
    position: relative;
    z-index: 1;
    max-width: var(--w-page);
    margin: 0 auto;
    padding: 0 24px;
}

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

/* ---------- Typography ---------- */
.overline {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
}

h1 {
    font-size: clamp(2.1rem, 6vw, 3.25rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.08;
    margin: 0.5rem 0 1rem;
}

.tagline {
    font-size: 1.125rem;
    color: var(--text-dim);
    max-width: 34em;
    margin: 0 auto;
}

/* ---------- Top nav ---------- */
.topnav {
    padding: 1.4rem 0 0;
    font-size: 0.88rem;
}
.topnav a { color: var(--text-dim); text-decoration: none; }
.topnav a:hover { color: var(--text); }

/* ---------- Hero & landing ---------- */
.hero { text-align: center; padding: clamp(4rem, 12vh, 8rem) 0 3.5rem; }
.hero .app-icon { margin: 0 auto 1.8rem; }
.badges { margin-top: 2rem; }
.features { padding: 3rem 0 1rem; }

.apps { display: grid; gap: 14px; max-width: 560px; margin: 0 auto; }
.app-name { font-size: 1.15rem; font-weight: 600; }
.app-desc { font-size: 0.95rem; color: var(--text-dim); }

.app-icon {
    width: 108px;
    height: 108px;
    border-radius: 24.2%;   /* iOS squircle-ish */
    box-shadow: var(--shadow-icon);
}

/* ---------- Badges ---------- */
.badge {
    display: inline-block;
    background: var(--text);
    color: var(--bg);
    padding: 0.8rem 1.6rem;
    border-radius: var(--radius-pill);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: transform 0.15s ease, opacity 0.15s ease;
}
@media (prefers-reduced-motion: no-preference) {
    a.badge:hover { transform: translateY(-1px); opacity: 0.92; }
}
.badge.soon { background: var(--surface); color: var(--text-dim); border: 1px solid var(--border); cursor: default; }

/* ---------- Cards ---------- */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 14px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 1.6rem;
    text-align: left;
    box-shadow: var(--shadow-card);
}
.card h2 { font-size: 1.2rem; font-weight: 600; margin-bottom: 1rem; }
.card h3 { font-size: 1.02rem; font-weight: 600; margin-bottom: 0.4rem; color: var(--text); }
.card p { font-size: 0.95rem; color: var(--text-dim); }
.card p + p { margin-top: 0.6rem; }
.card a { color: var(--accent); text-decoration: none; }
.card a:hover { text-decoration: underline; }

a.card {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 1.1rem;
    transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
a.card:hover {
    background: var(--surface-hover);
    border-color: var(--border-strong);
    transform: translateY(-2px);
}
a.card .app-icon { width: 64px; height: 64px; flex: none; }
a.card .arrow { margin-left: auto; color: var(--text-faint); font-size: 1.2rem; }
a.card .app-name { color: var(--text); }

/* ---------- Doc pages ---------- */
.page-header { text-align: center; padding: 3rem 0 2.5rem; }
.page-header .meta { font-size: 0.88rem; color: var(--text-faint); margin-top: 0.5rem; }
.page-header h1 { font-size: clamp(1.9rem, 5vw, 2.4rem); letter-spacing: -0.02em; }

.prose { padding-bottom: 1rem; }
.prose h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 2.2rem 0 0.6rem;
    padding-top: 2.2rem;
    border-top: 1px solid var(--border);
}
.prose h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose h3 { font-size: 1rem; font-weight: 600; margin: 1.6rem 0 0.35rem; }
.prose p, .prose ul {
    font-size: 0.95rem;
    color: var(--text-dim);
    line-height: 1.7;
    margin-bottom: 1rem;
}
.prose ul { padding-left: 1.25rem; }
.prose strong { color: var(--text); font-weight: 600; }
.prose a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: rgb(255 140 60 / 0.35);
    text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent);
    text-underline-offset: 2px;
}
.prose a:hover { text-decoration-color: var(--accent); }

.faq p { margin-bottom: 0; }
.faq h3 + p { margin-bottom: 1rem; }

/* ---------- Footer ---------- */
footer {
    text-align: center;
    padding: 3.5rem 24px 2.5rem;
    color: var(--text-faint);
    font-size: 0.88rem;
}
footer a { color: var(--text-dim); text-decoration: none; margin: 0 0.7rem; }
footer a:hover { color: var(--text); }
footer .copyright { margin-top: 1rem; color: var(--text-faint); }
