/* ============================================
   Obsidian World Info — Design System
   Dark magazine layout, elegant typography
   ============================================ */

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

:root {
  --bg-primary: #0a0a0f;
  --bg-card: #12121a;
  --bg-elevated: #1a1a26;
  --bg-hover: #22222e;
  --text-primary: #e8e6e3;
  --text-secondary: #9a9a9a;
  --text-muted: #666;
  --accent: #c9a55a;
  --accent-hover: #d4b76a;
  --accent-dim: rgba(201, 165, 90, 0.15);
  --danger: #c0392b;
  --safe: #27ae60;
  --border: #2a2a36;
  --radius: 8px;
  --radius-lg: 12px;
  --max-width: 1200px;
  --max-article: 780px;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; height: auto; border-radius: var(--radius); }

/* --- Typography --- */
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 700; line-height: 1.25; }
h1 { font-size: 2.5rem; margin-bottom: 1rem; }
h2 { font-size: 1.75rem; margin: 2.5rem 0 1rem; }
h3 { font-size: 1.35rem; margin: 2rem 0 0.75rem; }
h4 { font-size: 1.1rem; margin: 1.5rem 0 0.5rem; }
p { margin-bottom: 1.25rem; }

/* --- Layout --- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }
.article-body { max-width: var(--max-article); margin: 0 auto; }

/* --- Header / Nav --- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10, 10, 15, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
}
.logo {
  font-family: var(--font-heading);
  font-size: 1.4rem; font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}
.logo span { color: var(--accent); }

nav { display: flex; gap: 1.75rem; align-items: center; }
nav a {
  color: var(--text-secondary); font-size: 0.9rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.06em; transition: color 0.2s;
}
nav a:hover, nav a.active { color: var(--accent); }

.mobile-toggle {
  display: none; background: none; border: none; color: var(--text-primary);
  font-size: 1.5rem; cursor: pointer;
}

/* --- Hero --- */
.hero {
  padding: 5rem 0 3rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.hero h1 { font-size: 3rem; margin-bottom: 0.75rem; }
.hero h1 span { color: var(--accent); }
.hero .tagline {
  font-size: 1.15rem; color: var(--text-secondary);
  max-width: 600px; margin: 0 auto 1.5rem;
}
.hero .disclaimer {
  font-size: 0.8rem; color: var(--text-muted);
  max-width: 500px; margin: 0 auto;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* --- Category Grid --- */
.categories {
  padding: 3rem 0;
}
.categories h2 {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 1.5rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--font-body);
  font-weight: 600;
}
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}
.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: transform 0.2s, border-color 0.2s, background 0.2s;
}
.category-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: var(--bg-elevated);
}
.category-card .icon {
  font-size: 2rem; margin-bottom: 1rem;
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-dim);
  border-radius: var(--radius);
}
.category-card h3 {
  margin: 0 0 0.5rem; font-size: 1.25rem;
  font-family: var(--font-heading);
}
.category-card h3 a { color: var(--text-primary); }
.category-card h3 a:hover { color: var(--accent); }
.category-card p {
  color: var(--text-secondary); font-size: 0.92rem;
  margin-bottom: 1rem;
}
.category-card .article-list { list-style: none; }
.category-card .article-list li {
  padding: 0.4rem 0;
  border-top: 1px solid var(--border);
}
.category-card .article-list li:first-child { border-top: none; }
.category-card .article-list a {
  color: var(--text-secondary); font-size: 0.88rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.category-card .article-list a::before {
  content: '\2192'; color: var(--accent); font-size: 0.75rem;
}
.category-card .article-list a:hover { color: var(--accent); }

/* --- Article Cards (Featured) --- */
.featured { padding: 3rem 0; }
.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}
.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
}
.article-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}
.article-card .card-body { padding: 1.5rem; }
.article-card .tag {
  display: inline-block;
  font-size: 0.72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--accent); background: var(--accent-dim);
  padding: 0.25rem 0.65rem; border-radius: 4px;
  margin-bottom: 0.75rem;
}
.article-card h3 {
  font-size: 1.15rem; margin: 0 0 0.5rem;
  font-family: var(--font-heading);
}
.article-card h3 a { color: var(--text-primary); }
.article-card h3 a:hover { color: var(--accent); }
.article-card .excerpt {
  color: var(--text-secondary); font-size: 0.9rem;
  margin-bottom: 1rem;
}
.article-card .meta {
  display: flex; align-items: center; gap: 0.75rem;
  font-size: 0.8rem; color: var(--text-muted);
}
.article-card .meta .author { color: var(--accent); font-weight: 500; }

