/* ═══════════════════════════════════════════════
   Custom Jobs Guide — WARP 07-16
   Ragnarok Online themed dark palette
   ═══════════════════════════════════════════════ */

:root {
  /* RO-inspired palette: deep navy night sky, warm gold UI accents */
  --bg: #0b0e17;
  --bg-warm: #0e1119;
  --surface: #141822;
  --surface-raised: #1a1f2d;
  --surface-glow: #1e2536;
  --gold: #e8c252;
  --gold-dim: #a8923e;
  --gold-bright: #f5d76e;
  --red: #c44b4b;
  --red-dim: #8b3535;
  --blue: #4a8bb5;
  --blue-dim: #35698a;
  --green: #5daa68;
  --green-dim: #3d7a48;
  --purple: #8b6abf;
  --text: #c8c4b8;
  --text-dim: #6e6b60;
  --text-bright: #e8e4d8;
  --code-bg: #090c12;
  --code-border: #1e2230;
  --border: #1e2230;
  --border-subtle: #161a25;
  --checked: #5daa68;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'IBM Plex Sans', -apple-system, sans-serif;
  background: var(--bg-warm);
  color: var(--text);
  line-height: 1.75;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

/* ── Subtle grain texture ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
}

/* ═══ Layout ═══ */
.page-wrapper {
  max-width: 820px;
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
}

/* ═══ Hero ═══ */
.hero {
  position: relative;
  padding: 3rem 0 2.5rem;
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--border);
}

.hero::before {
  content: '';
  position: absolute;
  top: 0; left: -2rem; right: -2rem; bottom: 0;
  background:
    radial-gradient(ellipse 50% 70% at 15% 30%, rgba(232, 194, 82, 0.05) 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 80% 60%, rgba(74, 139, 181, 0.03) 0%, transparent 70%);
  pointer-events: none;
}

.hero-label {
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.hero-label::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 2px;
  background: var(--gold-dim);
}

.hero h1 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 2.8rem;
  font-weight: 400;
  color: var(--gold);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  text-shadow: 0 0 40px rgba(232, 194, 82, 0.1);
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-dim);
  max-width: 520px;
}

.hero-sub strong {
  color: var(--gold);
  font-weight: 500;
}

/* ═══ Overview grid ═══ */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin: 2rem 0 3rem;
}

.overview-cell {
  background: var(--surface);
  padding: 1.2rem 1.4rem;
}

.overview-cell-label {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.overview-cell-value {
  font-size: 0.95rem;
  color: var(--text-bright);
}

.overview-cell-value code {
  background: var(--code-bg);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-size: 0.85em;
}

/* ═══ Sidebar nav ═══ */
.toc {
  position: fixed;
  top: 3rem;
  right: max(1rem, calc((100vw - 820px) / 2 - 200px));
  width: 160px;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.toc a {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-decoration: none;
  padding: 0.25rem 0.6rem;
  border-left: 2px solid transparent;
  transition: all 0.2s ease;
  letter-spacing: 0.02em;
}

.toc a:hover,
.toc a.active {
  color: var(--gold);
  border-left-color: var(--gold-dim);
}

@media (max-width: 1200px) {
  .toc { display: none; }
}

@media (max-width: 640px) {
  .overview-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2rem; }
  .page-wrapper { padding: 2rem 1.25rem 3rem; }
}

/* ═══ Sections ═══ */
.section {
  margin-bottom: 3.5rem;
  position: relative;
}

.section + .section::before {
  content: '';
  display: block;
  width: 40px;
  height: 1px;
  background: var(--border);
  margin-bottom: 3.5rem;
}

/* ═══ Headings ═══ */
h2 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--text-bright);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  letter-spacing: -0.01em;
}

.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dim) 100%);
  color: var(--bg);
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(232, 194, 82, 0.15);
}

h3 {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gold);
  margin: 1.8rem 0 0.6rem;
  letter-spacing: 0.01em;
}

h3 code {
  color: var(--text-dim);
  font-weight: 400;
}

h4 {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-bright);
  margin: 1.4rem 0 0.5rem;
  padding-left: 0.75rem;
  border-left: 2px solid var(--gold-dim);
}

p { margin: 0.6rem 0; }
strong { color: var(--text-bright); font-weight: 600; }

/* ═══ Inline code ═══ */
code {
  font-family: 'JetBrains Mono', 'Cascadia Code', monospace;
  font-size: 0.82em;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  color: var(--gold-bright);
}

/* ═══ Code blocks ═══ */
pre {
  position: relative;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin: 1rem 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--text);
}

pre::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--gold-dim), transparent 60%);
  opacity: 0.3;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

.code-label {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: var(--surface);
  display: inline-block;
  padding: 0.2rem 0.7rem;
  border-radius: 4px 4px 0 0;
  border: 1px solid var(--code-border);
  border-bottom: none;
  margin-bottom: -1px;
  position: relative;
  z-index: 1;
}

/* ═══ Callout boxes ═══ */
.callout {
  position: relative;
  padding: 1rem 1.25rem 1rem 3.2rem;
  margin: 1.25rem 0;
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.65;
}

