/* ============================================================================
   EveryTech editorial. Production receipt portfolio
   Brief: the frozen ThatGuy/EveryToys light system. Signature: a monospace
   "production receipt" ledger motif (IBM Plex Mono) threaded through the hero
   and case cards. Display Newsreader, labels Quicksand, body Inter, data mono.
   Gold #c89519 (never neon). Warm white #FAFAF7. The e mark is an SVG.
   ========================================================================== */

:root {
    --paper: #FAFAF7;
    --paper-pure: #ffffff;
    --ink: #16140f;
    --body: #26231d;
    --muted: #6f6a60;
    --faint: #7a756b;
    --gold: #c89519;
    --gold-ink: #846611;
    --teal: #157d70;
    --red: #b3402f;
    --rule: rgba(22, 20, 15, 0.12);

    --serif: "Newsreader", Georgia, "Times New Roman", serif;
    --label: "Quicksand", ui-sans-serif, system-ui, sans-serif;
    --sans: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

    --measure: 42rem;
    --wide: 66rem;
    --pad: clamp(1.25rem, 4vw, 2.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--body);
    font-family: var(--sans);
    font-weight: 450;
    font-size: 1.0625rem;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--gold-ink); }

h1, h2, h3, h4 { font-family: var(--serif); color: var(--ink); font-weight: 600; line-height: 1.12; letter-spacing: -0.01em; }
.accent { color: var(--gold-ink); font-style: italic; }

.kicker {
    font-family: var(--label);
    font-weight: 700; text-transform: uppercase; letter-spacing: 0.18em;
    font-size: 0.72rem; color: var(--gold-ink); margin: 0 0 0.9rem;
}
.mono { font-family: var(--mono); font-feature-settings: "tnum" 1; }
.mark { display: block; }

/* ── Header ─────────────────────────────────────────────────────────────── */
.site-header {
    width: min(var(--wide), 100% - 2 * var(--pad));
    margin: 0 auto; padding: 1.5rem 0;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    border-bottom: 1px solid var(--rule);
}
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--ink); }
.brand .mark { width: 1.7rem; height: 1.7rem; color: var(--ink); transition: color 0.15s ease; }
.brand:hover .mark { color: var(--gold); }
.brand__word { font-family: var(--label); font-weight: 700; letter-spacing: 0.01em; font-size: 1.1rem; }
.site-nav ul { list-style: none; display: flex; gap: 1.4rem; margin: 0; padding: 0; }
.site-nav a { font-family: var(--label); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.site-nav a:hover { color: var(--gold-ink); }

/* ── Hero + receipt ledger (the signature) ──────────────────────────────── */
.hero {
    width: min(var(--wide), 100% - 2 * var(--pad)); margin-inline: auto;
    padding: clamp(3rem, 8vw, 5.5rem) 0 clamp(2rem, 5vw, 3rem);
}
.hero__title { font-size: clamp(2.6rem, 7vw, 4.6rem); margin: 0 0 1.1rem; max-width: 16ch; }
.hero__sub { font-size: 0.86rem; color: var(--muted); margin: 0 0 2.5rem; }

.ledger { margin: 0; max-width: 34rem; }
.ledger__row {
    display: flex; justify-content: space-between; align-items: baseline; gap: 1.5rem;
    font-family: var(--mono); font-size: 0.84rem;
    padding: 0.55rem 0; border-bottom: 1px dotted var(--rule);
}
.ledger__row:first-child { border-top: 1px solid var(--gold); padding-top: 0.7rem; }
.ledger__row dt { margin: 0; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.74rem; }
.ledger__row dd { margin: 0; color: var(--ink); text-align: right; }

/* ── Work / case feed ───────────────────────────────────────────────────── */
.work { width: min(var(--wide), 100% - 2 * var(--pad)); margin: clamp(2.5rem, 6vw, 4rem) auto 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 2px solid var(--ink); padding-bottom: 0.8rem; }
.section-head .kicker { margin: 0; color: var(--ink); }

.case-feed { display: grid; grid-template-columns: repeat(2, 1fr); }
.case { border-bottom: 1px solid var(--rule); }
.case:nth-child(odd) { border-right: 1px solid var(--rule); }
.case__link { display: block; height: 100%; padding: 1.8rem clamp(0rem, 2vw, 1.6rem) 1.8rem 0; transition: background 0.15s ease; }
.case:nth-child(even) .case__link { padding: 1.8rem 0 1.8rem clamp(0rem, 2vw, 1.6rem); }
.case__link:hover { background: rgba(200, 149, 25, 0.04); }
.case__top { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 0.7rem; }
.case__top .kicker { margin: 0; }
.case__date { font-size: 0.76rem; color: var(--faint); }
.case__title { font-size: clamp(1.4rem, 2.6vw, 1.85rem); margin: 0 0 0.6rem; }
.case__excerpt { color: var(--muted); margin: 0 0 1rem; }
.case__more { font-family: var(--label); font-weight: 600; font-size: 0.76rem; color: var(--gold-ink); text-transform: uppercase; letter-spacing: 0.1em; }
.case__link:hover .case__title { color: var(--gold-ink); }
.case__link:hover .case__more { text-decoration: underline; text-underline-offset: 3px; }

/* ── CTA strip ──────────────────────────────────────────────────────────── */
.cta-strip {
    width: min(var(--wide), 100% - 2 * var(--pad)); margin: clamp(3rem, 8vw, 5rem) auto;
    padding: clamp(2rem, 5vw, 3rem); background: var(--paper-pure);
    border: 1px solid var(--rule); border-radius: 16px; text-align: center;
    box-shadow: 0 24px 60px -42px rgba(22, 20, 15, 0.45);
}
.cta-strip .kicker { color: var(--gold-ink); }
.cta-strip__title { font-size: clamp(1.6rem, 3.5vw, 2.4rem); margin: 0.2rem 0 1.5rem; }
.btn { display: inline-block; padding: 0.85rem 1.7rem; border-radius: 999px; background: var(--gold); color: var(--ink); font-family: var(--label); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.82rem; }
.btn:hover { background: var(--ink); color: var(--paper); }

/* ── Pagination + archive head ──────────────────────────────────────────── */
.pagination { width: min(var(--wide), 100% - 2 * var(--pad)); margin: 2rem auto; display: flex; justify-content: space-between; font-family: var(--label); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.12em; }
.archive-head { padding-bottom: 2rem; }
.archive-desc { color: var(--muted); max-width: 48ch; margin: 0; font-size: 1.05rem; }
.author-head .author-meta { margin: 0.8rem 0 0; color: var(--muted); font-size: 0.82rem; letter-spacing: 0.04em; }
.author-links { display: flex; align-items: center; gap: 1.3rem; margin-top: 1.6rem; flex-wrap: wrap; }
.author-about { font-family: var(--label); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--gold-ink); }
.author-about:hover { color: var(--ink); }

