/* ============================================================================
   poe2.ai design system  ·  site.css
   Single source of truth for tokens + reusable components across every page.
   Load AFTER the Tailwind CDN so component classes can layer on top.
   See DESIGN.md for the rulebook (when to use what, how to add a page).
   ============================================================================ */

/* ---- Fonts ---------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ---- Design tokens -------------------------------------------------------- */
:root {
  /* Surfaces (dark, premium) */
  --bg:            #0a0a0f;
  --surface-1:     #14141c;
  --surface-2:     #1b1b26;
  --surface-3:     #232331;
  --border:        #2a2a3a;
  --border-strong: #3a3a4f;

  /* Text */
  --text:   #e7e8ee;
  --muted:  #9aa0b0;
  --faint:  #6b7180;

  /* Brand + semantic */
  --accent:       #6f74f2;
  --accent-hover: #8f93f7;
  --accent-ink:   #ffffff;
  --gold:   #ffd35c;   /* rare / chase */
  --violet: #a78bfa;   /* purple runes */
  --blue:   #6c8cff;   /* magic */
  --sky:    #38bdf8;   /* Hilda / info */
  --amber:  #fbbf24;   /* Jado */
  --red:    #f8737c;   /* danger / avoid */
  --green:  #43d39e;   /* good / confirm */

  /* Elevation + shape */
  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --shadow-1: 0 1px 2px rgba(0,0,0,.4);
  --shadow-2: 0 8px 24px -8px rgba(0,0,0,.55);
  --shadow-pop: 0 16px 40px -12px rgba(0,0,0,.6);
  --ring: 0 0 0 1px var(--border);

  /* Layout */
  --nav-h: 56px;
  --container: 1120px;

  /* Motion */
  --t-fast: .12s ease;
  --t: .18s ease;
}

