/* pensr: one issue, every angle.
   Dark editorial base; a six-hue "spectrum" stands for perspectives. */

:root {
    --ink: #0b0d12;
    --ink-2: #12151d;
    --ink-3: #1a1e29;
    --line: #262b38;
    --paper: #f1ede4;
    --paper-2: #b9b6ae;
    --paper-3: #7f7d78;

    --s1: #ff5a5f;   /* coral */
    --s2: #ffb547;   /* amber */
    --s3: #d6f25c;   /* lime */
    --s4: #3ee0c4;   /* teal */
    --s5: #5aa8ff;   /* sky */
    --s6: #b47bff;   /* violet */
    --spectrum: linear-gradient(90deg, var(--s1), var(--s2), var(--s3), var(--s4), var(--s5), var(--s6));

    --accent: var(--ghost-accent-color, #ff1a75);

    --font-display: var(--gh-font-heading, "Instrument Serif"), "Iowan Old Style", Georgia, serif;
    --font-body: var(--gh-font-body, "Inter Tight"), system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

    --wrap: 1240px;
    --gutter: clamp(16px, 4vw, 40px);
    --radius: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--ink);
    color: var(--paper);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
::selection { background: var(--s5); color: var(--ink); }

.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; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--paper); color: var(--ink); padding: 8px 12px; z-index: 100; border-radius: 6px; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--s5); outline-offset: 3px; }
.mono { font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }

.site { min-height: 100vh; display: flex; flex-direction: column; }
.site-main { flex: 1; }

