/* ==========================================================================
   Permanent Decisions — theme for adamezrre.com
   Dark, heavy-ink, image-first. Pirata One (display) + Inter (body).
   ========================================================================== */

:root {
    --ink: #0a0a0a;          /* page background */
    --ink-2: #111111;        /* raised surfaces */
    --ink-3: #1a1a1a;        /* borders / cards */
    --bone: #ede6da;         /* primary text */
    --bone-dim: #9a938a;     /* secondary text */
    --accent: #c1121f;       /* overridden inline from theme settings */
    /* Honor Ghost admin font choices when set, else the theme defaults */
    --display: var(--gh-font-heading, "Pirata One"), "Times New Roman", serif;
    --body: var(--gh-font-body, "Inter"), -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --max: 1240px;
    --pad: clamp(1.25rem, 4vw, 3rem);
}

* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--ink);
    color: var(--bone);
    font-family: var(--body);
    font-size: 1rem;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--bone); }

::selection { background: var(--accent); color: var(--bone); }

/* Film-grain overlay */
.grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9000;
    opacity: 0.06;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Scroll-reveal — hidden state only applies once JS confirms the observer
   is available (html.has-reveal), so content is never invisible without JS */
.has-reveal .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.has-reveal .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    .has-reveal .reveal { opacity: 1; transform: none; transition: none; }
    html { scroll-behavior: auto; }
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    background: linear-gradient(to bottom, rgba(10,10,10,0.92), rgba(10,10,10,0.75));
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--ink-3);
}

.header-inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0.85rem var(--pad);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    color: var(--bone);
}
.brand-mark {
    font-family: var(--display);
    font-size: 1.7rem;
    line-height: 1;
    color: var(--accent);
}
.brand-name {
    font-family: var(--display);
    font-size: 1.25rem;
    letter-spacing: 0.04em;
}
.brand:hover .brand-name { color: var(--accent); }

.site-nav {
    display: flex;
    align-items: center;
    gap: 1.6rem;
}
.nav-link {
    color: var(--bone-dim);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}
.nav-link:hover { color: var(--bone); }

.nav-cta {
    padding: 0.5rem 1.3rem;
    border: 1px solid var(--accent);
    color: var(--bone);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    transition: background 0.25s ease;
}
.nav-cta:hover { background: var(--accent); color: var(--bone); }

.nav-toggle {
    display: none;
    background: none;
    border: 0;
    padding: 0.4rem;
    cursor: pointer;
}
.nav-toggle span {
    display: block;
    width: 24px; height: 2px;
    margin: 5px 0;
    background: var(--bone);
    transition: transform 0.25s ease, opacity 0.25s ease;
}

@media (max-width: 760px) {
    .nav-toggle { display: block; }
    .site-nav {
        position: fixed;
        top: 57px; left: 0; right: 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        background: var(--ink);
        border-bottom: 1px solid var(--ink-3);
        padding: 0.5rem var(--pad) 1.25rem;
        display: none;
    }
    .site-nav.is-open { display: flex; }
    .site-nav .nav-link { padding: 0.8rem 0; font-size: 0.95rem; }
    .site-nav .nav-cta { margin-top: 0.75rem; }
    .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
    .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    text-align: center;
    padding: 7rem var(--pad) 4rem;
    background:
        radial-gradient(ellipse 70% 50% at 50% 110%, rgba(193,18,31,0.16), transparent 65%),
        radial-gradient(ellipse 60% 45% at 50% -10%, rgba(237,230,218,0.05), transparent 60%),
        var(--ink);
}

.hero-kicker {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--bone-dim);
    margin-bottom: 1.4rem;
}

.hero-wordmark {
    margin: 0;
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(4rem, 14vw, 11rem);
    line-height: 0.92;
    text-transform: none;
    letter-spacing: 0.01em;
}
.hero-wordmark .line { display: block; }
.hero-wordmark .line--accent {
    color: var(--accent);
    text-shadow: 0 0 60px rgba(193,18,31,0.35);
}

