:root {
  --bg: #0f1110; --bg-deep: #0a0c0b; --panel: #151917;
  --line: #26302a; --line-soft: #1d2420; --line-strong: #3a463f;
  --text: #d6e2d9; --text-2: #c4d1c8; --muted: #9fb0a4; --dim: #7d8f83; --faint: #56645a;
  --white: #fff; --red: #ff5c4d; --red-hi: #ff7a6d; --amber: #ffb84d; --green: #7be0a0;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 56px; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: 'JetBrains Mono', ui-monospace, monospace; min-height: 100vh; }
a { color: var(--text); }
a:hover { color: var(--red); }
::selection { background: var(--red); color: var(--bg); }
@keyframes blink { 50% { opacity: 0; } }
@keyframes linein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.wrap { max-width: 1120px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.prompt { font-size: 12px; color: var(--dim); }
.h2 { font-size: 32px; font-weight: 800; color: var(--white); margin: 8px 0 16px; letter-spacing: -.03em; text-wrap: balance; }
.lede { font-size: 14px; color: var(--muted); line-height: 1.7; margin: 0 0 20px; max-width: 460px; text-wrap: pretty; }

/* buttons */
.btn { display: inline-block; font: inherit; font-weight: 700; font-size: 14px; padding: 13px 20px; cursor: pointer; text-decoration: none; border: 1px solid transparent; }
.btn-red { background: var(--red); color: var(--bg); }
.btn-red:hover { background: var(--red-hi); color: var(--bg); }
.btn-ghost { border-color: var(--line-strong); color: var(--white); font-weight: 500; background: none; }
.btn-ghost:hover { border-color: var(--white); color: var(--white); }
.btn-outline { border-color: var(--red); color: var(--red); background: none; }
.btn-outline:hover { background: var(--red); color: var(--bg); }

/* nav */
.nav { position: sticky; top: 0; z-index: 10; background: rgba(15,17,16,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.nav .wrap { padding-top: 14px; padding-bottom: 14px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.brand { font-weight: 800; color: var(--white); font-size: 15px; text-decoration: none; }
.brand span { color: var(--red); }
.nav-links { display: flex; gap: 20px; font-size: 13px; color: var(--dim); flex-wrap: wrap; align-items: center; }
.nav-links a { color: var(--dim); text-decoration: none; }
.nav-links a:hover { color: var(--white); }
.nav-links a.nav-cta { color: var(--bg); background: var(--red); padding: 7px 12px; font-weight: 700; }
.nav-links a.nav-cta:hover { background: var(--red-hi); color: var(--bg); }

/* hero */
.hero { padding-top: 72px; padding-bottom: 64px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 48px; align-items: center; }
.hero h1 { font-weight: 800; font-size: clamp(40px, 6vw, 68px); line-height: 1.02; color: var(--white); margin: 16px 0 20px; letter-spacing: -.045em; text-wrap: balance; }
.cursor { color: var(--red); animation: blink 1s steps(1) infinite; }
.hero p { font-size: 15px; line-height: 1.7; color: var(--muted); margin: 0 0 32px; max-width: 500px; text-wrap: pretty; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-actions .btn { padding: 14px 20px; }

.term { background: var(--bg-deep); border: 1px solid var(--line); }
.term-bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 11px; color: var(--dim); }
.dots { display: flex; gap: 6px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); }
.dots i:nth-child(1) { background: var(--red); }
.dots i:nth-child(2) { background: var(--amber); }
.term-body { padding: 14px; height: 268px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 9px; font-size: 12px; line-height: 1.5; }
.tail-line { display: grid; grid-template-columns: 64px 58px 1fr; gap: 8px; animation: linein .35s ease-out; }
.tail-line .t { color: var(--faint); }
.tail-line .lvl { font-weight: 700; }
.tail-line .msg { color: var(--text-2); }

/* feed */
.section { border-top: 1px solid var(--line); }
.section-deep { background: var(--bg-deep); }
.feed-head { padding-top: 56px; padding-bottom: 8px; }
.feed-head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
.feed-head h2 { font-size: 32px; font-weight: 800; color: var(--white); margin: 8px 0 0; letter-spacing: -.03em; }
.tabs { display: flex; border: 1px solid var(--line); }
.tabs a { padding: 9px 14px; font-size: 13px; font-weight: 700; color: var(--dim); text-decoration: none; }
.tabs a.on { background: var(--white); color: var(--bg); }
.tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.tags a { font-size: 12px; padding: 5px 10px; border: 1px solid var(--line); color: var(--dim); text-decoration: none; }
.tags a.on { border-color: var(--red); color: var(--red); }
.feed { padding-bottom: 56px; }
.page-title { font-size: 32px; font-weight: 800; color: var(--white); margin: 8px 0 0; letter-spacing: -.03em; }
.page-blurb { font-size: 14px; max-width: 560px; margin: 0 0 20px; }
.pager { display: flex; gap: 20px; align-items: center; padding-top: 24px; font-size: 13px; }
.story-sub a { color: inherit; }
.story-sub a:hover { color: var(--red); }
.empty { padding: 40px 0; color: var(--dim); font-size: 13px; border-top: 1px solid var(--line-soft); }

.story { border-top: 1px solid var(--line-soft); display: grid; grid-template-columns: 92px minmax(0, 1fr) 64px; gap: 16px; padding: 18px 0; align-items: start; }
.story-meta { font-size: 11px; line-height: 1.6; color: var(--dim); }
.story-meta b { font-weight: 700; display: block; }
.story-main { cursor: pointer; }
.story-title { color: var(--white); font-size: 15px; font-weight: 700; line-height: 1.4; text-wrap: pretty; }
.story-main:hover .story-title { color: var(--red); }
.story-sub { font-size: 12px; color: var(--dim); margin-top: 6px; line-height: 1.6; overflow-wrap: anywhere; }
.story-sub .author { color: var(--muted); }
.story-body { margin-top: 16px; padding: 16px 18px; background: var(--panel); border-left: 2px solid var(--sev, var(--red)); font-size: 13px; line-height: 1.75; color: var(--text-2); cursor: auto; }
.story-body p { margin: 0 0 14px; text-wrap: pretty; white-space: pre-line; }
.story-body .lesson-h { color: var(--dim); font-size: 12px; }
.story-body .lesson { margin: 4px 0 0; color: var(--white); }
.toggle-label { font-size: 11px; color: var(--faint); margin-top: 8px; }
.story[data-open="false"] .story-body { display: none; }
.story[data-open="true"] .more, .story[data-open="false"] .less { display: none; }

.f-btn { width: 100%; font: inherit; font-size: 13px; text-align: center; padding: 8px 0; cursor: pointer; border: 1px solid var(--line); background: transparent; color: var(--white); font-weight: 700; user-select: none; }
.f-btn small { display: block; font-weight: 400; font-size: 11px; }
.f-btn.paid { background: var(--red); border-color: var(--red); color: var(--bg); }

/* hall of shame */
.shame { padding-top: 64px; padding-bottom: 64px; }
.shame-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.shame-card { border: 1px solid var(--line); background: var(--bg); padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.shame-top { display: flex; justify-content: space-between; align-items: baseline; }
.rank { font-size: 44px; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.shame-title { color: var(--white); font-size: 15px; font-weight: 700; line-height: 1.4; text-wrap: pretty; }
.shame-by { font-size: 12px; color: var(--dim); margin-top: auto; }

/* confess form */
.confess { padding-top: 64px; padding-bottom: 64px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 48px; align-items: start; }
.checks { font-size: 12px; color: var(--dim); line-height: 2; }
.checks span { color: var(--red); }
.form { background: var(--panel); border: 1px solid var(--line); padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--dim); }
.form input, .form textarea, .form select { background: var(--bg); border: 1px solid var(--line); color: var(--white); font: inherit; font-size: 14px; padding: 12px; outline: none; border-radius: 0; }
.form textarea { resize: vertical; line-height: 1.6; }
.form input:focus, .form textarea:focus, .form select:focus { border-color: var(--red); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.form .btn { align-self: flex-start; }
.form-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.more-fields { display: flex; flex-direction: column; gap: inherit; }
.more-fields[hidden], .form-actions .btn[hidden] { display: none; }
.shame-link { font-size: 12px; word-break: break-all; }
.err { font-size: 12px; color: var(--red); }
.ok { font-size: 12px; color: var(--green); }

/* plug */
.plug { padding-top: 64px; padding-bottom: 64px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); gap: 48px; align-items: center; }
.apm { background: var(--bg); border: 1px solid var(--line); font-size: 12px; line-height: 1.8; }
.apm-bar { padding: 10px 16px; border-bottom: 1px solid var(--line); color: var(--dim); display: flex; justify-content: space-between; gap: 12px; }
.apm-bar em { color: var(--red); font-style: normal; }
.apm-body { padding: 14px 16px; color: var(--text-2); white-space: pre-wrap; }
.apm-body .dim { color: var(--dim); }

footer .wrap { padding-top: 28px; padding-bottom: 28px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--faint); }
footer a { color: var(--dim); }

@media (max-width: 560px) {
  .story { grid-template-columns: 1fr 56px; }
  .story-meta { grid-column: 1 / -1; display: flex; gap: 10px; }
  .story-meta b { display: inline; }
  .f-btn { grid-column: 2; grid-row: 2; }
  .story-main { grid-column: 1; grid-row: 2; }
}

.err[hidden] { display: none; }
.form input.invalid, .form textarea.invalid { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
.err { border-left: 2px solid var(--red); padding-left: 10px; }
