/* ==========================================================================
   Nivalis Nights Guide — Shared Stylesheet
   Site: nivalisnights.cc
   Standard: SOP 00B v2.26 / Cyberpunk Dark Theme
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-base: #060912;
  --bg-card: #0b1120;
  --bg-card-hover: #101a30;
  --bg-elevated: #15223e;
  --bg-subtle: rgba(255, 255, 255, 0.03);

  --border-subtle: #1a2742;
  --border-glow-cyan: rgba(0, 240, 255, 0.35);
  --border-glow-pink: rgba(255, 42, 133, 0.35);

  --neon-cyan: #00f0ff;
  --neon-cyan-hover: #5ff4ff;
  --neon-pink: #ff2a85;
  --neon-pink-hover: #ff65a8;
  --neon-amber: #ffbe3b;
  --neon-purple: #9d4edd;

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #060912;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* Layout Widths */
  --width-container: 1140px;
  --width-article: 840px;

  /* Spacing */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

/* CSS Reset & Global Rules */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  line-height: 1.6;
  scroll-behavior: smooth;
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 50% 0%, #101932 0%, #060912 70%);
  background-attachment: fixed;
}

/* Typography Scale */
h1, h2, h3, h4, h5, h6 {
  color: #ffffff;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h1 { font-size: 2.25rem; margin-bottom: 1rem; }
h2 { font-size: 1.6rem; margin-top: 2rem; margin-bottom: 0.85rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--border-subtle); }
h3 { font-size: 1.25rem; margin-top: 1.5rem; margin-bottom: 0.65rem; color: var(--neon-cyan); }
p { margin-bottom: 1.15rem; color: var(--text-secondary); line-height: 1.7; }
p strong { color: var(--text-primary); }

a {
  color: var(--neon-cyan);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

a:hover, a:focus-visible {
  color: var(--neon-cyan-hover);
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--neon-cyan);
  outline-offset: 3px;
}

ul, ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
  color: var(--text-secondary);
}

li {
  margin-bottom: 0.45rem;
  line-height: 1.65;
}

li strong {
  color: var(--text-primary);
}

/* Layout Containers */
.container {
  width: 100%;
  max-width: var(--width-container);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.article-container {
  width: 100%;
  max-width: var(--width-article);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(6, 9, 18, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.75rem 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: #ffffff;
}

.brand-link:hover {
  text-decoration: none;
}

.brand-logo-img {
  width: 36px;
  height: 36px;
  display: block;
  filter: drop-shadow(0 0 6px rgba(0, 240, 255, 0.4));
}

.brand-name-group {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: #ffffff;
  line-height: 1.1;
}

.brand-name .highlight {
  color: var(--neon-cyan);
}

.brand-tag {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--neon-pink);
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.nav-link:hover, .nav-link.active {
  color: #ffffff;
  background-color: var(--bg-card);
  text-decoration: none;
}

.nav-link.active {
  border-bottom: 2px solid var(--neon-cyan);
}

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

.breadcrumbs a {
  color: var(--text-muted);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--neon-cyan);
  text-decoration: underline;
}

.breadcrumbs span.separator {
  color: var(--border-subtle);
}

.breadcrumbs span.current {
  color: var(--text-secondary);
}

/* Badges & Meta Chips */
.badge-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.badge-cyan {
  border-color: var(--border-glow-cyan);
  color: var(--neon-cyan);
  background-color: rgba(0, 240, 255, 0.08);
}

.badge-pink {
  border-color: var(--border-glow-pink);
  color: var(--neon-pink);
  background-color: rgba(255, 42, 133, 0.08);
}

.badge-amber {
  border-color: rgba(255, 190, 59, 0.4);
  color: var(--neon-amber);
  background-color: rgba(255, 190, 59, 0.08);
}

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

.hero-lead {
  font-size: 1.25rem;
  line-height: 1.6;
  color: #e2e8f0;
  max-width: 900px;
  margin-bottom: 1.5rem;
}

.hero-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--neon-cyan);
  border-radius: var(--radius-md);
  margin-top: 1.5rem;
}

.hero-meta-item {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.hero-meta-item strong {
  color: #ffffff;
}

/* Direct Answer Box (For immediate task resolution) */
.direct-answer-card {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.06) 0%, rgba(11, 17, 32, 0.95) 100%);
  border: 1px solid var(--border-glow-cyan);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.direct-answer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.direct-answer-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--neon-cyan);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.direct-answer-content {
  font-size: 1.05rem;
  color: #f8fafc;
  line-height: 1.65;
}

