:root {
  --bg: #0a0a12;
  --bg-card: #16162a;
  --bg-card-2: #1f1f3a;
  --ink: #f5f1e8;
  --ink-dim: #c4b8a8;
  --highlight-yellow: #f5ff3d;
  --neon-orange: #ff7a1a;
  --lavender: #c89bff;
  --acid-green: #8fff4f;
  --pink: #ff5fb5;
  --warn-bg: #2a1a1a;
  --warn-border: var(--neon-orange);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", Helvetica, Arial, sans-serif;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 20% 10%, rgba(200,155,255,0.08) 0%, transparent 40%),
    radial-gradient(circle at 80% 60%, rgba(245,255,61,0.06) 0%, transparent 40%),
    radial-gradient(circle at 50% 90%, rgba(143,255,79,0.05) 0%, transparent 40%);
  color: var(--ink);
  line-height: 1.5;
  font-size: 16px;
  padding: 0 16px 80px;
  max-width: 760px;
  margin: 0 auto;
}

/* sticky header */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 18, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  margin: 0 -16px;
  padding: 10px 16px;
  border-bottom: 2px solid var(--lavender);
}

.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

h1 {
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, var(--highlight-yellow), var(--acid-green), var(--lavender), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-transform: lowercase;
  line-height: 1;
}

#search {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--lavender);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 16px;
  font-family: inherit;
  min-width: 0;
}

#search::placeholder { color: var(--ink-dim); }
#search:focus { outline: 2px solid var(--highlight-yellow); }

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

nav a {
  display: inline-block;
  padding: 8px 14px;
  background: var(--bg-card);
  color: var(--highlight-yellow);
  text-decoration: none;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--lavender);
  min-height: 36px;
}

nav a:active { background: var(--lavender); color: var(--bg); }

.sub {
  color: var(--ink-dim);
  font-size: 0.75rem;
  font-style: italic;
  margin-top: 8px;
}

main { padding-top: 16px; }

section { margin: 28px 0; scroll-margin-top: 100px; }

h2 {
  font-size: 1.4rem;
  color: var(--neon-orange);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--ink-dim);
}

h3 {
  color: var(--acid-green);
  font-size: 1.05rem;
  margin-bottom: 8px;
  text-transform: lowercase;
}

p { margin-bottom: 10px; }
p:last-child { margin-bottom: 0; }
ul, ol { padding-left: 20px; margin-bottom: 10px; }
li { margin-bottom: 6px; }
strong { color: var(--highlight-yellow); font-weight: 700; }
a { color: var(--pink); }

details {
  background: var(--bg-card);
  border: 1px solid var(--lavender);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

details[open] { background: var(--bg-card-2); }

summary {
  font-weight: 700;
  color: var(--lavender);
  cursor: pointer;
  font-size: 1.05rem;
  list-style: none;
  position: relative;
  padding: 4px 28px 4px 0;
  text-transform: lowercase;
  min-height: 32px;
}

summary::-webkit-details-marker { display: none; }

summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 0;
  font-size: 1.6rem;
  color: var(--highlight-yellow);
  line-height: 1;
}

details[open] summary::after { content: "−"; }
details > *:not(summary) { margin-top: 12px; }

.warn {
  background: var(--warn-bg);
  border-left: 3px solid var(--warn-border);
  padding: 10px 12px;
  border-radius: 4px;
  font-size: 0.9rem;
}

.note {
  background: rgba(143,255,79,0.07);
  border-left: 3px solid var(--acid-green);
  padding: 10px 12px;
  border-radius: 4px;
  font-size: 0.9rem;
  color: var(--ink-dim);
  margin-bottom: 16px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 600px) {
  .grid { grid-template-columns: 1fr 1fr; }
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--lavender);
  border-radius: 12px;
  padding: 14px 16px;
}

.act-1 { border-left: 4px solid var(--acid-green); }
.act-2 { border-left: 4px solid var(--highlight-yellow); }
.act-3 { border-left: 4px solid var(--neon-orange); }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-bottom: 12px;
}

th, td {
  padding: 10px 8px;
  text-align: left;
  border-bottom: 1px solid #2a2a45;
  vertical-align: top;
}

th {
  background: var(--bg-card-2);
  color: var(--lavender);
  font-weight: 700;
  text-transform: lowercase;
  font-size: 0.8rem;
}

tbody tr:nth-child(even) { background: rgba(31,31,58,0.4); }
tbody tr.hidden { display: none; }

.tips li { padding-left: 4px; }
.tips li::marker { color: var(--pink); content: "▸ "; }

/* floating back to top */
#totop {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--lavender);
  color: var(--bg);
  border: none;
  font-size: 1.6rem;
  font-weight: 900;
  box-shadow: 0 4px 16px rgba(200,155,255,0.4);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 99;
}

#totop.show { opacity: 1; pointer-events: auto; }

footer {
  margin-top: 48px;
  padding-top: 16px;
  border-top: 1px dashed var(--ink-dim);
  color: var(--ink-dim);
  font-size: 0.75rem;
  font-style: italic;
}

footer p { margin-bottom: 4px; }

/* mobile tweaks */
@media (max-width: 480px) {
  body { font-size: 15px; }
  h1 { font-size: 1.2rem; }
  h2 { font-size: 1.2rem; }
  th, td { padding: 8px 6px; font-size: 0.85rem; }
}

.hl {
  background: var(--highlight-yellow);
  color: var(--bg);
  padding: 0 2px;
  border-radius: 2px;
}
