/*=================================================================
  Filthy Hippie CSS
  -----------------------------------------------------------------
  01. Reset + Theme Variables
  02. Fonts + Base Elements
  03. Typography + Reusable Helpers
  04. Layout, Sidebar, Content + Footer
  05. Header + Hero
  06. Navigation + Includes
  07. Shared Rows + Small Layout Patterns
  08. Page/Feature Components
      - Base Cards
      - Selective Breed Tables
      - Playscene Polaroids
      - Toy + Decor Shelves
      - Wallpaperz
      - Tutorial / ToC
      - Crew Cards
      - Nostalgia Sections
      - Stamp Binder
      - Carry Case
  09. FOUC prevention
================================================================= */

/*=================================================================
  01. Reset + Theme Variables
================================================================= */

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

html,
body {
    margin: 0;
    padding: 0;
    background-color: #526451;
}

body {
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
}

img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

input,
button,
textarea,
select {
    font: inherit;
    margin: 0;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0;
    margin-block: 0;
    margin-inline: 0;
    font-weight: inherit;
}

ul,
ol {
    margin: 0;
    padding: 0;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}

a {
    color: inherit;
    text-decoration: underline;
}

:root {
    --bg: #000;
    --fg: #000;
    --muted: #373d37;
    --link: #1d1f1d;
    --card: #fff;
    --border: #000000;
    --accent: #96a5fb;
    --header: #9ebdac;
    --p: rgba(212, 231, 223, 0.25);

    /* Polaroids */
    --polaroid-paper: #fff;
    --polaroid-shadow: 0 8px 22px rgba(0, 0, 0, .18);
    --polaroid-border: #e9e9e9;
    --polaroid-caption: #333;

    /* Toy shelves */
    --toy-item-min: 120px;
    --toy-item-max: 1fr;
    --toy-row-gap: 18px;
    --toy-col-gap: 14px;
    --toy-card-height: 140px;
    --toy-wall: rgba(0, 0, 0, 0.5);
    --toy-step: calc(var(--toy-card-height) + var(--toy-row-gap));
    --shelf-h: 13px;

    /* Decor shelves */
    --dec-item-min: 120px;
    --dec-item-max: 1fr;
    --dec-row-gap: 18px;
    --dec-col-gap: 14px;
    --dec-card-height: 140px;
    --dec-wall: rgba(0, 0, 0, 0.5);
    --dec-step: calc(var(--dec-card-height) + var(--dec-row-gap));
    --dec-shelf-h: 13px;
}

/*=================================================================
  02. Fonts + Base Elements
================================================================= */

@font-face {
    font-family: 'header';
    src: url(/assets/BrushUp.ttf);
}

@font-face {
    font-family: 'h3';
    src: url(/assets/PRESSSTART2P-REGULAR.TTF);
}

@font-face {
    font-family: 'body';
    src: url(/assets/COMIC.TTF);
}

@font-face {
    font-family: 'polaroid-hw';
    src: url(/assets/BLACKPINE-4BEVW.TTF);
}

@font-face {
    font-family: 'polaroid';
    src: url(/assets/DYMO.TTF);
}

body {
    margin: 0;
    background-image: url(/assets/wizard.png);
    color: var(--fg);
    font-family: 'body', arial;
    font-size: 18px;
    line-height: 1.5;

    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    text-wrap: balance;
    text-wrap: pretty;

    cursor: url('/assets/cursor.png') 4 4, auto;
}

main {
    display: flex;
    flex-direction: column;
    align-items: center;
}

code {
    font-family: 'Courier New', Courier, monospace;
    font-size: .9rem;
    font-style: italic;
    background-color: var(--header);
}


.code-box {
    font-family: 'Courier New', Courier, monospace;
    font-size: .9rem;
    font-style: italic;
    background-color: var(--header);
    padding: .5rem;
    width: fit-content;
    border: 1px solid rgba(0, 0, 0, 0.5);
}


a {
    color: var(--link);
    text-decoration: underline wavy;
}

a:hover {
    text-decoration: none;
}

a,
button,
.clickable {
    cursor: url('/assets/cursor-hover.png') 4 4, pointer;
}

a:active,
button:active,
.clickable:active {
    cursor: url('/assets/cursor-click.png') 4 4, pointer;
}

hr {
    border: 0;
    border-top: 1px solid var(--accent);
}

