/* ==========================================================================
   TornWires — Ghost theme
   ========================================================================== */

:root {
    --bg: #f2f2f2;
    --ink: #000;
    --paper-dark: #000;
    --on-dark: #fff;
    --accent: #e8542b;
    --muted: #555;
    --font-logo: "Jost", "Futura PT", Futura, "Century Gothic", sans-serif;
    /* Ghost Admin > Design > Brand fonts override these */
    --font-display: var(--gh-font-heading, var(--font-logo));
    --font-body: var(--gh-font-body, var(--font-logo));
    --font-ui: "Poppins", system-ui, -apple-system, sans-serif;
    --container: 1200px;
    --gutter: clamp(18px, 4vw, 40px);
    --gap: clamp(20px, 4.4vw, 44px);
}

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

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

.container {
    width: 100%;
    max-width: calc(var(--container) + var(--gutter) * 2);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

/* ---------- Masthead ---------- */

.site-header { padding: clamp(20px, 3vw, 32px) 0 0; }

.masthead {
    display: block;
    width: 100%;
    overflow: hidden;
    container-type: inline-size;   /* lets the title size itself from this box's width */
    color: var(--ink);
    text-align: center;
}

.masthead-text {
    display: inline-block;
    font-family: var(--font-logo);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    line-height: 0.82;
    white-space: nowrap;
    /* Title width = box width. --mast-k is measured once by main.js and remembered;
       0.17 is the exact value for "TORNWIRES" in Jost Bold. */
    font-size: calc(100cqi * var(--mast-k, 0.17));
    padding-top: 0.06em;
}

/* First visit with a not-yet-measured title: hide it until it can appear at its final size */
.mast-measuring .masthead-text[data-fit] { visibility: hidden; }

.masthead-logo { margin: 0 auto; max-height: 160px; width: auto; }

/* ---------- Navigation ---------- */

.site-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px 32px;
    flex-wrap: wrap;
    margin: clamp(24px, 4vw, 48px) 0 clamp(18px, 2vw, 22px);
}

.site-nav-items { flex: 1 1 auto; }

.site-nav-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: clamp(16px, 2.4vw, 28px);
    margin-left: auto;
    font-family: var(--font-ui);
    font-weight: 500;
    font-size: 15px;
}

.tw-search {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: none;
    border: 0;
    padding: 4px 0;
    font: inherit;
    color: var(--ink);
    cursor: pointer;
}

.tw-search svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
}

.tw-signin { padding: 4px 0; border-bottom: 2px solid transparent; }
.tw-signin:hover, .tw-search:hover span { border-bottom: 2px solid var(--ink); }

.tw-subscribe {
    background: var(--ink);
    color: #fff;
    border: 2px solid var(--ink);
    border-radius: 999px;
    padding: 7px 20px;
    font-size: 14px;
    transition: background .15s, color .15s;
}
.tw-subscribe:hover { background: transparent; color: var(--ink); }

.site-nav .nav,
.footer-links .nav {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.site-nav .nav { gap: 6px clamp(24px, 5vw, 46px); }

.site-nav .nav a {
    font-family: var(--font-ui);
    font-weight: 500;
    font-size: 15px;
    letter-spacing: 0.01em;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
    transition: border-color .15s;
}

.site-nav .nav a:hover,
.site-nav .nav-current a { border-bottom-color: var(--ink); }

.nav-toggle {
    display: none;
    font-family: var(--font-ui);
    font-weight: 600;
    font-size: 14px;
    background: var(--ink);
    color: #fff;
    border: 0;
    border-radius: 999px;
    padding: 8px 22px;
    cursor: pointer;
}

/* ---------- Hero ---------- */

.hero { padding-bottom: clamp(36px, 5vw, 48px); }

.hero-image {
    margin: 0;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #ddd;
}

.hero-image img { width: 100%; height: 100%; object-fit: cover; }

.hero-title {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(30px, 5.2vw, 64px);
    line-height: 1.08;
    letter-spacing: -0.01em;
    margin: clamp(14px, 2vw, 22px) 0 0;
    max-width: none;           /* span the full width under the image */
    text-wrap: balance;        /* even line lengths instead of a short last line */
}

.hero-link:hover .hero-title { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }

/* ---------- Sections ---------- */

.band { padding: clamp(28px, 4vw, 40px) 0 clamp(36px, 5vw, 48px); }
.band-tight { padding-top: 0; }

.band-dark { background: var(--paper-dark); color: var(--on-dark); }
.band-dark .card-image-placeholder { background: #1b1b1b; color: #333; }

.section-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(40px, 6.6vw, 68px);
    line-height: 1;
    letter-spacing: -0.015em;
    margin: 0 0 clamp(18px, 2.4vw, 26px);
}

/* ---------- Grid & cards ---------- */

.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(32px, 4.4vw, 56px) var(--gap);
}

