/* GTA VI Guide — sunset-neon theme */
:root {
  --bg: #140f24;
  --bg-2: #1c1532;
  --card: #221a3b;
  --card-2: #2b2149;
  --line: #3a2e5e;
  --text: #f1ecff;
  --muted: #b5aad3;
  --pink: #ff4fa3;
  --orange: #ff9a3d;
  --teal: #2ee6d6;
  --yellow: #ffd84d;
  --red: #ff5c6c;
  --green: #4be38a;
  --grad: linear-gradient(100deg, var(--pink), var(--orange));
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  background-image: radial-gradient(ellipse 80% 50% at 50% -10%, #3b1d4f 0%, transparent 70%);
  background-repeat: no-repeat;
  color: var(--text);
  font: 17px/1.65 var(--font);
}
img { max-width: 100%; height: auto; }
a { color: var(--teal); text-underline-offset: 3px; }
a:hover { color: #8ff5ec; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; border-radius: 4px; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--yellow); color: #000; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(20, 15, 36, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 800; letter-spacing: .3px; }
.logo-mark {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  background: var(--grad); color: #1a0f22; font-size: 17px; font-weight: 900;
}
.logo-text { font-size: 18px; }
.menu-toggle {
  display: none; background: var(--card); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 14px; font: 600 15px var(--font); cursor: pointer;
}
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav a { display: block; padding: 8px 11px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px; }
.site-nav a:hover { color: var(--text); background: var(--card); }
.site-nav a[aria-current="page"] { color: var(--text); background: var(--card-2); box-shadow: inset 0 -2px 0 var(--pink); }

@media (max-width: 880px) {
  .menu-toggle { display: block; }
  .site-nav { display: none; width: 100%; padding-bottom: 12px; }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; }
  .site-nav a { padding: 11px 12px; font-size: 16px; }
}

/* Main content */
main { padding-top: 24px; padding-bottom: 56px; min-height: 60vh; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: clamp(30px, 6vw, 46px); margin: 8px 0 12px; }
h2 { font-size: clamp(23px, 4vw, 29px); margin: 44px 0 12px; padding-top: 8px; }
h3 { font-size: 20px; margin: 28px 0 8px; }
h1 .accent, .grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { font-size: 19px; color: var(--muted); max-width: 760px; margin-top: 0; }
.updated { color: var(--muted); font-size: 14px; margin: 0; }
p, ul, ol { max-width: 780px; }
li { margin: 4px 0; }
strong { color: #fff; }
hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }
code, kbd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }
kbd { background: var(--card-2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; white-space: nowrap; }

/* Hero */
.hero {
  position: relative; overflow: hidden;
  border-radius: 22px; padding: 44px 28px; margin: 4px 0 32px;
  background:
    radial-gradient(circle at 80% 120%, rgba(255, 154, 61, .55), transparent 55%),
    radial-gradient(circle at 15% -20%, rgba(255, 79, 163, .55), transparent 55%),
    linear-gradient(160deg, #2a1846, #18122c 60%);
  border: 1px solid var(--line);
}
.hero::after {
  content: ""; position: absolute; right: -60px; bottom: -120px; width: 320px; height: 320px; border-radius: 50%;
  background: repeating-linear-gradient(180deg, var(--orange) 0 14px, transparent 14px 24px);
  opacity: .22; pointer-events: none;
}
.hero h1 { margin-top: 0; max-width: 700px; position: relative; z-index: 1; }
.hero p { position: relative; z-index: 1; }
.hero .facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; position: relative; z-index: 1; padding: 0; list-style: none; }
.hero .facts li { background: rgba(0, 0, 0, .3); border: 1px solid rgba(255, 255, 255, .14); padding: 6px 12px; border-radius: 99px; font-size: 14px; margin: 0; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin: 18px 0; }
.card {
  display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; text-decoration: none; color: var(--text); transition: transform .15s, border-color .15s;
}
a.card:hover { transform: translateY(-2px); border-color: var(--pink); color: var(--text); }
.card h3 { margin: 0 0 6px; font-size: 18px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.card .tag { display: inline-block; margin-bottom: 8px; }

/* Tags, callouts */
.tag { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 2px 8px; border-radius: 99px; background: var(--card-2); color: var(--muted); }
.tag.miss { background: rgba(255, 92, 108, .16); color: var(--red); }
.tag.opt { background: rgba(46, 230, 214, .12); color: var(--teal); }
.tag.hot { background: rgba(255, 154, 61, .16); color: var(--orange); }
.tag.j { background: rgba(255, 216, 77, .14); color: var(--yellow); }
.tag.l { background: rgba(255, 79, 163, .16); color: var(--pink); }

.callout { border: 1px solid var(--line); border-left: 4px solid var(--teal); background: var(--bg-2); border-radius: 10px; padding: 14px 18px; margin: 20px 0; max-width: 780px; }
.callout p { margin: 6px 0; }
.callout.warn { border-left-color: var(--orange); }
.callout.danger { border-left-color: var(--red); }
.callout strong:first-child { display: block; margin-bottom: 2px; }

/* TOC */
.toc { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin: 20px 0; max-width: 780px; }
.toc h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 6px; padding: 0; }
.toc ol { margin: 0; padding-left: 20px; columns: 2 220px; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 16px 0; border: 1px solid var(--line); border-radius: var(--radius); -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--card-2); color: var(--text); font-size: 13px; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
tbody tr:nth-child(even) td { background: rgba(255, 255, 255, .02); }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
th[data-sort] { cursor: pointer; user-select: none; }
th[data-sort]::after { content: " \2195"; opacity: .45; }
th[aria-sort="ascending"]::after { content: " \2191"; opacity: 1; }
th[aria-sort="descending"]::after { content: " \2193"; opacity: 1; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; color: var(--yellow); }

/* Stat bars */
.bar { display: inline-block; width: 54px; height: 6px; background: var(--line); border-radius: 3px; margin-right: 6px; vertical-align: middle; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--grad); }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; align-items: center; }
.filters input[type="search"] {
  flex: 1 1 220px; background: var(--card); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 10px 12px; font: 16px var(--font);
}
.chip {
  background: var(--card); color: var(--muted); border: 1px solid var(--line); border-radius: 99px;
  padding: 7px 14px; font: 600 14px var(--font); cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--grad); color: #1a0f22; border-color: transparent; }

