/* =========================================================================
   HOME — "PAPER ARCADE"
   -------------------------------------------------------------------------
   The rebuilt landing page: a tactile hero with today's daily drop, a
   filterable library of all 18 puzzles, a bento of reasons to come back, the
   journal and a big closing prompt.

   All selectors are scoped under .pf-home (or use the pf- prefix) so nothing
   here can leak into the game screens that still own their own layouts.
   ========================================================================= */

.pf-home {
    position: relative;
    overflow: clip;
    background: var(--pf-paper);
}

/* The legacy stylesheet puts body in a centred flex column and ui-kit adds
   a 12px padding for its "mobile optimised" mode. The new landing pages are
   full-bleed, so opt out explicitly. Scoped by a body class so old screens
   keep the compatibility layout they were designed against. */
body.pf-home-body {
    display: block !important;
    align-items: stretch !important;
    padding: 0 !important;
    margin: 0 !important;
}
body.pf-home-body .pf-home { width: 100%; }
body.pf-home-body .pf-header,
body.pf-home-body .pf-footer { width: 100%; }

.pf-home [hidden] { display: none !important; }

/* Shared heading furniture ------------------------------------------------ */
.pf-sectionhead {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: clamp(26px, 4vw, 44px);
}
.pf-sectionhead--left { align-items: flex-start; }
.pf-sectionhead__title {
    margin: 8px 0 0;
    font-size: clamp(2.3rem, 4.4vw, 3.8rem);
    font-weight: 900;
    letter-spacing: -0.055em;
    line-height: 0.94;
}
.pf-sectionhead__note {
    max-width: 30ch;
    margin: 0 0 6px;
    color: var(--pf-ink-soft);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    line-height: 1.6;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-align: right;
}
.pf-sectionhead__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 24px;
    padding: 2px 0;
    margin-bottom: 8px;
    color: var(--pf-ink);
    font-size: 0.85rem;
    font-weight: 800;
    text-decoration: none;
    border-bottom: 2px solid var(--pf-ink);
    padding-bottom: 2px;
}
.pf-sectionhead__link:hover { color: var(--pf-pine); border-color: var(--pf-pine); }

/* =========================================================================
   1. HERO
   ========================================================================= */
.pf-hero {
    position: relative;
    padding-top: clamp(34px, 5.6vw, 78px);
}
.pf-hero__texture {
    position: absolute;
    inset: 0 0 auto;
    height: calc(100% - 54px);
    background-image: radial-gradient(rgba(38, 32, 25, 0.18) 1.1px, transparent 1.1px);
    background-size: 23px 23px;
    -webkit-mask-image: radial-gradient(120% 90% at 62% 28%, #000 12%, transparent 72%);
    mask-image: radial-gradient(120% 90% at 62% 28%, #000 12%, transparent 72%);
    opacity: 0.55;
    pointer-events: none;
}
html[data-theme="dark"] .pf-hero__texture {
    background-image: radial-gradient(rgba(247, 242, 231, 0.2) 1.1px, transparent 1.1px);
    opacity: 0.36;
}
.pf-hero__texture::before {
    content: "";
    position: absolute;
    top: -12%;
    right: 2%;
    width: min(620px, 46vw);
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 197, 61, 0.55), rgba(255, 197, 61, 0) 66%);
    filter: blur(6px);
}
html[data-theme="dark"] .pf-hero__texture::before {
    background: radial-gradient(circle, rgba(124,230,180, 0.23), rgba(124,230,180, 0) 66%);
}
.pf-hero__grid {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
    align-items: center;
    gap: clamp(24px, 4vw, 64px);
    min-height: 560px;
    padding-bottom: clamp(34px, 5vw, 58px);
}

/* Copy column ------------------------------------------------------------ */
.pf-hero__copy { position: relative; z-index: 2; }
.pf-hero__eyebrow {
    margin: 0 0 20px;
    padding: 7px 12px 7px 10px;
    border: 1.5px solid color-mix(in srgb, var(--pf-ink) 22%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--pf-card) 70%, transparent);
    font-size: 0.63rem;
    letter-spacing: 0.13em;
}
.pf-hero__title {
    margin: 0;
    font-size: clamp(2.9rem, 5.6vw, 5.15rem);
    font-weight: 900;
    line-height: 0.94;
    letter-spacing: -0.058em;
}
.pf-hero__accent {
    display: inline-block;
    margin-top: 0.04em;
    padding: 0 0.04em 0.02em;
    white-space: nowrap;
    font-family: var(--font-accent);
    font-size: 0.9em;
    font-style: italic;
    font-weight: 600;
    letter-spacing: -0.035em;
    line-height: 1.02;
    color: var(--pf-pine);
    background-image: linear-gradient(transparent 61%, var(--pf-sun) 61%, var(--pf-sun) 92%, transparent 92%);
    background-repeat: no-repeat;
    background-size: 100% 100%;
}
html[data-theme="dark"] .pf-hero__accent {
    background-image: linear-gradient(transparent 61%, rgba(255, 197, 61, 0.42) 61%, rgba(255, 197, 61, 0.42) 92%, transparent 92%);
}
.pf-hero__lede {
    max-width: 46ch;
    margin: clamp(18px, 2.4vw, 26px) 0 0;
    color: var(--pf-ink-soft);
    font-size: clamp(1rem, 1.25vw, 1.16rem);
    line-height: 1.6;
    font-weight: 500;
}
.pf-hero__ctas {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: clamp(22px, 3vw, 32px);
}
.pf-dice {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border: 1.5px solid currentColor;
    border-radius: 6px;
    font-size: 0.8rem;
    line-height: 1;
}
.pf-btn--ghost {
    border-style: dashed;
    background: transparent;
    color: var(--pf-ink);
}
.pf-btn--ghost:hover { background: var(--pf-sun-soft); }
.pf-hero__facts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin: 26px 0 0;
    padding: 0;
    list-style: none;
    color: var(--pf-ink-soft);
    font-size: 0.8rem;
    font-weight: 650;
}
.pf-hero__facts li { display: inline-flex; align-items: center; gap: 6px; }
.pf-hero__facts span {
    display: inline-grid;
    place-items: center;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: var(--pf-spatial);
    color: var(--pf-spatial-ink);
    font-size: 0.62rem;
    font-weight: 900;
}

