/* ANDY portal — original visual language.
   Deep obsidian ground, amber signal colour, violet secondary.
   No external assets or fonts: everything here is generated. */

:root {
  --bg: #0a0c14;
  --bg-2: #10131f;
  --surface: #151a29;
  --surface-2: #1c2233;
  --line: #262e44;
  --line-soft: #1e2537;
  --text: #e8ebf5;
  --text-dim: #a8b0c8;
  --text-faint: #6f7794;
  --amber: #e8a33d;
  --amber-soft: #f2c078;
  --violet: #8b7be8;
  --teal: #4fb8a8;
  --rose: #d4685f;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.9);
  --maxw: 1180px;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 620px at 12% -8%, rgba(232, 163, 61, 0.10), transparent 60%),
    radial-gradient(900px 520px at 88% 4%, rgba(139, 123, 232, 0.10), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--amber-soft); text-decoration: none; }
a:hover { color: var(--amber); }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.18; margin: 0 0 12px; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.18rem; }
p { margin: 0 0 14px; }

.muted { color: var(--text-dim); }
.small { font-size: 0.87rem; }
.mono { font-family: var(--font-mono); font-size: 0.85em; }
.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;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--amber); color: #16110a; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; border-radius: 4px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(10, 12, 20, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.header-inner { display: flex; align-items: center; gap: 22px; min-height: 68px; }

.brand { display: flex; align-items: center; gap: 11px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-mark {
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(150deg, var(--amber), #b8762a);
  color: #150f05; font-family: var(--font-display); font-weight: 700; font-size: 1.3rem;
  box-shadow: 0 6px 18px -8px rgba(232, 163, 61, 0.8);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-family: var(--font-display); font-size: 1.16rem; letter-spacing: 0.12em; }
.brand-text small { color: var(--text-faint); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; }

.site-nav { margin-left: auto; }
.site-nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: block; padding: 8px 13px; border-radius: 999px;
  color: var(--text-dim); font-size: 0.92rem; font-weight: 500;
}
.site-nav a:hover { background: var(--surface-2); color: var(--text); }
.site-nav a[aria-current="page"] { background: rgba(232, 163, 61, 0.14); color: var(--amber-soft); }

.header-search input {
  width: 210px; padding: 8px 13px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  color: var(--text); font-size: 0.88rem; font-family: inherit;
}
.header-search input::placeholder { color: var(--text-faint); }
.header-search input:focus { border-color: var(--amber); outline: none; }

.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 9px; padding: 9px; cursor: pointer; }
.nav-toggle span { display: block; width: 18px; height: 2px; background: var(--text); margin: 3px 0; border-radius: 2px; }

/* ---------- layout ---------- */
main { display: block; }
.section { padding: 62px 0; }
.section-tight { padding: 34px 0; }
.section-head { margin-bottom: 28px; max-width: 760px; }
.eyebrow {
  display: inline-block; margin-bottom: 12px;
  font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--amber); font-weight: 700;
}
.lede { color: var(--text-dim); font-size: 1.06rem; }

.hero { position: relative; padding: 84px 0 66px; overflow: hidden; }
.hero::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px; align-items: center; }
.hero h1 .accent { color: var(--amber); }
.hero p.lede { font-size: 1.12rem; max-width: 56ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text);
  font-size: 0.93rem; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); border-color: var(--amber); color: var(--text); }