.card { margin: 0; }
.card-link { display: block; }

.card-image {
    margin: 0;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #ddd;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}

.card-link:hover .card-image img { transform: scale(1.03); }

.card-image-placeholder {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    background: #e2e2e2;
    color: #cfcfcf;
    font-weight: 800;
    font-size: 28px;
    text-transform: uppercase;
}

.card-title {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(19px, 1.8vw, 21px);
    line-height: 1.16;
    margin: 14px 0 0;
}

.card-link:hover .card-title { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Buttons & pagination ---------- */

.more-wrap { display: flex; justify-content: center; margin-top: clamp(40px, 5vw, 56px); }

.btn-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 210px;
    padding: 13px 32px;
    background: var(--ink);
    color: #fff;
    border: 2px solid var(--ink);
    border-radius: 999px;
    font-family: var(--font-ui);
    font-weight: 500;
    font-size: 12px;
    transition: background .15s, color .15s;
}

.btn-pill:hover { background: transparent; color: var(--ink); }
.btn-pill.is-loading { opacity: .6; pointer-events: none; }
.btn-outline { background: transparent; color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: #fff; }

.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 56px;
    font-family: var(--font-ui);
    font-size: 13px;
}

/* ---------- Archive headers ---------- */

.archive-head { padding-top: clamp(16px, 3vw, 28px); }
.archive-desc { font-size: 19px; color: var(--muted); max-width: 40em; margin: -6px 0 0; }
.author-head { display: flex; align-items: center; gap: 24px; }
.author-avatar { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; }

/* ---------- Footer ---------- */

.site-footer { padding: clamp(24px, 4vw, 40px) 0 clamp(36px, 5vw, 56px); }

.footer-bar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
    margin-top: clamp(28px, 4vw, 48px);
}

.footer-tagline {
    margin: 0;
    font-family: var(--font-ui);
    font-weight: 700;
    font-size: 12px;
}

.footer-social { display: flex; gap: 14px; justify-content: center; }
.footer-social svg { width: 14px; height: 14px; fill: currentColor; }
.footer-social a:hover { opacity: .6; }

.footer-links { justify-self: end; }
.footer-links .nav { justify-content: flex-end; }
.footer-links .nav li { font-family: var(--font-ui); font-size: 12px; }
.footer-links .nav li + li::before { content: "|"; margin: 0 4px; color: var(--ink); }
.footer-links .nav a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.footer-links .nav a:hover { color: var(--ink); }

/* ---------- Article ---------- */

.article { padding-bottom: clamp(40px, 6vw, 72px); }

/* Post layouts: Narrow / Medium (default) / Wide.
   --text-w = body text column, --head-w = headline block, --img-w = feature image */
.layout-narrow { --text-w: 600px;  --head-w: 640px;  --img-w: 760px;  --wide-extra: 80px; }
.layout-medium { --text-w: 720px;  --head-w: 900px;  --img-w: 1200px; --wide-extra: 120px; }
.layout-wide   { --text-w: 960px;  --head-w: 1100px; --img-w: 1200px; --wide-extra: 120px; }

.layout-narrow .article-title { font-size: clamp(32px, 4.8vw, 50px); }
.layout-wide .gh-content { font-size: 21px; }

.article-header { max-width: calc(var(--head-w, 900px) + var(--gutter) * 2); padding-top: clamp(12px, 2vw, 24px); }

.article-tag {
    display: inline-block;
    font-family: var(--font-ui);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
    background: var(--ink);
    color: #fff;
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 18px;
}

.article-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(34px, 5.6vw, 62px);
    line-height: 1.05;
    letter-spacing: -0.015em;
    margin: 0;
}

.article-excerpt { font-size: clamp(19px, 2.2vw, 23px); line-height: 1.4; color: #222; margin: 18px 0 0; }

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 22px;
    font-family: var(--font-ui);
    font-size: 13px;
    color: var(--muted);
}

.article-meta a { color: var(--ink); font-weight: 600; }

