/* StrangersX public site — mobile first, then larger screens. */

:root {
  --paper: #F4F1EA;
  --ink: #1B1A17;
  --accent: #1F5C4A;
  --card: #FBFAF6;
  --rule: #D6D0C2;
  --muted: #5C5850;
  --sand: #E7E2D5;
  --mint: #9FD1BE;
  --danger: #9B2C1F;
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --sans: 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --gutter: 20px;
  --header-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
img, iframe, video, audio { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.1; margin: 0; }
h1 { font-size: clamp(40px, 5.2vw + 14px, 68px); letter-spacing: -0.01em; }
h2 { font-size: clamp(32px, 3vw + 18px, 46px); }
h3 { font-size: clamp(24px, 1vw + 20px, 30px); }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--mint); color: var(--ink); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); width: 100%; }
.muted { color: var(--muted); }
.rule { border: 0; border-top: 1px solid var(--rule); margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 8px; }
.skip:focus { left: 8px; }

.eyebrow { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; color: var(--accent); margin: 0 0 14px; }
.lede { font-size: 18px; color: var(--muted); max-width: 36em; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border-radius: 999px; font: 600 16px/1.2 var(--sans);
  border: 2px solid var(--ink); color: var(--ink); background: transparent; cursor: pointer;
  transition: opacity .15s, transform .15s;
}
.btn:hover { text-decoration: none; opacity: .88; }
.btn:active { transform: translateY(1px); }
.btn.solid { background: var(--ink); color: var(--paper); }
.btn.sm { padding: 8px 16px; font-size: 14px; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .55; cursor: progress; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.more { font-weight: 600; }

.card { background: var(--card); border: 1px solid var(--rule); border-radius: 14px; padding: 22px; }
.chip {
  display: inline-block; padding: 8px 16px; border: 1px solid var(--ink); border-radius: 999px;
  font-size: 15px; margin: 0 8px 10px 0; color: var(--ink); background: transparent; font-family: inherit; cursor: pointer;
}
a.chip:hover { text-decoration: none; background: var(--ink); color: var(--paper); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 30; background: var(--paper); border-bottom: 1px solid var(--rule); }
.header-bar { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); gap: 16px; }
.logo { font-family: var(--serif); font-size: 26px; font-weight: 600; color: var(--ink); }
.logo:hover { text-decoration: none; }
.nav-links { display: none; gap: 28px; font-size: 15px; }
.nav-links a { color: var(--ink); padding: 6px 0; border-bottom: 2px solid transparent; }
.nav-links a:hover { text-decoration: none; border-bottom-color: var(--rule); }
.nav-links a[aria-current="page"] { border-bottom-color: var(--accent); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.menu-btn { width: 44px; height: 44px; border: 0; background: transparent; cursor: pointer; display: grid; place-items: center; border-radius: 10px; color: var(--ink); }
.menu-icon, .menu-icon::before, .menu-icon::after { display: block; width: 22px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .2s, opacity .2s; }
.menu-icon { position: relative; }
.menu-icon::before, .menu-icon::after { content: ''; position: absolute; left: 0; }
.menu-icon::before { top: -7px; }
.menu-icon::after { top: 7px; }
.menu-btn[aria-expanded="true"] .menu-icon { background: transparent; }
.menu-btn[aria-expanded="true"] .menu-icon::before { transform: translateY(7px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .menu-icon::after { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu { border-top: 1px solid var(--rule); background: var(--paper); padding: 8px 0 20px; max-height: calc(100svh - var(--header-h)); overflow-y: auto; }
.mobile-menu a { display: flex; align-items: baseline; gap: 14px; padding: 12px 0; font: 600 30px/1.1 var(--serif); color: var(--ink); border-bottom: 1px solid var(--rule); }
.mobile-menu a:hover { text-decoration: none; color: var(--accent); }
.mobile-menu a[aria-current="page"] { color: var(--accent); }
.mobile-menu .n { font: 600 13px var(--sans); color: var(--muted); letter-spacing: .08em; width: 22px; }

/* ---------- Page view + transitions ---------- */
#view { flex: 1; outline: none; }
#view[data-anim="out-next"] { animation: out-next .16s ease-in forwards; }
#view[data-anim="out-prev"] { animation: out-prev .16s ease-in forwards; }
#view[data-anim="in-next"] { animation: in-next .32s cubic-bezier(.2,.7,.2,1); }
#view[data-anim="in-prev"] { animation: in-prev .32s cubic-bezier(.2,.7,.2,1); }
@keyframes out-next { to { opacity: 0; transform: translateX(-28px); } }
@keyframes out-prev { to { opacity: 0; transform: translateX(28px); } }
@keyframes in-next { from { opacity: 0; transform: translateX(36px); } }
@keyframes in-prev { from { opacity: 0; transform: translateX(-36px); } }
.loading-bar { position: fixed; top: 0; left: 0; height: 3px; background: var(--accent); z-index: 60; width: 0; transition: width .4s ease, opacity .3s; }

.page { padding-block: 44px 56px; }
.page-head { margin-bottom: 32px; max-width: 46em; }
.page-head h1 { margin-bottom: 18px; }

/* ---------- Home ---------- */
.hero { display: grid; gap: 40px; align-items: center; padding-block: 40px 48px; min-height: calc(100svh - var(--header-h) - 150px); }
.hero h1 { margin: 0 0 22px; }
.hero .lede { font-size: 18px; margin-bottom: 30px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.art { aspect-ratio: 4/3; background: var(--sand); border-radius: 10px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 15px; margin-bottom: 18px; overflow: hidden; }
.art img { width: 100%; height: 100%; object-fit: cover; }
.episode-card h3 { margin: 0 0 8px; }
.episode-card .meta { margin: 0 0 16px; }

/* ---------- Lists ---------- */
.toolbar { display: flex; flex-direction: column; gap: 14px; margin-bottom: 26px; }
.search { font: inherit; padding: 12px 16px; border: 1px solid var(--ink); border-radius: 10px; background: var(--card); width: 100%; color: var(--ink); }
.search:focus { outline: 3px solid var(--accent); outline-offset: 2px; }
.tags { display: flex; flex-wrap: wrap; }
.tags .chip { font-size: 14px; padding: 6px 14px; }

.list { display: grid; gap: 0; border-top: 2px solid var(--ink); }
.row { display: grid; grid-template-columns: 84px 1fr; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--rule); color: var(--ink); align-items: start; }
.row:hover { text-decoration: none; }
.row:hover h3 { color: var(--accent); }
.row.no-art { grid-template-columns: 1fr; }
.row .thumb { aspect-ratio: 1; background: var(--sand); border-radius: 8px; overflow: hidden; display: grid; place-items: center; color: var(--muted); font: 600 22px var(--serif); }
.row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.row h3 { font-size: 22px; margin: 0 0 6px; transition: color .15s; }
.row p { margin: 0; font-size: 15px; }
.row .meta { font-size: 14px; color: var(--muted); margin-top: 6px; }

.empty { padding: 36px 24px; text-align: left; border: 1px dashed var(--rule); border-radius: 14px; background: var(--card); }
.empty h3 { margin-bottom: 8px; font-size: 24px; }
.empty p:last-child { margin: 0; }

/* ---------- Detail ---------- */
.back { display: inline-block; font-weight: 600; margin-bottom: 26px; }
.detail-head { max-width: 46em; margin-bottom: 30px; }
.detail-head h1 { margin-bottom: 16px; font-size: clamp(36px, 4vw + 16px, 60px); }
.player { margin: 0 0 36px; max-width: 760px; }
.player .frame { position: relative; aspect-ratio: 16/9; background: var(--ink); border-radius: 12px; overflow: hidden; }
.player .frame.spotify { aspect-ratio: auto; height: 232px; background: transparent; }
.player iframe { width: 100%; height: 100%; border: 0; }
.player audio { width: 100%; }
.facade { width: 100%; height: 100%; border: 0; cursor: pointer; background: var(--ink); color: var(--paper); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; font: 600 16px var(--sans); }
.facade img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.facade .play { position: relative; width: 72px; height: 72px; border-radius: 50%; background: var(--paper); display: grid; place-items: center; }
.facade .play::after { content: ''; border-left: 20px solid var(--ink); border-top: 12px solid transparent; border-bottom: 12px solid transparent; margin-left: 6px; }
.facade span { position: relative; }
.prose { max-width: 38em; font-family: var(--serif); font-size: 20px; line-height: 1.65; }
.prose h2, .prose h3, .prose h4 { margin: 1.4em 0 .5em; font-size: 28px; }
.prose h3 { font-size: 24px; }
.prose blockquote { margin: 1.2em 0; padding-left: 20px; border-left: 3px solid var(--accent); font-style: italic; color: var(--muted); }
.prose ul, .prose ol { padding-left: 1.2em; margin: 0 0 1em; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.item-tags { margin-top: 30px; }
.item-nav { display: grid; gap: 14px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--rule); }
.item-nav a { color: var(--ink); font-family: var(--serif); font-size: 20px; }
.item-nav small { display: block; font: 600 13px var(--sans); color: var(--muted); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; font-weight: 600; font-size: 15px; }
.field input, .field textarea, .field select {
  font: 400 16px var(--sans); padding: 13px 16px; border: 1px solid var(--ink); border-radius: 10px;
  background: var(--card); color: var(--ink); width: 100%; min-width: 0;
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: 3px solid var(--accent); outline-offset: 2px; }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-msg { min-height: 1.4em; margin: 4px 0 12px; font-size: 15px; font-weight: 500; }
.form-msg.err { color: var(--danger); }
.form-msg.ok { color: var(--accent); }
.inline-form { display: flex; gap: 12px; flex-wrap: wrap; }
.inline-form input { font: inherit; padding: 13px 16px; border: 1px solid var(--paper); border-radius: 10px; background: var(--paper); color: var(--ink); flex: 1 1 220px; min-width: 0; }

/* ---------- Newsletter band ---------- */
.band { background: var(--ink); color: var(--paper); border-radius: 0; }
.band .inner { padding: 56px var(--gutter); display: grid; gap: 32px; max-width: 1120px; margin: 0 auto; }
.band .eyebrow { color: var(--mint); }
.band h2 { margin-bottom: 14px; }
.band p { color: var(--rule); }
.band label { font-weight: 600; display: block; margin-bottom: 10px; }
.band .btn { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.band .form-msg.err { color: #F2B8A8; }
.band .form-msg.ok { color: var(--mint); }
.band :focus-visible, .band input:focus { outline-color: var(--mint); }

/* ---------- About / Digital ---------- */
.grid4 { display: grid; gap: 18px; }
.form-card { color: var(--ink); display: flex; flex-direction: column; }
.form-card:hover { text-decoration: none; border-color: var(--ink); }
.form-card h3 { font-size: 26px; margin: 0 0 10px; }
.form-card p { font-size: 16px; flex: 1; }
.form-card .count { font-size: 14px; color: var(--muted); margin: 0 0 12px; }
.split { display: grid; gap: 28px; }
.steps { display: grid; border-top: 2px solid var(--ink); margin-top: 8px; counter-reset: step; }
.step { padding: 20px 0; border-bottom: 1px solid var(--rule); }
.step .eyebrow { margin-bottom: 6px; }
.step h3 { font-size: 24px; margin-bottom: 6px; }
.step p { margin: 0; font-size: 16px; }
.section { padding-block: 48px; }
.section + .section { border-top: 1px solid var(--rule); }

/* ---------- Pager (replaces scrolling between sections) ---------- */
.pager { border-top: 1px solid var(--rule); }
.pager .wrap { display: grid; gap: 18px; padding-top: 28px; padding-bottom: 32px; }
.pager .count { flex-wrap: wrap; font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .08em; display: flex; align-items: center; gap: 12px; }
.pager .dots { display: flex; gap: 6px; }
.pager .dots a { width: 22px; height: 4px; border-radius: 2px; background: var(--rule); }
.pager .dots a[aria-current="page"] { background: var(--ink); }
.pager .dots a:hover { background: var(--accent); }
.pager .next { color: var(--ink); display: block; }
.pager .next:hover { text-decoration: none; }
.pager .next small { display: block; font: 600 14px var(--sans); color: var(--accent); margin-bottom: 4px; }
.pager .next strong { font: 600 clamp(44px, 7vw + 10px, 96px)/1 var(--serif); letter-spacing: -0.02em; display: inline-flex; align-items: baseline; gap: .25em; transition: color .2s; }
.pager .next strong::after { content: '→'; font-size: .6em; transition: transform .25s cubic-bezier(.2,.7,.2,1); }
.pager .next:hover strong { color: var(--accent); }
.pager .next:hover strong::after { transform: translateX(10px); }
.pager .prev { font-weight: 600; color: var(--muted); font-size: 15px; }
.swipe-hint { font-size: 12px; color: var(--muted); letter-spacing: 0; font-weight: 500; flex-basis: 100%; }

/* ---------- Footer ---------- */
.site-footer { padding-top: 40px; padding-bottom: 40px; display: flex; flex-direction: column; gap: 22px; font-size: 15px; }
.footer-logo { font-family: var(--serif); font-size: 24px; font-weight: 600; margin: 0 0 6px; }
.site-footer p { margin: 0; }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-links a { color: var(--ink); }
.legal { width: 100%; font-size: 14px; user-select: none; -webkit-user-select: none; }

/* The hidden sign-in trigger: looks and behaves exactly like the text around it. */
.sx-mark {
  cursor: inherit;
  color: inherit;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  touch-action: manipulation;
}
.sx-mark:focus, .sx-mark:active { outline: none; background: none; }

/* ---------- Login dialog ---------- */
.login { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; }
.login[hidden] { display: none; }
.login-backdrop { position: absolute; inset: 0; background: rgba(27, 26, 23, .55); animation: fade .2s ease; }
.login-card { position: relative; width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--rule); border-radius: 18px; padding: 30px 24px 24px; box-shadow: 0 24px 60px rgba(27,26,23,.25); animation: pop .26s cubic-bezier(.2,.7,.2,1); }
.login-logo { font: 600 22px var(--serif); margin: 0 0 18px; }
.login-card h2 { font-size: 30px; margin-bottom: 6px; }
.login-sub { margin: 0 0 22px; font-size: 15px; }
.login-x { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border: 0; background: transparent; font-size: 28px; line-height: 1; cursor: pointer; border-radius: 10px; color: var(--ink); }
.login-x:hover { background: var(--sand); }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 70px; }
.pw-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: var(--sand); border-radius: 8px; padding: 6px 10px; font: 600 13px var(--sans); cursor: pointer; color: var(--ink); }
#login-reset { display: block; margin: 16px auto 0; font-size: 14px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 12px 20px; border-radius: 999px; font-size: 15px; z-index: 90; box-shadow: 0 10px 30px rgba(0,0,0,.2); animation: pop .2s ease; max-width: calc(100vw - 32px); }
.toast.err { background: var(--danger); }

/* ---------- Larger screens ---------- */
@media (min-width: 640px) {
  :root { --gutter: 32px; }
  .toolbar { flex-direction: row; align-items: center; justify-content: space-between; }
  .search { max-width: 340px; }
  .row { grid-template-columns: 120px 1fr; gap: 22px; }
  .grid4 { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); column-gap: 24px; }
  .item-nav { grid-template-columns: 1fr 1fr; }
  .item-nav .older { text-align: right; grid-column: 2; }
  .login-card { padding: 36px 32px 28px; }
}

@media (min-width: 900px) {
  :root { --header-h: 84px; }
  body { font-size: 17px; }
  .logo { font-size: 28px; }
  .nav-links { display: flex; }
  .menu-btn, .mobile-menu { display: none !important; }
  .page { padding-block: 72px 80px; }
  .hero { grid-template-columns: 1.25fr 1fr; gap: 56px; padding-block: 64px 72px; min-height: calc(100vh - var(--header-h) - 180px); }
  .hero .lede { font-size: 20px; margin-bottom: 36px; }
  .card { padding: 28px; }
  .grid4 { grid-template-columns: repeat(4, 1fr); gap: 24px; }
  .split { grid-template-columns: 1fr 1.4fr; gap: 64px; }
  .steps { grid-template-columns: repeat(4, 1fr); }
  .step { padding: 24px 24px 0 0; border-bottom: 0; }
  .section { padding-block: 80px; }
  .band .inner { grid-template-columns: 1fr 1fr; gap: 56px; align-items: end; padding: 88px 32px; }
  .row h3 { font-size: 26px; }
  .site-footer { flex-direction: row; justify-content: space-between; flex-wrap: wrap; gap: 24px; padding-top: 48px; padding-bottom: 48px; }
  .pager .wrap { grid-template-columns: 1fr auto; align-items: end; padding-top: 36px; padding-bottom: 40px; }
  .pager .count { grid-column: 1 / -1; }
  .pager .prev { justify-self: end; }
  .swipe-hint { display: none; }
}

@media (hover: none) {
  .pager .next strong::after { transform: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