/* ---------- Masthead ---------- */
.masthead {
    position: sticky; top: 0; z-index: 50;
    background: color-mix(in srgb, var(--ink) 82%, transparent);
    backdrop-filter: saturate(140%) blur(12px);
    -webkit-backdrop-filter: saturate(140%) blur(12px);
    border-bottom: 1px solid var(--line);
}
.masthead-inner {
    max-width: var(--wrap); margin: 0 auto; padding: 14px var(--gutter);
    display: flex; align-items: center; gap: 24px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-word { font-family: var(--font-display); font-size: 30px; line-height: 1; letter-spacing: -.01em; }

.prism-mark { width: 40px; height: 34px; overflow: visible; }
.prism-beam { stroke: var(--paper); stroke-width: 2; }
.prism-glass { fill: color-mix(in srgb, var(--paper) 8%, transparent); stroke: var(--paper); stroke-width: 1.6; stroke-linejoin: round; }
.prism-ray { stroke-width: 2; stroke-linecap: round; }
.prism-ray.r1 { stroke: var(--s1); } .prism-ray.r2 { stroke: var(--s2); } .prism-ray.r3 { stroke: var(--s3); }
.prism-ray.r4 { stroke: var(--s4); } .prism-ray.r5 { stroke: var(--s6); }

.site-nav { margin-left: auto; display: flex; align-items: center; gap: 28px; }
.site-nav .nav { display: flex; gap: 24px; list-style: none; margin: 0; padding: 0; }
.site-nav .nav a { text-decoration: none; color: var(--paper-2); font-weight: 500; font-size: 15px; }
.site-nav .nav a:hover, .site-nav .nav-current a { color: var(--paper); }
.nav-actions { display: flex; gap: 10px; }

.nav-toggle { display: none; margin-left: auto; background: none; border: 0; width: 44px; height: 44px; cursor: pointer; position: relative; }
.nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after {
    position: absolute; left: 11px; width: 22px; height: 2px; background: var(--paper); content: ""; transition: transform .2s;
}
.nav-toggle-bar { top: 21px; }
.nav-toggle-bar::before { left: 0; top: -7px; }
.nav-toggle-bar::after { left: 0; top: 7px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 9px 16px; border-radius: 999px; font: 600 14px/1 var(--font-body);
    text-decoration: none; cursor: pointer; border: 1px solid var(--line); white-space: nowrap;
}
.btn-ghost { background: transparent; color: var(--paper); }
.btn-ghost:hover { border-color: var(--paper-3); }
.btn-prism {
    color: var(--ink); border: 0;
    background: var(--spectrum); background-size: 200% 100%; background-position: 0 0;
    transition: background-position .5s ease;
}
.btn-prism:hover { background-position: 100% 0; }

/* ---------- Hero ---------- */
.hero {
    max-width: var(--wrap); margin: 0 auto; padding: clamp(48px, 9vw, 120px) var(--gutter) clamp(40px, 7vw, 96px);
    display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(24px, 5vw, 72px); align-items: center;
}
.hero-copy { order: 1; }
.hero-beam { order: 2; }
.eyebrow { font-family: var(--font-mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--paper-3); margin: 0 0 18px; }
.hero-title {
    font-family: var(--font-display); font-weight: 400;
    font-size: clamp(52px, 8.4vw, 116px); line-height: .92; letter-spacing: -.025em; margin: 0 0 24px;
}
.hero-sub { font-size: clamp(17px, 1.6vw, 20px); color: var(--paper-2); max-width: 34ch; margin: 0 0 32px; }

/* the beam: one white line enters a prism, six colored lines leave */
.hero-beam { position: relative; height: clamp(220px, 32vw, 380px); }
.beam-in {
    position: absolute; left: 0; top: 50%; width: 44%; height: 2px; background: var(--paper);
    box-shadow: 0 0 18px 2px color-mix(in srgb, var(--paper) 40%, transparent);
    transform-origin: left center; animation: beamIn 1.2s cubic-bezier(.2,.7,.2,1) both;
}
.beam-prism {
    position: absolute; left: 36%; top: 50%; width: clamp(90px, 13vw, 150px); aspect-ratio: 1 / .9;
    transform: translate(-10%, -50%);
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
    background: linear-gradient(160deg, color-mix(in srgb, var(--paper) 22%, transparent), color-mix(in srgb, var(--paper) 4%, transparent));
    border: 0;
}
.beam-prism::after {
    content: ""; position: absolute; inset: 0; clip-path: inherit;
    background: conic-gradient(from 200deg at 50% 70%, var(--s1), var(--s3), var(--s5), var(--s6), var(--s1));
    opacity: .14; mix-blend-mode: screen;
}
.beam-out { position: absolute; left: 50%; top: 50%; width: 50%; height: 0; }
.beam-out span {
    position: absolute; left: 0; top: 0; height: 3px; width: 100%; border-radius: 3px;
    transform-origin: left center; opacity: 0;
    animation: rayOut 1s cubic-bezier(.2,.7,.2,1) forwards;
}
.beam-out span:nth-child(1) { background: var(--s1); --r: -22deg; animation-delay: .9s; }
.beam-out span:nth-child(2) { background: var(--s2); --r: -13deg; animation-delay: .98s; }
.beam-out span:nth-child(3) { background: var(--s3); --r: -4deg;  animation-delay: 1.06s; }
.beam-out span:nth-child(4) { background: var(--s4); --r: 5deg;   animation-delay: 1.14s; }
.beam-out span:nth-child(5) { background: var(--s5); --r: 14deg;  animation-delay: 1.22s; }
.beam-out span:nth-child(6) { background: var(--s6); --r: 23deg;  animation-delay: 1.3s; }
.beam-out span { box-shadow: 0 0 14px currentColor; }
@keyframes beamIn { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes rayOut {
    from { opacity: 0; transform: rotate(var(--r)) scaleX(0); }
    to   { opacity: .95; transform: rotate(var(--r)) scaleX(1); }
}
@media (prefers-reduced-motion: reduce) {
    .beam-in, .beam-out span { animation: none; opacity: .95; transform: rotate(var(--r, 0)); }
    .btn-prism { transition: none; }
}

/* signup */
.signup { display: flex; flex-wrap: wrap; gap: 10px; max-width: 520px; }
.signup input {
    flex: 1 1 220px; min-width: 0; padding: 13px 18px; border-radius: 999px;
    border: 1px solid var(--line); background: var(--ink-2); color: var(--paper); font: inherit; font-size: 15px;
}
.signup input::placeholder { color: var(--paper-3); }
.signup .btn { padding: 13px 20px; font-size: 15px; }
.signup-note { display: none; width: 100%; margin: 4px 0 0; font-size: 14px; color: var(--s4); }
.signup-note.err { color: var(--s1); }
.signup.success [data-members-success], .signup.error [data-members-error] { display: block; }
.signup.loading .btn { opacity: .6; pointer-events: none; }

/* ---------- Bands ---------- */
.band { max-width: var(--wrap); margin: 0 auto; padding: clamp(32px, 5vw, 64px) var(--gutter); }
.band-head {
    display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px;
    border-top: 1px solid var(--line); padding-top: 20px; margin-bottom: 28px;
}
.band-title { font-family: var(--font-display); font-weight: 400; font-size: clamp(30px, 3.6vw, 44px); line-height: 1.05; margin: 0; letter-spacing: -.01em; }
.band-note { margin: 0; color: var(--paper-3); font-size: 15px; }
.band-link { color: var(--paper-2); text-decoration: none; font-weight: 600; font-size: 15px; }
.band-link:hover { color: var(--paper); }
.empty { color: var(--paper-3); font-size: 18px; }

/* ---------- Issue cards (home) ---------- */
.issue-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; }
.issue-card {
    position: relative; display: flex; flex-direction: column; gap: 10px;
    padding: 24px; border-radius: var(--radius); text-decoration: none;
    background: var(--ink-2); border: 1px solid var(--line);
    transition: transform .25s ease, border-color .25s ease;
    overflow: hidden;
}
.issue-card::before {
    content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--spectrum);
    transform: scaleX(.18); transform-origin: left; transition: transform .45s cubic-bezier(.2,.7,.2,1);
}
.issue-card:hover { transform: translateY(-3px); border-color: #353b4b; }
.issue-card:hover::before { transform: scaleX(1); }
.issue-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--paper-3); }
.issue-spectrum { display: inline-flex; gap: 4px; }
.issue-spectrum i { display: block; width: 14px; height: 14px; border-radius: 50%; background: var(--s1); }
.issue-spectrum i:nth-child(6n+2) { background: var(--s2); }
.issue-spectrum i:nth-child(6n+3) { background: var(--s3); }
.issue-spectrum i:nth-child(6n+4) { background: var(--s4); }
.issue-spectrum i:nth-child(6n+5) { background: var(--s5); }
.issue-spectrum i:nth-child(6n+6) { background: var(--s6); }
.issue-spectrum i + i { margin-left: -8px; box-shadow: -2px 0 0 var(--ink-2); }
.issue-name { font-family: var(--font-display); font-weight: 400; font-size: 34px; line-height: 1.02; margin: 4px 0 0; }
.issue-desc { color: var(--paper-2); margin: 0; font-size: 15.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.issue-cta { margin-top: auto; padding-top: 8px; font-weight: 600; font-size: 14px; color: var(--paper); }

/* ---------- Perspective cards ---------- */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.lanes {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(300px, 1fr); gap: 16px;
    overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 12px;
    scrollbar-color: var(--line) transparent;
}
.lanes > * { scroll-snap-align: start; }

.pcard { --c: var(--s1); position: relative; }
.pgrid .pcard:nth-child(6n+2), .lanes .pcard:nth-child(6n+2) { --c: var(--s2); }
.pgrid .pcard:nth-child(6n+3), .lanes .pcard:nth-child(6n+3) { --c: var(--s3); }
.pgrid .pcard:nth-child(6n+4), .lanes .pcard:nth-child(6n+4) { --c: var(--s4); }
.pgrid .pcard:nth-child(6n+5), .lanes .pcard:nth-child(6n+5) { --c: var(--s5); }
.pgrid .pcard:nth-child(6n+6), .lanes .pcard:nth-child(6n+6) { --c: var(--s6); }
.pcard-link {
    height: 100%; display: flex; flex-direction: column; gap: 12px;
    padding: 22px 22px 20px 26px; border-radius: var(--radius);
    background: var(--ink-2); border: 1px solid var(--line); text-decoration: none;
    position: relative; overflow: hidden; transition: background .25s ease, transform .25s ease;
}
.pcard-link::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c); }
.pcard-link::after {
    content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
    background: radial-gradient(120% 70% at 0% 0%, color-mix(in srgb, var(--c) 16%, transparent), transparent 60%);
}
.pcard-link:hover { transform: translateY(-2px); }
.pcard-link:hover::after { opacity: 1; }
.pcard-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.kicker {
    font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase;
    color: var(--c, var(--paper-2)); text-decoration: none;
}
.lenses { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.lens {
    font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; text-decoration: none;
    border: 1px solid var(--line); color: var(--paper-2);
}
.pcard-title { font-family: var(--font-display); font-weight: 400; font-size: 28px; line-height: 1.08; margin: 0; letter-spacing: -.005em; }
.pcard-excerpt { color: var(--paper-2); margin: 0; font-size: 15.5px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.pcard-meta { margin-top: auto; padding-top: 6px; display: flex; align-items: center; gap: 8px; color: var(--paper-3); font-size: 13.5px; }
.avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.byline { color: var(--paper-2); font-weight: 600; text-decoration: none; }

/* ---------- Issue (tag) & author hero ---------- */
.issue-hero { max-width: var(--wrap); margin: 0 auto; padding: clamp(40px, 7vw, 96px) var(--gutter) 8px; }
.issue-hero .spectrum-rule { margin-bottom: 36px; max-width: 220px; }
.issue-hero-title { font-family: var(--font-display); font-weight: 400; font-size: clamp(48px, 8vw, 110px); line-height: .95; letter-spacing: -.025em; margin: 0 0 20px; }
.issue-hero-desc { font-size: clamp(18px, 1.8vw, 22px); color: var(--paper-2); max-width: 46ch; margin: 0; }
.issue-hero-img { margin-top: 40px; border-radius: var(--radius); width: 100%; max-height: 520px; object-fit: cover; }
.author-avatar { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; margin-bottom: 20px; }
.spectrum-rule { height: 3px; background: var(--spectrum); border-radius: 3px; }

/* ---------- Article ---------- */
.article { padding: clamp(40px, 7vw, 88px) var(--gutter) 24px; }
.article-head { max-width: 860px; margin: 0 auto 40px; }
.article-kicks { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 22px; --c: var(--s4); }
.article-kicks .kicker { font-size: 12.5px; }
.article-title { font-family: var(--font-display); font-weight: 400; font-size: clamp(42px, 6.4vw, 84px); line-height: .98; letter-spacing: -.02em; margin: 0 0 24px; }
.article-position {
    position: relative; margin: 0 0 28px; padding: 18px 22px 18px 24px; border-radius: 10px;
    background: var(--ink-2); border: 1px solid var(--line); font-size: clamp(18px, 1.7vw, 21px); color: var(--paper);
}
.article-position::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--spectrum); background-size: 100% 100%; }
.position-label { display: block; color: var(--paper-3); margin-bottom: 6px; }
.article-dek { font-size: 21px; color: var(--paper-2); margin: 0; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--paper-3); font-size: 15px; }
.article-meta .avatar { width: 30px; height: 30px; }
.article-image { max-width: 1200px; margin: 0 auto 48px; }
.article-image img { width: 100%; border-radius: var(--radius); }
.article-image figcaption, .gh-content figcaption { color: var(--paper-3); font-size: 14px; text-align: center; margin-top: 10px; }