.article-image { max-width: calc(var(--img-w, 1200px) + var(--gutter) * 2); margin: clamp(26px, 4vw, 40px) auto 0; }
.article-image img { width: 100%; }
.article-image figcaption,
.gh-content figcaption {
    font-family: var(--font-ui);
    font-size: 12px;
    color: var(--muted);
    margin-top: 8px;
    text-align: center;
}

.article-comments { max-width: var(--text-w, 720px); margin: 48px auto 0; padding: 0 var(--gutter); }

/* ---------- Post content (Koenig editor) ---------- */

.gh-content {
    display: grid;
    grid-template-columns:
        [full-start] minmax(var(--gutter), 1fr)
        [wide-start] minmax(0, var(--wide-extra, 120px))
        [main-start] min(var(--text-w, 720px), calc(100% - var(--gutter) * 2)) [main-end]
        minmax(0, var(--wide-extra, 120px)) [wide-end]
        minmax(var(--gutter), 1fr) [full-end];
    margin-top: clamp(28px, 4vw, 44px);
    font-size: 20px;
    line-height: 1.65;
}

.gh-content > * { grid-column: main-start / main-end; margin: 0 0 1.25em; }

.gh-content > .kg-width-wide { grid-column: wide-start / wide-end; }
.gh-content > .kg-width-full { grid-column: full-start / full-end; }
.gh-content > .kg-width-full img { width: 100%; }

.gh-content h2, .gh-content h3, .gh-content h4 {
    font-weight: 700;
    line-height: 1.15;
    margin: 1.6em 0 .5em;
}
.gh-content h2 { font-size: 34px; }
.gh-content h3 { font-size: 27px; }
.gh-content h4 { font-size: 22px; }

.gh-content a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.gh-content a:hover { color: var(--accent); }

.gh-content blockquote {
    border-left: 4px solid var(--ink);
    padding-left: 22px;
    font-size: 1.1em;
    font-style: italic;
}

.gh-content hr { border: 0; height: 2px; background: var(--ink); width: 80px; margin: 2.4em auto; }

.gh-content figure { margin-left: 0; margin-right: 0; }
.gh-content pre {
    background: #111;
    color: #eee;
    padding: 18px;
    overflow-x: auto;
    font-size: 15px;
    border-radius: 6px;
}
.gh-content code { font-size: .88em; }

.gh-content ul, .gh-content ol { padding-left: 1.3em; }
.gh-content li + li { margin-top: .35em; }

.kg-image-card img { margin: 0 auto; }
.kg-gallery-container { display: flex; flex-direction: column; gap: 10px; }
.kg-gallery-row { display: flex; gap: 10px; }
.kg-gallery-image img { width: 100%; height: 100%; object-fit: cover; }

.kg-bookmark-card a { color: inherit; text-decoration: none; }

/* ---------- Error ---------- */

.error-page { text-align: center; padding: 60px 0 80px; }
.error-code { font-weight: 800; font-size: clamp(80px, 18vw, 180px); line-height: 1; margin: 0; }
.error-page .archive-desc { margin: 0 auto; }

/* ---------- Responsive ---------- */

@media (max-width: 760px) {
    .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

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

    .nav-toggle { display: inline-block; order: 1; }
    .site-nav-actions { order: 2; gap: 14px; }
    .tw-search span { display: none; }
    .site-nav-items { display: none; order: 3; flex-basis: 100%; }
    .nav-open .site-nav-items { display: block; }
    .site-nav .nav { flex-direction: column; gap: 10px; }

    .footer-bar { grid-template-columns: 1fr; text-align: center; }
    .footer-links { justify-self: center; }
    .footer-links .nav { justify-content: center; }
}

/* ==========================================================================
   Membership pages: Sign In, Sign Up, Subscribe, Account, Welcome
   ========================================================================== */

.member-page {
    max-width: calc(520px + var(--gutter) * 2);
    margin: 0 auto;
    padding: clamp(24px, 5vw, 56px) var(--gutter) clamp(56px, 8vw, 96px);
}

.member-page-wide { max-width: calc(var(--container) + var(--gutter) * 2); }

.member-head { text-align: center; max-width: 720px; margin: 0 auto clamp(28px, 4vw, 44px); }

.member-title {
    font-weight: 700;
    font-size: clamp(38px, 6vw, 60px);
    line-height: 1.02;
    letter-spacing: -0.015em;
    margin: 0 0 12px;
}