.hero-sub {
    max-width: 32rem;
    margin: 1.8rem auto 0;
    color: var(--bone-dim);
    font-size: 1.05rem;
}

.hero-location {
    margin: 0.8rem 0 0;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--bone-dim);
}

.hero-actions {
    margin-top: 2.4rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-scroll {
    position: absolute;
    bottom: 2rem; left: 50%;
    transform: translateX(-50%);
}
.hero-scroll span {
    display: block;
    width: 1px; height: 48px;
    background: linear-gradient(to bottom, transparent, var(--accent));
    animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse {
    0%, 100% { opacity: 0.25; transform: scaleY(0.7); }
    50% { opacity: 1; transform: scaleY(1); }
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.9rem 2.2rem;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.btn--solid {
    background: var(--accent);
    color: var(--bone);
    border: 1px solid var(--accent);
}
.btn--solid:hover { background: transparent; color: var(--bone); }
.btn--ghost {
    border: 1px solid var(--ink-3);
    color: var(--bone-dim);
}
.btn--ghost:hover { border-color: var(--bone); color: var(--bone); }

/* ==========================================================================
   Marquee
   ========================================================================== */

.marquee {
    overflow: hidden;
    border-top: 1px solid var(--ink-3);
    border-bottom: 1px solid var(--ink-3);
    background: var(--ink-2);
    padding: 0.9rem 0;
}
.marquee-track {
    display: flex;
    width: max-content;
    animation: marquee 30s linear infinite;
}
.marquee-track span {
    font-family: var(--display);
    font-size: 1.5rem;
    letter-spacing: 0.08em;
    color: var(--bone-dim);
    white-space: nowrap;
    padding-right: 1rem;
}
@keyframes marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
    .marquee-track { animation: none; }
}

/* ==========================================================================
   Work grid
   ========================================================================== */

.work, .archive {
    max-width: var(--max);
    margin: 0 auto;
    padding: 5rem var(--pad);
}

.section-head {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}
.section-title, .archive-title {
    margin: 0;
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(2.4rem, 6vw, 4rem);
    line-height: 1;
}
.section-rule {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, var(--accent), transparent);
}

.archive-head { margin-bottom: 2.5rem; padding-top: 4rem; }
.archive-kicker {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.6rem;
}
.archive-sub { color: var(--bone-dim); max-width: 40rem; }

.work-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.1rem;
}
@media (max-width: 1024px) { .work-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .work-grid { grid-template-columns: 1fr; } }

.work-card {
    position: relative;
    background: var(--ink-2);
    border: 1px solid var(--ink-3);
    overflow: hidden;
}
.work-card-link { display: block; color: inherit; }

.work-card-img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    filter: grayscale(28%) contrast(1.05);
    transition: transform 0.6s ease, filter 0.6s ease;
}
.work-card:hover .work-card-img {
    transform: scale(1.045);
    filter: grayscale(0%) contrast(1.08);
}
.work-card-img--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ink-2);
}
.work-card-img--empty span {
    font-family: var(--display);
    font-size: 4rem;
    color: var(--ink-3);
}

.work-card-overlay {
    position: absolute;
    inset: auto 0 0 0;
    padding: 2.4rem 1.2rem 1.1rem;
    background: linear-gradient(to top, rgba(10,10,10,0.92), transparent);
    transform: translateY(12px);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
}
.work-card:hover .work-card-overlay { transform: none; opacity: 1; }
@media (hover: none) {
    .work-card-overlay { transform: none; opacity: 1; padding-top: 1.6rem; }
}

