/* ------------------------------------------------
   WhatKey Landing Page — Fernloop
   Aesthetic: warm, editorial, tactile precision
   ------------------------------------------------ */

:root {
    --bg: #171614;
    --surface: #f4f1ea;
    --surface-soft: #efebe3;
    --surface-strong: #e8e3d8;
    --text: #2b2924;
    --text-secondary: #6d675f;
    --text-tertiary: #968f85;
    --accent: #807465;
    --accent-strong: #5e5448;
    --border: #d4cec3;
    --border-light: #e6e1d7;

    --s1: 0.5rem;
    --s2: 0.75rem;
    --s3: 1rem;
    --s4: 1.5rem;
    --s5: 2.5rem;
    --s6: 4rem;
    --s7: 6rem;

    --font-display: "Newsreader", Georgia, "Times New Roman", serif;
    --font-body: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-mono: "SF Mono", Menlo, Monaco, Consolas, "JetBrains Mono", monospace;

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --duration: 0.5s;
}

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

html,
body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(var(--s3), 3vw, var(--s5));
}

.frame {
    width: 100%;
    max-width: 860px;
    background: var(--surface);
    padding: clamp(var(--s5), 5vw, var(--s7)) clamp(var(--s4), 5vw, var(--s6));
    animation: frame-in var(--duration) var(--ease-out) both;
}

@keyframes frame-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
}

/* ---- Topbar ---- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: clamp(var(--s4), 6vw, var(--s5));
}

.topbar__back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: color 0.15s ease;
}

.topbar__back:hover {
    color: var(--text);
}

.topbar__tag {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: var(--surface-soft);
    border: 1px solid var(--border-light);
    border-radius: 999px;
    padding: 0.2rem 0.65rem;
    letter-spacing: 0.02em;
}

/* ---- Hero ---- */
.hero {
    margin-bottom: var(--s4);
}

.hero__header {
    display: flex;
    align-items: center;
    gap: var(--s3);
    margin-bottom: var(--s3);
}

.hero__icon {
    width: 56px;
    height: 56px;
    border-radius: 13px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.hero__brand {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

h1 {
    margin: 0 0 var(--s3);
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 5.5vw, 3.4rem);
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: -0.015em;
    color: var(--text);
}

.hero__lede {
    margin: 0 0 var(--s4);
    font-size: clamp(1.05rem, 2vw, 1.2rem);
    line-height: 1.6;
    color: var(--text-secondary);
    max-width: 680px;
}

/* ---- Download Actions ---- */
.hero__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s3);
    margin-bottom: var(--s2);
}

.button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.75rem 1.4rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.button--primary {
    background: var(--text);
    color: var(--surface);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.button--primary:hover {
    background: #403d36;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
}

.button--primary svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.hero__meta {
    font-size: 0.82rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

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

.hero__meta a:hover {
    color: var(--text);
}

/* ---- App Screenshot Figure ---- */
.app-figure {
    margin: var(--s4) 0 var(--s5);
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.app-screenshot {
    width: 100%;
    max-width: 460px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(0, 0, 0, 0.08);
    display: block;
    transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
}

.app-screenshot:hover {
    transform: translateY(-2px);
    box-shadow: 0 26px 60px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.app-figure__caption {
    margin-top: var(--s2);
    font-size: 0.82rem;
    color: var(--text-secondary);
    text-align: center;
}

.app-figure__caption code {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    background: var(--surface-soft);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    padding: 0.1rem 0.35rem;
}

.divider {
    border: none;
    border-top: 1px solid var(--border-light);
    margin: var(--s5) 0;
}

/* ---- Feature Grid ---- */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--s4);
}

.feature {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.feature__title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 500;
    margin: 0;
    color: var(--text);
}

.feature__desc {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--text-secondary);
}

.feature__desc code {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    background: var(--surface-soft);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    padding: 0.1rem 0.3rem;
}

/* ---- Specs Matrix ---- */
.specs {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: var(--s3) var(--s4);
    margin: var(--s4) 0;
}

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

.specs__item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.specs__k {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
}

.specs__v {
    font-family: var(--font-mono);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text);
}

/* ---- Site Footer ---- */
.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--s5);
    padding-top: var(--s4);
    border-top: 1px solid var(--border-light);
    font-size: 0.85rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
    gap: var(--s2);
}

.site-footer__links {
    display: flex;
    gap: var(--s3);
}

.site-footer__link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s ease;
}

.site-footer__link:hover {
    color: var(--text);
}
