/* ==========================================================================
   kalnotes · Commentarii Hebdomadales
   One painting (Thomas Cole, The Course of Empire: Destruction, 1836) used as
   the hero and cut into details, letters written on parchment, royal blue,
   Cinzel + Cormorant Garamond + Inter.
   ========================================================================== */

:root {
  --sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --caps: 'Cinzel', 'Times New Roman', serif;

  --bg: #ffffff;
  --bone: #f5f1e8;
  --line: #e3ddcf;
  --line-strong: #cbc2ad;

  --ink: #0d1330;
  --ink-2: #333a57;
  --muted: #666b80;

  /* Royal blue (#111E67) and its family */
  --royal: #111e67;
  --royal-deep: #0b1447;
  --royal-night: #070d33;
  --royal-mid: #4c5aa6;
  --royal-soft: #e1e5f7;

  /* Parchment */
  --parchment: #f1e2c4;
  --parchment-ink: #2b2115;
  --parchment-2: #5c4931;
  --sepia: #7b4f25;
  --parchment-line: rgba(92, 66, 34, .24);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .42 0 0 0 0 .29 0 0 0 0 .15 .34 0 0 0 -.1'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");

  /* Torn-paper edges for the parchment: repeating tiles used as masks */
  --edge-left: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='200' viewBox='0 0 14 200' preserveAspectRatio='none'%3E%3Cpath d='M14 0 L7 0 L11.6 5 L8.8 10 L7.6 15 L8.5 20 L6.6 25 L5.2 30 L7 35 L7.4 40 L6.7 45 L7.1 50 L6.2 55 L6.2 60 L3.5 65 L4.5 70 L7 75 L8.3 80 L6.8 85 L9.9 90 L8.8 95 L10.1 100 L9.1 105 L6.1 110 L8.1 115 L10.2 120 L9.3 125 L8.5 130 L7.1 135 L7.2 140 L6.2 145 L3.7 150 L4.1 155 L7.2 160 L5.9 165 L5.6 170 L6.1 175 L6.3 180 L5.7 185 L8.9 190 L8.3 195 L7 200 L14 200Z' fill='%23000'/%3E%3C/svg%3E");
  --edge-right: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='200' viewBox='0 0 14 200' preserveAspectRatio='none'%3E%3Cpath d='M0 0 L7 0 L6 5 L5.3 10 L4.9 15 L6.4 20 L7.9 25 L9.4 30 L6.3 35 L9.6 40 L8 45 L8.4 50 L7.7 55 L7.3 60 L9.4 65 L10.4 70 L8.3 75 L7.4 80 L5.9 85 L5.2 90 L5.8 95 L5.6 100 L5.7 105 L7.4 110 L4.3 115 L5.8 120 L4 125 L5.5 130 L6.7 135 L8.5 140 L9.5 145 L9 150 L7.4 155 L8.7 160 L6.5 165 L8 170 L6.7 175 L8 180 L8.1 185 L7.3 190 L4.7 195 L7 200 L0 200Z' fill='%23000'/%3E%3C/svg%3E");
  --edge-top: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='14' viewBox='0 0 200 14' preserveAspectRatio='none'%3E%3Cpath d='M0 14 L0 7 L5 11.2 L10 7.9 L15 8.4 L20 6.1 L25 4.7 L30 8 L35 4.8 L40 6.9 L45 5 L50 6.1 L55 6 L60 3.4 L65 6.3 L70 6.6 L75 7.7 L80 9.1 L85 10.4 L90 10.2 L95 8 L100 6.3 L105 6.7 L110 5.9 L115 5.9 L120 8.9 L125 7.4 L130 8.9 L135 6.7 L140 6.2 L145 3.4 L150 5.9 L155 3.7 L160 5.2 L165 8.3 L170 5.4 L175 6.9 L180 4.6 L185 8.3 L190 7.7 L195 9.9 L200 7 L200 14Z' fill='%23000'/%3E%3C/svg%3E");
  --edge-bottom: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='14' viewBox='0 0 200 14' preserveAspectRatio='none'%3E%3Cpath d='M0 0 L0 7 L5 5.5 L10 2.3 L15 4.9 L20 5.7 L25 8.5 L30 9.3 L35 9.3 L40 7.4 L45 9.4 L50 6.6 L55 7.5 L60 8.2 L65 9.4 L70 11 L75 9.5 L80 4.7 L85 6.9 L90 4.1 L95 3.4 L100 7.6 L105 4.6 L110 4.8 L115 3.9 L120 3.7 L125 4.4 L130 6.4 L135 8.3 L140 7.6 L145 7.9 L150 10.2 L155 10.3 L160 8.7 L165 5.8 L170 6.7 L175 7.7 L180 6.8 L185 6.4 L190 7.6 L195 5 L200 7 L200 0Z' fill='%23000'/%3E%3C/svg%3E");

  --danger: #b42318;
  --radius: 3px;
  --pill: 999px;
  --header-h: 72px;
  --wrap: 1120px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body.no-scroll { overflow: hidden; }

h1, h2, h3, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
svg { display: block; }

:focus-visible { outline: 2px solid var(--royal-mid); outline-offset: 3px; }
.site-header :focus-visible, .on-dark :focus-visible, .hero :focus-visible,
.banner :focus-visible, .cta-band :focus-visible, .site-footer :focus-visible { outline-color: #fff; }
main:focus { outline: none; }

.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;
}
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.muted { color: var(--muted); }

.skip-link {
  position: fixed; left: 16px; top: -60px; z-index: 300;
  padding: 10px 16px; background: #fff; color: var(--royal);
  border-radius: var(--radius); font-size: 14px; font-weight: 600;
  box-shadow: 0 8px 24px -8px rgba(0, 0, 0, .4);
  transition: top .15s;
}
.skip-link:focus { top: 12px; }

main { flex: 1; display: flex; flex-direction: column; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 880px; }

/* Shared type */
.eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 11.5px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase;
  color: var(--royal-mid);
}
.eyebrow::before { content: ''; width: 24px; height: 1px; background: currentColor; }
.eyebrow.on-dark { color: rgba(255, 255, 255, .82); }

.kicker {
  font-size: 11.5px; font-weight: 500; letter-spacing: .15em; text-transform: uppercase;
  color: var(--sepia);
}
.numeral { font-family: var(--caps); letter-spacing: .06em; }

.plate {
  position: absolute; z-index: 1;
  right: max(24px, calc((100% - var(--wrap)) / 2 + 24px)); bottom: 18px;
  max-width: 46%;
  font-size: 11px; letter-spacing: .06em; text-align: right;
  color: rgba(255, 255, 255, .62);
}