.callout::before {
  position: absolute;
  left: 1.15rem;
  top: 1.05rem;
  font-size: 1rem;
  line-height: 1;
}

.callout-warn {
  background: rgba(196, 75, 75, 0.07);
  border: 1px solid rgba(196, 75, 75, 0.2);
}
.callout-warn::before { content: '\26A0'; }
.callout-warn strong { color: var(--red); }

.callout-info {
  background: rgba(74, 139, 181, 0.07);
  border: 1px solid rgba(74, 139, 181, 0.2);
}
.callout-info::before { content: '\2139'; }
.callout-info strong { color: var(--blue); }

.callout-critical {
  background: rgba(196, 75, 75, 0.1);
  border: 1px solid rgba(196, 75, 75, 0.3);
}
.callout-critical::before { content: '\2622'; }
.callout-critical strong { color: #e06050; }

/* ═══ Tables ═══ */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1.25rem 0;
  font-size: 0.88rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

th {
  background: var(--surface-raised);
  text-align: left;
  padding: 0.7rem 1rem;
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-dim);
  border-bottom: 1px solid var(--border);
}

td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface);
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface-glow); }

/* ═══ Checklist ═══ */
.checklist-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.25rem;
}

@media (max-width: 640px) {
  .checklist-section { grid-template-columns: 1fr; }
}

.checklist-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
}

.checklist-card h3 {
  margin: 0 0 0.8rem;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.checklist-progress {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.checklist-progress-bar {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.checklist-progress-fill {
  height: 100%;
  background: var(--green);
  border-radius: 2px;
  transition: width 0.3s ease;
  width: 0%;
}

.checklist {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.checklist li {
  position: relative;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text);
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.3rem 0.4rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s ease;
  user-select: none;
}

.checklist li:hover {
  background: var(--surface-glow);
}

.checklist li input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  min-width: 16px;
  border: 1.5px solid var(--gold-dim);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  margin-top: 2px;
  transition: all 0.2s ease;
  position: relative;
}

.checklist li input[type="checkbox"]:checked {
  background: var(--checked);
  border-color: var(--checked);
}

.checklist li input[type="checkbox"]:checked::after {
  content: '\2713';
  position: absolute;
  top: -1px;
  left: 2px;
  font-size: 11px;
  color: #fff;
  font-weight: 700;
}

.checklist li.checked-item {
  color: var(--text-dim);
  text-decoration: line-through;
  text-decoration-color: var(--text-dim);
}

.checklist-reset {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 1rem;
  padding: 0.35rem 0.8rem;
  font-size: 0.7rem;
  font-family: 'IBM Plex Sans', sans-serif;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.checklist-reset:hover {
  color: var(--red);
  border-color: var(--red-dim);
}

/* ═══ File tree ═══ */
.file-tree {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 8px;
  padding: 1.5rem 1.5rem 1.5rem 1.8rem;
  line-height: 1.75;
  color: var(--text-dim);
  white-space: pre;
  overflow-x: auto;
}

.file-tree em {
  color: var(--gold-dim);
  font-style: normal;
  opacity: 0.8;
}

.file-tree .ft-dir { color: var(--blue); }
.file-tree .ft-file { color: var(--text); }

/* ═══ Troubleshooting ═══ */
.trouble-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1.25rem 0;
}

.trouble-item {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border-radius: 8px;
  overflow: hidden;
}

@media (max-width: 640px) {
  .trouble-item { grid-template-columns: 1fr; }
}

.trouble-cell {
  background: var(--surface);
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
}

.trouble-cell:first-child {
  color: var(--text-bright);
  font-weight: 500;
}

.trouble-cell:nth-child(2) {
  color: var(--text-dim);
}

.trouble-cell:last-child {
  color: var(--green);
}

/* ═══ Footer ═══ */
footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-dim);
  font-size: 0.75rem;
  letter-spacing: 0.03em;
}

footer .footer-brand {
  font-family: 'DM Serif Display', serif;
  font-size: 0.9rem;
  color: var(--gold-dim);
}

@media (max-width: 640px) {
  footer {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}

/* ═══ Animations ═══ */
.section {
  opacity: 0;
  transform: translateY(12px);
  animation: fadeUp 0.5s ease forwards;
}

.section:nth-child(1)  { animation-delay: 0.05s; }
.section:nth-child(2)  { animation-delay: 0.1s; }
.section:nth-child(3)  { animation-delay: 0.15s; }
.section:nth-child(4)  { animation-delay: 0.2s; }
.section:nth-child(5)  { animation-delay: 0.25s; }
.section:nth-child(6)  { animation-delay: 0.3s; }
.section:nth-child(7)  { animation-delay: 0.35s; }
.section:nth-child(8)  { animation-delay: 0.4s; }
.section:nth-child(9)  { animation-delay: 0.45s; }
.section:nth-child(10) { animation-delay: 0.5s; }
.section:nth-child(11) { animation-delay: 0.55s; }

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ═══ Selection & Scrollbar ═══ */
::selection {
  background: rgba(232, 194, 82, 0.25);
  color: var(--text-bright);
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-warm); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dim); }