/* Mission lists */
ol.missions { padding-left: 0; list-style: none; counter-reset: m; max-width: 820px; }
ol.missions li { counter-increment: m; display: flex; gap: 12px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--line); margin: 0; flex-wrap: wrap; }
ol.missions li::before { content: counter(m); min-width: 28px; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 14px; }
ol.missions .note { color: var(--muted); font-size: 14px; flex-basis: 100%; padding-left: 40px; margin-top: -2px; }

/* Spoilers */
details.spoiler { background: var(--bg-2); border: 1px dashed var(--line); border-radius: 10px; padding: 10px 16px; margin: 16px 0; max-width: 820px; }
details.spoiler summary { cursor: pointer; font-weight: 700; color: var(--orange); }
details.spoiler[open] summary { margin-bottom: 8px; }

/* Character grid */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin: 16px 0; }
.person { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.person h3 { margin: 0 0 2px; font-size: 18px; }
.person .role { color: var(--muted); font-size: 14px; margin: 0 0 8px; }
.person p { margin: 6px 0; font-size: 15px; }
.person .missions { font-size: 14px; color: var(--muted); }

/* Steps */
.steps { counter-reset: s; list-style: none; padding: 0; max-width: 820px; }
.steps > li { counter-increment: s; position: relative; padding: 14px 16px 14px 60px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin: 10px 0; }
.steps > li::before {
  content: counter(s); position: absolute; left: 16px; top: 14px; width: 30px; height: 30px; border-radius: 50%;
  background: var(--grad); color: #1a0f22; font-weight: 800; display: grid; place-items: center; font-size: 15px;
}
.steps h3 { margin: 2px 0 4px; font-size: 18px; }
.steps p { margin: 4px 0; }

.sources { font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); margin-top: 48px; padding-top: 16px; max-width: 820px; }
.sources h2 { font-size: 16px; margin: 0 0 6px; padding: 0; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.sources ul { padding-left: 18px; }
.sources a { word-break: break-word; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: #0f0b1c; padding: 36px 0 28px; font-size: 15px; }
.footer-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 20px; margin-bottom: 20px; }
.site-footer h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 8px; padding: 0; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer a { color: var(--text); text-decoration: none; }
.site-footer a:hover { color: var(--teal); }
.disclaimer { color: var(--muted); font-size: 13px; max-width: 820px; }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .hero { padding: 30px 18px; }
  th, td { padding: 8px 10px; }
  .steps > li { padding-left: 56px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