img {
    filter:
        drop-shadow(1px 0 0 #000)
        drop-shadow(-1px 0 0 #000)
        drop-shadow(0 1px 0 #000)
        drop-shadow(0 -1px 0 #000)
        drop-shadow(-2px 3px 2px rgba(0, 0, 0, 0.333));
}

.no-outline {
    filter:
        drop-shadow(-2px 3px 2px rgba(0, 0, 0, 0.333));
}

ul {
    list-style: none;
    margin: 0.75rem 0;
    padding: 0;
}

li {
    margin-bottom: 0.4rem;
}

ul li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-left: 0;
}

ul li::before {
    content: "•";
    position: static;
    color: var(--header);
    font-size: 2rem;
    line-height: 1;
    flex: 0 0 auto;
}

/* Firefox */
html {
    scrollbar-width: thin;
    scrollbar-color: #3d3d3d #000;
}

/* Chrome, Edge, Safari */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: #000;
}

::-webkit-scrollbar-thumb {
    background-color: #000;
    border-radius: 6px;
    border: 3px solid #3d3d3d;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #444;
}

/*=================================================================
  03. Typography + Reusable Helpers
================================================================= */

h1,
h2,
h3,
h5,
h6 {
    font-family: 'header';
    letter-spacing: .1rem;
    color: var(--header);
    text-shadow: -2px 3px 3px rgba(0, 0, 0, 0.333);
}

h1 {
    font-size: 5rem;
    margin-top: 1.5rem;
}

h2 {
    font-size: 2.5rem;
}

h3 {
    font-size: 1.75rem;
}

h4 {
    font-family: 'h3';
    letter-spacing: 0;
    color: var(--header);
    font-size: .8rem;
    margin-bottom: .5rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

p {
    background-color: var(--p);
    padding: 1rem;
    padding-bottom: 1rem;
    border-radius: 5px;
}

.p-first {
    text-indent: 1rem;
    margin-top: 1rem;
}

.p-like {
    /*background-color: var(--p);*/
    border-radius: 5px;
    padding: 1rem;
    list-style: none;
    width: 100%;
    margin-bottom: 1rem;
    /*border: 2px dashed rgba(0, 0, 0, 0.25);*/
}

.p-like li {
    margin-bottom: 2rem;
}

.p-like::after {
    content: "";
    display: block;
    clear: both;
}

.clear-inside {
    background: none;
    padding: 0;
    margin-bottom: 1rem;
    list-style: none;
}

.mini-h {
    font-weight: bold;
    box-shadow: inset 0 -0.6em 0 0 hsla(283, 41%, 69%, 0.25);
}

.mini-h a {
    text-decoration: none;
}

.small {
    font-size: .75rem;
    margin: 0;
}

.break {
    margin: 1rem;
}

.clear {
    background: none;
    padding: 1rem;
    border-radius: 5px;
}

.wood-bg {
    background-image: url(/assets/wildflower-wood.png);
    padding: 1rem;
    border: 2px dashed rgba(255, 255, 255, 0.25);
}

.family-room {
    background-image: url(/assets/family-room-bg.png);
    padding: 1rem;
    border: 2px dashed rgba(0, 0, 0, 0.25);
}

.text-left {
    text-align: left;
}

.muted {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 1rem;
}

.inline-img {
    display: inline;
}

.center {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    margin-inline: auto;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.center img {
    width: auto;
    max-width: 100%;
    height: auto;
}

.center table {
    margin-left: auto;
    margin-right: auto;
}

.center table td {
    text-align: center;
}

.float-right {
    float: right;
    max-width: 100%;
    margin: 0 1rem;
}

.float-left {
    float: left;
    max-width: 100%;
    margin: 0 1rem;
}

.divider-slot {
    display: flex;
    justify-content: center;
    width: 100%;
    height: 3rem;
    position: relative;
    z-index: 2;
}

.divider {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    margin: 0;
    transform: translateY(-85%);
}

.tablecontainer {
    overflow: auto;
}

/*=================================================================
  04. Layout, Sidebar, Content + Footer
================================================================= */

.layout {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
}

.layout-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    padding: 3rem;
}

.content-columns {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    min-width: 0;
}

.sidebar {
    background-image: url(/assets/Tartan2.png);
    padding: 1rem;
    width: 100%;
}

.content,
.content-extra {
    padding: 1rem;
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.text-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;    
    align-items: center;
    background-color: var(--p);
    border: 2px dashed rgba(0, 0, 0, 1);
    margin: 2rem auto;
    max-width: 1200px;
    min-width: 0;
    padding: 2rem;
    padding-bottom: 5rem;
}

.text-wrapper img {
    max-width: 100%;
    height: auto;
}

footer {
    padding: 1rem;
    width: 100%;
    margin-bottom: 5rem;
}

.footer-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* Mobile hamburger menu */
.sidebar-toggle,
.sidebar-backdrop {
    display: none;
}

@media (max-width: 1023px) {
    .sidebar-toggle {
        display: inline-flex;
        width: 100%;
        align-items: center;
        justify-content: center;
        gap: 0.35rem;
        padding: 0.5rem 0.75rem;
        position: relative;
        z-index: 998;
        border: none;
        background: rgba(0, 0, 0, 1);
        color: var(--header);
        cursor: url('/assets/cursor-hover.png') 4 4, pointer;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 1000;
        width: min(280px, 82vw);
        max-width: none;
        height: 100dvh;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 999;
        background: rgba(0, 0, 0, 0.35);
    }

    .sidebar-backdrop.is-open {
        display: block;
    }

    .footer-row {
        flex-direction: column;
        align-items: center;
        justify-content: space-between;
    }
}

.content-columns {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    min-width: 0;
    align-items: center;
}

@media (min-width: 1024px) {
    .layout {
        flex-direction: row;
        align-items: stretch;
        gap: 0;
    }

    .layout-wrapper {
        flex: 1 1 auto;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .content-columns {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        gap: 1rem;
    }

    .sidebar {
        flex: 0 0 20%;
        max-width: 20%;
        position: sticky;
        top: 0;
        height: 100vh;
        overflow: auto;
    }

    .content {
        flex: 1 1 auto;
        max-width: none;
        min-width: 0;
    }

    /* Homepage: content shares its area with content-extra */
    .content-columns > .content {
        max-width: calc(60% - 0.5rem);
    }

    .content-extra {
        max-width: none;
        min-width: 0;
    }

    footer {
        width: 100%;
    }

    .text-wrapper-extra {
        margin-top: 1rem;
        width: 100%;
    }

    .menu-btn {
        display: none;
    }
}

.layout > .content > .text-wrapper {
    width: min(100%, 1200px);
    margin-inline: auto;
}

/*=================================================================
  05. Header + Hero
================================================================= */

.site-header {
    padding: 2rem;
    border-bottom: 5px solid var(--border);
    background-image: url(/assets/Cargo-Wildflower-Field.png);
    background-repeat: repeat-x;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    gap: 1rem;
}

.brand {
    font-family: 'h3', system-ui, sans-serif;
    text-decoration: none;
    color: var(--fg);
    font-size: clamp(16px, 2.8vw, 24px);
}

.menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .5rem .75rem;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: .5rem;
    cursor: url('/assets/cursor-hover.png') 4 4, pointer;
}

.hero {
    display: flex;
    justify-content: center;
    padding: 0.75rem 0 1rem;
    background: transparent;
}

.hero img {
    max-width: min(100%, 900px);
    height: auto;
    display: block;
}

@media (max-width: 1023px) {
    .site-header {
        background-size: 100% auto;
    }
}

/*=================================================================
  06. Navigation + Includes
================================================================= */

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

.nav-list a {
    display: block;
    padding: .5rem .6rem;
    text-decoration: none;
    color: var(--link);
    border-radius: .5rem;
}

.nav-list a:hover {
    color: #96a5fb;
}

.nav-accordion {
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.nav-link {
    display: block;
    font-family: 'header';
    font-size: 1.5rem;
    padding: .5rem .6rem;
    border-radius: .5rem;
    text-decoration: none;
    color: var(--header);
}

.nav-link:hover {
    color: #96a5fb;
    text-decoration: underline wavy;
}

.nav-section {
    overflow: hidden;
    color: var(--header);
}

.nav-summary {
    font-family: 'header';
    font-size: 1.5rem;
    list-style: none;
    cursor: url('/assets/cursor-hover.png') 4 4, pointer;
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem .7rem;
    user-select: none;
    color: var(--header);
}

.nav-summary::-webkit-details-marker {
    display: none;
}

.nav-summary::after {
    content: "▾";
    display: inline-block;
    transition: transform .18s ease;
}

.nav-section[open] .nav-summary::after {
    transform: rotate(180deg);
}

.nav-sublist {
    margin: 0;
    padding: .35rem .4rem .6rem;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: .2rem;
}

.nav-sublist a {
    display: block;
    padding: .4rem .5rem;
    border-radius: .4rem;
    text-decoration: none;
    color: var(--header);
}

.nav-sublist a:hover {
    color: #96a5fb;
    text-decoration: underline wavy;
}

html.includes-pending [data-include] {
    opacity: 0;
}

html.includes-ready [data-include] {
    opacity: 1;
    transition: opacity .15s ease;
}

[data-include][data-include-placeholder="header"] {
    min-height: 72px;
}

[data-include][data-include-placeholder="nav"] {
    min-height: 300px;
}

/*=================================================================
  07. Shared Rows + Small Layout Patterns
================================================================= */

.flex-row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.flex-row-bottom {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: center;
    gap: 1rem;
}

.clothes-row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: center;
    gap: 1rem;
}

.clothes-row > .clothes {
    flex: 1 1 425px;
    min-width: 250px;
    align-items: center;
    justify-content: flex-end;
}

.breed {
    margin-bottom: 5rem;
}

.breed:last-child {
    margin-bottom: 0;
}

.breed-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-end;
    gap: 1rem;
}

.breed-row > .breed {
    flex: 0 0 auto;

    display: inline-grid;
    grid-template-columns: min-content;
    justify-items: center;
    text-align: center;
}

.breed-row > .breed > img.breed-preview {
    width: auto !important;
    height: auto !important;
    max-width: none !important;
}

.breed-row > .breed > .p-like {
    width: 100%;
    min-width: 250px;
    box-sizing: border-box;
}

.pref-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    padding-bottom: 2rem;
}

.dl-row {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.dl-row img {
    filter: drop-shadow(0 0 0);
}

.clq-row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.bases {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: space-evenly;
    align-content: center;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .pref-row {
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
    }
}

/*=================================================================
  08A. Base Cards
================================================================= */

.base-cards {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    text-align: center;
    margin-inline: auto;
    margin-top: 1rem;
    margin-bottom: 1rem;
    width: 400px;
    height: 450px;
    perspective: 1000px;
    position: relative;
    overflow: hidden;
    z-index: 0;
    background-image: url(/assets/wildflower-wood.png);
    background-repeat: repeat;
    border: 2px dashed rgba(255, 255, 255, 0.25);
    box-shadow:
        0 6px 15px rgba(0, 0, 0, 0.25),
}

.base-img {
    display: flex;
    background-image: url(/assets/cargo-wildflowers-night-edit.png);
    background-repeat: repeat;
    border: 2px dashed rgba(0, 0, 0, 0.25);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    margin-inline: auto;
    margin-top: 1rem;
    margin-bottom: 1rem;
    width: 350px;
    height: 350px;
    z-index: 1;
    position: relative;
}

@keyframes shimmer {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes shine {
    0% {
        transform: translateX(-100%) rotate(25deg);
    }

    100% {
        transform: translateX(100%) rotate(25deg);
    }
}

/*=================================================================
  08B. Selective Breed Tables
================================================================= */

.sb-table-wrap {
    border-radius: 5px;
    overflow: hidden;
}

.sb-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    font-size: .85rem;
    margin: 1rem 0;
    background: transparent;
}

.sb-table th,
.sb-table td {
    padding: 8px 12px;
    vertical-align: middle;
}

.sb-table th,
.sb-table td {
    text-align: center;
}

.sb-table th:nth-child(1),
.sb-table td:nth-child(1),
.sb-table th:nth-child(2),
.sb-table td:nth-child(2),
.sb-table th:nth-child(3),
.sb-table td:nth-child(3),
.sb-table th:nth-child(4),
.sb-table td:nth-child(4),
.sb-table th:nth-child(5),
.sb-table td:nth-child(5) {
    width: 20%;
}

.sb-table th:nth-child(odd),
.sb-table td:nth-child(odd) {
    background: rgba(255, 255, 255, 0.5);
}

.sb-table th:nth-child(even),
.sb-table td:nth-child(even) {
    background: rgba(247, 247, 247, 0.2);
}

.sb-table tr:nth-child(even) {
    background: rgba(247, 247, 247, 0.3);
}

.sb-table tbody tr:hover td {
    filter: brightness(0.98);
}

.sb-table thead tr:first-child th:first-child {
    border-top-left-radius: 10px;
    background-clip: padding-box;
    position: relative;
    z-index: 1;
}

.sb-table thead tr:first-child th:last-child {
    border-top-right-radius: 10px;
    background-clip: padding-box;
    position: relative;
    z-index: 1;
}

.sb-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 10px;
    background-clip: padding-box;
    position: relative;
    z-index: 1;
}

.sb-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 10px;
    background-clip: padding-box;
    position: relative;
    z-index: 1;
}

