/* Hungry Nuggets — Design System Showcase
   Cette page est elle-même une application stricte du DESIGN.md. */

:root {
    /* Brand */
    --ink: #1E2122;
    --accent: #FBBB21;
    --accent-soft: #FFE79B;
    --accent-warm-bg: #FFF7E0;
    --cream: #F9F7F2;
    --white: #FFFFFF;

    /* Neutrals */
    --ink-700: #374047;
    --ink-600: #606E79;
    --ink-500: #6E7481;
    --ink-400: #6B6B6B;
    --ink-200: #DEE1E3;
    --ink-100: #ECEEEF;
    --ink-050: #FAFAFA;
    --line: rgba(30, 33, 34, 0.08);

    /* Semantic */
    --success: #22A06B;
    --error: #D63B3B;
    --info: #1E73BE;

    /* Type */
    --text-2xs: 12px;
    --text-xs: 14px;
    --text-sm: 15px;
    --text-base: 16px;
    --text-md: 18px;
    --text-lg: clamp(18px, 1.75vw, 20px);
    --text-xl: clamp(20px, 2.1vw, 24px);
    --text-2xl: clamp(24px, 2.8vw, 32px);
    --text-3xl: clamp(32px, 4.2vw, 48px);
    --text-display: clamp(36px, 5.4vw, 62px);

    /* Spacing */
    --s-1: 4px;
    --s-2: 8px;
    --s-3: 12px;
    --s-4: 16px;
    --s-5: 20px;
    --s-6: 24px;
    --s-8: 32px;
    --s-10: 40px;
    --s-12: 48px;
    --s-16: 64px;
    --s-20: 80px;

    /* Radius */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 22px;
    --radius-2xl: 24px;
    --radius-pill: 999px;

    /* Shadow */
    --shadow-xs: 0 1px 2px rgba(30, 33, 34, 0.04);
    --shadow-sm: 0 4px 12px -4px rgba(30, 33, 34, 0.08);
    --shadow-md: 0 8px 24px -8px rgba(30, 33, 34, 0.12);
    --shadow-lg: 0 14px 30px -10px rgba(30, 33, 34, 0.18);
    --shadow-xl: 0 20px 40px -12px rgba(30, 33, 34, 0.22);
    --shadow-glow: 0 12px 28px rgba(251, 187, 33, 0.35);

    /* Motion */
    --motion-fast: 150ms;
    --motion-base: 250ms;
    --motion-slow: 450ms;
    --ease-standard: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
}

body {
    background: var(--cream);
    color: var(--ink);
    font-family: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-image:
        radial-gradient(circle at 10% 0%, rgba(251, 187, 33, 0.08), transparent 40%),
        radial-gradient(circle at 95% 95%, rgba(251, 187, 33, 0.05), transparent 35%);
    background-attachment: fixed;
    min-height: 100dvh;
}

a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
ul, ol { list-style: none; }
img, svg { display: block; max-width: 100%; }
em { font-style: italic; }
code { font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace; font-size: 0.86em; }

/* ───────────────────────────── Top bar ───────────────────────────── */

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    background: rgba(249, 247, 242, 0.78);
    border-bottom: 1px solid var(--line);
}

.topbar__inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 12px var(--s-5);
    display: flex;
    align-items: center;
    gap: var(--s-6);
}

.brand {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    font-weight: 700;
    font-size: var(--text-base);
    line-height: 1;
}

.brand__nugget {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.brand__text em {
    font-weight: 500;
    color: var(--ink-600);
    margin-left: 6px;
}

.topnav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: var(--s-5);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--ink-600);
}

.topnav a:hover { color: var(--ink); }

.topnav__cta {
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    background: var(--ink);
    color: var(--white) !important;
    font-weight: 600;
    transition: transform var(--motion-fast) var(--ease-standard);
}

.topnav__cta:hover { transform: translateY(-1px); }

@media (max-width: 720px) {
    .topnav { gap: var(--s-3); font-size: var(--text-2xs); }
    .topnav a:not(.topnav__cta) { display: none; }
}

/* ───────────────────────────── Layout ───────────────────────────── */

main {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 var(--s-5) var(--s-20);
}

.section {
    padding: var(--s-16) 0;
    border-bottom: 1px solid var(--line);
}

.section:last-of-type { border-bottom: none; }