/* ---- Base ----------------------------------------------------------------- */
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* Subtle top-of-page brand glow so the site doesn't read as a flat doc. */
body.ds-glow::before {
  content: '';
  position: fixed;
  inset: 0 0 auto 0;
  height: 420px;
  pointer-events: none;
  background:
    radial-gradient(60% 100% at 20% 0%, rgba(111,116,242,.10), transparent 70%),
    radial-gradient(50% 100% at 90% 0%, rgba(167,139,250,.08), transparent 70%);
  z-index: 0;
}
::selection { background: rgba(111,116,242,.35); }
a { color: inherit; }
*:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---- Layout helpers ------------------------------------------------------- */
.ds-container { max-width: var(--container); margin: 0 auto; padding-left: 1rem; padding-right: 1rem; position: relative; z-index: 1; }
.ds-eyebrow { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); font-weight: 700; }
.ds-h1 { font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 800; color: #fff; letter-spacing: -.02em; line-height: 1.1; }
.ds-h2 { font-size: 1.35rem; font-weight: 800; color: #fff; letter-spacing: -.01em; }
.ds-muted { color: var(--muted); }
.ds-divider { height: 1px; background: var(--border); border: 0; margin: 1.5rem 0; }

/* ---- Top navigation ------------------------------------------------------- */
.ds-nav {
  position: sticky; top: 0; z-index: 40;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.ds-nav__inner { max-width: var(--container); margin: 0 auto; height: 100%; padding: 0 1rem; display: flex; align-items: center; justify-content: space-between; }
.ds-brand { font-size: 1.2rem; font-weight: 900; color: #fff; letter-spacing: -.02em; text-decoration: none; }
.ds-brand span { color: var(--accent); }
.ds-navlinks { display: flex; align-items: center; gap: .25rem; }
.ds-navlink {
  font-size: .9rem; font-weight: 600; color: var(--muted);
  padding: .4rem .7rem; border-radius: var(--radius-sm);
  text-decoration: none; transition: background var(--t-fast), color var(--t-fast);
}
.ds-navlink:hover { background: var(--surface-2); color: var(--text); }
.ds-navlink[aria-current="page"] { background: var(--surface-2); color: #fff; box-shadow: inset 0 0 0 1px var(--border-strong); }

/* ---- Buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-weight: 600; font-size: .9rem; line-height: 1;
  padding: .6rem 1rem; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer;
  transition: transform var(--t-fast), background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
  text-decoration: none; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: linear-gradient(180deg, var(--accent-hover), var(--accent)); color: var(--accent-ink); box-shadow: var(--shadow-1), 0 6px 18px -8px var(--accent); }
.btn--primary:hover { filter: brightness(1.06); }
.btn--ghost { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn--ghost:hover { background: var(--surface-3); border-color: var(--border-strong); }
.btn--sm { padding: .4rem .7rem; font-size: .82rem; }
.btn--link { background: none; color: var(--accent); padding: 0; }
.btn--link:hover { color: var(--accent-hover); }

/* ---- Cards ---------------------------------------------------------------- */
.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.15rem;
}
.card--sub { background: var(--surface-2); }
.card--hover { transition: transform var(--t), border-color var(--t), box-shadow var(--t); }
.card--hover:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: var(--shadow-2); }
.card__label { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); font-weight: 700; margin-bottom: .55rem; }

/* ---- Badges + chips ------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .74rem; font-weight: 700; letter-spacing: .01em;
  padding: .22rem .5rem; border-radius: 999px;
  background: var(--surface-3); color: var(--muted);
  border: 1px solid var(--border);
}
.badge--accent { background: color-mix(in srgb, var(--accent) 18%, transparent); color: #c9cbff; border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.badge--gold   { background: color-mix(in srgb, var(--gold) 15%, transparent);  color: var(--gold);  border-color: color-mix(in srgb, var(--gold) 35%, transparent); }
.badge--good   { background: color-mix(in srgb, var(--green) 15%, transparent); color: var(--green); border-color: color-mix(in srgb, var(--green) 35%, transparent); }
.badge--danger { background: color-mix(in srgb, var(--red) 15%, transparent);   color: var(--red);   border-color: color-mix(in srgb, var(--red) 35%, transparent); }

.chip {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .82rem; font-weight: 500;
  padding: .3rem .55rem; border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
}
.chip--gold   { color: var(--gold);   background: color-mix(in srgb, var(--gold) 10%, transparent);   border-color: color-mix(in srgb, var(--gold) 30%, transparent); }
.chip--violet { color: #d6c8ff; background: color-mix(in srgb, var(--violet) 14%, transparent); border-color: color-mix(in srgb, var(--violet) 34%, transparent); }
.chip--sky    { color: #bce6ff; background: color-mix(in srgb, var(--sky) 12%, transparent);    border-color: color-mix(in srgb, var(--sky) 32%, transparent); }
.chip--danger { color: #ffc2c6; background: color-mix(in srgb, var(--red) 12%, transparent);    border-color: color-mix(in srgb, var(--red) 30%, transparent); }

/* ---- Stat (label over value), for hero metric rows ------------------------ */
.stat { display: flex; flex-direction: column; gap: .1rem; padding: .55rem .8rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); min-width: 92px; }
.stat__k { font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); font-weight: 700; }
.stat__v { font-size: .95rem; font-weight: 700; color: #fff; }

/* ---- App shell: sidebar + content ---------------------------------------- */
.shell { display: grid; grid-template-columns: 248px 1fr; gap: 1.5rem; align-items: start; }
.rail { position: sticky; top: calc(var(--nav-h) + 1rem); display: flex; flex-direction: column; gap: .25rem; }
.rail__title { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); font-weight: 700; padding: 0 .6rem .4rem; }
.rail__item {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  text-align: left; width: 100%; cursor: pointer;
  padding: .55rem .7rem; border-radius: var(--radius-sm);
  background: transparent; border: 1px solid transparent; color: var(--muted);
  font-size: .9rem; font-weight: 600; transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.rail__item:hover { background: var(--surface-2); color: var(--text); }
.rail__item[aria-current="true"] { background: var(--surface-2); color: #fff; border-color: var(--border-strong); box-shadow: inset 2px 0 0 var(--accent); }
.rail__tag { font-size: .66rem; font-weight: 700; color: var(--faint); }
.rail__item[aria-current="true"] .rail__tag { color: var(--accent); }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; gap: 1rem; }
  .rail { position: static; flex-direction: row; flex-wrap: wrap; padding-bottom: .35rem; gap: .4rem; }
  .rail__title { flex-basis: 100%; padding: 0 0 .1rem; }
  .rail__item { width: auto; white-space: nowrap; flex: 0 0 auto; justify-content: center; }
  .rail__item .rail__tag { display: none; }
  .rail__item[aria-current="true"] { box-shadow: inset 0 0 0 1px var(--border-strong); }
}

/* ---- Two-column content within a strategy --------------------------------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---- Atlas node tiles (game-like master grid) ----------------------------- */
.atlas { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; max-width: 320px; }
.node { display: flex; flex-direction: column; align-items: center; gap: .3rem; text-align: center; }
.node__tile {
  width: 56px; height: 56px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--surface-1); border: 1px solid var(--border);
  opacity: .38; transition: transform var(--t-fast);
}
.node__tile > span { font-size: 1.15rem; line-height: 1; color: var(--faint); }
.node__name { font-size: .62rem; line-height: 1.15; color: var(--faint); max-width: 4.6rem; }
.node.is-on .node__tile { opacity: 1; }
.node.is-on .node__name { color: var(--text); }
/* master accents applied via .atlas--jado / --doryani / --hilda on the grid */
.atlas--jado    .node.is-on .node__tile { background: color-mix(in srgb, var(--amber) 16%, var(--surface-1)); border-color: color-mix(in srgb, var(--amber) 60%, transparent); box-shadow: 0 0 14px -3px color-mix(in srgb, var(--amber) 70%, transparent); }
.atlas--jado    .node.is-on .node__tile > span { color: var(--amber); }
.atlas--doryani .node.is-on .node__tile { background: color-mix(in srgb, var(--red) 16%, var(--surface-1)); border-color: color-mix(in srgb, var(--red) 60%, transparent); box-shadow: 0 0 14px -3px color-mix(in srgb, var(--red) 70%, transparent); }
.atlas--doryani .node.is-on .node__tile > span { color: var(--red); }
.atlas--hilda   .node.is-on .node__tile { background: color-mix(in srgb, var(--sky) 16%, var(--surface-1)); border-color: color-mix(in srgb, var(--sky) 60%, transparent); box-shadow: 0 0 14px -3px color-mix(in srgb, var(--sky) 70%, transparent); }
.atlas--hilda   .node.is-on .node__tile > span { color: var(--sky); }