.sb-table tbody tr:last-child td {
    border-bottom: none;
}

.sb-table td:first-child {
    text-align: left;
    font-weight: 600;
}

/*=================================================================
  08C. Playscene Polaroids
================================================================= */

.polaroid-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    width: min(1100px, 100%);
    margin-inline: auto;
    padding: 1rem;
}

.polaroid {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--polaroid-paper);
    border: 1px solid var(--polaroid-border);
    border-radius: 6px;
    box-shadow: var(--polaroid-shadow);
    text-align: center;
    padding: 10px 10px 22px;
    width: 100%;
    max-width: 320px;
    margin-inline: auto;
}

.polaroid__frame {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #f7f7f7;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #eee;
}

.polaroid__frame img {
    width: 100%;
    height: 100%;
    border: 1px solid var(--polaroid-caption);
    object-fit: cover;
    display: block;
}

.polaroid__caption-hw {
    margin-top: 2rem;
    margin-bottom: .5rem;
    font-size: 2.5rem;
    font-family: 'polaroid-hw';
    font-weight: 700;
    color: var(--polaroid-caption);
    line-height: 1.5;
    max-width: 100%;
    word-break: break-word;
}

.polaroid__caption {
    margin-top: 2rem;
    margin-bottom: .5rem;
    font-size: 3rem;
    font-family: 'polaroid';
    color: var(--polaroid-caption);
    line-height: 1.5;
    max-width: 100%;
    word-break: break-word;
}

