:root {
  --ground: #0f1517;
  --ground-alt: #121c1c;
  --panel: #12191b;
  --panel-2: #16211f;
  --line: #2c3b3f;
  --line-2: #3c4d50;
  --text: #e9eeec;
  --text-2: #c9d4d1;
  --muted: #a3b1ae;
  --faint: #7d8d8a;
  --teal: #7fd1c7;
  --teal-hi: #a8e3db;
  --gold: #e2bd5a;
  --orange: #f08a5d;
  --good: #7ccf7a;
  --display: 'Marcellus', Georgia, serif;
  --body: 'IBM Plex Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-hi); }

h1, h2, h3 { font-weight: 400; margin: 0; }
h1, h2 { font-family: var(--display); letter-spacing: 0.01em; }
h2 { font-size: clamp(28px, 4vw, 38px); margin-bottom: 32px; }
h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
p { margin: 0 0 16px; }

code, kbd { font-family: var(--mono); font-size: 0.88em; }
code { color: var(--teal); }
kbd {
  display: inline-block;
  padding: 0 6px;
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--panel-2);
  color: var(--text);
  line-height: 1.5;
}

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

.muted { color: var(--muted); }

/* Header */
.top {
  position: sticky; top: 0; z-index: 10;
  background: rgba(15, 21, 23, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--display); font-size: 22px; }
.brand:hover { color: var(--text); }
.mark { width: 32px; height: 32px; }
nav { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 15px; }
nav a { color: var(--text-2); padding: 10px 0; }
nav a:hover { color: var(--teal); }
@media (max-width: 560px) {
  .top { position: static; }
  .top-row { padding-top: 8px; padding-bottom: 4px; }
  nav { gap: 0 16px; }
}

/* Hero */
.hero {
  padding: 72px 0 88px;
  background:
    radial-gradient(ellipse 60% 70% at 85% 30%, rgba(127, 209, 199, 0.08), transparent 70%),
    var(--ground);
  border-bottom: 1px solid var(--line);
}
.hero-grid { display: grid; gap: 56px; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.1fr 1fr; } }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--teal); margin-bottom: 16px; }
h1 { font-size: clamp(40px, 6.5vw, 64px); line-height: 1.08; margin-bottom: 24px; }
.lead { font-size: 19px; color: var(--text-2); max-width: 34em; }
.note { font-size: 15px; color: var(--faint); margin-top: 20px; }
.dl-count { margin: 14px 0 0; font-size: 15px; color: var(--muted); }
.dl-count b { color: var(--teal); font-weight: 600; }

.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px; border-radius: 8px;
  font-size: 16px; font-weight: 600;
}
.btn-primary { background: var(--teal); color: #0d1a18; }
.btn-primary:hover { background: var(--teal-hi); color: #0d1a18; }
.btn-primary.is-soon { background: var(--panel-2); color: var(--muted); border: 1px dashed var(--line-2); cursor: default; }
.btn-ghost { border: 1px solid var(--line-2); color: var(--text); }
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); }

/* In-game windows, drawn from the addon's theme (Waystone/Theme.lua):
   flat panels, 1 px borders, outline buttons, small colored tags. */
.hero-visual { position: relative; display: grid; gap: 20px; max-width: 440px; width: 100%; justify-self: center; }
.mock { margin: 0; min-width: 0; }
.hero-grid > *, .gallery > * { min-width: 0; }
@media (min-width: 900px) { .mock-offset { margin-left: 56px; margin-right: -40px; margin-top: -8px; } }
@media (max-width: 899px) { .mock-offset { display: none; } }

.ws-panel {
  background: rgba(18, 25, 27, 0.96);
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  font-size: 15px; line-height: 1.45; color: var(--text);
  text-align: left; user-select: none;
}
.ws-grow { flex: 1; min-width: 0; }
.ws-muted { color: var(--faint); }
.ws-icon { width: 20px; height: 20px; flex: none; }
.ws-icon-big { width: 40px; height: 40px; }
.ws-gear { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ws-x { color: var(--faint); font-size: 22px; line-height: 1; padding: 0 2px; }

.ws-badge {
  font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 1px 7px; color: #140f0a; white-space: nowrap;
}
.ws-badge.ws-orange { background: var(--orange); }
.ws-badge.ws-goldbg { background: var(--gold); }

.ws-btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-2); color: var(--text-2);
  min-height: 30px; padding: 0 12px; font-size: 14px; white-space: nowrap;
}
.ws-sq { width: 28px; min-height: 26px; padding: 0; font-size: 18px; line-height: 1; }
.ws-btn.ws-gold { border-color: var(--gold); color: var(--gold); }
.ws-btn.ws-orange { border-color: var(--orange); color: var(--orange); }
.ws-btn.ws-teal { border-color: var(--teal); color: var(--teal); }
.ws-btn.ws-muted-btn { border-color: var(--line-2); color: var(--muted); }