.section__head {
    max-width: 720px;
    margin-bottom: var(--s-10);
}

.kicker {
    font-size: var(--text-2xs);
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-600);
    margin-bottom: var(--s-3);
}

h1, h2, h3 {
    letter-spacing: -0.01em;
    color: var(--ink);
}

.section h2 {
    font-size: var(--text-2xl);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--s-3);
}

.lead {
    font-size: var(--text-md);
    color: var(--ink-700);
    line-height: 1.5;
    font-weight: 500;
}

.subhead {
    font-size: var(--text-base);
    font-weight: 700;
    color: var(--ink);
    margin-top: var(--s-8);
    margin-bottom: var(--s-4);
}

.subhead:first-child { margin-top: 0; }

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

.hero {
    padding: var(--s-20) 0 var(--s-16);
    text-align: left;
    max-width: 820px;
}

.hero__title {
    font-size: var(--text-display);
    font-weight: 900;
    line-height: 1.0;
    letter-spacing: -0.025em;
    margin: var(--s-3) 0 var(--s-5);
}

.hero__title em {
    color: var(--accent);
    font-style: italic;
}

.hero__lead {
    font-size: var(--text-md);
    color: var(--ink-700);
    line-height: 1.5;
    margin-bottom: var(--s-8);
    max-width: 56ch;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-3);
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s-2);
    padding: 12px 22px;
    font: 600 var(--text-sm)/1 'Figtree', sans-serif;
    color: var(--ink);
    background: var(--white);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: transform var(--motion-fast) var(--ease-standard),
                background var(--motion-base) var(--ease-standard),
                border-color var(--motion-base) var(--ease-standard),
                box-shadow var(--motion-base) var(--ease-standard);
    -webkit-tap-highlight-color: transparent;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
    border-color: var(--ink);
}

.btn:active { transform: translateY(0); }

.btn--primary {
    background: var(--ink);
    color: var(--white);
    border-color: var(--ink);
}

.btn--primary:hover {
    background: var(--ink);
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
}

.btn--ghost {
    background: transparent;
    border-color: transparent;
    color: var(--ink-700);
}

.btn--ghost:hover {
    background: var(--ink-100);
    border-color: transparent;
    box-shadow: none;
}

.btn--secondary {
    background: var(--white);
    color: var(--ink);
}

.btn--pill {
    border-radius: var(--radius-pill);
    padding-inline: 26px;
}

/* ───────────────────────────── Cards grid ───────────────────────────── */

.cards-grid {
    display: grid;
    gap: var(--s-4);
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: var(--s-5) var(--s-5) var(--s-6);
    box-shadow: var(--shadow-xs);
    transition: transform var(--motion-base) var(--ease-standard),
                box-shadow var(--motion-base) var(--ease-standard),
                border-color var(--motion-base) var(--ease-standard);
}

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

.card__eyebrow {
    display: inline-block;
    font-size: var(--text-2xs);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-600);
    margin-bottom: var(--s-3);
}

.card p, .card li {
    font-size: var(--text-sm);
    color: var(--ink-700);
    line-height: 1.55;
}

.bullet-list li {
    padding-left: 18px;
    position: relative;
    margin-bottom: 6px;
}

.bullet-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 9px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

/* ───────────────────────────── Quotes ───────────────────────────── */

.quote-grid {
    display: grid;
    gap: var(--s-3);
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    margin-bottom: var(--s-8);
}

.quote {
    background: var(--white);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-md);
    padding: var(--s-4) var(--s-5);
    box-shadow: var(--shadow-xs);
}

