:root {
    --paper: #f3ead8;
    --paper-2: #fff8e8;
    --paper-3: #e8dcc4;
    --ink: #1d1b18;
    --muted: #6f6658;
    --red: #8c2f2f;
    --line: rgba(40, 35, 28, 0.18);
    --shadow: 0 14px 30px rgba(40, 30, 15, 0.22);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    font-family: "Courier Prime", monospace;
    background:
        radial-gradient(circle at 20% 20%, rgba(120,90,50,.08), transparent 30%),
        linear-gradient(rgba(80,60,35,.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(80,60,35,.05) 1px, transparent 1px),
        #d7c7aa;
    background-size: auto, 24px 24px, 24px 24px, auto;
}

.page-shell {
    width: min(1180px, calc(100vw - 40px));
    min-height: calc(100vh - 40px);
    margin: 20px auto;
    padding: 44px 56px 60px 80px;
    position: relative;
    background:
        linear-gradient(90deg, rgba(120,80,40,.08) 1px, transparent 1px),
        var(--paper);
    background-size: 32px 32px, auto;
    border: 1px solid rgba(50,40,30,.25);
    box-shadow: var(--shadow);
}

.site-header {
    display: flex;
    justify-content: space-between;
    gap: 40px;
    align-items: flex-start;
    margin-bottom: 70px;
}

.logo {
    color: var(--ink);
    text-decoration: none;
    font-family: "IBM Plex Mono", monospace;
    font-weight: 700;
    font-size: 42px;
    letter-spacing: -2px;
}

.tagline {
    margin: 8px 0 0;
    font-size: 16px;
}

.nav {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    font-family: "IBM Plex Mono", monospace;
    text-transform: uppercase;
    font-size: 13px;
    font-weight: 700;
}

.nav a {
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px solid var(--ink);
}

.side-note {
    position: absolute;
    left: 18px;
    top: 145px;
    width: 92px;
    color: #334f65;
    font-family: "Special Elite", monospace;
    font-size: 14px;
    line-height: 1.5;
    transform: rotate(-2deg);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1.25fr;
    gap: 48px;
    align-items: start;
}

.hero-title {
    max-width: 430px;
    font-size: 24px;
    line-height: 1.35;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 6px;
}

.hero-copy {
    max-width: 430px;
    line-height: 1.55;
}

.paper-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
    margin-top: 55px;
}

.paper-card {
    position: relative;
    padding: 26px 24px;
    min-height: 220px;
    background: var(--paper-2);
    border: 1px solid var(--line);
    box-shadow: 0 8px 16px rgba(40,30,15,.13);
}

.paper-card:nth-child(2) {
    background: #f7efd9;
    transform: rotate(-0.5deg);
}

.paper-card:nth-child(3) {
    background: #eee2c9;
    transform: rotate(0.7deg);
}

.paper-card:nth-child(4) {
    background: #f6eddc;
}

.paper-card::before {
    content: "";
    position: absolute;
    top: -13px;
    left: 38%;
    width: 76px;
    height: 24px;
    background: rgba(192, 160, 105, .38);
    transform: rotate(-1deg);
}

.card-kicker {
    color: var(--red);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 18px;
}

.card-title {
    margin: 0 0 10px;
    font-size: 22px;
}

.card-text {
    font-size: 15px;
    line-height: 1.45;
}

.card-link {
    color: var(--ink);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 13px;
}

.media-polaroid {
    position: relative;
    background: #fbf8ef;
    padding: 18px 18px 54px;
    box-shadow: 0 12px 22px rgba(30,20,10,.24);
    transform: rotate(2deg);
}

.media-polaroid::before {
    content: "";
    position: absolute;
    top: -16px;
    left: 42%;
    width: 100px;
    height: 28px;
    background: rgba(190, 155, 95, .45);
}

.placeholder-image {
    height: 245px;
    background:
        linear-gradient(135deg, rgba(255,255,255,.05), rgba(0,0,0,.12)),
        #1a1d1d;
    color: #d9d4c6;
    display: grid;
    place-items: center;
    font-family: "IBM Plex Mono", monospace;
    font-size: 14px;
    text-transform: uppercase;
}

.caption {
    position: absolute;
    left: 22px;
    bottom: 18px;
    font-size: 13px;
    color: var(--muted);
}

.terminal {
    margin-top: 34px;
    width: min(520px, 100%);
    padding: 22px;
    background: #111;
    color: #9fdf8f;
    border-radius: 6px;
    font-family: "IBM Plex Mono", monospace;
    box-shadow: 0 10px 20px rgba(20,10,5,.3);
}

.page-title {
    font-size: 40px;
    margin: 0 0 34px;
}

.list-page {
    max-width: 780px;
}

.list-item {
    border-top: 1px dashed var(--line);
    padding: 24px 0;
}

.meta {
    color: var(--red);
    font-size: 13px;
    text-transform: uppercase;
}

.project-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 40px;
}

.section {
    margin: 48px 0;
}

.checklist {
    list-style: none;
    padding: 0;
}

.checklist li {
    margin: 12px 0;
}

@media (max-width: 900px) {
    .site-header,
    .hero-grid,
    .project-layout {
        grid-template-columns: 1fr;
        display: grid;
    }

    .paper-row {
        grid-template-columns: 1fr;
    }

    .side-note {
        display: none;
    }

    .page-shell {
        padding: 28px;
    }
}

/* === REUSABLE SCRAPBOOK MODULES === */

.paper-block {
    position: relative;
    background: var(--paper-2);
    border: 1px solid var(--line);
    box-shadow: 0 8px 18px rgba(40, 30, 15, 0.14);
    padding: 18px 20px;
}

.paper-block.taped::before {
    content: "";
    position: absolute;
    top: -14px;
    left: 42%;
    width: 84px;
    height: 26px;
    background: rgba(190, 155, 95, 0.42);
    transform: rotate(-1.5deg);
}

.paper-block.ivory {
    background: #fff8e8;
}

.paper-block.yellowed {
    background: #efe0bd;
}

.paper-block.archive {
    background: #eadfc9;
}

.paper-block.rotate-left {
    transform: rotate(-0.7deg);
}

.paper-block.rotate-right {
    transform: rotate(0.7deg);
}

.index-card {
    position: relative;
    background: #f8edcf;
    border: 1px solid rgba(40, 35, 28, 0.22);
    padding: 22px;
    box-shadow: 0 8px 16px rgba(40, 30, 15, 0.14);
}

.index-card::after {
    content: "";
    position: absolute;
    left: 0;
    top: 52px;
    width: 100%;
    border-top: 1px dashed rgba(80, 60, 30, 0.22);
}

.meta-label {
    display: inline-block;
    margin-bottom: 12px;
    color: var(--red);
    font-family: "IBM Plex Mono", monospace;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.media-frame {
    position: relative;
    background: #fbf8ef;
    border: 1px solid rgba(40, 35, 28, 0.16);
    padding: 16px 16px 46px;
    box-shadow: 0 12px 24px rgba(30, 20, 10, 0.22);
}

.media-frame.taped::before {
    content: "";
    position: absolute;
    top: -15px;
    left: 38%;
    width: 96px;
    height: 26px;
    background: rgba(190, 155, 95, 0.45);
    transform: rotate(1.4deg);
}

.media-frame.polaroid {
    transform: rotate(1.5deg);
}

.media-placeholder {
    min-height: 230px;
    background:
        linear-gradient(135deg, rgba(255,255,255,.08), rgba(0,0,0,.12)),
        #1b1d1d;
    color: #e2ddcf;
    display: grid;
    place-items: center;
    font-family: "IBM Plex Mono", monospace;
    text-transform: uppercase;
    font-size: 13px;
}

.media-caption {
    position: absolute;
    left: 20px;
    bottom: 16px;
    color: var(--muted);
    font-size: 13px;
}

.terminal-block {
    background: #101211;
    color: #98d982;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 4px;
    padding: 18px 20px;
    font-family: "IBM Plex Mono", monospace;
    font-size: 14px;
    line-height: 1.55;
    box-shadow: 0 10px 22px rgba(20, 10, 5, 0.28);
}

.terminal-block .prompt {
    color: #7ccf70;
}

.terminal-block .output {
    color: #d7d4c8;
}

.diagram-sheet {
    position: relative;
    background: #f5edd8;
    border: 1px solid rgba(40, 35, 28, 0.2);
    padding: 24px;
    box-shadow: 0 8px 18px rgba(40, 30, 15, 0.13);
}

.diagram-box {
    min-height: 180px;
    border: 1px dashed rgba(40, 35, 28, 0.35);
    display: grid;
    place-items: center;
    font-family: "IBM Plex Mono", monospace;
    font-size: 13px;
    text-transform: uppercase;
}

.module-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 32px;
    align-items: start;
}