/* Stage column ----------------------------------------------------------- */
.pf-hero__stage {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    min-height: 530px;
    perspective: 1200px;
}
.pf-hero__sticker {
    position: absolute;
    top: 6px;
    right: 4%;
    z-index: 6;
    transform: rotate(5deg);
    box-shadow: 3px 3px 0 var(--pf-ink);
    background: var(--pf-sun);
}
.pf-hero__star {
    position: absolute;
    left: 0;
    bottom: 6%;
    width: 34px;
    height: 34px;
    color: var(--pf-pine);
    animation: pf-spin 22s linear infinite;
}
@keyframes pf-spin { to { transform: rotate(360deg); } }

/* Daily card ------------------------------------------------------------- */
.pf-daily {
    position: relative;
    z-index: 5;
    display: flex;
    flex-direction: column;
    width: min(360px, 84%);
    padding: 16px;
    border: 2px solid var(--pf-ink);
    border-radius: 28px;
    background: var(--pf-card);
    color: var(--pf-ink);
    text-decoration: none;
    box-shadow: 10px 10px 0 var(--pf-ink);
    transform: rotate(-2.2deg);
    transition: transform 0.35s var(--ease-spring), box-shadow 0.35s var(--ease-spring);
}
.pf-daily:hover,
.pf-daily:focus-visible {
    color: var(--pf-ink);
    transform: rotate(0deg) translateY(-6px);
    box-shadow: 14px 16px 0 var(--pf-ink);
}
.pf-daily__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 2px 4px 12px;
}
.pf-daily__kicker {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}
.pf-daily__date {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--pf-ink-soft);
}
.pf-daily__art {
    position: relative;
    display: grid;
    place-items: center;
    height: 210px;
    border: 2px solid var(--pf-ink);
    border-radius: 18px;
    background: var(--pf-word-soft);
    overflow: hidden;
    --fam: var(--pf-word);
}
.pf-daily[data-family="logic"] .pf-daily__art { background: var(--pf-logic-soft); --fam: var(--pf-logic); }
.pf-daily[data-family="spatial"] .pf-daily__art { background: var(--pf-spatial-soft); --fam: var(--pf-spatial); }
.pf-daily__art::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(color-mix(in srgb, var(--pf-ink) 18%, transparent) 1px, transparent 1px);
    background-size: 14px 14px;
    opacity: 0.6;
}
.pf-daily__art .puzzle-glyph {
    position: relative;
    width: 152px;
    height: 184px;
    transition: transform 0.4s var(--ease-spring);
}
.pf-daily:hover .puzzle-glyph { transform: scale(1.06) rotate(2deg); }
.pf-daily__body { display: flex; flex-direction: column; gap: 3px; padding: 16px 4px 8px; }
.pf-daily__meta { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.pf-daily__diff {
    padding: 3px 8px;
    border: 1.5px solid var(--pf-ink);
    border-radius: 999px;
    background: var(--pf-sun);
    color: var(--pf-word-ink); /* pinned: parent text is cream in dark */
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.pf-daily__time {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--pf-ink-soft);
}
.pf-daily__title {
    font-family: var(--font-display);
    font-size: clamp(1.7rem, 2.4vw, 2.15rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.04em;
}
.pf-daily__blurb { color: var(--pf-ink-soft); font-size: 0.84rem; font-weight: 600; }
.pf-daily__cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    font-size: 0.86rem;
    font-weight: 850;
}
.pf-daily__cta span { transition: transform var(--dur); }
.pf-daily:hover .pf-daily__cta span { transform: translateX(4px); }
.pf-daily__count {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    padding: 12px 4px 2px;
    border-top: 1.5px dashed color-mix(in srgb, var(--pf-ink) 25%, transparent);
    color: var(--pf-ink-soft);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.pf-daily__count time { color: var(--pf-ink); font-weight: 700; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.pf-daily__utc { color: var(--pf-ink-soft); font-size: 0.72rem; }

/* Floating mini cards ---------------------------------------------------- */
.pf-float {
    position: absolute;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 196px;
    padding: 10px;
    border: 2px solid var(--pf-ink);
    border-radius: 16px;
    background: var(--pf-card);
    color: var(--pf-ink);
    text-decoration: none;
    box-shadow: 5px 6px 0 var(--pf-ink);
    transition: transform 0.3s var(--ease-spring), box-shadow 0.3s var(--ease-spring);
}
.pf-float:hover {
    color: var(--pf-ink);
    transform: translateY(-5px) rotate(-2deg);
    box-shadow: 8px 10px 0 var(--pf-ink);
}
.pf-float--one {
    top: -82px;
    left: 2%;
    transform: rotate(-5deg);
}
.pf-float--one .pf-float__glyph { background: var(--pf-spatial-soft); }
.pf-float--two {
    display: none;
}
.pf-float--two .pf-float__glyph { background: var(--pf-word-soft); }
.pf-float__glyph {
    display: grid;
    place-items: center;
    width: 52px;
    height: 60px;
    flex: 0 0 auto;
    border: 1.5px solid var(--pf-ink);
    border-radius: 10px;
    overflow: hidden;
}
.pf-float__glyph .puzzle-glyph { width: 44px; height: 54px; }
.pf-float__meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pf-float__meta small {
    font-family: var(--font-mono);
    font-size: 0.52rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--pf-ink-soft);
}
.pf-float__meta strong { font-size: 0.86rem; font-weight: 850; letter-spacing: -0.02em; line-height: 1.05; }

/* Marquee ---------------------------------------------------------------- */
.pf-marquee {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-top: 2px solid var(--pf-ink);
    border-bottom: 2px solid var(--pf-ink);
    background: var(--pf-sun);
    /* The band is marigold in BOTH themes, so the ink must be pinned dark —
       --pf-ink flips to cream in dark mode and drops to ~1.6:1 on yellow. */
    color: var(--pf-word-ink);
}
.pf-marquee__track {
    display: flex;
    align-items: center;
    gap: 22px;
    width: max-content;
    padding: 11px 0;
    animation: pf-marquee 50s linear infinite;
}
.pf-marquee:hover .pf-marquee__track { animation-play-state: paused; }
.pf-marquee__item {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    white-space: nowrap;
}
.pf-marquee__star { font-size: 0.8rem; opacity: 0.65; }
@keyframes pf-marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* =========================================================================
   2. LIBRARY
   ========================================================================= */
.pf-library {
    padding: clamp(54px, 8vw, 100px) 0 clamp(44px, 6vw, 76px);
    background:
        radial-gradient(90% 55% at 50% 0%, color-mix(in srgb, var(--pf-sun) 16%, transparent), transparent 70%),
        var(--pf-paper);
}
.pf-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 26px;
}
.pf-filters__btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0.55rem 0.95rem;
    border: 1.5px solid color-mix(in srgb, var(--pf-ink) 22%, transparent);
    border-radius: 999px;
    background: var(--pf-card);
    color: var(--pf-ink);
    font-family: var(--font-body);
    font-size: 0.84rem;
    font-weight: 750;
    line-height: 1;
    cursor: pointer;
    transition: background-color var(--dur), border-color var(--dur), color var(--dur), transform var(--dur);
}
.pf-filters__btn span {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    opacity: 0.55;
}
.pf-filters__btn:hover {
    border-color: var(--pf-ink);
    background: var(--pf-sun-soft);
    transform: translateY(-1px);
}
.pf-filters__btn.is-active {
    border-color: var(--pf-ink);
    background: var(--pf-ink);
    color: var(--pf-paper);
}
html[data-theme="dark"] .pf-filters__btn.is-active { color: #0B2418; }
.pf-filters__btn.is-active span { opacity: 0.7; }
.pf-filters__btn--3d { border-color: var(--pf-pine); color: var(--pf-pine); }
.pf-filters__btn--3d.is-active { background: var(--pf-pine); border-color: var(--pf-ink); color: #FFFDF7; }
html[data-theme="dark"] .pf-filters__btn--3d.is-active { color: #0B2418; }
.pf-filters__divider {
    width: 1px;
    height: 22px;
    margin: 0 4px;
    background: color-mix(in srgb, var(--pf-ink) 20%, transparent);
}

.pf-gamegrid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
.pf-game {
    --fam: var(--pf-word);
    --fam-soft: var(--pf-word-soft);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 318px;
    padding: 14px;
    border: 2px solid var(--pf-ink);
    border-radius: 22px;
    background: var(--pf-card);
    color: var(--pf-ink);
    text-decoration: none;
    box-shadow: 4px 4px 0 var(--pf-ink);
    transition: transform var(--dur) var(--ease-spring),
                box-shadow var(--dur) var(--ease-spring),
                background-color var(--dur);
    overflow: hidden;
}
.pf-game[data-family="logic"] { --fam: var(--pf-logic); --fam-soft: var(--pf-logic-soft); }
.pf-game[data-family="spatial"] { --fam: var(--pf-spatial); --fam-soft: var(--pf-spatial-soft); }
.pf-game:hover,
.pf-game:focus-visible {
    color: var(--pf-ink);
    transform: translateY(-5px) rotate(-0.4deg);
    box-shadow: 8px 10px 0 var(--pf-ink);
    background: color-mix(in srgb, var(--pf-card) 86%, var(--fam-soft));
}
.pf-game__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 2px;
}
.pf-game__tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--pf-ink-soft);
}
.pf-game__tag::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--fam);
    border: 1px solid color-mix(in srgb, var(--pf-ink) 35%, transparent);
}
.pf-game__dim {
    padding: 2px 6px;
    border: 1px solid color-mix(in srgb, var(--pf-ink) 24%, transparent);
    border-radius: 5px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--pf-ink-soft);
}
.pf-game[data-dim="3D"] .pf-game__dim {
    border-color: var(--pf-ink);
    background: var(--pf-pine);
    color: #FFFDF7;
}
html[data-theme="dark"] .pf-game[data-dim="3D"] .pf-game__dim { color: #0B2418; }
.pf-game__art {
    display: grid;
    place-items: center;
    height: 146px;
    margin: 4px 0 10px;
    border: 1.5px solid color-mix(in srgb, var(--pf-ink) 20%, transparent);
    border-radius: 14px;
    background: var(--fam-soft);
    overflow: hidden;
}
.pf-game__art .puzzle-glyph {
    width: 92px;
    height: 112px;
    transition: transform 0.4s var(--ease-spring);
}
.pf-game:hover .puzzle-glyph { transform: scale(1.07) rotate(3deg); }
.pf-game__name {
    font-family: var(--font-display);
    font-size: 1.18rem;
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.035em;
}
.pf-game:hover .pf-game__name { color: var(--pf-pine); }
.pf-game__blurb { color: var(--pf-ink-soft); font-size: 0.8rem; font-weight: 550; line-height: 1.35; }
.pf-game__play {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: auto;
    padding-top: 8px;
    font-size: 0.78rem;
    font-weight: 850;
}
.pf-game__arrow { transition: transform var(--dur); }
.pf-game:hover .pf-game__arrow { transform: translateX(4px); }
.pf-game[data-dim="3D"] .pf-game__play { color: var(--pf-pine); }

/* =========================================================================
   3. BENTO
   ========================================================================= */
.pf-bento-section {
    padding: clamp(40px, 6vw, 72px) 0 clamp(54px, 8vw, 90px);
}
.pf-bento {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 16px;
}
.pf-bento__card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 290px;
    padding: clamp(20px, 2.4vw, 30px);
    border: 2px solid var(--pf-ink);
    border-radius: 24px;
    background: var(--pf-card);
    box-shadow: 5px 5px 0 var(--pf-ink);
    overflow: hidden;
}
.pf-bento__card--wide { grid-column: span 7; flex-direction: row; align-items: center; gap: 22px; }
.pf-bento__card:not(.pf-bento__card--wide) { grid-column: span 5; }
.pf-bento__card--night {
    background: var(--pf-ink);
    color: var(--pf-paper);
}
html[data-theme="dark"] .pf-bento__card--night { color: #0B2418; }
.pf-bento__card--night h3,
.pf-bento__card--night .pf-eyebrow { color: inherit; }
.pf-bento__card--sun { background: var(--pf-sun); color: #262019; }
.pf-bento__card--mint { background: var(--pf-spatial); color: #04231C; }
.pf-bento__card--paper { background: var(--pf-card); }
.pf-bento__copy { flex: 1 1 auto; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.pf-bento__card h3 {
    margin: 0;
    font-size: clamp(1.7rem, 2.6vw, 2.4rem);
    font-weight: 900;
    letter-spacing: -0.045em;
    line-height: 0.98;
}
.pf-bento__card p {
    max-width: 36ch;
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.5;
    opacity: 0.76;
}
.pf-bento__card .pf-btn,
.pf-bento__link { margin-top: auto; }
.pf-bento__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 24px;
    padding: 3px 0;
    color: inherit;
    font-size: 0.82rem;
    font-weight: 850;
    text-decoration: none;
    border-bottom: 1.5px solid currentColor;
    padding-bottom: 2px;
    width: fit-content;
}
.pf-bento__link:hover { color: inherit; opacity: 0.72; }
.pf-eyebrow--light { color: inherit; opacity: 0.6; }

.pf-streak {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    padding: 8px;
    border: 1.5px dashed color-mix(in srgb, var(--pf-paper) 32%, transparent);
    border-radius: 16px;
}
.pf-streak__day {
    display: grid;
    place-items: center;
    width: 32px;
    height: 38px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--pf-paper) 12%, transparent);
    font-family: var(--font-mono);
    font-size: 0.66rem;
    font-weight: 700;
}
.pf-streak__day.is-done { background: var(--pf-sun); color: #262019; }
.pf-streak__flame { margin-left: 4px; font-size: 1.4rem; }

.pf-podium {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 6px;
    height: 108px;
    margin-top: auto;
}
.pf-podium__bar {
    display: grid;
    place-items: center;
    width: 54px;
    border: 2px solid #262019;
    border-radius: 8px 8px 0 0;
    background: rgba(38, 32, 25, 0.12);
    font-family: var(--font-mono);
    font-size: 1rem;
}
.pf-podium__bar--1 { height: 100%; background: #262019; color: var(--pf-sun); }
.pf-podium__bar--2 { height: 70%; }
.pf-podium__bar--3 { height: 50%; }

.pf-ticket {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding: 16px 18px;
    border: 2px dashed #04231C;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.26);
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.12em;
}
.pf-ticket__stars { font-size: 0.9rem; letter-spacing: 0.05em; }
.pf-ticket__notch {
    position: absolute;
    top: 50%;
    width: 14px;
    height: 14px;
    border: 2px solid #04231C;
    border-radius: 50%;
    background: var(--pf-spatial);
    transform: translateY(-50%);
}
.pf-ticket__notch--l { left: -9px; }
.pf-ticket__notch--r { right: -9px; }

.pf-progress {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 0 0 300px;
    padding: 16px;
    border: 1.5px solid color-mix(in srgb, var(--pf-ink) 18%, transparent);
    border-radius: 16px;
    background: color-mix(in srgb, var(--pf-paper) 60%, transparent);
}
.pf-progress__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--pf-ink-soft);
}
.pf-progress__row span:last-child { color: var(--pf-ink); font-weight: 700; }
.pf-progress__bar {
    height: 8px;
    margin-top: -6px;
    border-radius: 99px;
    background: color-mix(in srgb, var(--pf-ink) 10%, transparent);
    overflow: hidden;
}
.pf-progress__bar i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--pf-pine);
}
.pf-progress__row:nth-of-type(3) + .pf-progress__bar i { background: var(--pf-spatial); }
.pf-progress__row:nth-of-type(5) + .pf-progress__bar i { background: var(--pf-word); }