.quote p {
    font-size: var(--text-md);
    font-weight: 600;
    line-height: 1.35;
    color: var(--ink);
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

.quote cite {
    font-size: var(--text-xs);
    font-style: normal;
    color: var(--ink-600);
    font-weight: 500;
}

.voice-rules {
    display: grid;
    gap: var(--s-4);
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.voice-rule {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: var(--s-5);
    box-shadow: var(--shadow-xs);
}

.voice-rule__label {
    display: inline-block;
    font-size: var(--text-2xs);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    margin-bottom: var(--s-3);
}

.voice-rule--do .voice-rule__label {
    background: rgba(34, 160, 107, 0.12);
    color: var(--success);
}

.voice-rule--dont .voice-rule__label {
    background: rgba(214, 59, 59, 0.10);
    color: var(--error);
}

.voice-rule ul li {
    font-size: var(--text-sm);
    color: var(--ink-700);
    padding: 6px 0;
    border-bottom: 1px solid var(--line);
}

.voice-rule ul li:last-child { border-bottom: none; }

/* ───────────────────────────── Color swatches ───────────────────────────── */

.swatches {
    display: grid;
    gap: var(--s-3);
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-bottom: var(--s-6);
}

.swatches--small {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.swatch {
    background: var(--c);
    color: var(--ink);
    padding: var(--s-5) var(--s-5) var(--s-4);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 110px;
    justify-content: flex-end;
    transition: transform var(--motion-base) var(--ease-standard);
}

.swatch:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.swatch__name {
    font-weight: 700;
    font-size: var(--text-base);
    color: var(--ink);
}

.swatch__hex {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: var(--text-xs);
    color: var(--ink);
    letter-spacing: -0.01em;
    opacity: 0.75;
}

.swatch__var {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: var(--text-2xs);
    color: var(--ink);
    opacity: 0.55;
    margin-top: 4px;
}

.swatch--sm {
    min-height: 80px;
    padding: var(--s-4);
}

.swatch--sm .swatch__name { font-size: var(--text-xs); margin-top: 4px; }

.rules {
    background: var(--white);
    border: 1px dashed var(--ink-200);
    border-radius: var(--radius-lg);
    padding: var(--s-5);
    margin-top: var(--s-6);
}

.rules p {
    font-size: var(--text-sm);
    color: var(--ink-700);
    margin-bottom: 8px;
}

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

/* ───────────────────────────── Type scale ───────────────────────────── */

.type-scale {
    display: flex;
    flex-direction: column;
    gap: var(--s-5);
}

.type-row {
    display: grid;
    gap: var(--s-4);
    grid-template-columns: 1fr 220px;
    padding: var(--s-5);
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    align-items: center;
}

.type-row__sample {
    color: var(--ink);
    overflow-wrap: break-word;
}

.type-row__meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-left: 1px solid var(--line);
    padding-left: var(--s-4);
}

.type-row__label {
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--ink);
}

.type-row__meta code {
    font-size: var(--text-2xs);
    color: var(--ink-600);
    line-height: 1.5;
}

@media (max-width: 720px) {
    .type-row {
        grid-template-columns: 1fr;
        gap: var(--s-3);
    }
    .type-row__meta {
        border-left: none;
        border-top: 1px solid var(--line);
        padding-left: 0;
        padding-top: var(--s-3);
    }
}

/* ───────────────────────────── Tokens grid ───────────────────────────── */

.tokens-grid {
    display: grid;
    gap: var(--s-6);
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.tokens-block {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: var(--s-5);
    box-shadow: var(--shadow-xs);
}

.tokens-block .subhead { margin-top: 0; }

/* Spacing list */
.space-list {
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
}

.space-list li {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    font-size: var(--text-xs);
    color: var(--ink-700);
}

.space-list code {
    color: var(--ink-700);
    font-size: var(--text-2xs);
}

.space-bar {
    display: inline-block;
    height: 12px;
    background: var(--accent);
    border-radius: 2px;
    flex-shrink: 0;
}

/* Radius grid */
.radius-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: var(--s-2);
}

.radius-tile {
    aspect-ratio: 1;
    background: var(--accent);
    color: var(--ink);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-2xs);
    font-weight: 600;
    text-align: center;
    padding: 4px;
}

.radius-tile code {
    font-size: 10px;
    line-height: 1.1;
}

/* Shadow grid */
.shadow-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: var(--s-3);
}

.shadow-tile {
    aspect-ratio: 1;
    background: var(--white);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: var(--ink-600);
    font-weight: 600;
}

/* ───────────────────────────── Components demo ───────────────────────────── */

.comp { margin-bottom: var(--s-10); }

.comp__row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-3);
    align-items: center;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: var(--accent);
    color: var(--ink);
    border-radius: var(--radius-pill);
}

.badge--ink { background: var(--ink); color: var(--white); }
.badge--success { background: var(--success); color: var(--white); }
.badge--error { background: var(--error); color: var(--white); }

.card-demo {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: var(--s-4) var(--s-5);
    display: flex;
    align-items: center;
    gap: var(--s-3);
    box-shadow: var(--shadow-xs);
    transition: transform var(--motion-base) var(--ease-standard), border-color var(--motion-base) var(--ease-standard);
    cursor: pointer;
    min-height: 72px;
}

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