.module-stack {
    display: grid;
    gap: 24px;
}

/* === HERO PROJECT MODULE === */

.hero-project {
    position: relative;
    display: grid;
    gap: 26px;
    margin: 40px 0 70px;
}

/* desktop */
@media (min-width: 920px) {
    .hero-project {
        grid-template-columns: 1.05fr 0.95fr;
        align-items: start;
    }
}

.hero-project-main {
    position: relative;
    z-index: 2;
}

.hero-project-paper {
    position: relative;
    background: #fbf3df;
    border: 1px solid rgba(40,35,28,.16);
    padding: 34px;
    box-shadow:
        0 18px 36px rgba(30,20,10,.18),
        0 2px 0 rgba(255,255,255,.45) inset;
}

.hero-project-paper::before {
    content: "";
    position: absolute;
    top: -14px;
    left: 38%;
    width: 92px;
    height: 28px;
    background: rgba(190,155,95,.42);
    transform: rotate(-1.4deg);
}

.hero-project-meta {
    color: var(--red);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 18px;
}

.hero-project-title {
    margin: 0 0 18px;
    font-size: clamp(42px, 7vw, 78px);
    line-height: 0.95;
    letter-spacing: -3px;
}

.hero-project-dek {
    max-width: 42ch;
    font-size: 20px;
    line-height: 1.45;
    margin-bottom: 28px;
}

.hero-project-links {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}

.hero-project-links a {
    color: var(--ink);
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    border-bottom: 1px solid var(--ink);
}

/* MEDIA SIDE */

.hero-project-media {
    position: relative;
}

.hero-polaroid {
    position: relative;
    background: #fdfaf2;
    padding: 16px 16px 54px;
    border: 1px solid rgba(40,35,28,.12);
    box-shadow:
        0 20px 34px rgba(20,10,5,.24);
}

.hero-polaroid::before {
    content: "";
    position: absolute;
    top: -16px;
    left: 42%;
    width: 100px;
    height: 28px;
    background: rgba(190,155,95,.44);
    transform: rotate(1.5deg);
}

.hero-polaroid.primary {
    transform: rotate(1.6deg);
    z-index: 2;
}

.hero-polaroid.secondary {
    position: absolute;
    width: 72%;
    right: -6%;
    bottom: -90px;
    transform: rotate(-4deg);
    z-index: 1;
}

/* MOBILE: stack naturally */

@media (max-width: 919px) {

    .hero-project {
        margin-top: 10px;
    }

    .hero-project-paper {
        padding: 28px 24px;
    }

    .hero-project-title {
        font-size: 52px;
        line-height: 0.92;
    }

    .hero-project-dek {
        font-size: 18px;
    }

    .hero-polaroid.secondary {
        position: relative;
        width: 82%;
        right: auto;
        bottom: auto;
        margin-top: 18px;
        margin-left: auto;
    }
}

/* IMAGE PLACEHOLDER */

.hero-image-placeholder {
    height: 340px;
    background:
        linear-gradient(135deg, rgba(255,255,255,.08), rgba(0,0,0,.16)),
        #1b1e1f;
    display: grid;
    place-items: center;
    color: #e2ddcf;
    font-family: "IBM Plex Mono", monospace;
    font-size: 13px;
    text-transform: uppercase;
}

.hero-caption {
    position: absolute;
    left: 18px;
    bottom: 16px;
    font-size: 13px;
    color: #655d50;
}

/* =========================================
   MOBILE NOTEBOOK MODE
========================================= */

@media (max-width: 900px) {

    body {
        background-size:
            auto,
            18px 18px,
            18px 18px,
            auto;
    }

    .page-shell {
        width: calc(100vw - 16px);
        margin: 8px auto;
        padding:
            20px
            16px
            60px;
    }

    .side-note {
        display: none;
    }

    /* HEADER */

    .site-header {
        display: block;
        margin-bottom: 32px;
    }

    .logo {
        font-size: 54px;
        line-height: 0.9;
        display: inline-block;
        margin-bottom: 12px;
    }

    .tagline {
        font-size: 15px;
        margin-bottom: 22px;
    }

    .nav {
        gap: 14px;
        font-size: 11px;
        line-height: 1.5;
    }

    /* HERO */

    .hero-project {
        display: block;
        margin:
            18px 0
            48px;
    }

    .hero-project-main,
    .hero-project-media {
        width: 100%;
    }

    .hero-project-paper {
        padding: 24px 20px;
        margin-top: 20px;
    }

    .hero-project-title {
        font-size: 58px;
        line-height: 0.88;
        letter-spacing: -3px;
    }

    .hero-project-dek {
        font-size: 18px;
        line-height: 1.5;
        max-width: none;
    }

    .hero-project-links {
        gap: 12px;
    }

    /* MEDIA */

    .hero-polaroid {
        transform: none !important;
        width: 100%;
    }

    .hero-polaroid.secondary {
        position: relative;
        width: 82%;
        margin:
            18px auto 0;
        right: auto;
        bottom: auto;
    }

    .hero-image-placeholder {
        height: 240px;
    }

    /* GRID -> STACK */

    .paper-row,
    .module-grid,
    .project-layout {
        display: block;
    }

    .paper-card,
    .paper-block,
    .index-card,
    .media-frame,
    .diagram-sheet,
    .terminal-block {
        width: 100%;
        margin-bottom: 22px;
    }

    /* REMOVE ROTATION */

    .rotate-left,
    .rotate-right,
    .hero-polaroid.primary,
    .hero-polaroid.secondary {
        transform: none !important;
    }

    /* TYPOGRAPHY */

    .page-title {
        font-size: 52px;
        line-height: 0.92;
        margin-bottom: 24px;
    }

    .card-title {
        font-size: 28px;
    }

    .card-text,
    .hero-copy,
    p {
        font-size: 17px;
        line-height: 1.6;
    }

    /* TERMINAL */

    .terminal-block {
        overflow-x: auto;
        font-size: 13px;
    }

    /* POLAROID CAPTION */

    .media-caption,
    .hero-caption {
        font-size: 12px;
    }
}

/* compact sidebar notes */

.project-layout aside .paper-block {
    padding: 14px 16px;
    font-size: 14px;
}

.project-layout aside .paper-block p {
    margin: 0;
    font-size: 15px;
    line-height: 1.45;
}

.project-layout aside .meta-label {
    margin-bottom: 8px;
    font-size: 11px;
}

/* sidebar notes should hug content */

.project-layout {
    align-items: start;
}

.project-layout aside {
    align-self: start;
}

.project-layout aside.module-stack {
    align-content: start;
    align-items: start;
}

.project-layout aside .paper-block {
    width: 100%;
    min-height: 0;
    height: auto;
    padding: 14px 16px;
    display: block;
}

.project-layout aside .paper-block p {
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
}

.project-layout aside .meta-label {
    display: block;
    margin-bottom: 8px;
    font-size: 11px;
}