.work-card-title {
    margin: 0;
    font-family: var(--body);
    font-size: 1rem;
    font-weight: 600;
    color: var(--bone);
}
.work-card-tag {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 3rem;
    font-size: 0.85rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.pagination a { color: var(--bone-dim); font-weight: 700; }
.pagination a:hover { color: var(--accent); }
.page-number { color: var(--bone-dim); }

/* ==========================================================================
   About
   ========================================================================== */

.about {
    border-top: 1px solid var(--ink-3);
    background:
        radial-gradient(ellipse 55% 60% at 85% 40%, rgba(193,18,31,0.08), transparent 65%),
        var(--ink-2);
}
.about-inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: 5.5rem var(--pad);
}
.about-kicker {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.6rem;
}
.about-title {
    margin: 0 0 1.4rem;
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(2.6rem, 7vw, 4.5rem);
    line-height: 1;
}
.about-body {
    max-width: 42rem;
    color: var(--bone-dim);
    font-size: 1.08rem;
}

/* ==========================================================================
   Idea Machine strip
   ========================================================================== */

.idea-strip {
    border-top: 1px solid var(--ink-3);
    background: var(--ink);
    text-align: center;
}
.idea-strip-inner {
    max-width: 44rem;
    margin: 0 auto;
    padding: 4.5rem var(--pad);
}
.idea-strip-title {
    margin: 0.2rem 0 1rem;
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(2.4rem, 6vw, 3.6rem);
    line-height: 1;
}
.idea-strip-blurb {
    color: var(--bone-dim);
    margin: 0 auto 1.8rem;
    max-width: 34rem;
}
.idea-strip .btn { cursor: pointer; font-family: var(--body); border: 1px solid var(--accent); }

/* ==========================================================================
   Booking CTA
   ========================================================================== */

.booking {
    border-top: 1px solid var(--ink-3);
    background:
        radial-gradient(ellipse 60% 70% at 50% 120%, rgba(193,18,31,0.18), transparent 70%),
        var(--ink);
    text-align: center;
}
.booking-inner {
    max-width: 46rem;
    margin: 0 auto;
    padding: 6rem var(--pad);
}
.booking-kicker {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--bone-dim);
    margin-bottom: 1rem;
}
.booking-title {
    margin: 0;
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(3rem, 9vw, 6rem);
    line-height: 0.95;
}
.booking-title em {
    font-style: normal;
    color: var(--accent);
}
.booking-blurb {
    margin: 1.6rem auto 0;
    max-width: 34rem;
    color: var(--bone-dim);
}
.booking-actions {
    margin-top: 2.2rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ==========================================================================
   Piece (post) + generic page
   ========================================================================== */

.piece, .page-single {
    max-width: 1000px;
    margin: 0 auto;
    padding: 8.5rem var(--pad) 4rem;
}

.piece-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}
.piece-tag {
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent);
    border: 1px solid var(--ink-3);
    padding: 0.28rem 0.7rem;
}
.piece-tag:hover { border-color: var(--accent); color: var(--bone); }
.piece-date {
    font-size: 0.78rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--bone-dim);
}

.piece-title, .page-title {
    margin: 0;
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(2.6rem, 7vw, 4.6rem);
    line-height: 1;
}
.piece-excerpt {
    margin: 1.2rem 0 0;
    color: var(--bone-dim);
    font-size: 1.1rem;
    max-width: 44rem;
}

.piece-feature { margin: 2.6rem 0 0; }
.piece-feature img {
    width: 100%;
    border: 1px solid var(--ink-3);
    cursor: zoom-in;
}
.piece-feature figcaption {
    margin-top: 0.7rem;
    font-size: 0.82rem;
    color: var(--bone-dim);
    text-align: center;
}

.piece-content { margin-top: 2.6rem; }

.piece-footer {
    margin-top: 3.5rem;
    border-top: 1px solid var(--ink-3);
    padding-top: 2rem;
}
.piece-tags { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 2rem; }