/* ---------- Buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 22px;
  border: 1px solid transparent; border-radius: var(--pill);
  font-size: 14px; font-weight: 500; letter-spacing: .02em; line-height: 1; white-space: nowrap;
  cursor: pointer; position: relative;
  transition: background-color .2s, border-color .2s, color .2s, transform .15s;
}
.btn svg { width: 16px; height: 16px; }
.btn:active { transform: translateY(1px); }
.btn-sm { height: 38px; padding: 0 16px; font-size: 13.5px; }
.btn-xs { height: 36px; padding: 0 14px; font-size: 13px; }
.btn-lg { height: 50px; padding: 0 28px; font-size: 14.5px; }
.btn-block { width: 100%; }

.btn-primary { background: var(--royal); color: #fff; }
.btn-primary:hover { background: var(--royal-deep); }

.btn-outline { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-outline:hover { border-color: var(--royal); color: var(--royal); }

.btn-light { background: #fff; color: var(--royal); }
.btn-light:hover { background: var(--royal-soft); }

.btn-outline-light { background: transparent; border-color: rgba(255, 255, 255, .55); color: #fff; }
.btn-outline-light:hover { background: #fff; border-color: #fff; color: var(--royal); }

.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--ink); background: var(--bone); }

.btn-danger-outline { background: #fff; border-color: var(--line-strong); color: var(--danger); }
.btn-danger-outline:hover { background: #fef3f2; border-color: #f4b8b2; }

.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: ''; position: absolute; width: 16px; height: 16px;
  border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff;
  border-radius: 50%; animation: spin .7s linear infinite;
}
.btn-light.is-loading::after, .btn-outline.is-loading::after, .btn-danger-outline.is-loading::after {
  border-color: rgba(17, 30, 103, .2); border-top-color: var(--royal);
}

.link-btn {
  padding: 0; border: 0; background: none; cursor: pointer;
  font-size: 14px; color: var(--muted);
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong);
}
.link-btn:hover { color: var(--ink); text-decoration-color: currentColor; }

.icon-btn {
  display: inline-grid; place-items: center; flex: none;
  width: 38px; height: 38px; padding: 0;
  border: 0; border-radius: 50%; background: transparent;
  color: var(--muted); cursor: pointer;
  transition: background-color .15s, color .15s;
}
.icon-btn:hover { background: var(--bone); color: var(--ink); }
.icon-btn svg { width: 19px; height: 19px; }

.input {
  width: 100%; height: 46px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: #fff; color: var(--ink);
  font: inherit; font-size: 15px;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.input::placeholder { color: #9a9eae; }
.input:hover { border-color: #b4aa92; }
.input:focus { outline: none; border-color: var(--royal); box-shadow: 0 0 0 4px rgba(17, 30, 103, .12); }
.input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(180, 35, 24, .08); }

.subscribe { display: flex; gap: 8px; max-width: 460px; }
.subscribe .input { flex: 1; min-width: 0; height: 50px; padding: 0 18px; border-radius: var(--pill); }
.subscribe .btn { height: 50px; padding: 0 26px; font-size: 14.5px; }

.subscribe.on-dark .input {
  background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .45); color: #fff;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.subscribe.on-dark .input::placeholder { color: rgba(255, 255, 255, .7); }
.subscribe.on-dark .input:hover { border-color: rgba(255, 255, 255, .7); }
.subscribe.on-dark .input:focus { border-color: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, .16); }
.subscribe.on-dark .input[aria-invalid="true"] { border-color: #ff9b91; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  color: #f3f5fb;
  background: var(--royal);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .08);
  transition: background-color .3s, box-shadow .3s;
}
body.has-hero .site-header { position: fixed; left: 0; right: 0; }
body.has-hero .site-header:not(.is-solid):not(.menu-open) {
  background: linear-gradient(180deg, rgba(7, 13, 51, .6), rgba(7, 13, 51, 0));
  box-shadow: none;
}
.site-header.is-solid { box-shadow: 0 1px 0 rgba(255, 255, 255, .08), 0 12px 32px -20px rgba(0, 0, 0, .55); }

.header-inner {
  max-width: var(--wrap); height: var(--header-h); margin: 0 auto; padding: 0 24px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
}

/* Logo: the blog name in Cinzel, with the newsletter's name under it */
.brand { justify-self: start; display: inline-flex; flex-direction: column; line-height: 1; color: inherit; }
.brand-name { font-family: var(--caps); font-size: 22px; font-weight: 500; letter-spacing: .16em; }
.brand-sub { margin-top: 6px; font-family: var(--caps); font-size: 8.5px; letter-spacing: .24em; text-transform: uppercase; white-space: nowrap; opacity: .72; }

.nav-center { display: flex; align-items: center; gap: 32px; }
.nav-link, .nav-login {
  position: relative; padding: 6px 0;
  font-family: var(--caps); font-size: 13px; font-weight: 500; letter-spacing: .1em;
  color: rgba(243, 245, 251, .8);
  transition: color .15s;
}
.nav-link:hover, .nav-login:hover { color: #fff; }
.nav-link.is-active, .nav-login.is-active { color: #fff; }
.nav-link.is-active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor;
}
.nav-actions { justify-self: end; display: flex; align-items: center; gap: 8px; }
.nav-login { margin: 0 8px 0 4px; }

.site-header .icon-btn { color: rgba(243, 245, 251, .85); }
.site-header .icon-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }

.profile-btn { padding-left: 6px; gap: 8px; }
.avatar-xs {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: #fff; color: var(--royal);
  font-size: 12px; font-weight: 700;
  transition: background-color .2s, color .2s;
}
.profile-btn:hover .avatar-xs, .profile-btn.is-active .avatar-xs { background: var(--royal); color: #fff; }
.profile-btn.is-active { background: #fff; color: var(--royal); border-color: #fff; }

.menu-btn { display: none; }
.mobile-menu {
  display: grid; padding: 4px 24px 16px;
  background: var(--royal); border-top: 1px solid rgba(255, 255, 255, .12);
}
.mobile-menu a {
  padding: 14px 2px;
  font-family: var(--caps); font-size: 14px; letter-spacing: .1em;
  color: rgba(255, 255, 255, .85);
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.mobile-menu a:last-child { border-bottom: 0; }
.mobile-menu a.is-active { color: #fff; }

/* ---------- Page shell ---------- */
.page { position: relative; flex: 1; display: flex; flex-direction: column; }
.page.enter { animation: fade .45s ease-out both; }
.page-canvas { background: var(--bone); }

/* ---------- The painting & its details ---------- */
.detail {
  background-color: #1d2347;
  background-image: url('../assets/empire.jpg');
  background-repeat: no-repeat;
  background-size: calc(var(--z, 250%) * var(--zs, 1)) auto;
  background-position: var(--p, 50% 50%);
}
.detail.is-cover { background-size: cover; }
.detail[data-d="colossus"] { --p: 92% 6%;  --z: 200%; }
.detail[data-d="fire"]     { --p: 64% 30%; --z: 300%; }
.detail[data-d="bridge"]   { --p: 44% 72%; --z: 250%; }
.detail[data-d="flight"]   { --p: 47% 90%; --z: 360%; }
.detail[data-d="storm"]    { --p: 26% 8%;  --z: 220%; }
.detail[data-d="temple"]   { --p: 1% 44%;  --z: 330%; }
.detail[data-d="harbor"]   { --p: 47% 52%; --z: 320%; }
.detail[data-d="fleet"]    { --p: 1% 92%;  --z: 300%; }

.fill { position: absolute; inset: 0; width: 100%; height: 100%; }
img.fill { object-fit: cover; }

/* ---------- Parchment ---------- */
.parchment {
  position: relative; isolation: isolate; color: var(--parchment-ink);
  /* Torn top and bottom edges (content sits well inside, so it is never cut) */
  -webkit-mask:
    var(--edge-top) left top / 200px 14px repeat-x,
    var(--edge-bottom) left bottom / 200px 14px repeat-x,
    linear-gradient(#000 0 0) center / 100% calc(100% - 26px) no-repeat;
  mask:
    var(--edge-top) left top / 200px 14px repeat-x,
    var(--edge-bottom) left bottom / 200px 14px repeat-x,
    linear-gradient(#000 0 0) center / 100% calc(100% - 26px) no-repeat;
}
.parchment::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background-color: var(--parchment);
  background-image:
    var(--grain),
    radial-gradient(110% 70% at 50% 0%, rgba(255, 249, 232, .6), transparent 62%),
    radial-gradient(80% 50% at 85% 100%, rgba(150, 98, 40, .16), transparent 70%),
    radial-gradient(60% 40% at 0% 60%, rgba(150, 98, 40, .1), transparent 70%);
  box-shadow:
    inset 0 0 0 1px rgba(120, 80, 35, .14),
    inset 0 0 56px rgba(132, 86, 34, .3),
    inset 0 0 12px rgba(110, 70, 28, .34);
  /* Torn left and right edges (the top and bottom are torn by .parchment itself,
     so the two masks overlap into natural corners). Standard CSS masks: work in
     Chrome, Safari (incl. iPhone) and Firefox, on letters of any length. */
  -webkit-mask:
    var(--edge-left) left top / 14px 200px repeat-y,
    var(--edge-right) right top / 14px 200px repeat-y,
    linear-gradient(#000 0 0) center / calc(100% - 26px) 100% no-repeat;
  mask:
    var(--edge-left) left top / 14px 200px repeat-y,
    var(--edge-right) right top / 14px 200px repeat-y,
    linear-gradient(#000 0 0) center / calc(100% - 26px) 100% no-repeat;
  pointer-events: none;
}

/* Wax seal (assets/seal.png): tilted a little, with a warm shadow so it
   looks pressed onto the paper */
.seal {
  flex: none; display: block;
  width: 48px; height: 48px; object-fit: contain;
  transform: rotate(-9deg);
  filter: drop-shadow(0 1px 1px rgba(45, 28, 10, .45)) drop-shadow(0 4px 6px rgba(45, 28, 10, .22));
}
.seal-lg { width: 76px; height: 76px; transform: rotate(-6deg); }

/* ---------- Home: hero ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; align-items: flex-end;
  min-height: clamp(580px, 88vh, 860px);
  padding: calc(var(--header-h) + 72px) 0 76px;
  color: #fff; background: var(--royal-night);
}
.hero-art {
  position: absolute; inset: -2%; z-index: -2;
  background: url('../assets/empire.jpg') 62% 40% / cover no-repeat;
  animation: drift 32s ease-in-out infinite alternate;
}
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(8, 14, 56, .9) 0%, rgba(8, 14, 56, .66) 36%, rgba(8, 14, 56, .2) 68%, rgba(8, 14, 56, .04) 100%),
    linear-gradient(0deg, rgba(7, 13, 51, .78) 0%, rgba(7, 13, 51, 0) 42%);
}
.hero::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: var(--royal); mix-blend-mode: color; opacity: .3; pointer-events: none;
}
.hero-inner { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.hero-copy { max-width: 620px; }
.hero-title {
  margin-top: 20px;
  font-family: var(--display); font-weight: 500;
  font-size: clamp(46px, 6.4vw, 80px); line-height: .98; letter-spacing: -.01em;
  text-wrap: balance;
}
.hero-tagline { max-width: 480px; margin-top: 20px; font-size: 18px; line-height: 1.6; color: rgba(255, 255, 255, .86); }
.hero .subscribe { margin-top: 32px; }
.hero-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 18px;
  font-size: 13px; color: rgba(255, 255, 255, .72);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.social-row { display: flex; gap: 8px; }
.social-btn {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .35); color: rgba(255, 255, 255, .9);
  transition: background-color .2s, color .2s, border-color .2s;
}
.social-btn svg { width: 16px; height: 16px; }
.social-btn:hover { background: #fff; border-color: #fff; color: var(--royal); }

/* ---------- Sections ---------- */
.section { padding: clamp(72px, 9vw, 128px) 0; }
.section-tight { padding: clamp(48px, 6vw, 80px) 0 clamp(72px, 8vw, 112px); }
.section-bone { background: var(--bone); }

.section-intro {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: end;
  gap: 20px 56px; margin-bottom: 48px;
}
.section-intro h2 {
  margin-top: 14px;
  font-family: var(--display); font-weight: 500;
  font-size: clamp(38px, 4.6vw, 56px); line-height: 1.02; letter-spacing: -.005em;
}
.section-intro > p { max-width: 420px; font-size: 16px; line-height: 1.65; color: var(--ink-2); }

/* Inside each letter: rotating parts */
.parts-grid { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 56px; align-items: start; }
.parts-list { display: grid; border-top: 1px solid var(--line-strong); }
.part-tab {
  display: flex; align-items: baseline; gap: 16px; width: 100%;
  padding: 18px 0; border: 0; border-bottom: 1px solid var(--line-strong); background: none;
  font-family: var(--display); font-size: 24px; font-weight: 500; line-height: 1.2; text-align: left;
  color: #8a8a96; cursor: pointer;
  transition: color .2s;
}
.part-tab .numeral { width: 26px; flex: none; font-size: 11.5px; color: var(--royal-mid); }
.part-tab:hover, .part-tab.is-active { color: var(--ink); }
.part-tab.is-active .numeral { color: var(--royal); }

.part-card {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  min-height: 360px;
  background: #fff;
  box-shadow: 0 30px 60px -30px rgba(13, 19, 48, .35), 0 0 0 1px rgba(13, 19, 48, .05);
}
.part-body { display: flex; flex-direction: column; padding: 36px 38px 28px; }
.part-count { font-family: var(--caps); font-size: 12px; letter-spacing: .1em; color: var(--royal-mid); }
.part-content h3 {
  margin-top: 14px;
  font-family: var(--display); font-weight: 500; font-size: 34px; line-height: 1.08;
}
.part-content p:last-child { margin-top: 14px; font-size: 15.5px; line-height: 1.7; color: var(--ink-2); }
.part-progress { display: flex; align-items: center; gap: 18px; margin-top: auto; padding-top: 32px; }
.part-bar { position: relative; flex: 1; height: 2px; overflow: hidden; background: var(--line); }
.part-bar i { position: absolute; inset: 0; background: var(--royal); transform: scaleX(0); transform-origin: left; }
.part-card.is-running .part-bar i { animation: fill-bar 7s linear forwards; }
.part-card.is-paused .part-bar i, .part-card.is-running:hover .part-bar i { animation-play-state: paused; }
.part-pause {
  padding: 4px 0; border: 0; background: none; cursor: pointer;
  font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--royal-mid);
}
.part-pause:hover { color: var(--royal); }
.part-media { position: relative; min-height: 280px; overflow: hidden; background: #1d2347; }
.part-media figcaption {
  position: absolute; left: 14px; bottom: 12px;
  font-size: 11px; letter-spacing: .08em; color: rgba(255, 255, 255, .9);
  text-shadow: 0 1px 8px rgba(0, 0, 0, .7);
}
.part-card.swap .part-content { animation: rise .5s ease-out both; }
.part-card.swap .part-media .fill { animation: settle .9s cubic-bezier(.2, .7, .2, 1) both; }

/* Letters list */
.letter-list { border-top: 1px solid var(--line-strong); }
.letter-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 176px; gap: 32px; align-items: center;
  padding: 26px 0; border-bottom: 1px solid var(--line);
}
.letter-row.is-new { animation: rise .4s ease-out both; }
.letter-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0 10px;
  font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.letter-meta > * + *::before { content: '·'; margin-right: 10px; color: var(--line-strong); }
.letter-meta .numeral { font-size: 12.5px; color: var(--royal-mid); letter-spacing: .08em; }
.letter-title {
  margin-top: 8px;
  font-family: var(--display); font-weight: 500; font-size: 29px; line-height: 1.12;
  color: var(--ink); transition: color .2s;
}
.letter-sub-line { margin-top: 8px; font-size: 15px; line-height: 1.6; color: var(--ink-2); }
.letter-thumb { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #1d2347; }
.letter-thumb .fill { transition: transform .7s cubic-bezier(.2, .7, .2, 1); }
.letter-row:hover .letter-title { color: var(--royal); }
.letter-row:hover .letter-thumb .fill { transform: scale(1.06); }

.year-head {
  display: flex; align-items: center; gap: 16px;
  padding: 28px 0 6px;
  font-family: var(--caps); font-size: 13px; letter-spacing: .14em; color: var(--royal-mid);
}
.year-head::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.letter-list:has(> .year-head:first-child) { border-top: 0; }
.letter-list > .year-head:first-child { padding-top: 0; }

/* Featured latest letter */
.feature {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: center;
  margin-bottom: 48px;
}
.feature-media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #1d2347; }
.feature-media .fill { transition: transform .8s cubic-bezier(.2, .7, .2, 1); }
.feature:hover .feature-media .fill { transform: scale(1.04); }
.feature-body { z-index: 1; margin-left: -72px; padding: 44px 44px 40px; }
.feature-title {
  margin-top: 12px;
  font-family: var(--display); font-weight: 600; font-size: clamp(30px, 3.2vw, 40px); line-height: 1.06;
  color: #22190f;
}
.feature-sub { margin-top: 12px; font-size: 16px; line-height: 1.6; color: var(--parchment-2); }
.feature-meta { margin-top: 16px; font-size: 13px; color: var(--parchment-2); }
.read-link {
  display: inline-flex; gap: 8px; margin-top: 22px;
  font-size: 12px; font-weight: 600; letter-spacing: .15em; text-transform: uppercase; color: var(--royal);
}
.feature:hover .read-link { text-decoration: underline; text-underline-offset: 4px; }

.empty-letter { max-width: 600px; margin: 0 auto; padding: 52px 40px 48px; text-align: center; }
.empty-letter .seal { margin: 0 auto 20px; }
.empty-letter-title {
  margin-top: 10px;
  font-family: var(--display); font-weight: 600; font-size: 34px; line-height: 1.1; color: #22190f;
}
.empty-letter p:last-child { max-width: 380px; margin: 10px auto 0; font-size: 15.5px; color: var(--parchment-2); }

.feed-cta { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 48px; }
.end-note { font-size: 14px; color: var(--muted); }

/* Closing band */
.cta-band {
  position: relative; isolation: isolate; overflow: hidden;
  padding: clamp(88px, 11vw, 140px) 0; text-align: center;
  color: #fff; background: var(--royal-night);
}
.cta-band > .detail { z-index: -2; }
.cta-band::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(70% 90% at 50% 50%, rgba(8, 14, 56, .7), rgba(7, 13, 51, .9));
}
.cta-band h2 {
  margin-top: 16px;
  font-family: var(--display); font-weight: 500; font-size: clamp(38px, 5vw, 60px); line-height: 1.02;
}
.cta-band p.cta-text { max-width: 460px; margin: 16px auto 0; font-size: 17px; color: rgba(255, 255, 255, .84); }
.cta-band .subscribe { margin: 32px auto 0; }

/* ---------- Banner (archive, profile) ---------- */
.banner {
  position: relative; isolation: isolate; overflow: hidden;
  padding: calc(clamp(72px, 9vw, 112px)) 0 clamp(48px, 6vw, 72px);
  color: #fff; background: var(--royal-night);
}
.banner > .detail, .banner > .banner-img { z-index: -2; }
.banner-img { object-position: 50% 40%; }
/* Warm, golden pictures (Archive: Mount Etna from Taormina): keep the text readable
   without tinting the picture blue */
.banner-warm::before {
  background:
    linear-gradient(90deg, rgba(8, 14, 56, .82) 0%, rgba(8, 14, 56, .45) 42%, rgba(8, 14, 56, 0) 75%),
    linear-gradient(0deg, rgba(7, 13, 51, .45), rgba(7, 13, 51, 0) 45%);
}
.banner-warm::after { display: none; }
.banner::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(8, 14, 56, .9), rgba(8, 14, 56, .55) 55%, rgba(8, 14, 56, .3)),
    linear-gradient(0deg, rgba(7, 13, 51, .6), rgba(7, 13, 51, 0) 60%);
}
.banner::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: var(--royal); mix-blend-mode: color; opacity: .3; pointer-events: none;
}
.banner h1 {
  margin-top: 16px;
  font-family: var(--display); font-weight: 500; font-size: clamp(46px, 6vw, 72px); line-height: 1;
}
.banner .wrap > p:last-child { max-width: 520px; margin-top: 14px; font-size: 17px; line-height: 1.6; color: rgba(255, 255, 255, .85); }
.banner-sm { padding: clamp(56px, 7vw, 80px) 0 clamp(36px, 5vw, 52px); }
.banner-sm h1 { font-size: clamp(40px, 5vw, 56px); }
.banner-sm .wrap { max-width: 848px; }

/* ---------- Letter reader (single post) ---------- */
.reader {
  display: grid; grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  min-height: calc(100vh - var(--header-h));
}
.reader-index { position: relative; background: #fff; border-right: 1px solid var(--line); }
.reader-index-stick {
  position: sticky; top: var(--header-h);
  max-height: calc(100vh - var(--header-h)); overflow: auto;
  padding: 26px 18px 36px;
}
.index-toggle { display: none; }
.index-label { margin-bottom: 8px; font-size: 11px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--royal-mid); }
.index-year + .index-year { margin-top: 18px; }
.index-year summary {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 0 8px; border-bottom: 1px solid var(--line);
  font-size: 12px; font-weight: 600; letter-spacing: .14em; color: var(--royal-mid);
  list-style: none; cursor: pointer;
}
.index-year summary::-webkit-details-marker { display: none; }
.index-year summary::after {
  content: ''; width: 6px; height: 6px; margin-right: 4px;
  border-right: 1.5px solid; border-bottom: 1.5px solid;
  transform: rotate(45deg) translateY(-2px); transition: transform .2s;
}
.index-year[open] summary::after { transform: rotate(-135deg) translateY(-1px); }
.index-year ul { list-style: none; margin: 6px 0 0; padding: 0; }
.index-year a {
  display: block; padding: 9px 10px 9px 12px; border-left: 2px solid transparent;
  transition: background-color .15s;
}
.index-year a:hover { background: var(--bone); }
.index-year a span { display: block; font-size: 12px; letter-spacing: .03em; color: var(--muted); }
.index-year a strong { display: block; margin-top: 1px; font-family: var(--display); font-size: 18.5px; font-weight: 500; line-height: 1.2; color: var(--ink); }
.index-year a.is-current { border-left-color: var(--royal); background: var(--royal-soft); }

.reader-stage {
  min-width: 0;
  padding: clamp(18px, 3.5vw, 48px) clamp(12px, 3.5vw, 52px) clamp(48px, 6vw, 80px);
  background:
    radial-gradient(90% 60% at 50% 0%, rgba(17, 30, 103, .55), transparent 70%),
    var(--royal-night);
}
.letter { width: min(100%, 780px); margin: 0 auto; padding: clamp(30px, 5.5vw, 68px) clamp(22px, 6vw, 76px) clamp(36px, 5vw, 60px); }

.breadcrumb {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  font-size: 13px; color: var(--parchment-2);
}
.breadcrumb a { flex: none; transition: color .15s; }
.breadcrumb a:hover { color: var(--royal); }
.breadcrumb-current { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; opacity: .8; }

.letter-kicker { margin-top: 30px; }
.letter h1 {
  margin-top: 12px;
  font-family: var(--display); font-weight: 600;
  font-size: clamp(36px, 5.4vw, 54px); line-height: 1.02; letter-spacing: -.005em;
  color: #22190f; text-wrap: balance;
}
.letter-sub { margin-top: 16px; font-size: 19px; line-height: 1.5; color: var(--parchment-2); }
.byline {
  display: flex; align-items: center; gap: 12px;
  margin-top: 26px; padding-bottom: 28px; border-bottom: 1px solid var(--parchment-line);
  font-size: 14px;
}
.byline-text { display: flex; flex-direction: column; line-height: 1.35; color: var(--parchment-2); }
.byline-name { font-weight: 600; color: var(--parchment-ink); }

.letter-figure { margin-top: 26px; }
.letter-figure-art {
  position: relative; aspect-ratio: 16 / 7; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(92, 66, 34, .3);
}
.letter-figure-art .detail { --zs: .62; mix-blend-mode: multiply; filter: sepia(.25) contrast(1.06); }
.letter-figure img {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover;
  box-shadow: 0 0 0 1px rgba(92, 66, 34, .3);
}
.letter-figure figcaption { margin-top: 8px; font-size: 12px; font-style: italic; color: var(--parchment-2); }
.letter .prose { margin-top: 34px; }

/* Letter text */
.prose { font-size: 17.5px; line-height: 1.78; color: var(--parchment-ink); }
.prose p { margin: 0 0 1.2em; }
.prose h2, .prose h3 {
  margin: 1.8em 0 .55em;
  font-family: var(--display); font-weight: 600; line-height: 1.15; color: #22190f;
}
.prose h2 { font-size: 34px; }
.prose h3 { font-size: 30px; }
.prose h4 { margin: 1.6em 0 .5em; font-size: 18px; font-weight: 700; }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.3em; }
.prose li { margin: .45em 0; padding-left: .2em; }
.prose li::marker { color: var(--sepia); }
.prose strong { color: #1d150c; font-weight: 650; }
.prose em { font-style: italic; }
.prose blockquote {
  margin: 1.8em 0; padding: 2px 0 2px 22px;
  border-left: 2px solid var(--sepia);
  font-family: var(--display); font-size: 25px; font-style: italic; line-height: 1.4; color: #22190f;
}
.prose blockquote p { margin: 0; }
.prose a { color: var(--royal); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(17, 30, 103, .35); }
.prose a:hover { text-decoration-color: var(--royal); }
/* Editor preview: a pasted link reads "Read more", like on the published letter */
.prose a[data-read-more] { font-size: 0; }
.prose a[data-read-more]::after { content: 'Read more'; font-size: 17.5px; }
.prose img { display: block; max-width: 100%; height: auto; margin: 2em auto; box-shadow: 0 0 0 1px rgba(92, 66, 34, .3); }
.prose hr { margin: 2.4em 0; border: 0; border-top: 1px solid var(--parchment-line); }
.prose code { padding: .12em .35em; border-radius: 3px; background: rgba(92, 66, 34, .1); font-size: .88em; }
.prose pre { margin: 0 0 1.2em; padding: 16px; overflow-x: auto; border-radius: var(--radius); background: #221a10; color: #f4ead6; font-size: 14px; line-height: 1.6; }
.prose pre code { padding: 0; background: none; color: inherit; font-size: inherit; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.letter .prose > p:first-child::first-letter,
.letter .prose > h3:first-child + p::first-letter {
  float: left; margin: .08em .12em 0 0;
  font-family: var(--display); font-weight: 700; font-size: 4.3em; line-height: .78;
  /* Gold leaf: a metallic gradient clipped to the letter, with a thin dark
     edge so it reads against the parchment (plain gold where clipping isn't supported) */
  color: #b0812a;
  background: linear-gradient(170deg, #f7e7a6 0%, #d9ab3f 28%, #9c6a12 52%, #e6c35c 72%, #8a5a0c 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: .6px rgba(92, 58, 8, .6);
}

.signoff { margin-top: 40px; }
.signoff p { font-family: var(--display); font-style: italic; font-size: 22px; line-height: 1.3; color: var(--parchment-2); }
.signoff .signoff-name {
  margin-top: 4px;
  font-family: var(--display); font-style: italic; font-weight: 600; font-size: 30px; line-height: 1.1; color: #22190f;
}

.ornament { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 52px 0 0; color: var(--sepia); }
.ornament::before, .ornament::after { content: ''; width: 72px; height: 1px; background: var(--parchment-line); }
.ornament span { width: 7px; height: 7px; border: 1px solid currentColor; transform: rotate(45deg); }

.letter-subscribe {
  margin-top: 44px; padding: 36px 28px 32px; text-align: center;
  border: 1px solid var(--parchment-line);
  outline: 1px solid var(--parchment-line); outline-offset: 5px;
}
.letter-subscribe h2 {
  margin-top: 10px;
  font-family: var(--display); font-weight: 600; font-size: 32px; line-height: 1.1; color: #22190f;
}
.letter-subscribe > p:not(.kicker) { max-width: 420px; margin: 10px auto 0; font-size: 15px; color: var(--parchment-2); }
.letter-subscribe .subscribe { margin: 24px auto 0; }
.parchment .input { background: rgba(255, 252, 244, .75); border-color: rgba(92, 66, 34, .35); }
.parchment .input:focus { background: #fffdf7; }

.keep-reading { margin-top: 56px; }
.keep-reading-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 4px; }
.keep-reading-head h2 { font-family: var(--display); font-weight: 600; font-size: 28px; color: #22190f; }
.view-more { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--royal); }
.view-more:hover { text-decoration: underline; text-underline-offset: 4px; }
.parchment .letter-list { border-top-color: var(--parchment-line); }
.parchment .letter-row { grid-template-columns: minmax(0, 1fr) 132px; gap: 24px; padding: 20px 0; border-bottom-color: var(--parchment-line); }
.parchment .letter-meta { color: var(--parchment-2); }
.parchment .letter-meta > * + *::before { color: rgba(92, 66, 34, .4); }
.parchment .letter-title { font-size: 24px; font-weight: 600; color: #22190f; }
.parchment .letter-sub-line { font-size: 14.5px; color: var(--parchment-2); }
.parchment .letter-row:hover .letter-title { color: var(--royal); }

/* ---------- Auth ---------- */
.auth-split {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: calc(100vh - var(--header-h));
}
.auth-art {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 48px clamp(24px, 4vw, 56px) 64px; color: #fff; background: var(--royal-night);
}
.auth-art > .detail { z-index: -2; }
.auth-art::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(0deg, rgba(7, 13, 51, .88) 0%, rgba(7, 13, 51, .35) 55%, rgba(7, 13, 51, .2) 100%);
}
.auth-art::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: var(--royal); mix-blend-mode: color; opacity: .28; pointer-events: none;
}
.auth-quote p { font-family: var(--display); font-style: italic; font-weight: 500; font-size: clamp(36px, 4vw, 52px); line-height: 1.05; }
.auth-quote footer { margin-top: 10px; font-size: 14px; letter-spacing: .04em; color: rgba(255, 255, 255, .78); }
.auth-art .plate { right: auto; left: clamp(24px, 4vw, 56px); bottom: 22px; max-width: none; text-align: left; }

.auth-panel {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 56px 24px; background: var(--bone);
}
.auth-card {
  width: 100%; max-width: 400px; padding: 40px 32px 32px; text-align: center;
  background: #fff; border: 1px solid var(--line);
  box-shadow: 0 30px 60px -36px rgba(13, 19, 48, .35);
}
.auth-logo { display: inline-flex; align-items: center; color: var(--ink); margin-bottom: 22px; }
.auth-logo .brand-name { font-size: 24px; }
.auth-card h1 { font-family: var(--display); font-weight: 600; font-size: 34px; line-height: 1.1; }
.auth-sub { margin-top: 8px; font-size: 15px; color: var(--muted); }
.auth-form { display: grid; gap: 16px; margin-top: 28px; text-align: left; }
.auth-form .btn { margin-top: 6px; }

.field label { display: block; margin-bottom: 6px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.field-error { margin-top: 6px; font-size: 13px; color: var(--danger); }

.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 48px; }
.pw-toggle { position: absolute; top: 4px; right: 4px; }
.pw-toggle svg { width: 18px; height: 18px; }

.auth-switch { margin-top: 24px; font-size: 14px; color: var(--muted); }
.auth-switch a {
  color: var(--royal); font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(17, 30, 103, .3);
}
.auth-switch a:hover { text-decoration-color: currentColor; }
.auth-legal { max-width: 400px; margin-top: 16px; font-size: 12px; text-align: center; color: var(--muted); }

/* ---------- Manage profile ---------- */
.profile-wrap { width: 100%; max-width: 848px; margin: 0 auto; padding: 36px 24px 96px; }

.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line-strong); }
.tab {
  position: relative; padding: 10px 0;
  border: 0; background: none; cursor: default;
  font-family: var(--caps); font-size: 13px; font-weight: 600; letter-spacing: .1em; color: var(--ink);
}
.tab.is-active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--royal);
}

.profile-cards { display: grid; gap: 18px; margin-top: 24px; }
.card {
  padding: 28px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 20px 44px -36px rgba(13, 19, 48, .35);
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.card-head.center { align-items: center; }
.card-head h2 { font-family: var(--display); font-weight: 600; font-size: 27px; line-height: 1.15; }
.card-head p { margin-top: 4px; font-size: 14px; color: var(--muted); }

.inset {
  margin-top: 20px; padding: 20px;
  background: var(--bone); border: 1px solid var(--line); border-radius: var(--radius);
}
.profile-inset { display: flex; align-items: center; gap: 20px; }
.avatar {
  flex: none; display: grid; place-items: center;
  width: 58px; height: 58px; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #3446a8, var(--royal) 58%, #080f3d);
  color: #efe2c3;
  font-family: var(--caps); font-size: 21px; font-weight: 600;
  box-shadow: 0 0 0 4px #fff, 0 0 0 5px var(--line);
}
.avatar svg { width: 26px; height: 26px; }

.detail-rows { flex: 1; min-width: 0; display: grid; gap: 12px; }
.detail-row {
  display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 12px;
  min-height: 36px; font-size: 14px;
}
.detail-row dt { font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.detail-row dd { font-weight: 500; overflow-wrap: anywhere; }
.detail-row + .detail-row { padding-top: 12px; border-top: 1px solid var(--line); }

.name-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.name-form .input { flex: 1 1 160px; max-width: 260px; height: 36px; font-size: 14px; }

.caption { margin-top: 12px; font-size: 13px; color: var(--muted); }

.badge {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 26px; padding: 0 11px; border-radius: var(--pill);
  font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-active { background: #ecf7f1; color: #17703f; border: 1px solid #b6dfc6; }
.badge-off { background: #fdf0ef; color: #a3231a; border: 1px solid #f2c0bb; }
.badge-founder { background: #fbf3dc; color: #7a5414; border: 1px solid #e6cf92; }
.badge-founder::before { background: linear-gradient(135deg, #f3dc8e, #a8761c); }
.plan-badges { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

.founder-note {
  display: flex; align-items: center; gap: 16px;
  margin-top: 20px; padding: 16px 18px;
  background: #fbf6e8; border: 1px solid #ecdcae; border-radius: var(--radius);
}
.founder-note .seal { width: 52px; height: 52px; }
.founder-title { font-family: var(--display); font-size: 22px; font-weight: 600; line-height: 1.2; color: #4a3410; }
.founder-title .numeral { font-size: 15px; color: #7a5414; }
.founder-desc { margin-top: 2px; font-size: 14px; color: #6b5a3a; }

.plan-inset { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.plan-name { font-family: var(--display); font-size: 22px; font-weight: 600; line-height: 1.2; }
.plan-desc { margin-top: 2px; font-size: 14px; color: var(--muted); }
.plan-price { font-family: var(--display); font-size: 30px; font-weight: 600; white-space: nowrap; }
.plan-price span { font-family: var(--sans); font-size: 13px; font-weight: 500; color: var(--muted); }

.card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 22px; }
.card-actions .note { font-size: 14px; color: var(--muted); }

.profile-footer { margin-top: 24px; }

.menu-wrap { position: relative; }
.dropdown {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 20;
  min-width: 184px; padding: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 20px 44px -18px rgba(13, 19, 48, .3);
  animation: pop .14s ease-out;
}
.dropdown button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 10px; border: 0; border-radius: 2px; background: none;
  font-size: 14px; text-align: left; color: var(--ink-2); cursor: pointer;
}
.dropdown button:hover, .dropdown button:focus-visible { background: var(--bone); color: var(--ink); outline: none; }
.dropdown button svg { width: 16px; height: 16px; }
.dropdown .is-danger { color: var(--danger); }
.dropdown .is-danger:hover { background: #fdf0ef; color: var(--danger); }

/* ---------- Footer ---------- */
.site-footer { color: rgba(255, 255, 255, .7); background: var(--royal-night); border-top: 1px solid rgba(255, 255, 255, .08); }
.footer-inner { max-width: var(--wrap); margin: 0 auto; padding: 64px 24px 32px; }
.footer-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 40px; }
.footer-brand { max-width: 420px; }
.footer-brand .brand { color: #fff; }
.footer-brand .brand-name { font-size: 26px; }
.footer-brand .brand-sub { font-size: 9.5px; }
.footer-brand p { margin-top: 20px; font-size: 14px; line-height: 1.7; }

.social-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.social-pill {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 16px 0 13px;
  border: 1px solid rgba(255, 255, 255, .22); border-radius: var(--pill);
  font-size: 13px; font-weight: 500; color: rgba(255, 255, 255, .86);
  transition: border-color .2s, background-color .2s, color .2s;
}
.social-pill svg { width: 16px; height: 16px; }
.social-pill:hover { border-color: #fff; background: #fff; color: var(--royal); }

.footer-heading { margin-bottom: 14px; font-family: var(--caps); font-size: 12.5px; letter-spacing: .14em; color: #fff; }
.footer-links ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.footer-links a { font-size: 14px; transition: color .15s; }
.footer-links a:hover { color: #fff; }

.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  margin-top: 48px; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, .12);
  font-size: 12.5px; color: rgba(255, 255, 255, .55);
}

/* ---------- Search modal ---------- */
.search-modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 12vh 16px 16px;
}
.search-backdrop {
  position: absolute; inset: 0;
  background: rgba(7, 13, 51, .55);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  animation: fade .15s ease-out;
}
.search-panel {
  position: relative; width: 100%; max-width: 580px; overflow: hidden;
  background: #fff; border-radius: var(--radius);
  box-shadow: 0 30px 70px -20px rgba(7, 13, 51, .6);
  animation: pop .18s ease-out;
}
.search-field {
  display: flex; align-items: center; gap: 12px;
  padding: 0 18px; border-bottom: 1px solid var(--line); color: var(--muted);
}
.search-field svg { width: 20px; height: 20px; flex: none; }
.search-field input {
  flex: 1; min-width: 0; height: 60px;
  border: 0; outline: none; background: transparent;
  font-family: var(--display); font-size: 22px; color: var(--ink);
}
.search-field input::placeholder { color: #9a9eae; }
.search-field input::-webkit-search-cancel-button { display: none; }
.search-field kbd {
  padding: 4px 6px; border: 1px solid var(--line); border-radius: 3px; background: var(--bone);
  font: 500 11px/1 var(--sans); color: var(--muted);
}
.search-count {
  padding: 14px 18px 6px;
  font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--royal-mid);
}
.search-results { list-style: none; max-height: 52vh; margin: 0; padding: 0 8px 8px; overflow: auto; }
.search-result { display: block; padding: 10px 12px; border-left: 2px solid transparent; }
.search-result.is-active, .search-result:hover { background: var(--bone); border-left-color: var(--royal); }
.res-title { display: block; font-family: var(--display); font-size: 20px; font-weight: 600; line-height: 1.25; color: var(--ink); }
.res-meta {
  display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  font-size: 13px; color: var(--muted);
}
.search-results mark { padding: 0 1px; background: var(--royal-soft); color: inherit; }
.search-empty { padding: 28px 12px; text-align: center; font-size: 14px; color: var(--muted); }

/* ---------- Toasts ---------- */
.toasts {
  position: fixed; left: 50%; bottom: 24px; z-index: 200;
  display: flex; flex-direction: column; gap: 8px;
  width: min(420px, calc(100vw - 32px));
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 12px 12px 14px;
  background: var(--royal-night); color: #fff; border-radius: var(--radius);
  box-shadow: 0 18px 44px -14px rgba(7, 13, 51, .6);
  font-size: 14px; line-height: 1.45;
  opacity: 0; transform: translateY(8px) scale(.98);
  transition: opacity .2s, transform .2s;
  pointer-events: auto;
}
.toast.is-in { opacity: 1; transform: none; }
.toast-icon { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; }
.toast-icon svg { width: 13px; height: 13px; stroke-width: 2.8; }
.toast-success .toast-icon { background: #1f9d5a; color: #fff; }
.toast-error .toast-icon { background: #d9443a; color: #fff; }
.toast-info .toast-icon { background: #fff; color: var(--royal); }
.toast-msg { flex: 1; padding-top: 1px; }
.toast-close {
  flex: none; display: grid; place-items: center; width: 24px; height: 24px; margin: -1px -2px 0 0;
  border: 0; border-radius: 3px; background: none; color: rgba(255, 255, 255, .6); cursor: pointer;
}
.toast-close:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.toast-close svg { width: 14px; height: 14px; }

/* ---------- Animations ---------- */
@keyframes drift {
  from { transform: scale(1.02) translate3d(0, 0, 0); }
  to { transform: scale(1.08) translate3d(-1.2%, -1%, 0); }
}
@keyframes fill-bar { to { transform: scaleX(1); } }
@keyframes settle { from { opacity: 0; transform: scale(1.05); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }

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

/* ---------- Medium screens ---------- */
@media (max-width: 960px) {
  .parts-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .parts-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
  .part-tab { font-size: 20px; padding: 14px 0; }

  .feature { grid-template-columns: minmax(0, 1fr); }
  .feature-body { margin: -56px 20px 0; }

  .reader { grid-template-columns: minmax(0, 1fr); }
  .reader-index { border-right: 0; border-bottom: 1px solid var(--line); }
  .index-toggle {
    display: flex; align-items: center; justify-content: space-between; width: 100%;
    padding: 14px 24px; border: 0; background: none; cursor: pointer;
    font-family: var(--caps); font-size: 13px; font-weight: 600; letter-spacing: .12em; color: var(--ink);
  }
  .index-toggle::after {
    content: ''; width: 7px; height: 7px; margin-right: 4px;
    border-right: 1.5px solid; border-bottom: 1.5px solid;
    transform: rotate(45deg) translateY(-2px); transition: transform .2s;
  }
  .index-toggle[aria-expanded="true"]::after { transform: rotate(-135deg) translateY(-1px); }
  .index-toggle span { margin-left: 6px; margin-right: auto; color: var(--muted); font-weight: 500; }
  .reader-index-stick { display: none; position: static; max-height: 60vh; padding: 0 24px 20px; }
  .reader-index.is-open .reader-index-stick { display: block; }

  .auth-split { grid-template-columns: minmax(0, 1fr); }
  .auth-art { min-height: 240px; padding: 32px 24px 52px; }
  .auth-quote p { font-size: 34px; }
}

/* ---------- Small screens ---------- */
@media (max-width: 760px) {
  :root { --header-h: 64px; }
  .header-inner { grid-template-columns: 1fr auto; padding: 0 16px; gap: 8px; }
  .nav-center, .nav-login, .post-btn-label { display: none; }
  .post-btn { width: 38px; padding: 0; }
  .menu-btn { display: inline-grid; }
  .mobile-menu { padding: 4px 16px 16px; }
  .brand-name { font-size: 19px; }
  .brand-sub { font-size: 7.5px; margin-top: 5px; }

  .wrap { padding: 0 16px; }
  .hero { min-height: 92vh; padding: calc(var(--header-h) + 48px) 0 64px; }
  .hero-inner { padding: 0 16px; }
  .hero-art { background-position: 74% 40%; }
  .hero::before {
    background:
      linear-gradient(0deg, rgba(7, 13, 51, .95) 0%, rgba(7, 13, 51, .72) 48%, rgba(7, 13, 51, .25) 100%);
  }
  .hero-tagline { font-size: 16.5px; }
  .plate { left: 16px; right: 16px; bottom: 14px; max-width: none; text-align: left; font-size: 10.5px; }

  .section-intro { grid-template-columns: minmax(0, 1fr); margin-bottom: 32px; }
  .parts-list { grid-template-columns: minmax(0, 1fr); }
  .part-card { grid-template-columns: minmax(0, 1fr); }
  .part-media { order: -1; min-height: 0; aspect-ratio: 16 / 9; }
  .part-body { padding: 26px 22px 22px; }
  .part-content h3 { font-size: 29px; }

  .letter-row { grid-template-columns: minmax(0, 1fr) 96px; gap: 16px; padding: 20px 0; align-items: start; }
  .letter-title { font-size: 23px; }
  .letter-sub-line { font-size: 14.5px; }
  .parchment .letter-row { grid-template-columns: minmax(0, 1fr) 84px; gap: 14px; }
  .parchment .letter-title { font-size: 21px; }
  .feature-body { margin: -40px 12px 0; padding: 30px 24px 28px; }
  .empty-letter { padding: 40px 24px 36px; }
  .empty-letter-title { font-size: 29px; }

  .banner { padding: 56px 0 40px; }

  .prose { font-size: 17px; }
  .prose h3 { font-size: 26px; }
  .letter-sub { font-size: 17.5px; }
  .letter-subscribe { padding: 30px 18px 26px; }
  .letter-subscribe h2 { font-size: 28px; }

  .auth-panel { padding: 36px 16px 48px; }
  .auth-card { padding: 32px 20px 24px; }
  .profile-wrap { padding: 28px 16px 72px; }
  .card { padding: 22px 18px; }
  .inset { padding: 16px; }
  .profile-inset { align-items: flex-start; gap: 16px; }
  .avatar { width: 46px; height: 46px; font-size: 17px; }
  .detail-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .card-actions .btn { width: 100%; }

  .footer-inner { padding: 48px 16px 28px; }
}
@media (min-width: 761px) { .mobile-menu { display: none !important; } }
@media (max-width: 440px) {
  .site-header .brand-sub { display: none; }
  .profile-btn-label { display: none; }
  .profile-btn { padding: 0 6px; }
  .subscribe { flex-direction: column; }
  .subscribe .input { flex: none; }
  .subscribe .btn { width: 100%; }
  .letter-row { grid-template-columns: minmax(0, 1fr) 80px; }
}