.media-image {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* markdown generated code blocks */

.paper-block pre {
    background: #101514;
    color: #8ee7a5;
    padding: 18px;
    overflow-x: auto;
    border-radius: 2px;
    margin: 20px 0;
    font-size: 14px;
    line-height: 1.5;
}

.paper-block code {
    font-family: "IBM Plex Mono", monospace;
}

.paper-block p code,
.paper-block li code {
    background: rgba(20,20,20,.08);
    padding: 2px 5px;
    border-radius: 2px;
    font-size: .92em;
}

/* media blocks */

.media-frame {
    position: relative;
    background: #f8f3e7;
    border: 1px solid rgba(40,35,28,.12);
    padding: 14px 14px 46px;
    box-shadow:
        0 14px 24px rgba(30,20,10,.16);
}

.media-frame.polaroid {
    max-width: 680px;
    transform: rotate(-1deg);
}

.media-frame.taped::before {
    content: "";
    position: absolute;
    top: -12px;
    left: 42%;
    width: 90px;
    height: 24px;
    background: rgba(190,155,95,.42);
}

.media-image {
    display: block;
    width: 100%;
    height: auto;
}

.media-caption {
    margin-top: 12px;
    font-size: 13px;
    color: #655d50;
}

/* project hero media */

.hero-media-section {
    margin-top: 34px;
    margin-bottom: 48px;
}

.project-hero-media {
    max-width: 760px;
}

.project-hero-media .media-image {
    display: block;
    width: 100%;
    height: auto;
}

/* =========================================================
   CONTENT BLOCK VARIANTS
========================================================= */

.content-block {
    margin-bottom: 42px;
}


/* PAPER */

.content-block--paper .paper-block,
.content-block--paper .media-frame,
.content-block--paper .index-card {
    transform: rotate(0deg);
}


/* NOTE */

.content-block--note .paper-block,
.content-block--note .index-card {
    background: #f4ebc8;
    border-left: 6px solid #d6c17a;
    transform: rotate(-0.6deg);
}


/* POLAROID */

.content-block--polaroid .media-frame {
    background: #f7f7f2;
    padding: 14px 14px 52px;
    transform: rotate(-1.2deg);
    box-shadow:
        0 16px 26px rgba(20,20,20,.18);
}


/* TERMINAL */

.content-block--terminal .terminal-block {
    background: #050606;
    color: #8effa0;
    border: 1px solid rgba(120,255,160,.14);
    box-shadow:
        0 0 0 1px rgba(100,255,150,.04),
        0 12px 24px rgba(0,0,0,.32);
}


/* DIAGRAM */

.content-block--diagram .diagram-sheet {
    background:
        linear-gradient(
            rgba(70,70,70,.05) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(70,70,70,.05) 1px,
            transparent 1px
        );
    background-size: 24px 24px;
    padding: 24px;
    border: 1px dashed rgba(30,30,30,.16);
}

.post-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
}

.post-navigation__slot {
    min-height: 4rem;
}

.post-navigation__slot--next {
    text-align: right;
}

.post-navigation__link {
    display: block;
    text-decoration: none;
}

.post-navigation__link strong {
    display: block;
    margin-top: 0.35rem;
    font-size: 1.05rem;
    line-height: 1.3;
}

@media (max-width: 700px) {
    .post-navigation {
        grid-template-columns: 1fr;
    }

    .post-navigation__slot--next {
        text-align: left;
    }
}

.series-navigation {
    margin-top: 1rem;
    padding-left: 1.5rem;
}

.series-navigation li {
    margin-bottom: 0.5rem;
}

.writing-index,
.writing-detail,
.series-index,
.series-detail {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.post-dek {
    font-size: 1.05rem;
    line-height: 1.6;
    max-width: 70ch;
}

.series-index .paper-block,
.writing-index .paper-block {
    transition:
        transform 120ms ease,
        box-shadow 120ms ease;
}

.series-index article.paper-block:hover,
.writing-index article.paper-block:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(40, 30, 15, 0.12);
}

.series-detail ol,
.series-navigation {
    line-height: 1.5;
}

.series-detail li,
.series-navigation li {
    margin-bottom: 1rem;
}

.series-detail li p,
.series-navigation li p {
    margin-top: 0.35rem;
    max-width: 75ch;
}

@media (max-width: 700px) {
    .writing-index,
    .writing-detail,
    .series-index,
    .series-detail {
        gap: 1rem;
    }

    .post-dek {
        font-size: 1rem;
    }
}

.code-block .codehilite {
    margin-top: 1rem;
    overflow-x: auto;
}

.code-block .codehilite pre {
    margin: 0;
    padding: 1rem;
    overflow-x: auto;
    line-height: 1.5;
    font-size: 0.9rem;
}

.code-block--terminal .codehilite {
    background: transparent;
}

.code-block--terminal .codehilite pre {
    background: transparent;
    color: inherit;
    padding: 0;
}

.codehilite .k,
.codehilite .kd,
.codehilite .kn,
.codehilite .ow {
    font-weight: 700;
}

.codehilite .c,
.codehilite .c1,
.codehilite .cm {
    font-style: italic;
    opacity: 0.75;
}

.codehilite .s,
.codehilite .s1,
.codehilite .s2 {
    opacity: 0.9;
}

/* ------------------------------------------------------------------
   Materiality improvements
   ------------------------------------------------------------------ */

/* ------------------------------------------------------------------
   Materiality improvements
   ------------------------------------------------------------------ */

.paper-block,
.index-card,
.diagram-sheet,
.media-frame,
.terminal-block {
    position: relative;
    border-radius: 2px;
    overflow: visible;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.04),
        0 4px 8px rgba(0, 0, 0, 0.05),
        0 12px 24px rgba(0, 0, 0, 0.06),
        0 24px 48px rgba(0, 0, 0, 0.03);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

/* Subtle paper grain and tonal variation */
.paper-block::before,
.index-card::before,
.diagram-sheet::before,
.media-frame::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.08;
    background-image:
        radial-gradient(circle at 15% 20%, rgba(0, 0, 0, 0.04) 0, transparent 35%),
        radial-gradient(circle at 80% 25%, rgba(0, 0, 0, 0.03) 0, transparent 30%),
        radial-gradient(circle at 30% 75%, rgba(0, 0, 0, 0.03) 0, transparent 40%),
        radial-gradient(circle at 75% 85%, rgba(0, 0, 0, 0.02) 0, transparent 35%),
        linear-gradient(
            to bottom,
            rgba(255, 255, 255, 0.03),
            rgba(0, 0, 0, 0.01)
        );
    mix-blend-mode: multiply;
    z-index: 1;
}

/* Printed paper edge and slight wear */
.paper-block::after,
.index-card::after,
.diagram-sheet::after,
.media-frame::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    border: 1px solid rgba(0, 0, 0, 0.025);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -1px 0 rgba(0, 0, 0, 0.015);
    border-radius: inherit;
    z-index: 2;
}

/* Ensure actual content remains above overlays */
.paper-block > *,
.index-card > *,
.diagram-sheet > *,
.media-frame > *,
.terminal-block > * {
    position: relative;
    z-index: 3;
}


/* ------------------------------------------------------------------
   Stronger visible paper texture
   ------------------------------------------------------------------ */

.paper-block,
.index-card,
.diagram-sheet,
.media-frame {
    background-image:
        radial-gradient(circle at 12% 18%, rgba(80, 55, 25, 0.045) 0 1px, transparent 1px),
        radial-gradient(circle at 72% 32%, rgba(80, 55, 25, 0.035) 0 1px, transparent 1px),
        radial-gradient(circle at 42% 78%, rgba(80, 55, 25, 0.03) 0 1px, transparent 1px),
        repeating-linear-gradient(
            0deg,
            rgba(70, 50, 25, 0.025) 0px,
            rgba(70, 50, 25, 0.025) 1px,
            transparent 1px,
            transparent 5px
        ),
        repeating-linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.06) 0px,
            rgba(255, 255, 255, 0.06) 1px,
            transparent 1px,
            transparent 7px
        );
    background-size:
        13px 13px,
        17px 17px,
        23px 23px,
        auto,
        auto;
    background-blend-mode: multiply;
}