/* =========================================================================
   4. MANIFESTO / FAMILIES
   ========================================================================= */
.pf-manifesto {
    padding: clamp(54px, 8vw, 96px) 0;
    border-top: 2px solid var(--pf-ink);
    border-bottom: 2px solid var(--pf-ink);
    background:
        radial-gradient(70% 90% at 0% 50%, color-mix(in srgb, var(--pf-sun) 15%, transparent), transparent 60%),
        var(--pf-paper);
}
.pf-manifesto__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
    gap: clamp(34px, 6vw, 80px);
    align-items: center;
}
.pf-manifesto__copy h2 {
    margin: 12px 0 20px;
    font-size: clamp(2.2rem, 4.2vw, 3.6rem);
    font-weight: 900;
    letter-spacing: -0.055em;
    line-height: 0.98;
}
.pf-accent-serif {
    font-family: var(--font-accent);
    font-style: italic;
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--pf-pine);
}
.pf-manifesto__copy p {
    max-width: 52ch;
    margin: 0 0 14px;
    color: var(--pf-ink-soft);
    font-size: 0.98rem;
    line-height: 1.65;
}
.pf-manifesto__copy .pf-btn { margin-top: 10px; }

.pf-families { display: flex; flex-direction: column; gap: 10px; }
.pf-family {
    --fam: var(--pf-word);
    --fam-soft: var(--pf-word-soft);
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border: 2px solid var(--pf-ink);
    border-radius: 16px;
    background: var(--pf-card);
    color: var(--pf-ink);
    text-decoration: none;
    box-shadow: 3px 3px 0 var(--pf-ink);
    transition: transform var(--dur) var(--ease-spring), box-shadow var(--dur) var(--ease-spring);
}
.pf-family[data-family="logic"] { --fam: var(--pf-logic); --fam-soft: var(--pf-logic-soft); }
.pf-family[data-family="spatial"] { --fam: var(--pf-spatial); --fam-soft: var(--pf-spatial-soft); }
.pf-family:hover {
    color: var(--pf-ink);
    transform: translateX(4px);
    box-shadow: 6px 4px 0 var(--pf-ink);
}
.pf-family__count {
    position: absolute;
    top: -8px;
    right: 12px;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border: 1.5px solid var(--pf-ink);
    border-radius: 50%;
    background: var(--fam);
    font-family: var(--font-mono);
    font-size: 0.66rem;
    font-weight: 700;
    color: var(--pf-word-ink);
}
.pf-family__glyph {
    display: grid;
    place-items: center;
    width: 70px;
    height: 78px;
    flex: 0 0 auto;
    border: 1.5px solid color-mix(in srgb, var(--pf-ink) 20%, transparent);
    border-radius: 10px;
    background: var(--fam-soft);
    overflow: hidden;
}
.pf-family__glyph .puzzle-glyph { width: 56px; height: 68px; }
.pf-family__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pf-family__title { font-size: 1.08rem; font-weight: 900; letter-spacing: -0.03em; }
.pf-family__blurb { color: var(--pf-ink-soft); font-size: 0.78rem; font-weight: 550; line-height: 1.35; }
.pf-family__arrow { margin-left: auto; font-size: 1.05rem; color: var(--pf-ink-soft); }
.pf-family:hover .pf-family__arrow { color: var(--pf-pine); }