/* Ghost content (Koenig) */
.gh-content {
    --content: 720px;
    display: grid;
    grid-template-columns: [full-start] minmax(var(--gutter), 1fr) [wide-start] minmax(0, 120px) [main-start] min(var(--content), 100% - var(--gutter) * 2) [main-end] minmax(0, 120px) [wide-end] minmax(var(--gutter), 1fr) [full-end];
    font-size: 19px; line-height: 1.7; color: #e3dfd6;
    margin: 0 calc(var(--gutter) * -1);
}
.gh-content > * { grid-column: main; margin: 0 0 1.25em; }
.gh-content > .kg-width-wide { grid-column: wide; }
.gh-content > .kg-width-full { grid-column: full; }
.gh-content > .kg-width-full img { border-radius: 0; }
.gh-content h2, .gh-content h3 { font-family: var(--font-display); font-weight: 400; line-height: 1.1; color: var(--paper); margin-top: 1.6em; margin-bottom: .5em; letter-spacing: -.01em; }
.gh-content h2 { font-size: 40px; }
.gh-content h3 { font-size: 30px; }
.gh-content h4 { font-size: 20px; margin-top: 1.4em; }
.gh-content a { color: var(--paper); text-decoration-color: var(--s5); text-underline-offset: 3px; text-decoration-thickness: 2px; }
.gh-content a:hover { text-decoration-color: var(--s3); }
.gh-content blockquote:not(.kg-blockquote-alt) {
    margin-left: 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--s6);
    font-family: var(--font-display); font-size: 28px; line-height: 1.3; color: var(--paper);
}
.gh-content .kg-blockquote-alt { font-family: var(--font-display); font-size: 34px; line-height: 1.25; text-align: center; color: var(--paper); font-style: italic; }
.gh-content hr { border: 0; height: 3px; background: var(--spectrum); border-radius: 3px; width: 96px; margin: 2.4em auto; }
.gh-content img { border-radius: 10px; }
.gh-content code { font-family: var(--font-mono); font-size: .85em; background: var(--ink-3); padding: 2px 6px; border-radius: 5px; }
.gh-content pre { background: var(--ink-2); border: 1px solid var(--line); padding: 18px; border-radius: 10px; overflow-x: auto; font-size: 15px; }
.gh-content pre code { background: none; padding: 0; }
.gh-content ul, .gh-content ol { padding-left: 1.3em; }
.gh-content li + li { margin-top: .35em; }
.gh-content table { border-collapse: collapse; width: 100%; font-size: 16px; }
.gh-content th, .gh-content td { border-bottom: 1px solid var(--line); padding: 10px; text-align: left; }
.gh-content .kg-callout-card { border-radius: 10px; }
.gh-content .kg-bookmark-card a { color: inherit; text-decoration: none; }