/* ------------------------------------------------------------------
   Archival paper texture
   ------------------------------------------------------------------ */

.paper-block,
.index-card,
.diagram-sheet,
.media-frame,
.hero-card,
.home-card {
    background-color: #f6eedb !important;
    background-image:
        radial-gradient(
            rgba(90, 65, 35, 0.06) 0.8px,
            transparent 0.8px
        ),
        radial-gradient(
            rgba(255, 255, 255, 0.10) 0.8px,
            transparent 0.8px
        ),
        repeating-linear-gradient(
            0deg,
            rgba(90, 65, 35, 0.012) 0px,
            rgba(90, 65, 35, 0.012) 1px,
            transparent 1px,
            transparent 6px
        ),
        linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.22) 0%,
            rgba(255, 255, 255, 0) 30%,
            rgba(90, 65, 35, 0.025) 100%
        );
    background-size:
        11px 11px,
        17px 17px,
        auto,
        auto;
    background-position:
        0 0,
        4px 6px,
        0 0,
        0 0;
    background-blend-mode:
        multiply,
        screen,
        multiply,
        normal;
}

/* ------------------------------------------------------------------
   Overdone paper texture test
   Purposefully too much, so we can dial it back
   ------------------------------------------------------------------ */

.paper-block,
.index-card,
.diagram-sheet,
.media-frame,
.hero-card,
.home-card {
    background-color: #f1e2bd !important;
    background-image:
        radial-gradient(
            circle at 10% 20%,
            rgba(80, 45, 15, 0.20) 0 1px,
            transparent 1.5px
        ),
        radial-gradient(
            circle at 70% 30%,
            rgba(130, 90, 35, 0.16) 0 1px,
            transparent 1.5px
        ),
        radial-gradient(
            circle at 40% 80%,
            rgba(60, 35, 15, 0.14) 0 1px,
            transparent 1.5px
        ),
        repeating-linear-gradient(
            0deg,
            rgba(80, 50, 20, 0.09) 0px,
            rgba(80, 50, 20, 0.09) 1px,
            transparent 1px,
            transparent 5px
        ),
        repeating-linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.14) 0px,
            rgba(255, 255, 255, 0.14) 1px,
            transparent 1px,
            transparent 8px
        ),
        linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.32) 0%,
            rgba(130, 90, 35, 0.06) 45%,
            rgba(60, 35, 15, 0.10) 100%
        ) !important;

    background-size:
        8px 8px,
        13px 13px,
        19px 19px,
        auto,
        auto,
        auto !important;

    background-blend-mode:
        multiply,
        multiply,
        multiply,
        multiply,
        screen,
        normal !important;
}

/* ==========================================================
   Notebook shell
   ========================================================== */

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(
            ellipse at center,
            transparent 55%,
            rgba(60, 40, 20, 0.06) 100%
        );
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(
            circle at 15% 20%,
            rgba(90, 60, 20, 0.025) 0,
            transparent 35%
        ),
        radial-gradient(
            circle at 85% 75%,
            rgba(90, 60, 20, 0.02) 0,
            transparent 40%
        );
}

/* ==========================================================
   Desktop notebook shell
   Visible open-notebook frame
   ========================================================== */

@media (min-width: 769px) {
    .page-shell,
    .notebook-page,
    main {
        position: relative;
    }

    .notebook-page::before,
    .page-shell::before {
        content: '';
        position: absolute;
        top: 0;
        bottom: 0;
        left: 2.2rem;
        width: 1px;
        background: rgba(90, 60, 30, 0.16);
        box-shadow:
            4px 0 0 rgba(90, 60, 30, 0.035),
            8px 0 0 rgba(90, 60, 30, 0.025);
        pointer-events: none;
    }

    .notebook-page::after,
    .page-shell::after {
        content: '';
        position: absolute;
        inset: 0;
        pointer-events: none;
        border-radius: 4px;
        box-shadow:
            inset 0 0 0 1px rgba(80, 55, 30, 0.08),
            inset 18px 0 34px rgba(70, 45, 20, 0.045),
            inset -18px 0 34px rgba(70, 45, 20, 0.035),
            inset 0 -16px 28px rgba(70, 45, 20, 0.035);
    }
}

/* ==========================================================
   Physical notebook realism
   Aging, imperfections and analog artifacts
   ========================================================== */

/* Slight random rotation for cards */
.paper-block,
.index-card,
.diagram-sheet {
    transform: rotate(-0.12deg);
}

/* Alternate subtle rotations */
.content-block:nth-child(2n) .paper-block,
.content-block:nth-child(2n) .index-card,
.content-block:nth-child(2n) .diagram-sheet {
    transform: rotate(0.18deg);
}

.content-block:nth-child(3n) .paper-block,
.content-block:nth-child(3n) .index-card,
.content-block:nth-child(3n) .diagram-sheet {
    transform: rotate(-0.22deg);
}

/* Aged paper edges and stains */
.paper-block,
.index-card,
.diagram-sheet,
.media-frame {
    position: relative;
    overflow: visible;
}

.paper-block::before,
.index-card::before,
.diagram-sheet::before,
.media-frame::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.55;
    background:
        radial-gradient(circle at 12% 18%,
            rgba(120, 90, 50, 0.05) 0,
            transparent 22%),
        radial-gradient(circle at 85% 10%,
            rgba(120, 90, 50, 0.035) 0,
            transparent 18%),
        radial-gradient(circle at 75% 82%,
            rgba(120, 90, 50, 0.04) 0,
            transparent 20%),
        radial-gradient(circle at 8% 92%,
            rgba(120, 90, 50, 0.03) 0,
            transparent 16%);
    border-radius: inherit;
    mix-blend-mode: multiply;
}

/* Worn edges */
.paper-block::after,
.index-card::after,
.diagram-sheet::after,
.media-frame::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        inset 0 -1px 0 rgba(90, 60, 30, 0.05),
        inset 1px 0 0 rgba(255, 255, 255, 0.2),
        inset -1px 0 0 rgba(90, 60, 30, 0.04),
        inset 0 0 18px rgba(120, 90, 50, 0.035);
}

/* Page edge aging */
.notebook-page {
    position: relative;
}

.notebook-page::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at top left,
            rgba(100, 70, 40, 0.08),
            transparent 20%),
        radial-gradient(circle at top right,
            rgba(100, 70, 40, 0.06),
            transparent 20%),
        radial-gradient(circle at bottom left,
            rgba(100, 70, 40, 0.06),
            transparent 22%),
        radial-gradient(circle at bottom right,
            rgba(100, 70, 40, 0.08),
            transparent 22%);
}

/* Slight uneven shadows */
.paper-block,
.index-card,
.diagram-sheet {
    box-shadow:
        0 2px 3px rgba(60, 40, 20, 0.05),
        0 8px 18px rgba(60, 40, 20, 0.06),
        2px 14px 24px rgba(60, 40, 20, 0.035);
}

/* Polaroids feel more physical */
.media-frame.polaroid {
    transform: rotate(-1.2deg);
}

.media-frame.polaroid:nth-child(2n) {
    transform: rotate(1.4deg);
}

/* Tiny dust and imperfections */
body {
    background-image:
        radial-gradient(circle at 10% 10%, rgba(90, 60, 30, 0.012) 0 1px, transparent 1px),
        radial-gradient(circle at 80% 30%, rgba(90, 60, 30, 0.01) 0 1px, transparent 1px),
        radial-gradient(circle at 30% 70%, rgba(90, 60, 30, 0.012) 0 1px, transparent 1px),
        radial-gradient(circle at 70% 85%, rgba(90, 60, 30, 0.01) 0 1px, transparent 1px),
        linear-gradient(
            to right,
            rgba(110, 90, 60, 0.06) 1px,
            transparent 1px
        );
}