.btn-primary { background: linear-gradient(150deg, var(--amber), #c8852f); color: #171003; border-color: transparent; }
.btn-primary:hover { color: #171003; }
.btn-ghost { background: transparent; }
.btn-sm { padding: 7px 14px; font-size: 0.84rem; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }

.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 34px; }
.stat {
  background: linear-gradient(160deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 14px 16px;
}
.stat b { display: block; font-family: var(--font-display); font-size: 1.75rem; color: var(--amber-soft); line-height: 1; }
.stat span { font-size: 0.78rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.1em; }

/* ---------- cards ---------- */
.card {
  background: linear-gradient(165deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 20px; transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}
.card-hover:hover { transform: translateY(-3px); border-color: var(--line); box-shadow: var(--shadow); }
.card h3 { margin-bottom: 8px; }
.card p { color: var(--text-dim); font-size: 0.93rem; margin-bottom: 0; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); }

/* ---------- badges ---------- */
.badge {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  border: 1px solid var(--line); color: var(--text-dim); background: var(--surface-2);
}
.badge-combat { color: #f0a08a; border-color: rgba(240, 160, 138, 0.35); background: rgba(240, 160, 138, 0.1); }
.badge-magic { color: #8fb8f5; border-color: rgba(143, 184, 245, 0.35); background: rgba(143, 184, 245, 0.1); }
.badge-hybrid { color: #9fe0c4; border-color: rgba(159, 224, 196, 0.35); background: rgba(159, 224, 196, 0.1); }
.badge-special { color: var(--violet); border-color: rgba(139, 123, 232, 0.4); background: rgba(139, 123, 232, 0.12); }
.badge-completed { color: #8fdca8; border-color: rgba(143, 220, 168, 0.35); background: rgba(143, 220, 168, 0.1); }
.badge-planned { color: #9fb4e8; border-color: rgba(159, 180, 232, 0.35); background: rgba(159, 180, 232, 0.1); }
.badge-blocked { color: var(--rose); border-color: rgba(212, 104, 95, 0.4); background: rgba(212, 104, 95, 0.1); }
.badge-deferred, .badge-in_progress { color: var(--amber); border-color: rgba(232, 163, 61, 0.35); background: rgba(232, 163, 61, 0.1); }
.badge-human { color: var(--teal); border-color: rgba(79, 184, 168, 0.35); background: rgba(79, 184, 168, 0.1); }
.badge-divine { color: var(--violet); border-color: rgba(139, 123, 232, 0.35); background: rgba(139, 123, 232, 0.1); }

/* ---------- tables / lists ---------- */
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 18px; font-size: 0.93rem; }
.kv dt { color: var(--text-faint); }
.kv dd { margin: 0; color: var(--text); }

.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

.empty {
  border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 34px; text-align: center; color: var(--text-faint); background: rgba(21, 26, 41, 0.4);
}
.empty h3 { color: var(--text-dim); }

.notice {
  border-left: 3px solid var(--amber); background: rgba(232, 163, 61, 0.07);
  padding: 14px 18px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-dim); font-size: 0.92rem; margin-bottom: 18px;
}
.notice strong { color: var(--text); }

/* ---------- filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 22px; }
.filters input, .filters select {
  padding: 9px 14px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; color: var(--text); font-family: inherit; font-size: 0.9rem;
}
.filters input:focus, .filters select:focus { outline: none; border-color: var(--amber); }
.chip {
  padding: 7px 15px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text-dim); font-size: 0.85rem; cursor: pointer;
  font-family: inherit; font-weight: 600;
}
.chip[aria-pressed="true"] { background: rgba(232, 163, 61, 0.16); border-color: var(--amber); color: var(--amber-soft); }
.result-count { color: var(--text-faint); font-size: 0.85rem; margin-left: auto; }

/* ---------- class cards ---------- */
.class-card { display: flex; flex-direction: column; gap: 10px; cursor: pointer; text-align: left; width: 100%; }
.class-card .card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.class-card h3 { margin: 0; font-size: 1.1rem; }
.class-card .tier { flex-shrink: 0; }
.class-desc { color: var(--text-dim); font-size: 0.9rem; }

.compare-pick {
  margin-top: auto; padding: 6px 12px; border-radius: 999px; font-size: 0.78rem; font-weight: 700;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text-dim); cursor: pointer;
  font-family: inherit; align-self: flex-start;
}
.compare-pick[aria-pressed="true"] { background: rgba(232, 163, 61, 0.18); border-color: var(--amber); color: var(--amber-soft); }

/* ---------- compare tray ---------- */
.compare-tray {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: rgba(16, 19, 31, 0.97); border-top: 1px solid var(--line);
  backdrop-filter: blur(12px); transform: translateY(105%); transition: transform 0.2s ease;
}
.compare-tray[data-open="true"] { transform: translateY(0); }
.compare-tray-inner { display: flex; align-items: center; gap: 14px; padding: 14px 24px; flex-wrap: wrap; }
.compare-tray .picked { display: flex; gap: 8px; flex-wrap: wrap; }
.compare-tray .picked .badge { cursor: pointer; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: none; }
.modal[data-open="true"] { display: block; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(5, 6, 11, 0.78); backdrop-filter: blur(3px); }
.modal-panel {
  position: relative; margin: 6vh auto; max-width: 720px; max-height: 86vh; overflow: auto;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow);
}
.modal-close {
  position: absolute; top: 14px; right: 14px; background: var(--surface);
  border: 1px solid var(--line); color: var(--text-dim); border-radius: 8px;
  width: 32px; height: 32px; cursor: pointer; font-size: 1.1rem; line-height: 1;
}

/* ---------- builder ---------- */
.builder { display: grid; grid-template-columns: 300px 1fr; gap: 22px; align-items: start; }
.builder-panel { position: sticky; top: 88px; }
.build-field { margin-bottom: 16px; }
.build-field label { display: block; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-faint); margin-bottom: 6px; }
.build-field select {
  width: 100%; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); color: var(--text); font-family: inherit; font-size: 0.92rem;
}
.build-field select:focus { outline: none; border-color: var(--amber); }
.slot-meter { margin-bottom: 12px; }
.slot-meter-head { display: flex; justify-content: space-between; font-size: 0.85rem; margin-bottom: 5px; }
.slot-bar { height: 7px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.slot-fill { height: 100%; background: linear-gradient(90deg, var(--teal), var(--amber)); border-radius: 999px; transition: width 0.2s ease; }
.slot-fill.over { background: linear-gradient(90deg, var(--rose), #e88a5f); }
.warning-list { list-style: none; margin: 0; padding: 0; }
.warning-list li {
  padding: 9px 12px; margin-bottom: 7px; border-radius: var(--radius-sm);
  background: rgba(212, 104, 95, 0.1); border: 1px solid rgba(212, 104, 95, 0.3);
  color: #f0a89f; font-size: 0.86rem;
}
.ok-state {
  padding: 9px 12px; border-radius: var(--radius-sm);
  background: rgba(143, 220, 168, 0.08); border: 1px solid rgba(143, 220, 168, 0.28);
  color: #a8e0bd; font-size: 0.86rem;
}

/* ---------- timeline ---------- */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding-bottom: 22px; }
.tl-item::before {
  content: ""; position: absolute; left: -24px; top: 7px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--surface-2); border: 2px solid var(--line);
}
.tl-item.completed::before { background: var(--teal); border-color: var(--teal); }
.tl-item.blocked::before { background: var(--rose); border-color: var(--rose); }
.tl-item.deferred::before, .tl-item.in_progress::before { background: var(--amber); border-color: var(--amber); }
.tl-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; }
.tl-title { font-weight: 600; font-size: 1rem; }
.tl-meta { color: var(--text-faint); font-size: 0.82rem; }
.tl-summary { color: var(--text-dim); font-size: 0.9rem; margin: 6px 0 0; }

details.entry {
  border: 1px solid var(--line-soft); border-radius: var(--radius-sm);
  background: var(--surface); margin-bottom: 12px; overflow: hidden;
}
details.entry summary {
  padding: 15px 18px; cursor: pointer; list-style: none;
  display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap;
}
details.entry summary::-webkit-details-marker { display: none; }
details.entry summary::after { content: "▾"; margin-left: auto; color: var(--text-faint); transition: transform 0.15s ease; }
details.entry[open] summary::after { transform: rotate(180deg); }
details.entry .entry-body { padding: 0 18px 18px; border-top: 1px solid var(--line-soft); padding-top: 14px; }
details.entry .entry-body pre {
  white-space: pre-wrap; font-family: var(--font-mono); font-size: 0.78rem;
  color: var(--text-dim); margin: 0; line-height: 1.65;
}

/* ---------- compare table ---------- */
.compare-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.compare-table th, .compare-table td {
  text-align: left; vertical-align: top; padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
}
.compare-table thead th { color: var(--amber-soft); font-family: var(--font-display); font-size: 0.98rem; }
.compare-table tbody th { color: var(--text-faint); font-weight: 500; white-space: nowrap; width: 150px; }
.compare-table td { color: var(--text-dim); }

/* ---------- boss ---------- */
.boss-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.boss-card { position: relative; overflow: hidden; }
.boss-card::before {
  content: ""; position: absolute; inset: 0; opacity: 0.55; pointer-events: none;
  background: radial-gradient(320px 160px at 80% -10%, rgba(139, 123, 232, 0.22), transparent 70%);
}
.boss-sin { font-family: var(--font-display); font-size: 1.5rem; color: var(--amber-soft); }
.boss-name { font-size: 0.85rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--text-faint); }

.two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; align-items: start; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line-soft); margin-top: 40px; padding: 34px 0; background: rgba(10, 12, 20, 0.6); }
.footer-inner { display: flex; gap: 34px; justify-content: space-between; flex-wrap: wrap; }
.footer-brand { font-family: var(--font-display); font-size: 1.1rem; letter-spacing: 0.14em; margin-bottom: 6px; }
.footer-meta { text-align: right; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .hero-grid, .two-col, .builder { grid-template-columns: 1fr; }
  .builder-panel { position: static; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .header-inner { flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; min-height: 0; }
  .nav-toggle { display: block; margin-left: auto; order: 2; }
  .site-nav { order: 4; width: 100%; margin-left: 0; display: none; }
  .site-nav[data-open="true"] { display: block; }
  .site-nav ul { flex-direction: column; gap: 2px; padding-bottom: 10px; }
  .site-nav a { padding: 11px 13px; border-radius: var(--radius-sm); }
  .header-search { order: 3; width: 100%; margin-left: 0; }
  .header-search input { width: 100%; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 10px; }
  .footer-meta { text-align: left; }
  .section { padding: 44px 0; }
  .hero { padding: 56px 0 44px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