.member-lede { font-size: 20px; line-height: 1.4; color: #222; margin: 0 0 24px; }
.member-note { font-size: 18px; margin: 0 0 20px; }

.member-switch {
    font-family: var(--font-ui);
    font-size: 14px;
    text-align: center;
    margin: 20px 0 0;
}
.member-switch a { text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }

.member-content { display: block; margin-top: 36px; font-size: 18px; }
.member-content > * { margin: 0 0 1em; }

/* Forms */
.member-form { display: grid; gap: 16px; }

.field { display: grid; gap: 6px; }
.field span, .newsletters legend {
    font-family: var(--font-ui);
    font-weight: 600;
    font-size: 13px;
}

.field input {
    width: 100%;
    font: 400 17px/1.3 var(--font-ui);
    padding: 14px 18px;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: #fff;
    color: var(--ink);
}
.field input:focus { outline: 3px solid rgba(0,0,0,.15); outline-offset: 2px; }

.newsletters { border: 0; padding: 0; margin: 4px 0 0; display: grid; gap: 10px; }
.newsletters legend { margin-bottom: 8px; }
.check { display: flex; gap: 12px; align-items: flex-start; font-family: var(--font-ui); font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--ink); }
.check small { display: block; color: var(--muted); font-size: 13px; }

.btn-block { width: 100%; min-width: 0; font-size: 14px; padding: 15px 28px; }
.btn-pill.is-static { pointer-events: none; opacity: .55; }