.card-demo__icon {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: rgba(251, 187, 33, 0.14);
    color: var(--ink);
    display: grid;
    place-items: center;
}

.card-demo__icon--accent {
    background: var(--accent);
}

.card-demo__title {
    font-weight: 600;
    font-size: var(--text-base);
    color: var(--ink);
}

.card-demo__sub {
    font-size: var(--text-xs);
    color: var(--ink-600);
}

.card-demo__chev {
    margin-left: auto;
    color: var(--ink-600);
    font-size: var(--text-md);
}

.card-demo--primary {
    background: var(--ink);
    border-color: var(--ink);
}

.card-demo--primary .card-demo__title { color: var(--white); font-weight: 700; }
.card-demo--primary .card-demo__sub { color: rgba(255,255,255,0.7); }
.card-demo--primary .card-demo__chev { color: var(--accent); }

.card-demo--feature {
    background: linear-gradient(135deg, var(--accent-warm-bg) 0%, var(--white) 65%);
    border-color: rgba(251, 187, 33, 0.55);
    display: grid;
    grid-template-columns: 40px 1fr auto;
    grid-template-rows: auto auto;
    column-gap: var(--s-3);
    row-gap: var(--s-3);
    padding: var(--s-3) var(--s-5) var(--s-4);
}

.card-demo--feature > .badge {
    grid-column: 1 / -1;
    justify-self: end;
}

.card-demo--feature > .card-demo__icon { grid-row: 2; }
.card-demo--feature > div { grid-row: 2; }
.card-demo--feature > .card-demo__chev { grid-row: 2; }

/* Form fields */
.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 220px;
    min-width: 200px;
}

.field__label {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--ink-700);
}

.field__input {
    height: 44px;
    padding: 0 14px;
    font: 400 var(--text-sm) 'Figtree', sans-serif;
    color: var(--ink);
    background: var(--white);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-sm);
    transition: border-color var(--motion-base) var(--ease-standard), box-shadow var(--motion-base) var(--ease-standard);
}

textarea.field__input {
    height: auto;
    padding: 12px 14px;
    line-height: 1.5;
    resize: vertical;
}

.field__input::placeholder { color: var(--ink-400); }

.field__input:focus {
    outline: none;
    border-color: var(--ink);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Social pills */
.social-pills {
    display: flex;
    gap: var(--s-3);
}

.social-pills a {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--white);
    border: 1px solid var(--line);
    display: grid;
    place-items: center;
    color: var(--ink);
    box-shadow: var(--shadow-xs);
    transition: transform var(--motion-base) var(--ease-standard), background var(--motion-base) var(--ease-standard), color var(--motion-base) var(--ease-standard);
}

.social-pills a:hover {
    background: var(--ink);
    color: var(--accent);
    transform: translateY(-2px) rotate(-3deg);
    box-shadow: var(--shadow-md);
}

.social-pills svg {
    width: 20px;
    height: 20px;
}

/* ───────────────────────────── Brand assets ───────────────────────────── */

.assets-grid {
    display: grid;
    gap: var(--s-4);
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.asset-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: var(--s-4);
    box-shadow: var(--shadow-xs);
    text-align: center;
}

.asset-card__preview {
    aspect-ratio: 4/3;
    border-radius: var(--radius-md);
    display: grid;
    place-items: center;
    margin-bottom: var(--s-4);
    padding: var(--s-4);
}

.asset-card__preview--ink { background: var(--ink); }
.asset-card__preview--accent { background: var(--accent); }
.asset-card__preview--cream { background: var(--cream); border: 1px solid var(--line); }

.asset-card__name {
    font-weight: 700;
    font-size: var(--text-sm);
    color: var(--ink);
    margin-bottom: 4px;
}

.asset-card__hint {
    font-size: var(--text-xs);
    color: var(--ink-600);
}

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

.foot {
    text-align: center;
    padding: var(--s-12) var(--s-4) var(--s-8);
    color: var(--ink-600);
    font-size: var(--text-sm);
    line-height: 1.6;
}

.foot__copy {
    margin-top: var(--s-3);
    font-size: var(--text-xs);
    opacity: 0.8;
}

/* ───────────────────────────── Reduce motion ───────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