.ws-check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-2); }
.ws-check::before {
  content: ""; width: 16px; height: 16px; flex: none;
  border: 1px solid var(--line-2); background: #0c1213;
}
.ws-check.is-on::before {
  border-color: #6b5a2a;
  background: #0c1213 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3L13 4' fill='none' stroke='%23e2bd5a' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
}

/* Next panel: a fixed top bar (header and target buttons) over a body that
   grows with the step (Waystone_Guide/NextPanel.lua) */
.ws-next { display: flex; flex-direction: column; }
.ws-bar { display: flex; flex-direction: column; gap: 8px; padding: 9px 12px 12px; }
.ws-head { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.ws-head .ws-sq + .ws-sq { margin-left: -4px; }
.ws-head .ws-grow { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-row { display: flex; gap: 5px; }
.ws-btn.ws-tbtn {
  flex: 1 1 0; min-width: 0; min-height: 34px; justify-content: flex-start; padding: 0 8px;
  overflow: hidden; text-overflow: ellipsis; display: block; line-height: 32px; font-size: 13.5px;
}
.ws-btn.ws-tbtn:only-child { font-size: 14px; }
.ws-btn.is-next { background: rgba(226, 189, 90, 0.22); }
.ws-body { border-top: 1px solid var(--line); padding: 9px 12px 11px; display: flex; flex-direction: column; gap: 1px; }
.ws-line { display: flex; gap: 6px; font-size: 15px; color: var(--text-2); }
.ws-line.is-now { color: var(--text); }
.ws-mark { width: 12px; flex: none; color: var(--gold); }
.ws-sub { padding-left: 22px; color: var(--text-2); font-size: 14.5px; }
.ws-tip { margin-top: 5px; font-size: 13.5px; color: var(--text-2); }
.ws-coord { margin-top: 3px; font-size: 13px; color: var(--faint); }

/* Guide window */
.ws-title { display: flex; align-items: center; gap: 12px; padding: 14px 16px 12px; border-bottom: 1px solid var(--line); }
.ws-h { font-family: var(--display); font-size: 22px; line-height: 1.2; color: var(--text); }
.ws-title .ws-muted { font-size: 13px; margin-top: 2px; }
.ws-steps { list-style: none; margin: 0; padding: 8px 0; font-size: 14.5px; }
.ws-steps li { display: grid; grid-template-columns: 40px 1fr; padding: 2px 16px 2px 0; color: var(--text); }
.ws-steps i { font-style: normal; text-align: right; padding-right: 12px; color: var(--faint); font-size: 13px; line-height: 1.6; }
.ws-steps .is-done { color: var(--faint); }
.ws-steps .is-done span::before { content: "✓"; color: var(--good); font-weight: 700; margin-right: 6px; }
.ws-steps .is-now { color: var(--gold); }
.ws-guide-foot { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 13px; }
.ws-hint { text-align: right; line-height: 1.35; font-size: 12.5px; }

/* Settings */
.ws-settings { display: flex; flex-direction: column; gap: 8px; padding: 0 0 16px; }
.ws-settings .ws-title { margin-bottom: 4px; }
.ws-settings > :not(.ws-title) { margin: 0 18px; }
.ws-settings .ws-h { font-size: 20px; }
.ws-ver { font-family: var(--body); font-size: 13px; color: var(--faint); margin-left: 4px; }
.ws-sec { margin-top: 8px !important; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.ws-key { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--text-2); }
.ws-key .ws-btn { width: 110px; flex: none; }
.ws-key .ws-btn.ws-choice { width: 150px; }
.ws-slider { display: flex; align-items: center; gap: 10px; flex: none; }
.ws-track { position: relative; width: 110px; height: 2px; background: var(--line-2); }
.ws-track i { position: absolute; top: -7px; width: 8px; height: 16px; margin-left: -4px; background: var(--teal); }
.ws-slider b { width: 40px; font-weight: 400; font-size: 13px; color: var(--teal); }
.ws-help { margin-top: 8px !important; font-size: 13px; }

.tag { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; padding: 2px 8px; border-radius: 4px; line-height: 1.6; }
.tag-teal { background: var(--teal); color: #0d1a18; }
.tag-muted { background: var(--line); color: var(--text-2); }

.gallery { display: grid; gap: 40px; align-items: start; }
@media (min-width: 860px) { .gallery { grid-template-columns: 1.15fr 1fr; gap: 48px; } }
.gallery figcaption { margin-top: 14px; font-size: 15px; color: var(--text-2); }
.gallery figcaption b { color: var(--text); font-weight: 600; }

/* Sections */
.section { padding: 88px 0; }
.section-alt { background: var(--ground-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.grid3 { display: grid; gap: 20px; }
@media (min-width: 640px) { .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 24px; }
.card p { color: var(--text-2); font-size: 16px; margin: 0; }

.how { list-style: none; counter-reset: how; margin: 0 0 48px; padding: 0; display: grid; gap: 24px; }
@media (min-width: 860px) { .how { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.how li { counter-increment: how; display: flex; flex-direction: column; gap: 8px; position: relative; padding-top: 56px; }
.how li::before {
  content: counter(how);
  position: absolute; top: 0; left: 0;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--teal); color: var(--teal);
  font-family: var(--display); font-size: 20px;
  display: flex; align-items: center; justify-content: center;
}
.how b { font-weight: 600; }
.how span { color: var(--text-2); font-size: 16px; }

.modules { display: grid; gap: 16px; }
@media (min-width: 640px) { .modules { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .modules { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.modules-note { margin: 16px 0 0; font-size: 15px; color: var(--muted); }
.module { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 20px; }
.module p { margin: 12px 0 0; color: var(--text-2); font-size: 15px; }
.module-later { border-style: dashed; background: transparent; }

.section-lead { color: var(--text-2); font-size: 18px; margin: -16px 0 28px; max-width: 40em; }
.loop { list-style: none; counter-reset: loop; margin: 0 0 32px; padding: 0; display: grid; gap: 12px; }
@media (min-width: 760px) { .loop { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; } }
.loop li { counter-increment: loop; position: relative; padding: 14px 16px 14px 52px; color: var(--text-2); font-size: 15px; line-height: 1.45; border: 1px solid var(--line); background: var(--panel); }
.loop li b { display: block; color: var(--text); font-weight: 600; }
.loop li::before {
  content: counter(loop); position: absolute; left: 14px; top: 14px; width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--teal); color: var(--teal); font-family: var(--display); font-size: 15px;
  display: flex; align-items: center; justify-content: center;
}
@media (min-width: 760px) {
  .loop li + li { border-left: 0; }
  .loop li:first-child { border-radius: 10px 0 0 10px; }
  .loop li:last-child { border-radius: 0 10px 10px 0; color: var(--text); background: #142224; border-color: var(--teal); }
}
@media (max-width: 759px) { .loop li { border-radius: 10px; } .loop li:last-child { border-color: var(--teal); background: #142224; } }
.help-grid { display: grid; gap: 20px; align-items: stretch; }
@media (min-width: 760px) { .help-grid { grid-template-columns: 1fr 1fr; } .help-privacy { grid-column: 1 / -1; } }
@media (min-width: 1040px) { .help-grid { grid-template-columns: 1.15fr 1fr 1fr; } .help-privacy { grid-column: auto; } }
.help-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.help-card p { color: var(--text-2); font-size: 16px; margin: 0; flex: 1; }
.help-card .btn { align-self: flex-start; }
.help-main { border-color: var(--teal); background: #142224; }
.help-privacy { background: transparent; }
.help-privacy .checks { margin: 0; font-size: 15px; }
.checks { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; font-size: 16px; }
.checks li { position: relative; padding-left: 28px; color: var(--text-2); }
.checks li::before { position: absolute; left: 0; top: 0; font-weight: 600; }
.checks .yes::before { content: "✓"; color: var(--good); }
.checks .no::before { content: "×"; color: var(--orange); font-size: 20px; line-height: 1.2; }

.faq { max-width: 820px; }
details { border-bottom: 1px solid var(--line); }
details:first-of-type { border-top: 1px solid var(--line); }
summary {
  cursor: pointer; list-style: none; padding: 18px 36px 18px 0; position: relative;
  font-size: 18px; font-weight: 500;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 4px; top: 14px; font-size: 24px; color: var(--teal); }
details[open] summary::after { content: "−"; }
summary:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
details p { color: var(--text-2); padding-bottom: 8px; }

/* Footer */
.foot { padding: 32px 0 40px; font-size: 14px; }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }

a:focus-visible, .btn:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }

/* Support */
.support { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 32px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 28px; }
.support h2 { margin-bottom: 8px; font-size: clamp(24px, 3vw, 30px); }
.support p { margin: 0; color: var(--text-2); max-width: 36em; }
.btn-coffee { gap: 10px; background: var(--gold); color: #1d1606; }
.btn-coffee:hover { background: #ecd07f; color: #1d1606; }
.btn-coffee svg { width: 20px; height: 20px; }

/* Report page */
.narrow { max-width: 760px; }
.report { padding-top: 56px; }
.page-title { font-size: clamp(34px, 5vw, 48px); line-height: 1.1; margin-bottom: 16px; }
.report .lead { margin-bottom: 40px; }
form { display: flex; flex-direction: column; gap: 32px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend, .field > label { display: block; font-weight: 600; font-size: 17px; margin-bottom: 12px; padding: 0; }
.optional { font-weight: 400; color: var(--faint); }
.hint { font-size: 15px; color: var(--muted); margin: -4px 0 12px; }
.field .hint:last-child { margin: 8px 0 0; }

.choice-row { display: grid; gap: 12px; }
@media (min-width: 640px) { .choice-row { grid-template-columns: 1fr 1fr; } }
.choice-row legend { grid-column: 1 / -1; }
.choice { display: flex; gap: 12px; align-items: flex-start; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; cursor: pointer; }
.choice:hover { border-color: var(--line-2); }
.choice:has(input:checked) { border-color: var(--teal); background: #142224; }
.choice input { margin-top: 4px; accent-color: var(--teal); width: 18px; height: 18px; flex: none; }
.choice-body { display: flex; flex-direction: column; gap: 4px; }
.choice-body span { font-size: 15px; color: var(--muted); }

.pills { display: flex; flex-wrap: wrap; gap: 10px; }
.pill { position: relative; cursor: pointer; }
.pill input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pill span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--line-2); border-radius: 22px; font-size: 15px; color: var(--text-2); }
.pill:hover span { border-color: var(--teal); }
.pill input:checked + span { background: var(--teal); border-color: var(--teal); color: #0d1a18; font-weight: 600; }
.pill input:focus-visible + span { outline: 2px solid var(--teal); outline-offset: 2px; }

textarea, input[type="text"] {
  width: 100%; background: var(--panel); color: var(--text); border: 1px solid var(--line-2); border-radius: 8px;
  padding: 12px 14px; font: inherit; font-size: 16px; line-height: 1.5; resize: vertical;
}
#share { font-family: var(--mono); font-size: 14px; word-break: break-all; }
textarea:focus, input[type="text"]:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(127, 209, 199, 0.2); }
textarea[aria-invalid="true"] { border-color: var(--orange); }

.share-preview { margin-top: 12px; background: #142224; border: 1px solid #2b4a48; border-radius: 8px; padding: 14px 16px; }
.share-ok { margin: 0 0 8px; color: var(--teal); font-size: 15px; font-weight: 600; }
.share-preview dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; font-size: 15px; }
.share-preview dt { color: var(--muted); }
.share-preview dd { margin: 0; overflow-wrap: anywhere; }
.field-error, .form-error { color: var(--orange); font-size: 15px; margin: 10px 0 0; }
.form-error { margin: 0; padding: 12px 16px; border: 1px solid rgba(240, 138, 93, 0.5); border-radius: 8px; background: rgba(240, 138, 93, 0.08); }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
form .btn { align-self: flex-start; border: 0; font-family: inherit; cursor: pointer; }
.btn:disabled { opacity: 0.6; cursor: wait; }
.thanks { background: var(--panel); border: 1px solid var(--teal); border-radius: 10px; padding: 28px; }
.thanks:focus { outline: none; }
.thanks h2 { margin-bottom: 8px; }
.thanks .cta { margin-top: 16px; }
.thanks .btn { font-family: inherit; cursor: pointer; background: transparent; }
.privacy-note { margin-top: 48px; font-size: 14px; color: var(--faint); }
.turnstile { min-height: 65px; }

/* Journal page */
.field-title { font-family: var(--body); font-size: 17px; font-weight: 600; margin: 0 0 10px; }
.path { margin: 0 0 12px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; font-size: 14px; overflow-wrap: anywhere; }
.path code { color: var(--text-2); }
.path i { font-style: normal; color: var(--gold); }
.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 120px; padding: 20px; margin-top: 8px; text-align: center; cursor: pointer;
  border: 1px dashed var(--line-2); border-radius: 10px; background: var(--panel);
}
.drop:hover, .drop.is-over { border-color: var(--teal); background: #142224; }
.drop:focus-within { outline: 2px solid var(--teal); outline-offset: 2px; }
.drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.drop-main { color: var(--teal); font-weight: 600; font-size: 16px; }
.drop-sub { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.consent { display: flex; align-items: flex-start; gap: 10px; margin-top: 16px; font-size: 16px; cursor: pointer; }
.consent input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--teal); flex: none; }
