/* ppuzzle.org — cottagecore pastoral blog
   Palette (Meadow & Linen):
     #FAF6F0 background (linen)
     #FFF9F0 surface (parchment)
     #3D3228 text primary (bark)
     #7B7567 text secondary (dried sage)
     #C27D7D accent warm (rose hip)
     #7B9E7B accent cool (sage green)
     #C4A265 accent gold (wheat)
   Typography: Playfair Display, Lora, Dancing Script, Inter
*/

:root {
    --linen: #FAF6F0;
    --parchment: #FFF9F0;
    --bark: #3D3228;
    --sage-text: #7B7567;
    --rose-hip: #C27D7D;
    --sage-green: #7B9E7B;
    --wheat: #C4A265;
    --twine: rgba(61, 50, 40, 0.15);
    --twine-strong: rgba(61, 50, 40, 0.28);
    --tape: rgba(196, 162, 101, 0.3);
    --tape-rose: rgba(194, 125, 125, 0.28);
    --serif-display: 'Playfair Display', 'Lora', Georgia, serif;
    --serif-body: 'Lora', Georgia, serif;
    --hand: 'Dancing Script', 'Lora', cursive;
    --sans: 'Inter', system-ui, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    background: var(--linen);
}

body {
    margin: 0;
    background: var(--linen);
    color: var(--bark);
    font-family: var(--serif-body);
    font-size: 17px;
    line-height: 1.8;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-image:
        radial-gradient(circle at 12% 18%, rgba(123, 158, 123, 0.05), transparent 36%),
        radial-gradient(circle at 88% 62%, rgba(194, 125, 125, 0.05), transparent 38%),
        radial-gradient(circle at 50% 92%, rgba(196, 162, 101, 0.05), transparent 40%);
    background-attachment: fixed;
    overflow-x: hidden;
}

/* Subtle paper noise via SVG-fed background */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='4'/><feColorMatrix values='0 0 0 0 0.24  0 0 0 0 0.20  0 0 0 0 0.16  0 0 0 0.045 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
    mix-blend-mode: multiply;
}

/* Wildflower border (fixed top) */
.wildflower-border {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 44px;
    z-index: 100;
    background: linear-gradient(180deg, var(--linen) 0%, var(--linen) 60%, rgba(250, 246, 240, 0) 100%);
    pointer-events: none;
}

.wildflower-border svg {
    width: 100%;
    height: 44px;
    display: block;
}

/* Page column */
.page {
    position: relative;
    z-index: 1;
    max-width: 640px;
    margin: 0 auto;
    padding: 96px 24px 80px;
}

/* Reveal */
.reveal {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 800ms ease-out, transform 800ms ease-out;
    will-change: opacity, transform;
}

.reveal.is-visible {
    opacity: 1;
    transform: none;
}

/* Masthead */
.masthead {
    text-align: center;
    padding: 32px 0 24px;
}

.kicker {
    font-family: var(--sans);
    font-size: 12px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--sage-text);
    margin: 0 0 18px;
}

.title {
    font-family: var(--serif-display);
    font-weight: 700;
    font-size: 56px;
    line-height: 1.05;
    letter-spacing: -0.01em;
    color: var(--bark);
    margin: 0 0 18px;
}

.subtitle {
    font-family: var(--serif-body);
    font-style: italic;
    font-size: 18px;
    color: var(--sage-text);
    margin: 0 auto 22px;
    max-width: 520px;
    line-height: 1.6;
}

.hand-note {
    font-family: var(--hand);
    font-size: 24px;
    color: var(--rose-hip);
    margin: 6px 0 0;
    line-height: 1.2;
}

.hand-note.big {
    font-size: 30px;
    color: var(--rose-hip);
}

/* Meadow break */
.meadow-break {
    position: relative;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    height: 120px;
    margin-top: 40px;
    margin-bottom: 40px;
    background: linear-gradient(180deg, rgba(123, 158, 123, 0.08), rgba(194, 125, 125, 0.06));
    border-top: 1px solid var(--twine);
    border-bottom: 1px solid var(--twine);
    overflow: hidden;
}

.meadow-break.alt {
    background: linear-gradient(180deg, rgba(196, 162, 101, 0.10), rgba(123, 158, 123, 0.06));
    height: 100px;
}

.meadow-break .petal {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50% 50% 50% 0;
    background: var(--sage-green);
    opacity: 0.45;
    transform: rotate(15deg);
    animation: drift 14s ease-in-out infinite;
}

.meadow-break .petal-1 { top: 20%; left: 12%; background: var(--sage-green); animation-delay: 0s; }
.meadow-break .petal-2 { top: 55%; left: 32%; background: var(--rose-hip); width: 10px; height: 10px; animation-delay: -3s; }
.meadow-break .petal-3 { top: 30%; left: 58%; background: var(--wheat); width: 12px; height: 12px; animation-delay: -6s; }
.meadow-break .petal-4 { top: 65%; left: 78%; background: var(--sage-green); width: 8px; height: 8px; animation-delay: -9s; }
.meadow-break .petal-5 { top: 40%; left: 88%; background: var(--rose-hip); width: 11px; height: 11px; animation-delay: -2s; }