.piece-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
@media (max-width: 640px) { .piece-nav { grid-template-columns: 1fr; } }
.piece-nav-link {
    display: block;
    border: 1px solid var(--ink-3);
    padding: 1.1rem 1.3rem;
    color: var(--bone);
    transition: border-color 0.25s ease;
}
.piece-nav-link:hover { border-color: var(--accent); }
.piece-nav-link--next { text-align: right; }
.piece-nav-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--bone-dim);
    margin-bottom: 0.3rem;
}
.piece-nav-title { font-weight: 600; }

.page-head { margin-bottom: 1rem; }

/* ==========================================================================
   Ghost content (Koenig cards)
   ========================================================================== */

.gh-content > * + * { margin-top: 1.4rem; }
.gh-content h1, .gh-content h2, .gh-content h3 {
    font-family: var(--display);
    font-weight: 400;
    line-height: 1.1;
    margin: 2.4rem 0 0;
}
.gh-content h2 { font-size: 2.2rem; }
.gh-content h3 { font-size: 1.7rem; }
.gh-content a { text-decoration: underline; text-underline-offset: 3px; }
.gh-content blockquote {
    margin: 2rem 0;
    padding-left: 1.4rem;
    border-left: 3px solid var(--accent);
    color: var(--bone-dim);
    font-size: 1.15rem;
}
.gh-content img { border: 1px solid var(--ink-3); cursor: zoom-in; }
.gh-content hr {
    border: 0;
    height: 1px;
    background: var(--ink-3);
    margin: 3rem 0;
}
.gh-content pre {
    background: var(--ink-2);
    border: 1px solid var(--ink-3);
    padding: 1.2rem;
    overflow-x: auto;
    font-size: 0.9rem;
}
.gh-content figcaption {
    margin-top: 0.6rem;
    font-size: 0.82rem;
    color: var(--bone-dim);
    text-align: center;
}

/* Koenig width helpers (required by Ghost) */
.kg-width-wide {
    position: relative;
    width: 85vw;
    max-width: 1200px;
    margin-left: 50%;
    transform: translateX(-50%);
}
.kg-width-full {
    position: relative;
    width: 100vw;
    margin-left: 50%;
    transform: translateX(-50%);
}
@media (max-width: 1000px) {
    .kg-width-wide, .kg-width-full { width: 100%; margin-left: 0; transform: none; }
}

/* Koenig galleries */
.kg-gallery-container { display: flex; flex-direction: column; gap: 0.6rem; }
.kg-gallery-row { display: flex; gap: 0.6rem; }
.kg-gallery-image { flex: 1; }
.kg-gallery-image img { width: 100%; height: 100%; object-fit: cover; }

/* Koenig buttons/callouts minimal support */
.kg-button-card, .kg-btn { text-align: center; }
.kg-btn, a.kg-btn {
    display: inline-block;
    background: var(--accent);
    color: var(--bone);
    padding: 0.8rem 1.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
}
.kg-callout-card {
    display: flex;
    gap: 0.8rem;
    background: var(--ink-2);
    border: 1px solid var(--ink-3);
    padding: 1.2rem;
}

/* ==========================================================================
   Booking form
   ========================================================================== */

.book {
    max-width: 780px;
    margin: 0 auto;
    padding: 8.5rem var(--pad) 5rem;
}
.book-head .page-title em.accent { font-style: normal; color: var(--accent); }
.book-sub {
    color: var(--bone-dim);
    max-width: 36rem;
    margin: 1.2rem 0 0;
}
.book-intro { margin: 2rem 0 0; }

.book-form { margin-top: 2.6rem; }
.form-row { margin-bottom: 1.3rem; }
.form-row--2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.3rem;
}
@media (max-width: 640px) { .form-row--2 { grid-template-columns: 1fr; } }