/* ==========================================================
   Real paper texture using SVG noise
   ========================================================== */

/* Main notebook page */
.notebook-page {
    background-image:
        url('/static/img/paper-noise.svg'),
        linear-gradient(
            to bottom,
            rgba(255, 255, 255, 0.04),
            rgba(120, 90, 40, 0.015)
        );
    background-repeat: repeat;
    background-size: 240px 240px, auto;
}

/* Paper-based components */
.paper-block,
.index-card,
.diagram-sheet,
.media-frame,
.hero-card,
.section-card {
    background-image:
        url('/static/img/paper-noise.svg'),
        linear-gradient(
            to bottom,
            rgba(255, 255, 255, 0.03),
            rgba(120, 90, 40, 0.012)
        );
    background-repeat: repeat;
    background-size: 180px 180px, auto;
}

/* Stronger texture on taped notes */
.index-card {
    background-size: 150px 150px, auto;
}

/* Slightly warmer polaroids */
.media-frame.polaroid {
    background-image:
        url('/static/img/paper-noise.svg'),
        linear-gradient(
            to bottom,
            rgba(255, 255, 255, 0.04),
            rgba(140, 110, 60, 0.018)
        );
    background-repeat: repeat;
    background-size: 150px 150px, auto;
}

/* ==========================================================
   Strong visible paper texture
   ========================================================== */

.notebook-page,
.paper-block,
.index-card,
.diagram-sheet,
.media-frame,
.hero-card,
.home-card,
.section-card {
    background-image:
        url('/static/img/paper-noise.svg') !important;
    background-repeat: repeat !important;
    background-size: 220px 220px !important;
    background-blend-mode: multiply !important;
}

/* Slightly darker paper tone to help texture stand out */
.notebook-page {
    background-color: #f3ecd9 !important;
}

.paper-block,
.index-card,
.diagram-sheet,
.hero-card,
.home-card,
.section-card {
    background-color: #f8f1df !important;
}

.media-frame {
    background-color: #fffaf0 !important;
}

/* ==========================================================
   Aged paper treatment
   ========================================================== */

.notebook-page {
    position: relative;
    background-color: #f4ecd9;
    background-image: url('/static/img/paper-noise.svg');
    background-repeat: repeat;
    background-size: 180px 180px;
    box-shadow:
        inset 0 0 120px rgba(90, 60, 20, 0.06),
        inset 0 0 20px rgba(90, 60, 20, 0.04),
        0 18px 60px rgba(40, 25, 10, 0.14);
}

/* Darkened corners and subtle stains */
.notebook-page::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(circle at 10% 12%,
            rgba(120, 85, 40, 0.05),
            transparent 35%),
        radial-gradient(circle at 85% 15%,
            rgba(120, 85, 40, 0.04),
            transparent 30%),
        radial-gradient(circle at 12% 88%,
            rgba(120, 85, 40, 0.03),
            transparent 28%),
        radial-gradient(circle at 88% 82%,
            rgba(120, 85, 40, 0.05),
            transparent 32%);
}

/* Soft edge wear */
.notebook-page::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    box-shadow:
        inset 0 0 2px rgba(120, 90, 40, 0.12),
        inset 0 0 80px rgba(90, 60, 20, 0.05);
}

/* Ensure content stays above overlays */
.notebook-page > * {
    position: relative;
    z-index: 1;
}


/* ==========================================================
   Notebook paper as the main surface
   ========================================================== */

.page-shell,
.notebook-page,
main {
    background-image:
        url('/static/img/paper-noise.svg?v=103'),
        repeating-linear-gradient(
            to right,
            rgba(80, 55, 25, 0.035) 0,
            rgba(80, 55, 25, 0.035) 1px,
            transparent 1px,
            transparent 32px
        ),
        linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.28),
            rgba(80, 55, 25, 0.025)
        ) !important;
    background-size: 720px 720px, 32px 32px, cover !important;
}

.paper-block,
.index-card,
.diagram-sheet,
.media-frame,
.hero-card,
.home-card,
.section-card {
    background-image:
        url('/static/img/paper-noise.svg?v=103'),
        linear-gradient(
            to bottom,
            rgba(255, 255, 255, 0.22),
            rgba(100, 70, 30, 0.018)
        ) !important;
    background-size: 640px 640px, cover !important;
}



/* Terminal surfaces should stay terminal-like */
.terminal-block,
.code-block--terminal {
    background-color: #050706 !important;
    background-image: none !important;
}

/* ==========================================================
   Printed ink typography
   Typewriter / letterpress feel
   ========================================================== */

body {
    color: #2f261b;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

/* Main readable text: slightly printed into paper */
p,
li,
blockquote,
.paper-block,
.index-card,
.diagram-sheet {
    text-shadow:
        0 0.35px 0 rgba(255, 248, 230, 0.55),
        0 0 0.45px rgba(55, 35, 18, 0.18);
}

/* Headings: darker ink, faint press impression */
h1,
h2,
h3 {
    color: #241b12;
    text-shadow:
        0 1px 0 rgba(255, 248, 230, 0.48),
        0 -0.35px 0 rgba(70, 45, 20, 0.14),
        0 0 0.7px rgba(40, 25, 10, 0.22);
}

/* Metadata: stamped / archival label feeling */
.meta-label,
.card-kicker {
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(45, 32, 20, 0.72);
    text-shadow:
        0 0.5px 0 rgba(255, 248, 230, 0.45),
        0 0 0.6px rgba(60, 40, 20, 0.18);
}

/* Links: printed but interactive */
a {
    text-shadow:
        0 0.35px 0 rgba(255, 248, 230, 0.45),
        0 0 0.5px rgba(40, 25, 10, 0.16);
}

a:hover {
    text-shadow:
        0 0.5px 0 rgba(255, 248, 230, 0.55),
        0 0 1px rgba(40, 25, 10, 0.28);
}

/* Terminal and code should stay crisp */
.terminal-block,
.terminal-block *,
.code-block,
.code-block * {
    text-shadow: none;
}

/* ==========================================================
   Universal tape system
   ========================================================== */

.content-block {
    position: relative;
}

.content-block::before,
.content-block::after {
    content: '';
    position: absolute;
    pointer-events: none;
    z-index: 20;
    width: 4.8rem;
    height: 1.1rem;
    background:
        linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.18),
            rgba(166, 128, 64, 0.28),
            rgba(255, 255, 255, 0.12)
        );
    border-left: 1px solid rgba(120, 90, 40, 0.12);
    border-right: 1px solid rgba(120, 90, 40, 0.12);
    box-shadow:
        0 1px 2px rgba(40, 25, 10, 0.08),
        inset 0 0 8px rgba(255, 255, 255, 0.18);
    opacity: 0;
}

/* No tape */
.tape-style--none::before,
.tape-style--none::after {
    display: none;
}

/* One tape, top center */
.tape-style--top::before {
    opacity: 1;
    top: -0.55rem;
    left: 50%;
    transform: translateX(-50%) rotate(-1deg);
}

/* One tape, top left */
.tape-style--top-left::before {
    opacity: 1;
    top: -0.5rem;
    left: 2rem;
    transform: rotate(-4deg);
}

/* One tape, top right */
.tape-style--top-right::before {
    opacity: 1;
    top: -0.5rem;
    right: 2rem;
    transform: rotate(4deg);
}

/* Two tapes, both top corners */
.tape-style--double-top::before {
    opacity: 1;
    top: -0.5rem;
    left: 2rem;
    transform: rotate(-3deg);
}

.tape-style--double-top::after {
    opacity: 1;
    top: -0.5rem;
    right: 2rem;
    transform: rotate(3deg);
}

/* Cross tape, left */
.tape-style--cross-left::before {
    opacity: 1;
    top: -0.2rem;
    left: 1.5rem;
    transform: rotate(-38deg);
}