.pf-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin-top: 10px;
    padding-top: 14px;
    border-top: 2px solid var(--pf-ink);
}
.pf-stats div { display: flex; flex-direction: column; gap: 0; }
.pf-stats strong {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 2.6vw, 2.2rem);
    font-weight: 900;
    letter-spacing: -0.05em;
    line-height: 1;
}
.pf-stats span {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--pf-ink-soft);
}

/* =========================================================================
   5. JOURNAL
   ========================================================================= */
.pf-journal { padding: clamp(54px, 8vw, 96px) 0 clamp(30px, 5vw, 56px); }
.pf-journal__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}
.pf-article {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 12px 18px;
    border: 2px solid var(--pf-ink);
    border-radius: 20px;
    background: var(--pf-card);
    color: var(--pf-ink);
    text-decoration: none;
    box-shadow: 4px 4px 0 var(--pf-ink);
    transition: transform var(--dur) var(--ease-spring), box-shadow var(--dur) var(--ease-spring);
}
.pf-article:hover {
    color: var(--pf-ink);
    transform: translateY(-5px);
    box-shadow: 7px 9px 0 var(--pf-ink);
}
.pf-article__art {
    display: grid;
    place-items: center;
    height: 170px;
    margin-bottom: 4px;
    border: 1.5px solid color-mix(in srgb, var(--pf-ink) 18%, transparent);
    border-radius: 12px;
    background-color: var(--pf-sun-soft);
    background-size: cover;
    background-position: center;
}
.pf-article[data-index="1"] .pf-article__art { background-color: var(--pf-pink-soft); }
.pf-article[data-index="2"] .pf-article__art { background-color: var(--pf-sky-soft); }
.pf-article__glyph {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
}
.pf-article__glyph .puzzle-glyph {
    width: 96px;
    height: 118px;
    transition: transform 0.4s var(--ease-spring);
}
.pf-article:hover .puzzle-glyph { transform: rotate(-3deg) scale(1.06); }
.pf-article__meta {
    padding: 0 4px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--pf-ink-soft);
}
.pf-article__title {
    padding: 0 4px;
    font-family: var(--font-display);
    font-size: 1.22rem;
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.035em;
}
.pf-article:hover .pf-article__title { color: var(--pf-pine); }
.pf-article__desc {
    padding: 0 4px;
    color: var(--pf-ink-soft);
    font-size: 0.8rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.pf-article__more {
    margin-top: auto;
    padding: 6px 4px 0;
    font-size: 0.78rem;
    font-weight: 850;
}

/* =========================================================================
   6. CTA
   ========================================================================= */
.pf-cta { padding: clamp(24px, 4vw, 46px) 0 clamp(20px, 3vw, 40px); }
.pf-cta__card {
    position: relative;
    overflow: hidden;
    padding: clamp(38px, 6vw, 76px) clamp(20px, 5vw, 70px);
    border: 2px solid var(--pf-ink);
    border-radius: 30px;
    background:
        radial-gradient(80% 120% at 100% 0%, rgba(255, 255, 255, 0.42), transparent 55%),
        var(--pf-sun);
    color: #262019;
    box-shadow: 9px 9px 0 var(--pf-ink);
    text-align: center;
}
.pf-cta__card .pf-eyebrow { justify-content: center; margin-bottom: 12px; }
.pf-cta__card h2 {
    margin: 0 auto;
    max-width: 18ch;
    font-size: clamp(2.4rem, 5.2vw, 4.6rem);
    font-weight: 900;
    letter-spacing: -0.06em;
    line-height: 0.93;
    color: #262019;
}
.pf-cta__card .pf-accent-serif { color: #262019; }
.pf-cta__lede {
    max-width: 46ch;
    margin: 18px auto 0;
    font-size: 0.98rem;
    line-height: 1.55;
    color: rgba(38, 32, 25, 0.7);
}
.pf-cta__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 24px;
}
.pf-cta__actions .pf-btn { box-shadow: 0 5px 0 rgba(38, 32, 25, 0.9); }
.pf-cta__doodle {
    position: absolute;
    font-size: clamp(1.2rem, 2.2vw, 2rem);
    color: rgba(38, 32, 25, 0.55);
    animation: pf-float 5s ease-in-out infinite;
}
.pf-cta__doodle--one { top: 16%; left: 8%; }
.pf-cta__doodle--two { bottom: 20%; left: 18%; animation-delay: 1.4s; font-size: 0.9rem; }
.pf-cta__doodle--three { top: 22%; right: 9%; animation-delay: 0.6s; }
@keyframes pf-float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-9px) rotate(9deg); }
}