@keyframes drift {
    0%, 100% { transform: rotate(15deg) translate(0, 0); }
    25% { transform: rotate(25deg) translate(6px, -4px); }
    50% { transform: rotate(35deg) translate(10px, 2px); }
    75% { transform: rotate(20deg) translate(4px, 6px); }
}

/* Entry section */
.entry {
    margin: 32px 0;
}

.entry-label {
    font-family: var(--hand);
    font-size: 22px;
    color: var(--sage-green);
    margin: 0 0 6px;
    letter-spacing: 0.01em;
}

.entry-title {
    font-family: var(--serif-display);
    font-weight: 700;
    font-size: 36px;
    line-height: 1.15;
    color: var(--bark);
    margin: 0 0 22px;
    letter-spacing: -0.005em;
}

.entry p {
    margin: 0 0 18px;
    color: var(--bark);
}

.entry .lead {
    font-size: 18px;
    line-height: 1.85;
}

.press-flower {
    display: inline-block;
    width: 22px;
    height: 22px;
    margin-right: 6px;
    vertical-align: -4px;
}

.press-flower svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Pull quote */
.pull-quote {
    font-family: var(--hand);
    font-size: 26px;
    line-height: 1.4;
    color: var(--rose-hip);
    text-align: center;
    padding: 24px 24px;
    margin: 28px auto;
    max-width: 540px;
    border-top: 1px solid var(--twine);
    border-bottom: 1px solid var(--twine);
    font-style: normal;
}

/* Specimen card */
.specimen-card {
    background: var(--parchment);
    border: 1px solid var(--twine);
    border-radius: 12px;
    padding: 32px 28px 28px;
    position: relative;
    margin: 32px 0;
    box-shadow: 0 1px 0 rgba(61, 50, 40, 0.04), 0 8px 22px -16px rgba(61, 50, 40, 0.18);
}

.specimen-card.stitch {
    border: 2px dashed var(--twine);
    box-shadow: none;
    background:
        linear-gradient(var(--parchment), var(--parchment));
}

/* Tape pseudo-elements via spans (so we can have two tapes) */
.specimen-card .tape,
.invitation .tape {
    position: absolute;
    top: -10px;
    width: 48px;
    height: 18px;
    background: var(--tape);
    box-shadow: 0 1px 0 rgba(61, 50, 40, 0.06);
    border-left: 1px solid rgba(196, 162, 101, 0.4);
    border-right: 1px solid rgba(196, 162, 101, 0.4);
}

.specimen-card .tape-left {
    left: 24px;
    transform: rotate(-2deg);
}

.specimen-card .tape-right {
    right: 28px;
    transform: rotate(3deg);
    background: var(--tape-rose);
}

/* tiny corner stitches */
.specimen-card.stitch::before,
.specimen-card.stitch::after {
    content: "";
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--twine-strong);
}

.specimen-card.stitch::before {
    top: 8px;
    left: 8px;
}

.specimen-card.stitch::after {
    bottom: 8px;
    right: 8px;
}

.card-kicker {
    font-family: var(--sans);
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--sage-text);
    margin: 0 0 8px;
}

.card-title {
    font-family: var(--serif-display);
    font-weight: 700;
    font-size: 26px;
    line-height: 1.2;
    color: var(--bark);
    margin: 0 0 14px;
}

.card-body {
    font-family: var(--serif-body);
    color: var(--bark);
    margin: 0 0 18px;
    line-height: 1.75;
}

.meta {
    list-style: none;
    margin: 0;
    padding: 14px 0 0;
    border-top: 1px dashed var(--twine);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.meta li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 14px;
    gap: 16px;
}

.meta-key {
    font-family: var(--sans);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--sage-text);
    flex-shrink: 0;
}

.meta-val {
    font-family: var(--serif-body);
    font-style: italic;
    color: var(--bark);
    text-align: right;
}

/* Swap grid */
.swap-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    margin: 28px 0 20px;
    perspective: 1000px;
}

.swap-card {
    appearance: none;
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0;
    width: 100%;
    aspect-ratio: 1 / 1;
    cursor: pointer;
    perspective: 800px;
    font-family: inherit;
    color: inherit;
    text-align: left;
}

.swap-inner {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    transition: transform 700ms cubic-bezier(0.6, 0.05, 0.2, 1);
    transform-style: preserve-3d;
}

.swap-card[data-flip="true"] .swap-inner {
    transform: rotateY(180deg);
}

.swap-front,
.swap-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    background: var(--parchment);
    border: 1px solid var(--twine);
    border-radius: 12px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 8px;
    box-shadow: 0 6px 18px -14px rgba(61, 50, 40, 0.3);
}

.swap-back {
    transform: rotateY(180deg);
    background: var(--linen);
    border: 2px dashed var(--twine);
    justify-content: flex-start;
}

.swap-icon {
    width: 36px;
    height: 36px;
    display: inline-block;
}

.swap-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.swap-label {
    font-family: var(--sans);
    font-size: 10px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--sage-text);
}