.other-angles { border-top: 0; }
.comments { max-width: 860px; }

/* ---------- Pagination ---------- */
.pagination { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 36px; color: var(--paper-3); font-size: 15px; }
.pagination a { text-decoration: none; font-weight: 600; color: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 64px; }
.footer-inner {
    max-width: var(--wrap); margin: 0 auto; padding: 40px var(--gutter) 48px;
    display: grid; grid-template-columns: 2fr 1fr; gap: 24px 48px; align-items: start;
}
.footer-brand p { color: var(--paper-3); max-width: 42ch; margin: 12px 0 0; }
.footer-nav .nav { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 22px; justify-content: flex-end; }
.footer-nav a { color: var(--paper-2); text-decoration: none; }
.footer-nav a:hover { color: var(--paper); }
.footer-meta { grid-column: 1 / -1; color: var(--paper-3); font-size: 14px; margin: 0; }

/* ---------- Error page ---------- */
.error-page { max-width: 760px; margin: 0 auto; padding: 18vh var(--gutter); }
.error-page .spectrum-rule { max-width: 200px; margin-bottom: 32px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .hero { grid-template-columns: 1fr; }
    .hero-beam { order: 0; height: 170px; }
    .nav-toggle { display: block; }
    .site-nav {
        display: none; position: absolute; left: 0; right: 0; top: 100%;
        flex-direction: column; align-items: stretch; gap: 18px;
        background: var(--ink); border-bottom: 1px solid var(--line); padding: 18px var(--gutter) 24px;
    }
    .nav-open .site-nav { display: flex; }
    .nav-open .nav-toggle-bar { background: transparent; }
    .nav-open .nav-toggle-bar::before { transform: translateY(7px) rotate(45deg); }
    .nav-open .nav-toggle-bar::after { transform: translateY(-7px) rotate(-45deg); }
    .site-nav .nav { flex-direction: column; gap: 14px; }
    .site-nav .nav a { font-size: 18px; }
    .lanes { grid-auto-columns: 84%; }
    .footer-inner { grid-template-columns: 1fr; }
    .footer-nav .nav { justify-content: flex-start; }
    .gh-content { font-size: 18px; }
}