/* =========================================================================
   7. RESPONSIVE
   ========================================================================= */
@media (max-width: 1240px) {
    .pf-gamegrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .pf-float--one { left: -1%; }
    .pf-float--two { right: -1%; }
}
@media (max-width: 1080px) {
    .pf-hero__grid { grid-template-columns: 1fr; min-height: 0; }
    .pf-float { display: none; }
    .pf-hero__copy { max-width: 640px; }
    .pf-hero__stage { min-height: 570px; margin-top: 14px; }
    .pf-daily { width: min(360px, 72%); }
    .pf-float--one { left: 4%; top: -72px; }
    .pf-bento__card--wide { grid-column: span 12; }
    .pf-bento__card:not(.pf-bento__card--wide) { grid-column: span 6; }
    .pf-manifesto__grid { grid-template-columns: 1fr; }
    .pf-manifesto__copy { max-width: 680px; }
}
@media (max-width: 860px) {
    .pf-gamegrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pf-journal__grid { grid-template-columns: 1fr 1fr; }
    .pf-journal__grid .pf-article:last-child { display: none; }
    .pf-sectionhead { flex-direction: column; align-items: flex-start; gap: 10px; }
    .pf-sectionhead__note { text-align: left; margin: 0; }
    .pf-bento__card--wide { flex-direction: column; align-items: flex-start; }
    .pf-bento__card:not(.pf-bento__card--wide) { grid-column: span 12; }
    .pf-progress { flex: 1 1 auto; width: 100%; }
    .pf-streak { width: 100%; justify-content: space-between; }
}
@media (max-width: 620px) {
    .pf-hero__title { font-size: clamp(2.65rem, 12.8vw, 4.2rem); }
    .pf-hero__accent { white-space: normal; font-size: 0.82em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
    .pf-hero__lede { font-size: 0.98rem; }
    .pf-hero__ctas { flex-direction: column; align-items: stretch; }
    .pf-hero__ctas .pf-btn { width: 100%; }
    .pf-hero__stage { min-height: 500px; }
    .pf-daily { width: min(340px, 92%); transform: rotate(-1.4deg); box-shadow: 6px 7px 0 var(--pf-ink); }
    .pf-daily__art { height: 180px; }
    .pf-float { display: none; }
    .pf-hero__sticker { top: -4px; right: 2%; }
    .pf-hero__star { display: none; }
    .pf-gamegrid { grid-template-columns: 1fr; }
    .pf-game { min-height: 280px; }
    .pf-game__art { height: 180px; }
    .pf-journal__grid { grid-template-columns: 1fr 1fr; }
    .pf-journal__grid .pf-article:last-child { display: none; }
    .pf-article__art { height: 120px; }
    .pf-article__title { font-size: 1rem; }
    .pf-article__desc { display: none; }
    .pf-cta__card { border-radius: 22px; box-shadow: 6px 6px 0 var(--pf-ink); }
    .pf-filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; margin-inline: -2px; }
    .pf-filters__btn { flex: 0 0 auto; }
    .pf-filters__divider { display: none; }
    .pf-streak__day { width: 28px; height: 34px; }
    .pf-bento { grid-template-columns: 1fr 1fr; gap: 10px; }
    .pf-bento__card { min-height: 0; padding: 16px; }
    .pf-bento__card--wide { grid-column: 1 / -1; }
    .pf-bento__card:not(.pf-bento__card--wide) { grid-column: span 1; }
    .pf-bento__card h3 { font-size: 1.35rem; }
    .pf-bento__card p { font-size: 0.82rem; }
    .pf-streak { margin-top: 8px; }
    .pf-streak__day { width: 26px; height: 30px; }
    .pf-progress { flex: 0 0 auto; width: 100%; }
}