.tape-style--cross-left::after {
    opacity: 1;
    top: -0.2rem;
    left: 1.5rem;
    transform: rotate(38deg);
}

/* Cross tape, right */
.tape-style--cross-right::before {
    opacity: 1;
    top: -0.2rem;
    right: 1.5rem;
    transform: rotate(38deg);
}

.tape-style--cross-right::after {
    opacity: 1;
    top: -0.2rem;
    right: 1.5rem;
    transform: rotate(-38deg);
}

/* Tape texture */
.content-block::before,
.content-block::after {
    background-image:
        url('/static/img/paper-noise.svg?v=103'),
        linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.22),
            rgba(176, 137, 69, 0.34),
            rgba(255, 255, 255, 0.16)
        );
    background-size: 220px 220px, cover;
    background-blend-mode: multiply, normal;
}

/* ==========================================================
   Tape refinement
   ========================================================== */

.content-block {
    margin-top: 0.85rem;
}

/* Give taped blocks a little breathing room */
.content-block:not(.tape-style--none) {
    padding-top: 0.35rem;
}

/* Make tape feel more translucent and physical */
.content-block::before,
.content-block::after {
    backdrop-filter: blur(0.6px);
    border-radius: 1px;
}

/* Dark surfaces need quieter tape */
.content-block--terminal::before,
.content-block--terminal::after,
.content-block--code.content-block--terminal::before,
.content-block--code.content-block--terminal::after {
    background-image:
        url('/static/img/paper-noise.svg?v=103'),
        linear-gradient(
            90deg,
            rgba(210, 210, 195, 0.18),
            rgba(135, 135, 120, 0.34),
            rgba(230, 230, 215, 0.12)
        );
    border-left: 1px solid rgba(220, 220, 200, 0.08);
    border-right: 1px solid rgba(220, 220, 200, 0.08);
}

/* Mobile: smaller tape */
@media (max-width: 768px) {
    .content-block::before,
    .content-block::after {
        width: 3.6rem;
        height: 0.85rem;
    }

    .tape-style--top-left::before,
    .tape-style--double-top::before {
        left: 1rem;
    }

    .tape-style--top-right::before,
    .tape-style--double-top::after {
        right: 1rem;
    }
}

/* ==========================================================
   Unified tape and pin system v2
   ========================================================== */

.content-block {
    position: relative;
}

.content-block::before,
.content-block::after {
    content: '';
    position: absolute;
    pointer-events: none;
    z-index: 20;
    opacity: 0;
}

/* Base tape */
.content-block::before,
.content-block::after {
    width: 5rem;
    height: 1.05rem;
    background-image:
        url('/static/img/paper-noise.svg?v=103'),
        linear-gradient(
            90deg,
            rgba(255, 245, 210, 0.34),
            rgba(184, 143, 78, 0.38),
            rgba(255, 245, 210, 0.24)
        );
    background-size: 260px 260px, cover;
    background-blend-mode: multiply, normal;
    border-left: 1px solid rgba(120, 90, 40, 0.12);
    border-right: 1px solid rgba(120, 90, 40, 0.12);
    box-shadow:
        0 1px 2px rgba(40, 25, 10, 0.10),
        inset 0 0 7px rgba(255, 255, 255, 0.22);
}

/* No attachment */
.tape-style--none::before,
.tape-style--none::after {
    display: none;
}

/* Tape top center */
.tape-style--tape-top::before {
    opacity: 0.82;
    top: -0.55rem;
    left: 50%;
    transform: translateX(-50%) rotate(-1.5deg);
}

/* Tape top and bottom center */
.tape-style--tape-top-bottom::before {
    opacity: 0.82;
    top: -0.55rem;
    left: 50%;
    transform: translateX(-50%) rotate(-1deg);
}

.tape-style--tape-top-bottom::after {
    opacity: 0.78;
    bottom: -0.55rem;
    left: 50%;
    transform: translateX(-50%) rotate(1.2deg);
}

/* Tape at two top corners */
.tape-style--tape-top-corners::before {
    opacity: 0.82;
    top: -0.5rem;
    left: 1.75rem;
    transform: rotate(-3deg);
}

.tape-style--tape-top-corners::after {
    opacity: 0.82;
    top: -0.5rem;
    right: 1.75rem;
    transform: rotate(3deg);
}

/* Tape on the sides */
.tape-style--tape-sides::before {
    opacity: 0.8;
    top: 42%;
    left: -2.4rem;
    transform: rotate(-90deg);
}

.tape-style--tape-sides::after {
    opacity: 0.8;
    top: 42%;
    right: -2.4rem;
    transform: rotate(90deg);
}

/* Pin system uses small circles instead of tape strips */
.tape-style--pin-top::before,
.tape-style--pin-corners::before,
.tape-style--pin-corners::after,
.tape-style--pin-all::before,
.tape-style--pin-all::after {
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 999px;
    background:
        radial-gradient(
            circle at 35% 35%,
            rgba(255, 255, 255, 0.9),
            rgba(150, 130, 95, 0.65) 45%,
            rgba(70, 55, 35, 0.45) 100%
        );
    box-shadow:
        0 1px 2px rgba(40, 25, 10, 0.24),
        inset 0 1px 1px rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(70, 55, 35, 0.25);
}

/* One pin, top center */
.tape-style--pin-top::before {
    opacity: 1;
    top: -0.42rem;
    left: 50%;
    transform: translateX(-50%);
}

/* Pins in top corners */
.tape-style--pin-corners::before {
    opacity: 1;
    top: -0.42rem;
    left: 1.4rem;
}

.tape-style--pin-corners::after {
    opacity: 1;
    top: -0.42rem;
    right: 1.4rem;
}

/* Pin all corners: top pins via before/after, bottom pins via inner shadows */
.tape-style--pin-all::before {
    opacity: 1;
    top: -0.42rem;
    left: 1.4rem;
}

.tape-style--pin-all::after {
    opacity: 1;
    top: -0.42rem;
    right: 1.4rem;
}

/* Extra bottom pins using box-shadow clones */
.tape-style--pin-all::before {
    box-shadow:
        0 1px 2px rgba(40, 25, 10, 0.24),
        inset 0 1px 1px rgba(255, 255, 255, 0.55),
        0 calc(100% + 0.85rem) 0 rgba(150, 130, 95, 0.65);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .content-block::before,
    .content-block::after {
        width: 3.6rem;
        height: 0.85rem;
    }

    .tape-style--tape-top-corners::before,
    .tape-style--pin-corners::before,
    .tape-style--pin-all::before {
        left: 1rem;
    }

    .tape-style--tape-top-corners::after,
    .tape-style--pin-corners::after,
    .tape-style--pin-all::after {
        right: 1rem;
    }

    .tape-style--tape-sides::before,
    .tape-style--tape-sides::after {
        display: none;
    }
}

/* ==========================================================
   Rotation and depth controls
   ========================================================== */

/* Rotation styles */
.rotation--none {
    transform: none;
}

.rotation--left {
    transform: rotate(-0.8deg);
}

.rotation--right {
    transform: rotate(0.8deg);
}

.rotation--left-more {
    transform: rotate(-1.8deg);
}

.rotation--right-more {
    transform: rotate(1.8deg);
}

/* Depth styles */
.depth--flat {
    box-shadow:
        0 1px 2px rgba(40, 25, 10, 0.04);
}

.depth--low {
    box-shadow:
        0 3px 8px rgba(40, 25, 10, 0.06);
}

.depth--medium {
    box-shadow:
        0 8px 18px rgba(40, 25, 10, 0.08),
        2px 12px 24px rgba(40, 25, 10, 0.04);
}

.depth--high {
    box-shadow:
        0 14px 32px rgba(40, 25, 10, 0.12),
        4px 24px 48px rgba(40, 25, 10, 0.06);
}

/* Mobile: keep layout readable */
@media (max-width: 768px) {
    .rotation--left,
    .rotation--right,
    .rotation--left-more,
    .rotation--right-more {
        transform: none;
    }
}