.swap-name {
    font-family: var(--serif-display);
    font-size: 18px;
    line-height: 1.25;
    color: var(--bark);
    font-weight: 700;
}

.swap-back-title {
    font-family: var(--hand);
    font-size: 22px;
    color: var(--rose-hip);
    margin-bottom: 4px;
}

.swap-back p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--bark);
    font-family: var(--serif-body);
}

/* Almanac list */
.almanac-list {
    list-style: none;
    counter-reset: alm;
    margin: 24px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.almanac-list li {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 16px;
    padding: 18px 22px;
    background: var(--parchment);
    border: 1px solid var(--twine);
    border-radius: 12px;
    align-items: start;
    position: relative;
}

.almanac-list li::before {
    content: "";
    position: absolute;
    inset: 4px;
    border-radius: 9px;
    border: 1px dashed var(--twine);
    pointer-events: none;
}

.ord {
    font-family: var(--serif-display);
    font-style: italic;
    font-weight: 700;
    font-size: 30px;
    color: var(--rose-hip);
    line-height: 1;
    text-align: center;
}

.ord-text strong {
    display: block;
    font-family: var(--serif-display);
    font-weight: 700;
    font-size: 18px;
    line-height: 1.3;
    color: var(--bark);
    margin-bottom: 4px;
}

.ord-text span {
    font-family: var(--serif-body);
    font-size: 16px;
    line-height: 1.7;
    color: var(--bark);
}

/* Invitation card */
.invitation {
    background: var(--parchment);
    border: 2px dashed var(--twine);
    border-radius: 14px;
    padding: 36px 28px 28px;
    margin: 28px 0;
    text-align: center;
    position: relative;
}

.invitation::before {
    content: "";
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%) rotate(-1.5deg);
    width: 90px;
    height: 18px;
    background: var(--tape);
    border-left: 1px solid rgba(196, 162, 101, 0.4);
    border-right: 1px solid rgba(196, 162, 101, 0.4);
}

.invitation-list {
    list-style: none;
    margin: 18px auto 22px;
    padding: 16px 0 0;
    border-top: 1px dashed var(--twine);
    max-width: 480px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.invitation-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    font-size: 15px;
}

.invitation-rsvp {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 12px 0 0;
}

.rsvp-label {
    font-family: var(--hand);
    font-size: 22px;
    color: var(--sage-green);
}

.rsvp-input {
    flex: 1 1 220px;
    min-width: 180px;
    background: var(--linen);
    border: 1px solid var(--twine);
    border-radius: 8px;
    padding: 10px 14px;
    font-family: var(--serif-body);
    font-size: 15px;
    color: var(--bark);
    outline: none;
    transition: border-color 240ms ease, background 240ms ease;
}

.rsvp-input::placeholder {
    color: var(--sage-text);
    font-style: italic;
}

.rsvp-input:hover {
    border-color: var(--sage-green);
}

.rsvp-button {
    appearance: none;
    border: 1px solid var(--rose-hip);
    background: var(--rose-hip);
    color: var(--parchment);
    font-family: var(--sans);
    font-size: 12px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    padding: 11px 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 240ms ease, transform 240ms ease;
}

.rsvp-button:hover {
    background: #b06a6a;
    transform: translateY(-1px);
}

.visitors-book {
    list-style: none;
    margin: 18px auto 0;
    padding: 0;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
}

.visitors-book li {
    background: var(--linen);
    border: 1px solid var(--twine);
    border-radius: 8px;
    padding: 10px 14px;
    font-family: var(--serif-body);
    font-size: 15px;
    color: var(--bark);
    position: relative;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 600ms ease-out, transform 600ms ease-out;
}

.visitors-book li.in {
    opacity: 1;
    transform: none;
}

.visitors-book li::before {
    content: "";
    position: absolute;
    top: -6px;
    left: 14px;
    width: 28px;
    height: 12px;
    background: var(--tape);
    transform: rotate(-3deg);
}

.visitors-book .visitor-hand {
    display: block;
    font-family: var(--hand);
    font-size: 13px;
    color: var(--sage-green);
    margin-top: 2px;
}

/* Colophon */
.colophon {
    text-align: center;
    margin-top: 64px;
    padding-top: 28px;
    border-top: 1px dashed var(--twine);
    color: var(--sage-text);
}

.colophon p {
    margin: 6px 0;
    font-size: 14px;
}

.colophon .tiny {
    font-family: var(--sans);
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--sage-text);
    margin-top: 14px;
}

/* Responsive niceties */
@media (max-width: 540px) {
    .page {
        padding: 80px 18px 60px;
    }

    .title {
        font-size: 44px;
    }

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

    .specimen-card {
        padding: 30px 22px 24px;
    }

    .swap-grid {
        grid-template-columns: 1fr;
    }

    .meta li,
    .invitation-list li {
        flex-direction: column;
        gap: 0;
    }

    .meta-val,
    .invitation-list .meta-val {
        text-align: left;
    }

    .invitation-rsvp {
        flex-direction: column;
        align-items: stretch;
    }

    .rsvp-button {
        width: 100%;
    }
}