.polaroid__caption-sm {
    margin-top: 1rem;
    margin-bottom: .5rem;
    font-size: 2rem;
    font-family: 'polaroid-hw';
    font-weight: 700;
    color: var(--polaroid-caption);
    line-height: 1.5;
    max-width: 100%;
    word-break: break-word;
}

.polaroid:nth-child(3n) {
    transform: rotate(-1.2deg);
}

.polaroid:nth-child(3n+1) {
    transform: rotate(0.6deg);
}

.polaroid:nth-child(3n+2) {
    transform: rotate(-0.4deg);
}

.polaroid--sm {
    max-width: 200px;
}

.polaroid--md {
    max-width: 260px;
}

.polaroid--lg {
    max-width: 320px;
}

.polaroid--lg .polaroid__caption {
    font-size: 1rem;
}

@media (hover: hover) {
    .polaroid:hover {
        translate: 0 -2px;
        box-shadow: 0 12px 28px rgba(0, 0, 0, .22);
    }
}

/*=================================================================
  08D. Toy + Decor Shelves
================================================================= */

.toy-shelves,
.dec-shelves {
    /* Explicit row groups make the shelf breaks predictable.
       Each group can wrap and center itself at any screen width. */
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 1rem;
    border-radius: 5px;
    overflow: hidden;
}