/* ---- Tablet loadout slots ------------------------------------------------- */
.slots { display: flex; flex-wrap: wrap; gap: .5rem; }
.slot {
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem .7rem; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--border);
}
.slot__n { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: color-mix(in srgb, var(--accent) 22%, transparent); color: #c9cbff; font-weight: 800; font-size: .8rem; flex: 0 0 auto; }
.slot__label { font-size: .84rem; color: var(--text); }

/* ---- Mod list rows -------------------------------------------------------- */
.mods { display: flex; flex-direction: column; gap: .35rem; }
.mod { display: flex; gap: .5rem; align-items: baseline; font-size: .88rem; color: var(--text); }
.mod__mark { flex: 0 0 auto; }
.mod--must .mod__mark { color: var(--gold); }
.mod--good .mod__mark { color: var(--faint); }

/* ---- Guide steps (numbered, follow-along) --------------------------------- */
.steps { display: grid; gap: .9rem; }
.gstep__head { display: flex; align-items: center; gap: .6rem; margin-bottom: .85rem; flex-wrap: wrap; }
.gstep__n {
  width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; font-weight: 800; font-size: .9rem;
  background: linear-gradient(180deg, var(--accent-hover), var(--accent)); color: #fff;
  box-shadow: 0 4px 12px -4px var(--accent);
}
.gstep__title { font-weight: 800; color: #fff; font-size: 1.02rem; letter-spacing: -.01em; }
.gstep__masters { display: flex; flex-wrap: wrap; gap: 1.25rem; }

/* Callout for must-have info */
.callout {
  border-left: 3px solid var(--gold);
  background: color-mix(in srgb, var(--gold) 8%, transparent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: .7rem .85rem;
}
.callout__k { font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); font-weight: 800; margin-bottom: .4rem; }

/* Checklist (in-map routine, run steps) */
.checklist { display: grid; gap: .5rem; }
.check { display: flex; gap: .55rem; align-items: baseline; font-size: .88rem; line-height: 1.5; color: var(--text); }
.check__i { flex: 0 0 auto; color: var(--accent); font-weight: 800; }

/* Collapsible annotation (hide detail behind a "Details" toggle) */
.ann { margin-top: .7rem; }
.ann > summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: .35rem; font-size: .76rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--accent); user-select: none; }
.ann > summary::-webkit-details-marker { display: none; }
.ann > summary::before { content: '▸'; font-size: .7rem; transition: transform var(--t-fast); }
.ann[open] > summary::before { transform: rotate(90deg); }
.ann__body { margin-top: .7rem; }
.ann__note { font-size: .8rem; color: var(--muted); line-height: 1.5; }

/* Ordered crafting recipe (numbered how-to steps) */
.recipe { display: grid; gap: .5rem; margin: 0; padding: 0; list-style: none; counter-reset: recipe; }
.recipe__step { display: flex; gap: .6rem; align-items: flex-start; font-size: .86rem; line-height: 1.5; color: var(--text); }
.recipe__step > span { flex: 1; min-width: 0; }
.recipe__step::before {
  counter-increment: recipe; content: counter(recipe);
  flex: 0 0 auto; width: 22px; height: 22px; margin-top: 1px;
  border-radius: 7px; background: color-mix(in srgb, var(--accent) 20%, transparent);
  color: #c9cbff; font-weight: 800; font-size: .72rem; display: grid; place-items: center;
}
.recipe b, .recipe strong { color: #fff; font-weight: 700; }

/* Bulleted spec lines (waystone breakdown) */
.spec { display: grid; gap: .4rem; }
.spec__row { display: flex; gap: .5rem; align-items: baseline; font-size: .88rem; line-height: 1.5; }
.spec__row::before { content: '›'; color: var(--accent); font-weight: 800; flex: 0 0 auto; }

/* ---- Footer --------------------------------------------------------------- */
.ds-footer { border-top: 1px solid var(--border); text-align: center; font-size: .78rem; color: var(--faint); padding: 1.5rem 1rem; margin-top: 2.5rem; }
.ds-footer a { color: var(--muted); text-decoration: none; }
.ds-footer a:hover { color: var(--accent); }