.book-form label {
    display: block;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--bone-dim);
}
.book-form input,
.book-form textarea,
.book-form select {
    display: block;
    width: 100%;
    margin-top: 0.45rem;
    padding: 0.8rem 0.9rem;
    background: var(--ink-2);
    border: 1px solid var(--ink-3);
    color: var(--bone);
    font-family: var(--body);
    font-size: 1rem;
    box-sizing: border-box;
    border-radius: 0;
}
.book-form input:focus,
.book-form textarea:focus,
.book-form select:focus {
    outline: none;
    border-color: var(--accent);
}
.book-form ::placeholder { color: #55504a; }

.form-hp {
    position: absolute;
    left: -9999px;
    height: 1px;
    overflow: hidden;
}

.form-optional {
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    color: #6a645c;
}
.book-form input[type="file"] {
    padding: 0.6rem 0.9rem;
    cursor: pointer;
}
.book-form input[type="file"]::file-selector-button {
    background: var(--accent);
    border: 0;
    color: var(--bone);
    padding: 0.45rem 1rem;
    margin-right: 0.9rem;
    font-family: var(--body);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
}
.book-previews {
    display: flex;
    gap: 0.7rem;
    margin-top: 0.8rem;
    flex-wrap: wrap;
}
.book-preview {
    position: relative;
    width: 96px;
    height: 96px;
}
.book-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 1px solid var(--ink-3);
}
.book-preview button {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent);
    border: 0;
    color: var(--bone);
    font-size: 0.9rem;
    line-height: 1;
    cursor: pointer;
}

.form-error {
    color: var(--accent);
    font-weight: 600;
    margin: 0 0 1rem;
}
.book-submit { width: 100%; cursor: pointer; font-family: var(--body); }
.book-submit[disabled] { opacity: 0.6; cursor: wait; }
.form-note {
    margin-top: 0.9rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--bone-dim);
}

.book-success {
    margin-top: 2.6rem;
    border: 1px solid var(--accent);
    padding: 2.4rem;
    text-align: center;
}
.book-success h2 {
    font-family: var(--display);
    font-weight: 400;
    font-size: 2.2rem;
    margin: 0 0 0.6rem;
}
.book-success p { color: var(--bone-dim); margin: 0; }

/* ==========================================================================
   Error page
   ========================================================================== */

.error-page {
    min-height: 80svh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 7rem var(--pad) 4rem;
}
.error-code {
    font-family: var(--display);
    font-size: clamp(6rem, 20vw, 12rem);
    line-height: 1;
    color: var(--accent);
    display: block;
}
.error-title {
    font-family: var(--display);
    font-weight: 400;
    font-size: 2.4rem;
    margin: 0.5rem 0 0.8rem;
}
.error-sub { color: var(--bone-dim); margin-bottom: 2rem; }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
    border-top: 1px solid var(--ink-3);
    background: var(--ink-2);
}
.footer-inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: 3.5rem var(--pad) 2.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: flex-start;
    justify-content: space-between;
}
.footer-wordmark {
    font-family: var(--display);
    font-size: 1.8rem;
}
.footer-tag {
    margin: 0.3rem 0 0;
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--bone-dim);
}
.footer-links { display: flex; gap: 1.6rem; }
.footer-links a {
    color: var(--bone-dim);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}
.footer-links a:hover { color: var(--accent); }
.footer-copy {
    width: 100%;
    margin: 1.5rem 0 0;
    font-size: 0.78rem;
    color: var(--bone-dim);
}

/* ==========================================================================
   Intro takeover — pencil clip, then invert-to-black reveal
   ========================================================================== */

body.intro-lock { overflow: hidden; }

.intro {
    position: fixed;
    inset: 0;
    z-index: 12000;
    background: #e9e2d4; /* paper tone while the video loads */
}
.intro-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.intro-skip {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10,10,10,0.55);
    border: 1px solid rgba(237,230,218,0.35);
    color: #ede6da;
    padding: 0.6rem 1.6rem;
    font-family: var(--body);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    cursor: pointer;
    backdrop-filter: blur(4px);
}
.intro-skip:hover { background: rgba(10,10,10,0.8); }

