/* Iron Pen Study Club member portal. Palette: deep navy, metallic gold, warm ivory. No third-party fonts or scripts. */
:root {
  --navy: #0e1a2b; --navy-2: #15263d; --navy-3: #1d3352;
  --gold: #c9a24a; --gold-2: #e8cd86; --gold-3: #a8812f;
  --ivory: #f8f3e7; --paper: #fffdf8; --ink: #1c1a17; --muted: #6a6255; --line: #e6dcc6;
  --ok: #2f6b45; --warn: #8a5a12; --err: #8f2d23;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 14px; --shadow: 0 10px 30px rgba(14, 26, 43, .10);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--ivory); color: var(--ink); font: 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--gold-3); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--gold-2); outline-offset: 2px; }
.hidden { display: none !important; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 22px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: .2px; line-height: 1.2; margin: 0; }
.eyebrow { font: 600 12px/1.4 var(--sans); letter-spacing: 2.4px; text-transform: uppercase; color: var(--gold); }
.note { color: var(--muted); font-size: 14px; }

/* ---------- header ---------- */
header.top { background: var(--navy); color: var(--ivory); border-bottom: 1px solid rgba(201, 162, 74, .35); position: sticky; top: 0; z-index: 20; }
header.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ivory); text-decoration: none; }
.brand img { width: 40px; height: auto; }
.brand span { display: flex; flex-direction: column; font-family: var(--serif); font-size: 19px; line-height: 1.1; }
.brand small { font: 600 10px/1.6 var(--sans); letter-spacing: 2.6px; text-transform: uppercase; color: var(--gold-2); }
nav.top { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
nav.top a { color: #d9d3c4; text-decoration: none; font-size: 14px; padding: 8px 12px; border-radius: 999px; white-space: nowrap; }
nav.top a:hover { color: var(--paper); background: rgba(255, 255, 255, .06); }
nav.top a[aria-current="page"] { color: var(--navy); background: var(--gold-2); }
nav.top a.back { color: var(--gold-2); border: 1px solid rgba(232, 205, 134, .45); }
.review-bar { background: #fff6de; color: #5c4513; border-bottom: 1px solid #ecd9a6; font-size: 13px; }
.review-bar .wrap { padding: 8px 22px; }
.review-bar a { color: #5c4513; font-weight: 600; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; color: var(--ivory);
  background: radial-gradient(900px 420px at 78% 40%, rgba(201, 162, 74, .22), transparent 60%),
              linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 55%, var(--navy-3) 100%); }
.hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.hero .wrap { display: grid; grid-template-columns: 1.25fr .75fr; align-items: center; gap: 28px; padding-top: 46px; padding-bottom: 46px; }
.hero h1 { font-size: clamp(32px, 4.6vw, 52px); color: var(--paper); margin: 10px 0 12px; }
.hero h1 em { font-style: normal; color: var(--gold-2); }
.hero p.lede { font-size: 18px; color: #d8d2c3; max-width: 560px; margin: 0; }
.hero .emblem { justify-self: center; width: min(340px, 80%); filter: drop-shadow(0 18px 40px rgba(0, 0, 0, .45)) drop-shadow(0 0 30px rgba(201, 162, 74, .25)); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(232, 205, 134, .5); color: var(--gold-2); background: rgba(14, 26, 43, .35); }
.pill.ok { border-color: rgba(120, 190, 140, .55); color: #bfe3c9; }
.pill.warn { border-color: rgba(232, 180, 100, .6); color: #f2d39a; }

/* ---------- stat tiles ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: -34px auto 0; position: relative; z-index: 2; }
.tile { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); }
.tile .k { font: 600 11px/1.4 var(--sans); letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.tile .v { font-family: var(--serif); font-size: 40px; color: var(--navy); line-height: 1.1; margin: 6px 0 4px; }
.tile .v.small { font-size: 26px; }
.meter { height: 8px; background: #efe7d4; border-radius: 99px; overflow: hidden; margin: 10px 0 8px; }
.meter span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-3), var(--gold-2)); border-radius: 99px; }

/* ---------- sections ---------- */
main { padding-bottom: 56px; }
section.block { margin-top: 44px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.section-head h2 { font-size: 30px; color: var(--navy); }
.section-head .rule { flex: 1 1 100%; height: 1px; background: linear-gradient(90deg, var(--gold), transparent); margin-top: 8px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }

/* covers */
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 22px; }
.book { display: flex; flex-direction: column; gap: 10px; }
.cover { position: relative; aspect-ratio: 2 / 3; border-radius: 8px; overflow: hidden; background: linear-gradient(160deg, var(--navy-2), var(--navy)); box-shadow: 0 8px 22px rgba(14, 26, 43, .22), inset 0 0 0 1px rgba(201, 162, 74, .35); }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover .placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 14px; text-align: center; color: var(--gold-2); font-family: var(--serif); font-size: 15px; }
.cover .placeholder img { width: 46%; height: auto; object-fit: contain; }
.cover .tag { position: absolute; left: 8px; top: 8px; font: 600 10px/1 var(--sans); letter-spacing: 1px; text-transform: uppercase; padding: 5px 7px; border-radius: 4px; background: rgba(14, 26, 43, .82); color: var(--gold-2); }
.book h3 { font-size: 15px; line-height: 1.3; color: var(--ink); }
.book .meta { font-size: 12.5px; color: var(--muted); margin-top: -4px; }
.book .actions { margin-top: auto; }
.book .buy-link { display: block; margin-top: 8px; text-align: center; font-size: .85rem; color: var(--navy); text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; }
.book .buy-link:hover { color: #7a5b16; }

/* controls */
button, .btn { font: 600 14px/1 var(--sans); border: 0; border-radius: 999px; padding: 11px 18px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .08s ease, background .2s ease; }
button:active { transform: translateY(1px); }
.btn-gold, button.gold { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: var(--navy); box-shadow: 0 2px 0 var(--gold-3); }
.btn-gold:hover, button.gold:hover { background: linear-gradient(180deg, #f0d896, var(--gold-2)); }
button.navy, .btn-navy { background: var(--navy); color: var(--paper); }
button.ghost, .btn-ghost { background: transparent; color: var(--navy); border: 1px solid var(--line); }
button.ghost:hover { border-color: var(--gold); }
button.block { width: 100%; }
button:disabled { opacity: .5; cursor: not-allowed; }
.badge { display: inline-block; font: 600 11px/1 var(--sans); letter-spacing: .6px; padding: 7px 10px; border-radius: 999px; background: #efe7d4; color: var(--muted); }
.tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { background: var(--paper); border: 1px solid var(--line); color: var(--navy); font-weight: 600; font-size: 13px; padding: 9px 14px; }
.chip[aria-pressed="true"] { background: var(--navy); color: var(--gold-2); border-color: var(--navy); }
input[type=search], input[type=email], input[type=text] { font: 16px var(--sans); padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
input[type=search] { flex: 1 1 240px; }
label.label { display: block; font: 600 12px/1.4 var(--sans); letter-spacing: 1.6px; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.msg { padding: 12px 16px; border-radius: 10px; font-size: 14.5px; margin: 14px 0; }
.msg.ok { background: #e9f3ec; color: var(--ok); }
.msg.err { background: #f8e8e5; color: var(--err); }
.empty { color: var(--muted); font-style: italic; }

/* feature cards */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.feature { position: relative; overflow: hidden; border-radius: var(--radius); padding: 28px; color: var(--ivory); background: linear-gradient(135deg, var(--navy), var(--navy-3)); box-shadow: var(--shadow); min-height: 210px; display: flex; flex-direction: column; gap: 10px; }
.feature h3 { font-size: 26px; color: var(--paper); }
.feature p { color: #d8d2c3; margin: 0; max-width: 460px; }
.feature .go { margin-top: auto; align-self: flex-start; }
.feature .glyph { position: absolute; right: -18px; bottom: -22px; width: 150px; opacity: .16; }
.feature.locked { background: linear-gradient(135deg, #2b2b33, #3a3a46); }

/* benefits */
.benefits { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px 22px; }
.benefit { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 15px; }
.benefit .ic { flex: 0 0 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.benefit.on .ic { background: var(--gold-2); color: var(--navy); }
.benefit.off { color: #9a917f; }
.benefit.off .ic { background: #ece5d5; color: #a59b86; }

/* account */
.account { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.account div .k { font: 600 11px/1.4 var(--sans); letter-spacing: 1.6px; text-transform: uppercase; color: var(--muted); }
.account div .v { font-size: 16px; margin-top: 4px; word-break: break-word; }

/* sign-in */
.signin-wrap { min-height: calc(100vh - 68px); display: grid; grid-template-columns: 1.1fr .9fr; }
.signin-art { background: radial-gradient(700px 400px at 50% 45%, rgba(201, 162, 74, .25), transparent 65%), linear-gradient(160deg, var(--navy), var(--navy-3)); color: var(--ivory); display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 48px 32px; gap: 18px; }
.signin-art img { width: min(320px, 70%); filter: drop-shadow(0 18px 40px rgba(0, 0, 0, .5)) drop-shadow(0 0 34px rgba(201, 162, 74, .3)); }
.signin-art h1 { font-size: clamp(30px, 3.6vw, 44px); color: var(--paper); }
.signin-art p { color: #d8d2c3; max-width: 440px; margin: 0; }
.signin-card { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.signin-card .inner { width: 100%; max-width: 400px; }
.signin-card .logo { width: 200px; margin: 0 auto 18px; }
.signin-card h2 { font-size: 28px; color: var(--navy); text-align: center; }
.signin-card p.lede { text-align: center; color: var(--muted); margin: 8px 0 22px; }
.signin-card form { display: flex; flex-direction: column; gap: 12px; }
.signin-card .fine { font-size: 12.5px; color: var(--muted); text-align: center; margin-top: 18px; }
input.code { letter-spacing: 10px; font-size: 26px; text-align: center; font-family: "Courier New", monospace; }

/* beyond the pages */
.items { display: grid; gap: 16px; }
.item { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); }
.item h3 { font-size: 22px; color: var(--navy); margin: 6px 0 8px; }
.item .body { white-space: pre-wrap; border-left: 3px solid var(--gold); padding-left: 14px; margin: 12px 0; }
.item .locked { color: var(--warn); font-weight: 600; }

footer { background: var(--navy); color: #a9a293; font-size: 13px; padding: 26px 0; border-top: 1px solid rgba(201, 162, 74, .35); }
footer .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .hero .wrap { grid-template-columns: 1fr; text-align: left; }
  .hero .emblem { width: 180px; justify-self: start; order: -1; }
  .stats { grid-template-columns: 1fr 1fr; }
  .duo { grid-template-columns: 1fr; }
  .signin-wrap { grid-template-columns: 1fr; }
  .signin-art { padding: 32px 22px; }
  .signin-art img { width: 150px; }
}
@media (max-width: 640px) {
  header.top .wrap { flex-direction: column; align-items: flex-start; padding-top: 10px; padding-bottom: 10px; }
  nav.top { justify-content: flex-start; }
  nav.top a { padding: 6px 10px; font-size: 13px; }
  header.top { position: static; }
  .stats { grid-template-columns: 1fr; }
  .shelf { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .section-head h2 { font-size: 25px; }
  .tile .v { font-size: 34px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