.toy-shelves {
    gap: var(--toy-row-gap);
    background:
        url("/assets/shelf-mid-tile.png") repeat-y left top / 100% var(--toy-step),
        repeating-linear-gradient(
            to bottom,
            transparent 0,
            var(--toy-wall) calc(var(--toy-step) - var(--shelf-h)),
            var(--toy-wall) var(--toy-step)
        ),
        url("/assets/wildflower-wood.png") repeat center top / auto;
}

.dec-shelves {
    gap: var(--dec-row-gap);
    background:
        url("/assets/shelf-mid-tile.png") repeat-y left top / 100% var(--dec-step),
        repeating-linear-gradient(
            to bottom,
            transparent 0,
            var(--dec-wall) calc(var(--dec-step) - var(--dec-shelf-h)),
            var(--dec-wall) var(--dec-step)
        ),
        url("/assets/wildflower-wood.png") repeat center top / auto;
}

.toy-shelf-row,
.dec-shelf-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-end;
    width: 100%;
    min-width: 0;
}

.toy-shelf-row {
    gap: var(--toy-row-gap) var(--toy-col-gap);
}

.dec-shelf-row {
    gap: var(--dec-row-gap) var(--dec-col-gap);
}

/* The cards stay a consistent, responsive size instead of stretching
   across an incomplete row. A short shelf is centered as a group. */
.toy-shelf-row > .toy-card {
    flex: 0 1 clamp(var(--toy-item-min), 12vw, 160px);
    min-width: 0;
    max-width: 100%;
}

.dec-shelf-row > .dec-card {
    flex: 0 1 clamp(var(--dec-item-min), 12vw, 160px);
    min-width: 0;
    max-width: 100%;
}

.toy-card,
.dec-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
}

.toy-card {
    height: var(--toy-card-height);
    padding-bottom: var(--shelf-h);
}

.dec-card {
    height: var(--dec-card-height);
    padding-bottom: var(--dec-shelf-h);
}

.toy-card img,
.dec-card img {
    display: block;
    width: auto;
    height: auto;
    max-height: 100%;
    object-fit: contain;
    transform-origin: center bottom;
    filter: drop-shadow(-2px 4px 2px rgba(0, 0, 0, .3));
    transition: filter 0.2s ease, transform 0.2s ease;
}

.toy-card img {
    transform: translateY(var(--toy-offset, 0px));
}

.dec-card img {
    transform: translateY(var(--dec-offset, 0px));
}

.toy-card img:hover {
    transform: translateY(calc(var(--toy-offset, 0px) - 15px)) rotate(5deg);
    cursor: url('/assets/cursor-grab.png') 4 4, pointer;
}

.dec-card img:hover {
    transform: translateY(calc(var(--dec-offset, 0px) - 15px)) rotate(5deg);
    cursor: url('/assets/cursor-grab.png') 4 4, pointer;
}

/*=================================================================
  08E. Wallpaperz
================================================================= */

.wallpaperz-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    width: min(1100px, 100%);
    margin-inline: auto;
    padding: 1rem;
    justify-content: center;
}

.wallpaperz {
    display: block;
    flex: 0 0 auto;
    width: auto;
    height: auto;
    max-width: none;
}

.wallpaperz:nth-child(3n) {
    transform: rotate(-1.2deg);
}

.wallpaperz:nth-child(3n+1) {
    transform: rotate(0.6deg);
}

.wallpaperz:nth-child(3n+2) {
    transform: rotate(-0.4deg);
}

@media (hover: hover) {
    .wallpaperz:hover {
        translate: 0 -2px;
        box-shadow: 0 12px 28px rgba(0, 0, 0, .22);
    }
}

/*=================================================================
  08F. Tutorial + Table of Contents
================================================================= */

.tutorial img {
    filter: none;
    margin-bottom: 1rem;
}

.tutorial h4 {
    font-size: 1rem;
    letter-spacing: 0;
    color: var(--fg);
}

.tutorial .p-like {
    margin-top: 2rem;
}

.tutorial .p-like ul {
    margin: 1.5rem 0;
}

.tutorial .p-like li {
    font-size: .9rem;
    line-height: 1.5;
}

.toc-layout {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.toc-left {
    flex: 1 1 auto;
    min-width: 0;
}

.toc-right {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2rem;
}

.toc-right img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
}

@media (max-width: 768px) {
    .toc-right {
        display: none;
    }
}

/*=================================================================
  08G. Crew Cards
================================================================= */

.pet-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    border-radius: 5px;
    padding: 1rem;
}

.pet-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
    justify-content: flex-end;
}

.pet-card-text {
    display: flex;
    flex-direction: column;
    background: var(--p);
    color: var(--fg);
    border-radius: 10px;
    border: 2px dashed #000;
    padding: 2rem 1rem 1rem;
    margin-top: -2.5rem;
}

.pet-card img {
    width: auto;
    max-width: 100%;
    height: auto;
    align-self: center;
}

.pet-card img:hover {
    animation: pet-cursor 750ms infinite;
}