/* Content visibility: the library and below-the-fold sections are expensive
   to paint on low-end phones. This keeps them out of the initial render but
   leaves them fully accessible to find-in-page and keyboard navigation. */
.pf-library,
.pf-bento-section,
.pf-manifesto,
.pf-journal {
    content-visibility: auto;
    contain-intrinsic-size: auto 900px;
}

@media (prefers-reduced-motion: reduce) {
    .pf-marquee__track { animation: none; }
    .pf-hero__star,
    .pf-cta__doodle { animation: none; }
}

/* =========================================================================
   LIBRARY GROUPS — 3D first, then the classics
   -------------------------------------------------------------------------
   Replaces the single 18-card flat grid. Grouping gives the collection an
   actual information hierarchy: the 3D side (the brand's differentiator) is
   first and the classics follow. Each group is a 3×3 table on desktop and a
   compact 2-up grid on phones so the page does not become a 12,000px scroll.
   ========================================================================= */
.pf-library__groups {
    display: flex;
    flex-direction: column;
    gap: clamp(34px, 5vw, 64px);
}
.pf-library__grouphead {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 18px;
    padding-top: 18px;
    border-top: 2px solid var(--pf-ink);
}
.pf-library__grouphead h3 {
    margin: 8px 0 6px;
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 3.2vw, 2.6rem);
    font-weight: 900;
    letter-spacing: -0.05em;
    line-height: 0.98;
}
.pf-library__grouplead {
    max-width: 56ch;
    margin: 0;
    color: var(--pf-ink-soft);
    font-size: 0.88rem;
    line-height: 1.5;
}
.pf-library__grouphead .pf-sectionhead__link { flex: 0 0 auto; }
.pf-library .pf-gamegrid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}
.pf-library .pf-game {
    min-height: 0;
    padding: 16px;
}
.pf-library .pf-game__art { height: clamp(150px, 13.5vw, 178px); }
.pf-library .pf-game__art .puzzle-glyph { width: 138px; height: 168px; }
.pf-library .pf-game__name { font-size: clamp(1.1rem, 1.4vw, 1.3rem); }
.pf-library .pf-game__blurb { font-size: 0.82rem; }
.pf-library .pf-game__play { padding-top: 12px; }