/* ==========================================================
   Content block layout widths and alignment
   ========================================================== */

.content-block-flow {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 1.5rem;
    align-items: start;
}

.content-block {
    width: 100%;
}

/* Full width */
.content-block.width--full {
    grid-column: 1 / -1;
}

/* Half width */
.content-block.width--half.align--left {
    grid-column: 1 / span 6;
}

.content-block.width--half.align--center {
    grid-column: 4 / span 6;
}

.content-block.width--half.align--right {
    grid-column: 7 / span 6;
}

/* Third width */
.content-block.width--third.align--left {
    grid-column: 1 / span 4;
}

.content-block.width--third.align--center {
    grid-column: 5 / span 4;
}

.content-block.width--third.align--right {
    grid-column: 9 / span 4;
}

/* Fallbacks */
.content-block.width--half:not(.align--left):not(.align--center):not(.align--right) {
    grid-column: span 6;
}

.content-block.width--third:not(.align--left):not(.align--center):not(.align--right) {
    grid-column: span 4;
}

/* Mobile: field notebook stack */
@media (max-width: 768px) {
    .content-block-flow {
        display: flex;
        flex-direction: column;
        gap: 1.25rem;
    }

    .content-block,
    .content-block.width--full,
    .content-block.width--half,
    .content-block.width--third,
    .content-block.align--left,
    .content-block.align--center,
    .content-block.align--right {
        width: 100%;
        max-width: 100%;
        grid-column: auto;
    }
}

/* ==========================================================
   Content block layout widths and alignment
   ========================================================== */

.content-block-flow {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 1.5rem;
    align-items: start;
}

.content-block {
    width: 100%;
}

/* Full width */
.content-block.width--full {
    grid-column: 1 / -1;
}

/* Half width */
.content-block.width--half.align--left {
    grid-column: 1 / span 6;
}

.content-block.width--half.align--center {
    grid-column: 4 / span 6;
}

.content-block.width--half.align--right {
    grid-column: 7 / span 6;
}

/* Third width */
.content-block.width--third.align--left {
    grid-column: 1 / span 4;
}

.content-block.width--third.align--center {
    grid-column: 5 / span 4;
}

.content-block.width--third.align--right {
    grid-column: 9 / span 4;
}

/* Fallbacks */
.content-block.width--half:not(.align--left):not(.align--center):not(.align--right) {
    grid-column: span 6;
}

.content-block.width--third:not(.align--left):not(.align--center):not(.align--right) {
    grid-column: span 4;
}

/* Mobile: everything becomes a vertical notebook stack */
@media (max-width: 768px) {
    .content-block-flow {
        display: flex;
        flex-direction: column;
        gap: 1.25rem;
    }

    .content-block,
    .content-block.width--full,
    .content-block.width--half,
    .content-block.width--third,
    .content-block.align--left,
    .content-block.align--center,
    .content-block.align--right {
        width: 100%;
        max-width: 100%;
        grid-column: auto;
    }
}

/* ==========================================================
   Content sections
   ========================================================== */