.intro--flip {
    filter: invert(1);
    transition: filter 0.45s ease-in;
}
.intro--out {
    opacity: 0;
    transition: filter 0.45s ease-in, opacity 0.8s ease 0.1s;
    pointer-events: none;
}

/* ==========================================================================
   Idea Machine chat
   ========================================================================== */

.chat {
    position: fixed;
    right: 1.2rem;
    bottom: 1.2rem;
    z-index: 9500;
    font-family: var(--body);
}
.chat-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--ink-2);
    border: 1px solid var(--ink-3);
    color: var(--accent);
    font-size: 1.35rem;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    opacity: 0.85;
    box-shadow: 0 4px 18px rgba(0,0,0,0.45);
    transition: opacity 0.25s ease, border-color 0.25s ease;
}
.chat-toggle:hover { opacity: 1; border-color: var(--accent); }

.chat-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(5,5,5,0.55);
}

/* the display:flex below overrides the hidden attribute's UA rule —
   this puts hidden back in charge */
.chat-panel[hidden] { display: none; }

.chat-panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 0.8rem);
    width: min(380px, calc(100vw - 2.4rem));
    height: min(520px, calc(100svh - 7rem));
    display: flex;
    flex-direction: column;
    background: var(--ink);
    border: 1px solid var(--ink-3);
    box-shadow: 0 12px 60px rgba(0,0,0,0.7);
}
.chat-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--ink-3);
    background: var(--ink-2);
}
.chat-head strong {
    font-family: var(--display);
    font-weight: 400;
    font-size: 1.25rem;
    letter-spacing: 0.03em;
}
.chat-head-sub {
    display: block;
    font-size: 0.74rem;
    color: var(--bone-dim);
    margin-top: 0.15rem;
}
.chat-close {
    background: none;
    border: 0;
    color: var(--bone);
    font-size: 1.9rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.2rem 0.6rem;
    min-width: 44px;
    min-height: 44px;
    flex-shrink: 0;
}
.chat-close:hover { color: var(--accent); }

/* On phones the chat is a bottom sheet (~60% of the screen), never
   full-screen. Close via the X, tapping the dimmed area, or Esc. */
@media (max-width: 640px) {
    .chat-panel {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        width: auto;
        height: min(62svh, 460px);
        border-left: 0;
        border-right: 0;
        border-bottom: 0;
        border-top: 2px solid var(--accent);
    }
    body.chat-open { overflow: hidden; }
}
@media (min-width: 641px) {
    .chat-backdrop { display: none; }
}

.chat-log {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}
.chat-msg {
    max-width: 88%;
    padding: 0.65rem 0.9rem;
    font-size: 0.9rem;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: break-word;
}
.chat-msg--user {
    align-self: flex-end;
    background: var(--accent);
    color: var(--bone);
}
.chat-msg--bot {
    align-self: flex-start;
    background: var(--ink-2);
    border: 1px solid var(--ink-3);
    color: var(--bone);
}
.chat-msg--system {
    align-self: center;
    color: var(--bone-dim);
    font-size: 0.78rem;
    text-align: center;
}
.chat-msg--typing { color: var(--bone-dim); font-style: italic; }

.chat-form {
    display: flex;
    border-top: 1px solid var(--ink-3);
}
.chat-form input {
    flex: 1;
    background: var(--ink-2);
    border: 0;
    color: var(--bone);
    padding: 0.9rem 1rem;
    font-family: var(--body);
    font-size: 0.95rem;
}
.chat-form input:focus { outline: none; }
.chat-send {
    background: var(--accent);
    border: 0;
    color: var(--bone);
    padding: 0 1.2rem;
    font-size: 1.2rem;
    cursor: pointer;
}
.chat-send[disabled] { opacity: 0.5; cursor: wait; }

.chat-sketch {
    background: var(--ink);
    border: 0;
    border-left: 1px solid var(--ink-3);
    color: var(--bone-dim);
    padding: 0 0.9rem;
    font-family: var(--body);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
}
.chat-sketch:hover { color: var(--accent); }
.chat-sketch[disabled] { opacity: 0.5; cursor: wait; }

