/* ============================================================
   The Little Kitchen — a storybook surface inside cubud's tokens.
   Bedtime register: enormous patient type, terracotta drop caps,
   amber-underlined wonder-phrases, and a literal door at the end
   of every page (<details> — taps open, prints open).
   Tokens only; light and dark ride the baseof token swap.
   ============================================================ */

.lk {
    max-width: 46rem;
    margin: 0 auto;
    padding: 2rem 5% 5rem;
}

/* ---------- shared type ---------- */

.lk-overline {
    font-size: 0.85rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-action-terracotta);
    font-weight: 700;
}

.lk-title {
    font-size: clamp(2.6rem, 8vw, 4.4rem);
    line-height: 1.02;
    letter-spacing: -0.03em;
    color: var(--ui-logo);
    margin: 0.35rem 0 0.6rem;
}

.lk-lede, .lk-whisper {
    font-size: 1.2rem;
    line-height: 1.6;
    color: var(--ui-text-faded);
    font-style: italic;
    max-width: 34rem;
}

/* ---------- the shelf (list page) ---------- */

.lk-masthead { margin-bottom: 3rem; }

.lk-shelf {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1.25rem;
}

.lk-cover {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 0.3rem;
    min-height: 220px;
    padding: 1.1rem;
    text-decoration: none;
    background: var(--ui-surface);
    border: 1px solid var(--ui-border-strong);
    clip-path: var(--chamfer-container-md);
    position: relative;
    overflow: hidden;
    transform: rotate(calc((var(--lk-i) - 3.5) * 0.35deg));
    transition: transform 0.25s ease;
    animation: lk-arrive 0.5s ease backwards;
    animation-delay: calc(var(--lk-i) * 90ms);
}
.lk-cover:hover, .lk-cover:focus-visible {
    transform: rotate(0deg) translateY(-4px);
}
/* alternating warm accents along the shelf — brand + action tones only */
.lk-cover:nth-child(3n+1) { border-top: 6px solid var(--color-action-terracotta); }
.lk-cover:nth-child(3n+2) { border-top: 6px solid var(--color-action-amber); }
.lk-cover:nth-child(3n)   { border-top: 6px solid var(--color-brand-pine); }

.lk-cover-letter {
    position: absolute;
    top: -0.28em;
    right: 0.02em;
    font-size: 7.5rem;
    font-weight: 800;
    line-height: 1;
    color: var(--ui-border);
    letter-spacing: -0.05em;
    user-select: none;
}
.lk-cover-name {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--ui-logo);
    letter-spacing: -0.02em;
    position: relative;
}
.lk-cover-whisper {
    font-size: 0.92rem;
    font-style: italic;
    color: var(--ui-text-faded);
    position: relative;
}

.lk-shelf-foot {
    margin-top: 3rem;
    font-size: 0.95rem;
    color: var(--ui-text-faded);
    font-style: italic;
}

@keyframes lk-arrive {
    from { opacity: 0; transform: translateY(14px); }
}

/* ---------- the reading page ---------- */

.lk-crumb { margin-bottom: 2.5rem; }
.lk-crumb a {
    color: var(--ui-text-faded);
    text-decoration: none;
    font-size: 0.95rem;
}
.lk-crumb a:hover { color: var(--color-action-terracotta); }

.lk-page-head { margin-bottom: 2.5rem; }

.lk-prose {
    font-size: 1.35rem;
    line-height: 1.75;
    color: var(--ui-text);
}
.lk-prose p { margin: 0 0 1.5em; }

/* drop cap: the first letter of the first paragraph, set in terracotta
   on a chamfered oat block — the storybook's opening breath */
.lk-prose > p:first-of-type::first-letter {
    float: left;
    font-size: 4.6em;
    line-height: 0.82;
    font-weight: 800;
    color: var(--ui-on-accent);
    background: var(--color-action-terracotta);
    padding: 0.08em 0.16em 0.02em;
    margin: 0.06em 0.18em 0 0;
    clip-path: var(--chamfer-affordance-sm);
}