.content-section {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.content-section__header {
    margin-bottom: 1rem;
}

.content-section__header h2 {
    margin-bottom: 0.35rem;
}

/* Section layout modifiers */

.section-layout--one-column .content-block {
    grid-column: 1 / -1;
}

.section-layout--two-columns .content-block {
    grid-column: span 6;
}

.section-layout--three-columns .content-block {
    grid-column: span 4;
}

.section-layout--gallery .content-block {
    grid-column: span 4;
}

.section-layout--split .content-block:nth-child(1) {
    grid-column: 1 / span 5;
}

.section-layout--split .content-block:nth-child(2) {
    grid-column: 6 / span 7;
}

/* Mobile: every section becomes a field notebook stack */
@media (max-width: 768px) {
    .section-layout--one-column,
    .section-layout--two-columns,
    .section-layout--three-columns,
    .section-layout--gallery,
    .section-layout--split {
        display: flex;
        flex-direction: column;
    }

    .section-layout--one-column .content-block,
    .section-layout--two-columns .content-block,
    .section-layout--three-columns .content-block,
    .section-layout--gallery .content-block,
    .section-layout--split .content-block {
        width: 100%;
        max-width: 100%;
        grid-column: auto;
    }
}
/* ==========================================================
   Hero section system
   ========================================================== */

.hero-section {
    display: grid;
    gap: 2rem;
    margin-bottom: 3rem;
    align-items: start;
}

.hero-section__content {
    position: relative;
    z-index: 2;
}

.hero-section__media {
    margin: 0;
}

/* Text hero */
.hero-section--text {
    grid-template-columns: 1fr;
    max-width: 52rem;
}

/* Split hero */
.hero-section--split {
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
    align-items: center;
}

/* Cover hero */
.hero-section--cover {
    grid-template-columns: 1fr;
}

.hero-section--cover .hero-section__media {
    order: -1;
    margin-bottom: 1.5rem;
}

/* Notebook hero */
.hero-section--notebook {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
    align-items: start;
}

.hero-section--notebook .hero-section__content {
    transform: rotate(-0.6deg);
}

.hero-section--notebook .hero-section__media {
    transform: rotate(1.2deg);
}

/* Hero typography */
.hero-section h1 {
    margin-top: 0.25rem;
    margin-bottom: 0.75rem;
}

.hero-section .hero-copy {
    font-size: 1.15rem;
    line-height: 1.7;
}

/* Mobile */
@media (max-width: 900px) {
    .hero-section,
    .hero-section--split,
    .hero-section--cover,
    .hero-section--notebook {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .hero-section__content,
    .hero-section__media {
        transform: none !important;
    }

    .hero-section--cover .hero-section__media {
        order: 0;
        margin-bottom: 0;
    }
}
/* ==========================================================
   Polaroid caption positioning fix
   ========================================================== */

.media-frame.polaroid {
    display: inline-block;
    background: #fffdf8;
    padding: 1rem 1rem 3.75rem 1rem;   /* extra space for caption */
    position: relative;
    box-sizing: border-box;
}

.media-frame.polaroid .media-image {
    display: block;
    width: 100%;
    height: auto;
}

.media-frame.polaroid .media-caption {
    position: absolute;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    margin: 0;
    padding: 0;
    background: transparent;
    text-align: center;
    font-size: 0.85rem;
    line-height: 1.3;
    color: rgba(40, 35, 30, 0.72);
    font-style: normal;
}

/* ==========================================================
   Section-level styling controls
   ========================================================== */

.content-section {
    position: relative;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

/* Spacing controls */

.section-spacing--tight {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.section-spacing--normal {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

.section-spacing--loose {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
}

/* Style variants */

.section-style--plain {
    background: transparent;
}

.section-style--paper {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

.section-style--note {
    padding-left: 1rem;
    padding-right: 1rem;
    transform: rotate(-0.15deg);
}

.section-style--diagram {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

.section-style--scrapbook {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* Background controls */

.section-background--none {
    background: transparent;
}

.section-background--paper {
    background-color: rgba(250, 242, 222, 0.58);
    background-image:
        url('/static/img/paper-noise.svg?v=103'),
        linear-gradient(
            to bottom,
            rgba(255, 255, 255, 0.14),
            rgba(120, 90, 40, 0.025)
        );
    background-size: 640px 640px, cover;
    background-blend-mode: multiply, normal;
}

.section-background--grid {
    background-color: rgba(250, 242, 222, 0.5);
    background-image:
        linear-gradient(rgba(90, 65, 35, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(90, 65, 35, 0.08) 1px, transparent 1px),
        url('/static/img/paper-noise.svg?v=103');
    background-size:
        32px 32px,
        32px 32px,
        640px 640px;
}

.section-background--stained {
    background-color: rgba(246, 235, 206, 0.6);
    background-image:
        radial-gradient(
            circle at 18% 25%,
            rgba(125, 82, 35, 0.10),
            transparent 24%
        ),
        radial-gradient(
            circle at 82% 72%,
            rgba(125, 82, 35, 0.075),
            transparent 22%
        ),
        url('/static/img/paper-noise.svg?v=103');
    background-size:
        auto,
        auto,
        640px 640px;
}

/* Frame controls */

.section-frame--none {
    box-shadow: none;
}

.section-frame--line {
    border: 1px solid rgba(80, 55, 30, 0.16);
}

.section-frame--paper {
    border: 1px solid rgba(80, 55, 30, 0.08);
    box-shadow:
        0 2px 4px rgba(40, 25, 10, 0.04),
        0 12px 28px rgba(40, 25, 10, 0.06);
}

.section-frame--shadow {
    box-shadow:
        0 10px 24px rgba(40, 25, 10, 0.08),
        0 28px 60px rgba(40, 25, 10, 0.05);
}

/* Rounded almost-notebook-paper frame */
.section-background--paper,
.section-background--grid,
.section-background--stained,
.section-frame--line,
.section-frame--paper,
.section-frame--shadow {
    border-radius: 3px;
}

/* Mobile: keep section effects lighter */
@media (max-width: 768px) {
    .section-style--paper,
    .section-style--note,
    .section-style--diagram,
    .section-style--scrapbook {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        transform: none;
    }

    .section-spacing--loose {
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
    }
}

/* ==========================================================
   Search filters
   ========================================================== */

.search-filters {
    margin-top: 0.75rem;
}

.search-filters a {
    text-decoration: none;
    opacity: 0.72;
}

.search-filters a:hover,
.search-filters a.is-active {
    opacity: 1;
    text-decoration: underline;
}

/* ==========================================================
   Search anchor target highlight
   ========================================================== */

.content-block:target {
    outline: 2px solid rgba(150, 60, 35, 0.42);
    outline-offset: 0.35rem;
    animation: search-target-pulse 1.8s ease-out 1;
}

@keyframes search-target-pulse {
    0% {
        box-shadow:
            0 0 0 0 rgba(150, 60, 35, 0.34),
            0 14px 32px rgba(40, 25, 10, 0.12);
    }

    100% {
        box-shadow:
            0 0 0 1.2rem rgba(150, 60, 35, 0),
            0 14px 32px rgba(40, 25, 10, 0.12);
    }
}

/* ==========================================================
   Compact search results
   ========================================================== */

.search-count {
    font-size: 0.8rem;
    font-weight: 400;
    opacity: 0.55;
    margin-left: 0.35rem;
}

.search-result-card {
    padding-top: 1rem;
    padding-bottom: 1rem;
    margin-bottom: 0.85rem;
}

.search-result-card h3 {
    margin-top: 0.15rem;
    margin-bottom: 0.35rem;
}

.search-result-card p {
    margin-top: 0.25rem;
    margin-bottom: 0;
}

.search-result-card .meta-label {
    margin-bottom: 0.25rem;
}

.search-result-card--block {
    font-size: 0.95rem;
}

.search-result-card--block p:last-child {
    opacity: 0.82;
}

/* ==========================================================
   Home page links
   ========================================================== */

.hero-project-title a,
.paper-card a {
    color: inherit;
    text-decoration: none;
}

.paper-card a {
    display: block;
    height: 100%;
}

.paper-card {
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease;
}

.paper-card:hover {
    transform: translateY(-2px) rotate(-0.2deg);
}

.paper-card:hover .card-title {
    text-decoration: underline;
}

.hero-project-links a {
    color: inherit;
}

/* ==========================================================
   Reading typography refinement
   ========================================================== */

.writing-detail,
.project-layout article {
    font-size: 1.02rem;
    line-height: 1.68;
}

.writing-detail p,
.project-layout article p,
.paper-block p,
.index-card p,
.diagram-sheet p {
    max-width: 68ch;
}

.paper-block,
.index-card,
.diagram-sheet {
    line-height: 1.65;
}

.paper-block > *:first-child,
.index-card > *:first-child,
.diagram-sheet > *:first-child {
    margin-top: 0;
}

.paper-block > *:last-child,
.index-card > *:last-child,
.diagram-sheet > *:last-child {
    margin-bottom: 0;
}

.writing-detail h1,
.project-layout h1 {
    line-height: 0.95;
    letter-spacing: -0.035em;
}

.writing-detail h2,
.project-layout h2 {
    line-height: 1.05;
    letter-spacing: -0.025em;
    margin-top: 2.25rem;
    margin-bottom: 0.85rem;
}

.writing-detail h3,
.project-layout h3 {
    line-height: 1.15;
    letter-spacing: -0.015em;
    margin-top: 1.6rem;
    margin-bottom: 0.55rem;
}

.post-dek,
.hero-copy,
.hero-project-dek {
    max-width: 58ch;
    font-size: 1.15rem;
    line-height: 1.55;
}

.meta-label,
.card-kicker {
    line-height: 1.25;
}

/* ==========================================================
   Mobile reading refinement
   ========================================================== */

@media (max-width: 768px) {
    .writing-detail,
    .project-layout article {
        font-size: 1rem;
        line-height: 1.62;
    }

    .writing-detail,
    .project-layout,
    .hero-project,
    .paper-row {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .paper-block,
    .index-card,
    .diagram-sheet,
    .terminal-block,
    .media-frame,
    .paper-card {
        padding: 1.15rem;
    }

    .writing-detail h1,
    .project-layout h1,
    .hero-project-title {
        font-size: clamp(2.1rem, 11vw, 3.2rem);
        line-height: 0.98;
        letter-spacing: -0.035em;
    }

    .writing-detail h2,
    .project-layout h2,
    .card-title {
        font-size: clamp(1.35rem, 7vw, 2rem);
        line-height: 1.08;
    }

    .post-dek,
    .hero-copy,
    .hero-project-dek {
        font-size: 1.05rem;
        line-height: 1.55;
    }

    .meta-label,
    .card-kicker {
        font-size: 0.72rem;
        letter-spacing: 0.08em;
    }

    .paper-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* ==========================================================
   Measure and content rhythm
   ========================================================== */

.writing-detail .content-block,
.project-layout .content-block {
    margin-bottom: 1.5rem;
}

.writing-detail ul,
.writing-detail ol,
.project-layout ul,
.project-layout ol {
    max-width: 64ch;
    padding-left: 1.4rem;
    line-height: 1.7;
}

.writing-detail li,
.project-layout li {
    margin-bottom: 0.35rem;
}

.writing-detail blockquote,
.project-layout blockquote {
    max-width: 60ch;
    font-size: 1.05em;
    line-height: 1.65;
}

.writing-detail pre,
.project-layout pre {
    overflow-x: auto;
    line-height: 1.55;
}

.writing-detail img,
.project-layout img {
    height: auto;
}

/* ==========================================================
   Creative collage wall
   ========================================================== */

.creative-collage {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0 3rem;
}

.creative-collage-item {
    margin: 0;
}

.creative-collage-item:nth-child(3n) {
    transform: rotate(-2deg);
}

.creative-collage-item:nth-child(3n + 1) {
    transform: rotate(1.5deg);
}

.creative-collage-item:nth-child(3n + 2) {
    transform: rotate(-0.75deg);
}

.creative-collage-item a {
    color: inherit;
    text-decoration: none;
}

/* ==========================================================
   Creative collage placeholders
   ========================================================== */

.creative-placeholder {
    aspect-ratio: 1 / 1;
    width: 100%;
    display: grid;
    place-items: center;
    background: #171a18;
    color: rgba(245, 240, 225, 0.72);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.72rem;
    line-height: 1.2;
    text-align: center;
}



/* ==========================================================
   Creative collage placeholders
   ========================================================== */

.creative-collage {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0 3rem;
    justify-items: center;
    align-items: start;
}

.creative-collage-item {
    width: 220px;
    margin: 0;
}

.creative-collage .media-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    min-height: 0;
    height: auto;
}