@keyframes pet-cursor {
    0% {
        cursor: url("/assets/cursor-pet_0000_57.png") 8 8, pointer;
    }

    12.5% {
        cursor: url("/assets/cursor-pet_0001_56.png") 8 8, pointer;
    }

    25% {
        cursor: url("/assets/cursor-pet_0002_55.png") 8 8, pointer;
    }

    37.5% {
        cursor: url("/assets/cursor-pet_0003_54.png") 8 8, pointer;
    }

    50% {
        cursor: url("/assets/cursor-pet_0004_53.png") 8 8, pointer;
    }

    62.5% {
        cursor: url("/assets/cursor-pet_0005_52.png") 8 8, pointer;
    }

    75% {
        cursor: url("/assets/cursor-pet_0006_51.png") 8 8, pointer;
    }

    87.5% {
        cursor: url("/assets/cursor-pet_0005_52.png") 8 8, pointer;
    }

    100% {
        cursor: url("/assets/cursor-pet_0004_53.png") 8 8, pointer;
    }
}

.pet-name {
    font-weight: bold;
    align-self: center;
}

.pet-owner,
.pet-breed,
.pet-breed-face,
.pet-guid,
.pet-date,
.pet-generations,
.pet-gender,
.pet-blood,
.pet-ancestors,
.pet-full-tree,
.pet-tree-trimmed,
.pet-inbred,
.pet-generations-stored,
.pet-comment,
.pet-file {
    font-size: .75rem;
}

/*=================================================================
  08H. Nostalgia Sections
================================================================= */

.nostalgia-section {
    margin-bottom: 1rem;
}

.nostalgia-summary {
    font-family: 'header';
    font-size: 1.75rem;
    letter-spacing: .1rem;
    text-shadow: -2px 3px 3px rgba(0, 0, 0, 0.333);
    color: var(--header);
    cursor: url('/assets/cursor-hover.png') 4 4, pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: 1rem 1.25rem;
    background-color: none;
    border-radius: 5px;
}

.nostalgia-summary::-webkit-details-marker {
    display: none;
}

.nostalgia-summary::after {
    content: "▾";
    display: inline-block;
    transition: transform .18s ease;
}

.nostalgia-section[open] .nostalgia-summary::after {
    transform: rotate(180deg);
}

.nostalgia-section .wallpaperz-grid {
    margin-top: .5rem;
    margin-bottom: 1.5rem;
}

.nostalgia-section a {
    display: inline-block;
    text-decoration: none;
}

.nostalgia-section .wallpaperz {
    width: auto;
    max-width: 600px;
    height: auto;
    transform: none;
    filter: none;
}

/*=================================================================
  08I. Stamp Binder
================================================================= */

.stamp-binder-section {
    width: 100%;
}

.stamp-binder-gallery {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 100%;
    margin-inline: auto;
}