/* Ghost adds .loading / .success / .error to member forms */
.when-loading, .form-message { display: none; }
.member-form.loading .when-idle { display: none; }
.member-form.loading .when-loading { display: inline; }
.member-form.loading button { opacity: .6; pointer-events: none; }
.form-message { font-family: var(--font-ui); font-size: 14px; margin: 0; padding: 12px 16px; border-radius: 12px; }
.member-form.success .form-success { display: block; background: #e7f5ea; color: #1d5e2d; }
.member-form.success .field,
.member-form.success .newsletters,
.member-form.success button { display: none; }
.member-form.error .form-error,
.form-error:not(:empty) { display: block; background: #fdecea; color: #a3261a; }

/* Subscribe / tiers */
.billing-toggle {
    display: inline-flex;
    margin-top: 8px;
    padding: 4px;
    border: 2px solid var(--ink);
    border-radius: 999px;
    font-family: var(--font-ui);
}
.billing-toggle button {
    font: 500 14px var(--font-ui);
    border: 0;
    background: transparent;
    color: var(--ink);
    padding: 8px 22px;
    border-radius: 999px;
    cursor: pointer;
}
.billing-toggle .is-active { background: var(--ink); color: #fff; }

[data-billing="yearly"] .price-monthly,
[data-billing="monthly"] .price-yearly { display: none; }

.tiers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--gap);
    align-items: stretch;
}

.tier {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 2px solid var(--ink);
    padding: clamp(24px, 3vw, 32px);
}
.tier-paid:last-child { background: var(--ink); color: #fff; }
.tier-paid:last-child .btn-pill { background: #fff; color: var(--ink); border-color: #fff; }
.tier-paid:last-child .btn-pill:hover { background: transparent; color: #fff; }

.tier-name { font-weight: 700; font-size: 30px; line-height: 1.05; margin: 0 0 8px; }
.tier-desc { margin: 0 0 16px; font-size: 17px; opacity: .85; }
.tier-price { margin: 0; font-family: var(--font-ui); }
.tier-price strong { font-size: 40px; font-weight: 700; letter-spacing: -0.02em; }
.tier-price span { font-size: 15px; opacity: .7; margin-left: 4px; }
.tier-trial { font-family: var(--font-ui); font-size: 13px; font-weight: 600; margin: 6px 0 0; }

.tier-benefits { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 8px; font-size: 17px; }
.tier-benefits li { padding-left: 26px; position: relative; }
.tier-benefits li::before { content: "✓"; position: absolute; left: 0; font-weight: 700; }

.tier-action { margin-top: auto; padding-top: 24px; }

/* Account */
.account-profile {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 20px 0;
    border-top: 2px solid var(--ink);
    border-bottom: 1px solid #ccc;
}
.account-avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.account-name { font-weight: 600; font-size: 20px; margin: 0; }
.account-email { font-family: var(--font-ui); font-size: 14px; color: var(--muted); margin: 0; }
.account-badge {
    margin-left: auto;
    font: 600 12px var(--font-ui);
    text-transform: uppercase;
    letter-spacing: .06em;
    background: var(--ink);
    color: #fff;
    padding: 5px 12px;
    border-radius: 999px;
}

.account-section { padding: 22px 0; border-bottom: 1px solid #ccc; }
.account-section h2 { font-size: 22px; font-weight: 700; margin: 0 0 12px; }
.account-sub + .account-sub { margin-top: 16px; }
.account-sub-name { margin: 0 0 4px; display: flex; justify-content: space-between; gap: 12px; font-size: 18px; }
.account-sub-name span { font-family: var(--font-ui); font-size: 15px; }
.account-sub-meta { font-family: var(--font-ui); font-size: 14px; color: var(--muted); margin: 4px 0 0; }
.account-sub-meta a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.account-sub-meta a.link-danger { color: #a3261a; }

.account-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.account-section.account-actions { border-bottom: 0; }
.account-actions .btn-pill { min-width: 0; font-size: 13px; padding: 11px 22px; }

/* Paywall (overrides Ghost's default CTA) */
.paywall {
    grid-column: main-start / main-end;
    text-align: center;
    background: var(--ink);
    color: #fff;
    padding: clamp(28px, 5vw, 48px) clamp(20px, 4vw, 40px);
    margin-top: 8px;
}
.paywall-title { font-size: clamp(28px, 4vw, 38px); font-weight: 700; line-height: 1.1; margin: 0 0 10px; }
.paywall-text { font-size: 18px; margin: 0; opacity: .85; }
.paywall .account-actions { justify-content: center; }
.paywall .btn-pill { background: #fff; color: var(--ink); border-color: #fff; text-decoration: none; }
.paywall .btn-pill:hover { background: transparent; color: #fff; }
.paywall .btn-outline { background: transparent; color: #fff; }

.tiers-single { max-width: 420px; margin: 0 auto; grid-template-columns: 1fr; }


/* ==========================================================================
   Newsletter popup
   ========================================================================== */

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.nl-lock, .nl-lock body { overflow: hidden; }

.nl-popup {
    position: fixed;
    inset: 0;
    z-index: 3999;   /* below Ghost Portal / Search (which sit higher) */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.nl-popup[hidden] { display: none; }

.nl-popup-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .62);
    opacity: 0;
    transition: opacity .2s ease;
}

.nl-popup-dialog {
    position: relative;
    width: 100%;
    max-width: 540px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: var(--bg);
    color: var(--ink);
    border: 3px solid var(--ink);
    padding: clamp(28px, 5vw, 44px);
    opacity: 0;
    transform: translateY(14px) scale(.98);
    transition: opacity .2s ease, transform .2s ease;
}

.nl-popup.is-open .nl-popup-backdrop { opacity: 1; }
.nl-popup.is-open .nl-popup-dialog { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    .nl-popup-backdrop, .nl-popup-dialog { transition: none; }
}

.nl-popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    display: grid;
    place-items: center;
}
.nl-popup-close:hover { background: rgba(0,0,0,.08); }
.nl-popup-close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }

.nl-popup-kicker {
    margin: 0 0 10px;
    font: 800 13px var(--font-logo);
    text-transform: uppercase;
    letter-spacing: .12em;
}

.nl-popup-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(32px, 6vw, 46px);
    line-height: 1.02;
    letter-spacing: -0.015em;
    margin: 0 0 12px;
    padding-right: 24px;
}

.nl-popup-text { font-size: 19px; line-height: 1.4; margin: 0 0 22px; }

.nl-popup-row {
    display: flex;
    gap: 8px;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: #fff;
    padding: 5px;
}
.nl-popup-row input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    padding: 10px 14px;
    font: 400 16px var(--font-ui);
    color: var(--ink);
}
.nl-popup-row input:focus { outline: none; }
.nl-popup-row:focus-within { outline: 3px solid rgba(0,0,0,.15); outline-offset: 2px; }
.nl-popup-row .btn-pill { min-width: 0; padding: 11px 24px; font-size: 14px; }

.nl-popup-form { gap: 12px; }
.nl-popup-form.success .nl-popup-row { display: none; }

.nl-popup-fine { margin: 16px 0 0; font: 400 13px var(--font-ui); color: var(--muted); }
.nl-popup-fine a { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 480px) {
    .nl-popup { align-items: flex-end; padding: 0; }
    .nl-popup-dialog { max-width: none; border-width: 3px 0 0; max-height: 90vh; }
    .nl-popup-row { flex-direction: column; border-radius: 22px; }
    .nl-popup-row .btn-pill { width: 100%; padding: 13px; }
}