/* --- Article Page --- */
.article-header {
  padding: 4rem 0 2rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.article-header .breadcrumb {
  font-size: 0.85rem; color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.article-header .breadcrumb a { color: var(--text-secondary); }
.article-header h1 { font-size: 2.5rem; max-width: 700px; margin: 0 auto 1rem; }
.article-header .subtitle {
  font-size: 1.1rem; color: var(--text-secondary);
  max-width: 600px; margin: 0 auto 1.5rem;
}
.article-header .meta-bar {
  display: flex; align-items: center; justify-content: center;
  gap: 1.5rem; font-size: 0.88rem; color: var(--text-muted);
}
.article-header .meta-bar .author { color: var(--accent); font-weight: 600; }

.article-content {
  padding: 3rem 0 4rem;
}
.article-content .article-body p { font-size: 1.05rem; }
.article-content .article-body h2 {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.article-content .article-body ul,
.article-content .article-body ol {
  margin: 0 0 1.25rem 1.5rem;
}
.article-content .article-body li {
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}
.article-content .article-body li strong { color: var(--text-primary); }

/* Callout Boxes */
.callout {
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  margin: 1.5rem 0;
  border-left: 4px solid;
}
.callout-safety {
  background: rgba(39, 174, 96, 0.08);
  border-color: var(--safe);
}
.callout-warning {
  background: rgba(192, 57, 43, 0.08);
  border-color: var(--danger);
}
.callout-info {
  background: var(--accent-dim);
  border-color: var(--accent);
}
.callout h4 {
  margin: 0 0 0.5rem; font-size: 0.95rem;
  font-family: var(--font-body); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.callout-safety h4 { color: var(--safe); }
.callout-warning h4 { color: var(--danger); }
.callout-info h4 { color: var(--accent); }
.callout p { font-size: 0.92rem; margin-bottom: 0; color: var(--text-secondary); }

/* Image Figures (Shibari tutorials) */
.figure {
  margin: 2rem 0;
  text-align: center;
}
.figure img {
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.figure .placeholder {
  background: var(--bg-elevated);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.figure figcaption {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Step-by-step (tutorials) */
.steps { counter-reset: step; margin: 1.5rem 0; }
.step {
  counter-increment: step;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  position: relative;
  padding-left: 4rem;
}
.step::before {
  content: counter(step);
  position: absolute; left: 1.25rem; top: 1.5rem;
  width: 2rem; height: 2rem;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem;
}
.step h4 { margin: 0 0 0.5rem; font-family: var(--font-body); }
.step p { margin: 0; color: var(--text-secondary); font-size: 0.92rem; }

/* --- Sources / References --- */
.sources {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.sources h3 {
  font-size: 1rem; font-family: var(--font-body);
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted); margin-bottom: 1rem;
}
.source-item {
  display: flex; gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(42, 42, 54, 0.5);
  font-size: 0.88rem;
}
.source-item .badge {
  flex-shrink: 0;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.7rem; font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  height: fit-content;
}
.source-item .details { color: var(--text-secondary); }
.source-item .details strong { color: var(--text-primary); }

/* --- Author Box --- */
.author-box {
  display: flex; gap: 1.25rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-top: 3rem;
}
.author-box .avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--accent-dim);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}
.author-box h4 { margin: 0 0 0.25rem; font-family: var(--font-body); font-size: 1rem; }
.author-box .role { color: var(--accent); font-size: 0.85rem; font-weight: 500; margin-bottom: 0.5rem; }
.author-box p { color: var(--text-secondary); font-size: 0.88rem; margin: 0; }

/* --- Footer --- */
.site-footer {
  margin-top: 4rem;
  padding: 2.5rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.site-footer a { color: var(--text-secondary); }
.footer-links { display: flex; gap: 1.5rem; justify-content: center; margin-bottom: 1rem; }

/* --- Responsive --- */
@media (max-width: 768px) {
  .hero h1 { font-size: 2rem; }
  .article-header h1 { font-size: 1.75rem; }
  .category-grid { grid-template-columns: 1fr; }
  .featured-grid { grid-template-columns: 1fr; }
  nav { display: none; }
  nav.open { display: flex; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: var(--bg-primary); border-bottom: 1px solid var(--border); padding: 1rem 1.5rem; gap: 1rem; }
  .mobile-toggle { display: block; }
  .author-box { flex-direction: column; text-align: center; }
  .article-header .meta-bar { flex-direction: column; gap: 0.5rem; }
  .step { padding-left: 3.5rem; }
}

@media (max-width: 480px) {
  body { font-size: 15px; }
  .hero { padding: 3rem 0 2rem; }
  .container { padding: 0 1rem; }
  h1 { font-size: 1.75rem; }
}