/* wonder-phrases: bold text carries an amber swash under it */
.lk-prose strong {
    font-weight: 800;
    background: linear-gradient(transparent 68%, var(--color-action-amber) 68%, var(--color-action-amber) 92%, transparent 92%);
    padding: 0 0.08em;
}

/* the story-clothes: any h2 section (cherry's tale) reads as a stitched card */
.lk-prose h2 {
    font-size: 1.5rem;
    color: var(--ui-logo);
    margin: 2.2em 0 0.8em;
    letter-spacing: -0.01em;
}
.lk-prose blockquote {
    margin: 1.4em 0;
    padding: 1.2em 1.6em;
    background: var(--ui-surface);
    border: 2px dashed var(--ui-border-strong);
    clip-path: var(--chamfer-container-md);
    font-style: italic;
    font-size: 1.25rem;
    transform: rotate(-0.5deg);
}
.lk-prose blockquote p { margin: 0.2em 0; }

/* ---------- the door ---------- */

.lk-door {
    margin: 3.5rem auto 2rem;
    max-width: 30rem;
}
.lk-door summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.9rem;
    outline-offset: 6px;
}
.lk-door summary::-webkit-details-marker { display: none; }

.lk-door-frame {
    display: block;
    padding: 10px;
    background: var(--ui-border-strong);
    clip-path: var(--chamfer-container-md);
}
.lk-door-leaf {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 150px;
    height: 210px;
    background: var(--color-brand-pine);
    clip-path: var(--chamfer-container-md);
    position: relative;
    transform-origin: left center;
    transition: transform 0.55s cubic-bezier(0.3, 0.8, 0.3, 1);
}
.lk-door-knob {
    position: absolute;
    right: 14px;
    top: 50%;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--color-action-amber);
}
.lk-door-plaque {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ui-on-brand);
    text-align: center;
    line-height: 1.5;
}
.lk-door-hint {
    font-size: 0.98rem;
    font-style: italic;
    color: var(--ui-text-faded);
    text-align: center;
}

/* opening: the door leans on its hinge and the room behind appears */
.lk-door[open] .lk-door-leaf { transform: perspective(700px) rotateY(-52deg); }
.lk-door[open] .lk-door-hint { display: none; }

.lk-door-inside {
    margin-top: 1.6rem;
    padding: 1.6rem 1.8rem;
    background: var(--ui-surface);
    border: 1px solid var(--ui-border-strong);
    clip-path: var(--chamfer-container-md);
    animation: lk-arrive 0.5s ease backwards 0.25s;
}
.lk-door-question {
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.55;
    color: var(--ui-logo);
    margin: 0 0 0.8em;
}
.lk-door-promise {
    font-size: 1.15rem;
    line-height: 1.65;
    color: var(--ui-text);
    margin: 0;
}

.lk-page-foot { margin-top: 3.5rem; text-align: center; }
.lk-next {
    color: var(--color-action-terracotta);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.05rem;
}
.lk-next:hover { text-decoration: underline; }

/* ---------- calm for those who ask for it ---------- */

@media (prefers-reduced-motion: reduce) {
    .lk-cover, .lk-door-leaf, .lk-door-inside { animation: none; transition: none; }
    .lk-cover { transform: none; }
}

/* ---------- paper: the bedtime edition ---------- */

@media print {
    body > header, body > footer, .lk-crumb, .lk-page-foot, .lk-door-hint { display: none !important; }
    .lk { max-width: none; padding: 0; }
    .lk-prose { font-size: 13.5pt; line-height: 1.7; }
    /* paper can't tap: the door prints open */
    .lk-door:not([open]) .lk-door-inside { display: block; }
    .lk-door summary { pointer-events: none; }
    .lk-door-frame { display: none; }
    .lk-door-inside { border: 2pt solid var(--color-brand-pine); page-break-inside: avoid; }
    .lk-door-inside::before {
        content: "A DOOR FOR LATER";
        display: block;
        font-size: 9pt;
        font-weight: 700;
        letter-spacing: 0.1em;
        margin-bottom: 0.6em;
    }
    .lk-cover { animation: none; transform: none; }
}