.stamp-binder-spread {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.stamp-binder-page {
    position: relative;
    width: 500px;
    height: 350px;
    flex: 0 0 auto;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;
    overflow: hidden;
}

.stamp-binder-page--left {
    background-image: url("/assets/stamp-binder-left.png");
}

.stamp-binder-page--right {
    background-image: url("/assets/stamp-binder-right.png");
}

.stamp-binder-grid {
    position: absolute;
    top: 26px;
    right: 34px;
    bottom: 24px;
    left: 34px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(3, 1fr);
}

.stamp-slot {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.stamp-slot img,
.stamp-image {
    display: block;
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
    flex: 0 0 auto;
    object-fit: initial;
    transform-origin: center center;
}

.stamp-image {
    filter: drop-shadow(-1px 2px 2px rgba(0, 0, 0, 0.2));
}

@media (min-width: 1100px) {
    .stamp-binder-spread {
        flex-direction: row;
        align-items: flex-start;
    }
}

@media (max-width: 560px) {
    .stamp-binder-page {
        width: 100%;
        max-width: 500px;
        aspect-ratio: 500 / 350;
        height: auto;
    }
}

/*=================================================================
  08J. Carry Case
================================================================= */

.carry-case {
    position: relative;
    width: 293px;
    height: 230px;
    background-image: url("/assets/travel-case.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 293px 230px;
    image-rendering: pixelated;
}

.carry-case__arrow {
    position: absolute;
    left: 97px;
    top: 45px;
    width: 18px;
    height: 21px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: url('/assets/cursor-hover.png') 4 4, pointer;
}

.carry-case__shelf {
    position: absolute;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
}

.carry-case__shelf--top {
    left: 123px;
    top: 50px;
    width: 140px;
    height: 45px;
}

.carry-case__shelf--middle {
    left: 123px;
    top: 109px;
    width: 140px;
    height: 43px;
}

.carry-case__shelf--bottom {
    left: 123px;
    top: 164px;
    width: 140px;
    height: 43px;
}

.carry-case__item {
    display: inline-flex;
    align-items: flex-end;
    justify-content: center;
}

.carry-case__item img {
    display: block;
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
    image-rendering: pixelated;
}

/*=================================================================
  09. Responsive refinements (small screens + tablets)
  Keep the original desktop layout, artwork and styling intact.
================================================================= */

/* Avoid oversized flex children in narrow layouts. */
.layout,
.layout-wrapper,
.content-columns,
.content,
.content-extra,
.text-wrapper,
.p-like {
    min-width: 0;
}

/* Tables or screenshots can be scrolled without stretching the whole page. */
.tablecontainer,
.sb-table-wrap {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
}

/* The menu control is consistent on every page. */
.sidebar-toggle {
    touch-action: manipulation;
}

.sidebar-toggle-lines {
    display: inline-block;
    width: 19px;
    height: 14px;
    flex: 0 0 auto;
    background: linear-gradient(
        to bottom,
        currentColor 0 2px,
        transparent 2px 6px,
        currentColor 6px 8px,
        transparent 8px 12px,
        currentColor 12px 14px
    );
}

.sidebar-backdrop[hidden] {
    display: none !important;
}

/* Visible keyboard focus even with the site's custom cursors. */
.sidebar-toggle:focus-visible,
.sidebar a:focus-visible,
.sidebar summary:focus-visible {
    outline: 3px solid #e9b67f;
    outline-offset: 3px;
}

/* Stamp pages preserve their original 500x350 artwork and position the
   stamps precisely, while the outer viewport is allowed to shrink. */
.stamp-binder-host {
    width: 100%;
    min-width: 0;
}

.stamp-binder-page-viewport {
    position: relative;
    flex: 0 0 auto;
    width: min(500px, 100%);
    min-width: 0;
    aspect-ratio: 500 / 350;
}

.stamp-binder-page-viewport > .stamp-binder-page {
    position: absolute;
    inset: 0 auto auto 0;
    width: 500px;
    height: 350px;
    max-width: none;
    transform: scale(var(--stamp-page-scale, 1));
    transform-origin: top left;
}

/* Let an entire binder spread wrap rather than forcing 1000px into an
   800px content column on laptops. */
@media (min-width: 1100px) {
    .stamp-binder-spread {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 1023px) {
    .layout-wrapper {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .layout,
    .content-columns {
        flex-direction: column;
        align-items: stretch;
    }

    .content,
    .content-extra {
        flex: 1 1 auto;
        width: 100%;
        max-width: 100%;
        padding: 0.5rem;
    }

    .text-wrapper {
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
        padding: clamp(1rem, 3vw, 1.75rem);
        padding-bottom: 2.5rem;
    }

    .site-header {
        padding: 0.75rem 0.75rem 0.5rem;
        background-size: auto 100%;
    }

    .hero {
        padding: 0.25rem 0;
    }

    .sidebar-toggle {
        position: sticky;
        top: 0;
        z-index: 998;
        display: flex;
        width: 100%;
        min-height: 48px;
        padding: 0.65rem 1rem;
        background: #171b19;
        border-bottom: 2px solid #9ebdac;
        color: #e0efe4;
        font-family: 'body', Arial, sans-serif;
        font-size: 1rem;
        line-height: 1.25;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 1000;
        width: min(320px, 88vw);
        max-width: none;
        height: 100vh;
        height: 100dvh;
        padding: 1.25rem 1rem 2.5rem;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        transform: translateX(-105%);
        visibility: hidden;
        transition: transform 0.22s ease, visibility 0.22s ease;
    }

    .sidebar.is-open {
        transform: translateX(0);
        visibility: visible;
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 999;
        background: rgba(0, 0, 0, 0.65);
    }

    .sidebar-backdrop.is-open {
        display: block;
    }

    body.mobile-nav-open {
        overflow: hidden;
    }

    .sidebar a,
    .sidebar summary {
        min-height: 44px;
    }

    .sidebar .nav-sublist li,
    .sidebar .nav-list li {
        display: block;
    }

    .sidebar .nav-sublist li::before,
    .sidebar .nav-list li::before {
        display: none;
    }

    .sidebar .nav-sublist a,
    .sidebar .nav-link,
    .sidebar .nav-summary {
        display: flex;
        align-items: center;
    }

    .sidebar .nav-summary::after {
        margin-left: auto;
    }

    h1 {
        font-size: clamp(2.7rem, 9vw, 4.3rem);
        line-height: 1.1;
        margin-top: 0.7rem;
        overflow-wrap: anywhere;
    }

    h2 {
        font-size: clamp(2rem, 7vw, 2.5rem);
        line-height: 1.15;
    }

    h3 {
        font-size: clamp(1.5rem, 5.5vw, 1.75rem);
    }

    /* Centred panels should not grow to the minimum width of a child table. */
    .text-wrapper .center:not(img) {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .p-like {
        padding: 0.65rem;
    }

    .clear,
    .wood-bg,
    .family-room {
        padding: 0.75rem;
    }

    .float-left,
    .float-right {
        float: none;
        display: block;
        margin: 0.75rem auto 1rem;
    }

    .footer-row {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
    }

    .dl-row {
        flex-wrap: wrap;
        justify-content: center;
        max-width: 100%;
    }

    .dl-row > p {
        flex: 1 1 160px;
        min-width: 0;
    }

    .base-cards {
        width: min(400px, 100%);
        height: auto;
        min-height: 390px;
    }

    .base-img {
        width: min(350px, 100%);
        height: auto;
        aspect-ratio: 1;
    }

    .breed-row {
        width: 100%;
    }

    .breed-row > .breed {
        display: flex;
        flex-direction: column;
        width: min(400px, 100%);
        max-width: 100%;
        min-width: 0;
    }

    .breed-row > .breed > img.breed-preview {
        max-width: 100% !important;
        height: auto !important;
    }

    .breed-row > .breed > .p-like {
        min-width: 0;
    }

    .wallpaperz-grid,
    .polaroid-grid,
    .pet-container {
        padding: 0.5rem;
        max-width: 100%;
    }

    .wallpaperz {
        flex: 0 1 auto;
        max-width: 100%;
    }

    .nostalgia-section .wallpaperz {
        max-width: 100%;
    }

    .sb-table {
        min-width: 590px;
    }

    .toc-layout {
        flex-direction: column;
        align-items: stretch;
    }

    .toc-right {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        width: 100%;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .layout-wrapper {
        padding: 0.5rem;
    }

    .content,
    .content-extra {
        padding: 0.25rem;
    }

    .text-wrapper {
        padding: 0.85rem;
        padding-bottom: 2rem;
    }

    body {
        font-size: 16px;
        word-break: normal;
        overflow-wrap: anywhere;
        text-wrap: pretty;
    }

    p {
        padding: 0.75rem;
    }

    .p-like {
        padding: 0.5rem;
    }

    .breed {
        margin-bottom: 2.5rem;
    }

    .toy-shelves,
    .dec-shelves {
        padding: 0.5rem;
    }

    .toy-shelves {
        --toy-item-min: 95px;
        --toy-col-gap: 9px;
    }

    .dec-shelves {
        --dec-item-min: 95px;
        --dec-col-gap: 9px;
    }

    .stamp-binder-gallery {
        gap: 1rem;
    }

    .stamp-binder-spread {
        gap: 0.75rem;
    }

    .polaroid__caption {
        font-size: clamp(1.75rem, 8vw, 3rem);
    }

    .nostalgia-summary {
        padding: 0.8rem 0.5rem;
        font-size: 1.5rem;
    }
}


/*=================================================================
  Crew page refinements (generated + older stand-alone pages)
  Keep the original Petz-sized images; avoid fixed widths on small screens.
================================================================= */
.pet-container {
    width: 100%;
    min-width: 0;
    align-items: stretch;
}

.pet-card {
    min-width: 0;
    max-width: 100%;
}

.pet-card-text {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
}

@media (max-width: 1023px) {
    .pet-container {
        gap: 0.75rem;
        padding: 0.5rem;
    }

    .pet-card {
        flex: 0 1 230px;
        width: 100%;
        padding: 0.5rem;
        justify-content: flex-end;
    }

    .pet-card-text {
        width: 100%;
        padding: 1.75rem 0.85rem 0.8rem;
        margin-top: -1.75rem;
    }

    .pet-card img {
        max-width: 100%;
        height: auto;
        object-fit: contain;
    }
}

@media (max-width: 480px) {
    .pet-container {
        gap: 0.5rem;
        padding: 0.25rem;
    }

    .pet-card {
        flex: 1 1 100%;
        width: min(100%, 285px);
        max-width: 285px;
        padding: 0.25rem;
    }

    .pet-card-text {
        padding: 1.6rem 0.75rem 0.8rem;
        margin-top: -1.5rem;
    }
}

@media (hover: none) {
    .pet-card img:hover {
        animation: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sidebar,
    .polaroid,
    .wallpaperz,
    .toy-card img,
    .dec-card img {
        transition: none;
        animation: none;
    }
}


/*=================================================================
  Homepage: flexible columns + readable updates at half-screen sizes.
  Allows the Clique Case to wrap below the welcome panel when needed.
================================================================= */
@media (min-width: 1024px) {
    .content-columns {
        flex-wrap: wrap;
    }

    .content-columns > .content {
        flex: 2 1 600px;
        max-width: 100%;
    }

    .content-columns > .content-extra {
        flex: 1 1 300px;
        max-width: 100%;
    }
}

/* Unlike the site's generic pref-row, updates wrap naturally when
   the welcome panel is narrow, even in a desktop-sized viewport. */
.content-columns .pref-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.content-columns .pref-row > img {
    flex: 0 1 auto;
    max-width: min(180px, 100%);
}

.content-columns .pref-row > ul {
    flex: 1 1 260px;
    min-width: 0;
    max-width: 100%;
    margin: 0;
}

/* The global ul li rule uses flex. Updates need normal block flow so
   the date and description stay together, not in competing flex cells. */
.content-columns .pref-row li {
    display: block;
    position: relative;
    padding-left: 1.35rem;
    min-width: 0;
    overflow-wrap: break-word;
    word-break: normal;
}

.content-columns .pref-row li::before {
    position: absolute;
    top: 0;
    left: 0;
}

@media (max-width: 768px) {
    .content-columns .pref-row > ul {
        flex: 1 1 100%;
    }
}

/*=================================================================
  09. FOUC prevention: hide async header/nav until their markup is loaded.
================================================================= */

html:not(.includes-ready) [data-include-placeholder="header"],
html:not(.includes-ready) [data-include-placeholder="nav"] {
    visibility: hidden;
}

/* Do not fade the whole header/nav back in after each include refresh. */
html.includes-ready [data-include] {
    transition: none;
}

/* Keep the space needed by the banner while its HTML is being fetched.
   This avoids the main content jumping when the header appears. */
[data-include-placeholder="header"]:empty {
    min-height: 0;
    padding: 2rem;
    border-bottom: 5px solid transparent;
}
[data-include-placeholder="header"]:empty::before {
    content: "";
    display: block;
    width: min(100%, 574px);
    aspect-ratio: 574 / 292;
    margin-inline: auto;
}