/* ── Single post / page ─────────────────────────────────────────────────── */
.post, .page { width: min(var(--measure), 100% - 2 * var(--pad)); margin: clamp(2.5rem, 6vw, 4rem) auto clamp(3rem, 8vw, 5rem); }
.post-header { margin-bottom: 2rem; }
.post-title { font-size: clamp(2.1rem, 5vw, 3.1rem); margin: 0 0 1rem; }
.post-dek { font-family: var(--serif); font-size: 1.2rem; color: var(--muted); margin: 0 0 1.2rem; }
.post-byline { font-family: var(--mono); font-size: 0.8rem; color: var(--faint); margin: 0; }
.post-figure { margin: 0 0 2rem; }
.post-figure img { border-radius: 14px; }
.post-figure figcaption { font-family: var(--label); font-size: 0.8rem; color: var(--muted); margin-top: 0.6rem; }

/* ── Content typography ─────────────────────────────────────────────────── */
.gh-content > * { margin: 0 0 1.4rem; }
.gh-content > *:last-child { margin-bottom: 0; }
.post-content.gh-content > p:first-of-type { font-size: 1.18rem; color: var(--ink); }
.gh-content h2 { font-size: 1.7rem; margin-top: 2.6rem; }
.gh-content h3 { font-size: 1.3rem; margin-top: 2rem; }
.gh-content a { color: var(--gold-ink); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.gh-content ul, .gh-content ol { padding-left: 1.2rem; }
.gh-content li { margin-bottom: 0.5rem; }
.gh-content strong { color: var(--ink); }
.gh-content img { border-radius: 14px; }
.gh-content figcaption { font-family: var(--label); font-size: 0.8rem; color: var(--muted); text-align: center; margin-top: 0.6rem; }

/* tables (RCA outcome ledgers) -> receipt style */
.gh-content table { width: 100%; border-collapse: collapse; font-size: 0.92rem; margin: 2rem 0; }
.gh-content th, .gh-content td { text-align: left; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.gh-content th { font-family: var(--label); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.74rem; color: var(--gold-ink); }
.gh-content tbody tr:hover { background: rgba(200, 149, 25, 0.05); }

/* Koenig editor card widths */
.gh-content .kg-width-wide { width: min(var(--wide), 100vw - 2rem); margin-left: 50%; transform: translateX(-50%); max-width: none; }
.gh-content .kg-width-full { width: 100vw; margin-left: 50%; transform: translateX(-50%); max-width: none; }
.gh-content .kg-width-full img { border-radius: 0; }

/* Koenig callout card -> accent / stat block */
.gh-content .kg-callout-card { display: flex; gap: 0.75rem; padding: 1.2rem 1.4rem; margin: 2rem 0; border-radius: 12px; background: rgba(200, 149, 25, 0.08); border: 1px solid rgba(200, 149, 25, 0.28); border-left: 3px solid var(--gold); font-family: var(--label); font-weight: 600; color: var(--ink); }
.gh-content .kg-callout-emoji { font-size: 1.15rem; line-height: 1.5; }
.gh-content .kg-callout-text { margin: 0; }

/* Koenig button card -> gold CTA */
.gh-content .kg-button-card { margin: 2rem 0; text-align: center; }
.gh-content .kg-btn { display: inline-block; padding: 0.75rem 1.5rem; border-radius: 999px; background: var(--gold); color: var(--ink); font-family: var(--label); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.82rem; }
.gh-content .kg-btn:hover { background: var(--ink); color: var(--paper); }

/* blockquote = headline-receipt card */
.gh-content blockquote { margin: 2rem 0; padding: 1.4rem 1.6rem; background: var(--paper-pure); border: 1px solid var(--rule); border-left: 3px solid var(--gold); border-radius: 12px; box-shadow: 0 12px 30px -18px rgba(22, 20, 15, 0.25); font-family: var(--serif); font-size: 1.2rem; color: var(--ink); }
.gh-content blockquote p:last-child { margin-bottom: 0; }

/* code */
.gh-content pre { background: #1c1a16; color: #f2eee6; padding: 1rem 1.2rem; border-radius: 12px; overflow: auto; font-size: 0.9rem; font-family: var(--mono); line-height: 1.6; }
.gh-content :not(pre) > code { background: rgba(200, 149, 25, 0.12); color: var(--gold-ink); padding: 0.1em 0.4em; border-radius: 6px; font-size: 0.92em; font-family: var(--mono); }

/* ── Post footer / tags ─────────────────────────────────────────────────── */
.post-footer { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); }
.post-tags { font-family: var(--label); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.post-cta { margin-top: 2.5rem; padding: clamp(1.4rem, 4vw, 1.9rem); background: var(--paper-pure); border: 1px solid var(--rule); border-left: 3px solid var(--gold); border-radius: 14px; box-shadow: 0 18px 44px -34px rgba(22, 20, 15, 0.4); }
.post-cta .kicker { margin-bottom: 0.5rem; }
.post-cta__line { font-family: var(--serif); font-size: 1.2rem; line-height: 1.35; color: var(--ink); margin: 0 0 1.2rem; }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.site-footer { width: min(var(--wide), 100% - 2 * var(--pad)); margin: clamp(3rem, 8vw, 5rem) auto 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.brand--footer .mark { width: 1.4rem; height: 1.4rem; }
.brand--footer .brand__word { color: var(--muted); }
.footer-meta { font-size: 0.78rem; color: var(--faint); }

/* ── Motion (subtle, reduced-motion safe) ───────────────────────────────── */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.hero > * { animation: rise 0.5s ease both; }
.hero__title { animation-delay: 0.05s; }
.hero__sub { animation-delay: 0.12s; }
.ledger { animation-delay: 0.18s; }

/* ── Quality floor: focus + reduced motion + responsive ─────────────────── */
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 3px; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (max-width: 720px) {
    .case-feed { grid-template-columns: 1fr; }
    .case:nth-child(odd) { border-right: none; }
    .case__link, .case:nth-child(even) .case__link { padding-left: 0; padding-right: 0; }
    .site-header { flex-direction: column; align-items: flex-start; gap: 0.8rem; }
    .site-nav ul { gap: 1rem; flex-wrap: wrap; }
}

/* ── Wow factor: reveal, card glow + tilt, ticker, shine (JS-gated, reduced-motion safe) ── */
.js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); will-change: opacity, transform; }
.js [data-reveal].in { opacity: 1; transform: none; }

/* animated gold accent word in the hero */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .accent {
    background: linear-gradient(90deg, var(--gold-ink), var(--gold) 45%, #e7b84a 55%, var(--gold-ink));
    background-size: 220% 100%;
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
    animation: shimmer 7s linear infinite;
  }
}
@keyframes shimmer { to { background-position: 220% 0; } }

/* focus-area ticker (a receipt tape that scrolls) */
.ticker { margin-top: 2.4rem; border-block: 1px solid var(--rule); overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.ticker__track { display: flex; width: max-content; gap: 2.6rem; padding: 0.6rem 0;
    font-family: var(--mono); font-size: 0.8rem; color: var(--muted); animation: marquee 32s linear infinite; }
.ticker:hover .ticker__track { animation-play-state: paused; }
.ticker__track span { white-space: nowrap; }
.ticker__track span::after { content: "\203A"; margin-left: 2.6rem; color: var(--gold); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* count-up stat figures */
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

/* case card: pointer glow, lift, animated arrow */
.case__link { position: relative; overflow: hidden; }
.case__link::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
    transition: opacity 0.3s ease;
    background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%), rgba(200, 149, 25, 0.13), transparent 62%); }
.case__link:hover::before { opacity: 1; }
.case { transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.35s ease; transform-style: preserve-3d; }
.case.tilt { box-shadow: 0 30px 60px -45px rgba(22, 20, 15, 0.5); border-radius: 14px; z-index: 1; }
.case__more { display: inline-flex; align-items: center; gap: 0.4rem; }
.case__arrow { display: inline-block; transition: transform 0.25s ease; }
.case__link:hover .case__arrow { transform: translateX(6px); }

/* CTA button shine sweep + card lift */
.btn { position: relative; overflow: hidden; }
.btn::after { content: ""; position: absolute; top: 0; left: -75%; width: 45%; height: 100%;
    transform: skewX(-20deg); background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    transition: left 0.55s ease; }
.btn:hover::after { left: 130%; }
.cta-strip { transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.35s ease; }
.cta-strip:hover { transform: translateY(-4px); box-shadow: 0 36px 80px -44px rgba(22, 20, 15, 0.5); }

/* header search button */
.site-nav { display: flex; align-items: center; gap: 1.2rem; }
.search-btn { display: inline-flex; align-items: center; gap: 0.45rem; background: none;
    border: 1px solid var(--rule); border-radius: 999px; padding: 0.4rem 0.85rem; cursor: pointer;
    color: var(--muted); font-family: var(--label); font-weight: 600; font-size: 0.74rem;
    text-transform: uppercase; letter-spacing: 0.12em;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease; }
.search-btn:hover { color: var(--ink); border-color: var(--gold); background: rgba(200, 149, 25, 0.06); }
.search-btn svg { width: 14px; height: 14px; }
.auth-link { font-family: var(--label); font-weight: 600; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.auth-link:hover { color: var(--ink); }
.btn--sm { padding: 0.42rem 0.95rem; font-size: 0.72rem; }

/* paid gate (paywall CTA Ghost injects into gated content) */
.gh-content .gh-post-upgrade-cta, .gh-content .gh-post-upgrade-cta-content {
    background: var(--paper-pure); border: 1px solid var(--rule); border-left: 3px solid var(--gold);
    border-radius: 14px; padding: clamp(1.4rem, 4vw, 1.9rem); margin: 2.2rem 0; text-align: center;
    box-shadow: 0 18px 44px -34px rgba(22, 20, 15, 0.4);
}
.gh-content .gh-post-upgrade-cta h2, .gh-content .gh-post-upgrade-cta-content h2 { font-family: var(--serif); margin: 0 0 0.6rem; }
.gh-content .gh-post-upgrade-cta a { display: inline-block; margin-top: 0.6rem; padding: 0.75rem 1.5rem; border-radius: 999px; background: var(--gold); color: var(--ink); font-family: var(--label); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.8rem; text-decoration: none; }
.gh-content .gh-post-upgrade-cta a:hover { background: var(--ink); color: var(--paper); }

/* reduced-motion: keep everything visible and still */
@media (prefers-reduced-motion: reduce) {
    .js [data-reveal] { opacity: 1 !important; transform: none !important; }
    .accent { background: none; -webkit-text-fill-color: var(--gold-ink); color: var(--gold-ink); }
    .ticker__track { animation: none; }
    .case__arrow { transform: none !important; }
}