@media (max-width: 900px) {
    .pf-library .pf-gamegrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pf-library__grouphead { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 620px) {
    .pf-library { padding-top: 34px; }
    .pf-library__groups { gap: 26px; }
    .pf-library__grouphead { flex-direction: column; align-items: flex-start; padding-top: 14px; margin-bottom: 10px; }
    .pf-library__grouphead h3 { font-size: 1.65rem; }
    .pf-library__grouplead { font-size: 0.8rem; }
    .pf-filters { flex-wrap: wrap; overflow: visible; gap: 6px; }
    .pf-filters__btn { flex: 0 0 auto; min-height: 40px; padding: 0.45rem 0.8rem; font-size: 0.8rem; }
    .pf-filters__divider { display: none; }
    .pf-filters__btn--3d { display: none; }
    .pf-library .pf-gamegrid { grid-template-columns: 1fr; gap: 8px; }
    .pf-library .pf-game {
        position: relative;
        display: grid;
        grid-template-columns: 76px minmax(0, 1fr);
        grid-template-rows: auto auto auto;
        align-items: center;
        column-gap: 11px;
        min-height: 0;
        padding: 9px 11px;
        border-radius: 16px;
        box-shadow: 3px 3px 0 var(--pf-ink);
    }
    .pf-library .pf-game__top { grid-column: 2; grid-row: 1; margin: 0; }
    .pf-library .pf-game__tag { font-size: 0.75rem; }
    .pf-library .pf-game__dim { font-size: 0.72rem; }
    .pf-library .pf-game__art {
        grid-column: 1;
        grid-row: 1 / 4;
        width: 76px;
        height: 86px;
        margin: 0;
        border-radius: 10px;
    }
    .pf-library .pf-game__art .puzzle-glyph { width: 58px; height: 70px; }
    .pf-library .pf-game__name { grid-column: 2; grid-row: 2; font-size: 1rem; }
    .pf-library .pf-game__blurb {
        grid-column: 2;
        grid-row: 3;
        display: block;
        padding-right: 34px;
        font-size: 0.72rem;
        line-height: 1.25;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .pf-library .pf-game__play {
        position: absolute;
        right: 11px;
        bottom: 12px;
        padding: 0;
        margin: 0;
        font-size: 0.7rem;
    }
    .pf-library .pf-game__play .pf-game__arrow { display: none; }
    .pf-library .pf-game:hover { transform: translateY(-2px); box-shadow: 5px 5px 0 var(--pf-ink); }
}
@media (max-width: 390px) {
    .pf-library .pf-game { grid-template-columns: 66px minmax(0, 1fr); }
    .pf-library .pf-game__art { width: 66px; height: 78px; }
    .pf-library .pf-game__art .puzzle-glyph { width: 52px; height: 64px; }
    .pf-library .pf-game__blurb { display: none; }
    .pf-library .pf-game__play { bottom: 9px; }
}

.pf-hero__3dlink {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    color: var(--pf-ink);
    font-size: 0.84rem;
    font-weight: 800;
    text-decoration: none;
    border-bottom: 2px solid var(--pf-pine);
    padding-bottom: 2px;
    width: fit-content;
}
.pf-hero__3dlink span:first-child { color: var(--pf-pine); }
.pf-hero__3dlink:hover { color: var(--pf-pine); }
.pf-hero__3dlink:hover span:last-child { transform: translateX(3px); display: inline-block; }

/* Secondary section links keep a full 44px touch target while their type
   remains a quiet text link. */
.pf-sectionhead__link,
.pf-bento__link,
.pf-hero__3dlink {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}


/* The homepage hero uses its own accent class; give it the same dark-mode
   treatment as every .pf-accent-serif headline (mint text + thin sun
   underline, never mint on a solid marigold block). */
html[data-theme="dark"] .pf-hero__accent {
    background-image: none !important;
    color: var(--pf-pine) !important;
    text-decoration: underline;
    text-decoration-color: var(--pf-sun);
    text-decoration-thickness: 3px;
    text-underline-offset: 8px;
}