.chat-msg--img {
    padding: 0.3rem;
    max-width: 92%;
}
.chat-msg--img img {
    display: block;
    width: 100%;
    border: 1px solid var(--ink-3);
}

.chat-img-actions {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.5rem 0.4rem 0.3rem;
}
.chat-img-actions button {
    background: var(--accent);
    border: 0;
    color: var(--bone);
    padding: 0.45rem 0.9rem;
    font-family: var(--body);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
}
.chat-img-actions button[disabled] { opacity: 0.5; }
.chat-img-actions a {
    color: var(--bone-dim);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.chat-img-actions a:hover { color: var(--accent); }

/* Phone verification mini-form inside the chat */
.chat-verify-form { max-width: 92%; font-size: 0.88rem; }
.chat-verify-form p { margin: 0 0 0.5rem; }
.chat-verify-row { display: flex; gap: 0.4rem; }
.chat-verify-row input {
    flex: 1;
    min-width: 0;
    background: var(--ink);
    border: 1px solid var(--ink-3);
    color: var(--bone);
    padding: 0.5rem 0.6rem;
    font-family: var(--body);
    font-size: 0.9rem;
}
.chat-verify-row input:focus { outline: none; border-color: var(--accent); }
.chat-verify-row button {
    background: var(--accent);
    border: 0;
    color: var(--bone);
    padding: 0.5rem 0.8rem;
    font-family: var(--body);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    white-space: nowrap;
}
.chat-verify-row button[disabled] { opacity: 0.5; cursor: wait; }
.chat-verify-opt {
    display: block;
    margin-top: 0.5rem;
    color: var(--bone-dim);
    font-size: 0.78rem;
}
.chat-verify-status { color: var(--accent); margin: 0.5rem 0 0 !important; }

/* ==========================================================================
   Journal
   ========================================================================== */

.journal {
    max-width: 860px;
    margin: 0 auto;
    padding: 5rem var(--pad);
}
.journal-list { display: flex; flex-direction: column; }
.journal-item { border-bottom: 1px solid var(--ink-3); }
.journal-item-link {
    display: flex;
    gap: 1.6rem;
    align-items: flex-start;
    padding: 1.8rem 0;
    color: var(--bone);
}
.journal-item-img {
    width: 130px;
    aspect-ratio: 1;
    object-fit: cover;
    border: 1px solid var(--ink-3);
    filter: grayscale(30%);
    transition: filter 0.4s ease;
    flex-shrink: 0;
}
.journal-item:hover .journal-item-img { filter: grayscale(0%); }
.journal-item-date {
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--bone-dim);
}
.journal-item-title {
    margin: 0.35rem 0 0.5rem;
    font-family: var(--display);
    font-weight: 400;
    font-size: 1.9rem;
    line-height: 1.05;
}
.journal-item:hover .journal-item-title { color: var(--accent); }
.journal-item-excerpt {
    margin: 0;
    color: var(--bone-dim);
    font-size: 0.95rem;
}
@media (max-width: 560px) {
    .journal-item-link { flex-direction: column; gap: 1rem; }
    .journal-item-img { width: 100%; aspect-ratio: 16/9; }
}

/* ==========================================================================
   Lightbox
   ========================================================================== */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(5,5,5,0.94);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}
.lightbox.is-open { display: flex; }
.lightbox img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: 0 0 80px rgba(0,0,0,0.8);
}
.lightbox-close {
    position: absolute;
    top: 1rem; right: 1.4rem;
    background: none;
    border: 0;
    color: var(--bone);
    font-size: 2.6rem;
    line-height: 1;
    cursor: pointer;
}
.lightbox-close:hover { color: var(--accent); }
@media (max-width: 640px) { .lightbox { padding: 1rem; } }