.direct-answer-content p:last-child {
  margin-bottom: 0;
}

/* Feature & Task Selection Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.task-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
  position: relative;
}

.task-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glow-cyan);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 240, 255, 0.1);
}

.task-card-header {
  margin-bottom: 1rem;
}

.task-card-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.5rem;
}

.task-card-body {
  flex: 1;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.task-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.btn-task {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-elevated);
  color: var(--neon-cyan);
  border: 1px solid var(--border-glow-cyan);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-task:hover {
  background: var(--neon-cyan);
  color: var(--bg-base);
  text-decoration: none;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.5);
}

/* Figures & Images */
.figure-wrapper {
  margin: 2rem 0;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.figure-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.figcaption {
  padding: 0.85rem 1.25rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-base);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.figcaption-type {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
}

.figcaption-type.explanatory { color: var(--neon-cyan); }
.figcaption-type.context { color: var(--neon-pink); }

.figcaption-desc {
  color: var(--text-secondary);
}

/* Responsive Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.75rem 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.925rem;
  text-align: left;
}

.data-table th,
.data-table td {
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table th {
  background-color: var(--bg-elevated);
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background-color: var(--bg-subtle);
}

.data-table td strong {
  color: #ffffff;
}

/* Step / Troubleshooting Flow */
.step-list {
  list-style: none;
  padding: 0;
  margin: 2rem 0;
  counter-reset: step-counter;
}

.step-item {
  position: relative;
  padding-left: 3.5rem;
  margin-bottom: 1.75rem;
  counter-increment: step-counter;
}

.step-item::before {
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 2px solid var(--neon-cyan);
  color: var(--neon-cyan);
  font-weight: 800;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

.step-item-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.35rem;
}

.step-item-body {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.65;
}

/* Notice / Callout Boxes */
.callout {
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-md);
  margin: 1.75rem 0;
  border-left: 4px solid;
  background: var(--bg-card);
}

.callout-info {
  border-left-color: var(--neon-cyan);
  background: linear-gradient(90deg, rgba(0, 240, 255, 0.05) 0%, var(--bg-card) 100%);
}

.callout-warning {
  border-left-color: var(--neon-amber);
  background: linear-gradient(90deg, rgba(255, 190, 59, 0.05) 0%, var(--bg-card) 100%);
}

.callout-alert {
  border-left-color: var(--neon-pink);
  background: linear-gradient(90deg, rgba(255, 42, 133, 0.05) 0%, var(--bg-card) 100%);
}

.callout-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.callout-info .callout-title { color: var(--neon-cyan); }
.callout-warning .callout-title { color: var(--neon-amber); }
.callout-alert .callout-title { color: var(--neon-pink); }

.callout p:last-child {
  margin-bottom: 0;
}

/* External Link Component (00B 4B / 4B.1 compliant) */
.external-link {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
  transition: color 0.15s ease;
}

.external-link:hover {
  color: var(--neon-cyan);
}

.external-icon {
  font-size: 0.85em;
  color: var(--neon-cyan);
  font-weight: 800;
  display: inline-block;
  user-select: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Verification Note / Natural Attribution Box */
.verification-strip {
  padding: 0.75rem 1rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 2rem 0;
}

.verification-strip strong {
  color: var(--text-secondary);
}

/* Footer */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-subtle);
  background: rgba(6, 9, 18, 0.95);
  padding: 2.5rem 0 2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.footer-brand-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-disclaimer {
  line-height: 1.6;
  max-width: 800px;
}

.footer-bottom-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.8rem;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-nav a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-nav a:hover {
  color: var(--neon-cyan);
  text-decoration: underline;
}

/* Responsive Media Queries */
@media (max-width: 768px) {
  h1 { font-size: 1.85rem; }
  h2 { font-size: 1.35rem; }
  h3 { font-size: 1.15rem; }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    gap: 0.75rem;
  }

  .hero {
    padding: 2rem 0 1.5rem;
  }

  .hero-lead {
    font-size: 1.1rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .footer-brand-row,
  .footer-bottom-row {
    flex-direction: column;
    align-items: flex-start;
  }
}
