/* ─────────────────────────────────────────────
   Databricks ABAC Tutorials — Global Styles
   Dark terminal-data aesthetic
───────────────────────────────────────────── */

:root {
  --bg:         #07091280;
  --bg-solid:   #070912;
  --surface:    #0d1220;
  --surface2:   #111827;
  --border:     #1e2d4a;
  --border2:    #243352;
  --accent:     #00d4c8;
  --accent-dim: #00a89e;
  --accent2:    #ff6b35;
  --accent3:    #7c6af7;
  --text:       #e2e8f4;
  --text-muted: #8899b8;
  --text-dim:   #4a6080;
  --code-bg:    #080e1c;
  --success:    #22d3a0;
  --warning:    #f59e0b;
  --danger:     #f87171;

  --font-mono: "JetBrains Mono", "Fira Code", "Cascadia Code", "SF Mono", "Consolas", monospace;
  --font-body: "SF Pro Display", -apple-system, "Segoe UI", system-ui, sans-serif;
  --font-display: "SF Pro Display", -apple-system, system-ui, sans-serif;

  --radius: 8px;
  --radius-lg: 14px;
  --shadow: 0 4px 24px rgba(0,0,0,0.5);
  --shadow-accent: 0 0 32px rgba(0,212,200,0.12);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg-solid);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(0,212,200,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(124,106,247,0.05) 0%, transparent 50%);
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-solid); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-dim); }

/* ── Typography ── */
h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; margin-bottom: 1rem; }
h3 { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 0.75rem; }
h4 { font-size: 0.95rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 0.5rem; }
p { color: var(--text-muted); margin-bottom: 1rem; }
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: #fff; }
strong { color: var(--text); font-weight: 600; }

/* ── Layout ── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 2rem; }
.container-narrow { max-width: 820px; margin: 0 auto; padding: 0 2rem; }

/* ── Nav ── */
.nav {
  position: sticky; top: 0; z-index: 100;
  border-bottom: 1px solid var(--border);
  background: rgba(7,9,18,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.nav-inner {
  max-width: 1100px; margin: 0 auto;
  padding: 0 2rem;
  height: 60px;
  display: flex; align-items: center; gap: 1.5rem;
}
.nav-logo {
  display: flex; align-items: center; gap: 0.6rem;
  font-weight: 700; font-size: 0.95rem;
  color: var(--text); letter-spacing: -0.01em;
}
.nav-logo .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: inline-block; flex-shrink: 0; }
.nav-back {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.875rem; color: var(--text-muted);
  transition: color var(--transition);
}
.nav-back:hover { color: var(--accent); }
.nav-back svg { width: 14px; height: 14px; }
.nav-title { font-size: 0.875rem; color: var(--text-dim); border-left: 1px solid var(--border); padding-left: 1.5rem; }

/* ── Hero ── */
.hero {
  padding: 5rem 0 4rem;
  text-align: center;
  position: relative;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: rgba(0,212,200,0.08); border: 1px solid rgba(0,212,200,0.2);
  border-radius: 100px; padding: 0.3rem 1rem;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.06em;
  color: var(--accent); text-transform: uppercase;
  margin-bottom: 1.5rem;
}
.hero-badge .pulse {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}
.hero h1 { margin-bottom: 1rem; }
.hero h1 .highlight { color: var(--accent); }
.hero-subtitle { font-size: 1.1rem; color: var(--text-muted); max-width: 600px; margin: 0 auto 2.5rem; }

/* ── Cards ── */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.5rem; margin-top: 3rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  position: relative; overflow: hidden;
  text-decoration: none; color: inherit; display: block;
}
.card::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(0,212,200,0.04) 0%, transparent 60%);
  opacity: 0; transition: opacity var(--transition);
}
.card:hover { border-color: var(--accent-dim); transform: translateY(-3px); box-shadow: var(--shadow-accent); }
.card:hover::before { opacity: 1; }
.card:hover .card-arrow { transform: translateX(4px); color: var(--accent); }

.card-num {
  font-family: var(--font-mono);
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em;
  color: var(--accent); text-transform: uppercase;
  margin-bottom: 0.75rem; display: block;
}
.card h3 { font-size: 1.2rem; color: var(--text); margin-bottom: 0.6rem; }
.card p { font-size: 0.9rem; color: var(--text-muted); margin: 0 0 1.5rem; }
.card-footer { display: flex; align-items: center; justify-content: space-between; }
.card-tags { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.tag {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em;
  padding: 0.2rem 0.6rem; border-radius: 4px;
  background: rgba(255,255,255,0.05); color: var(--text-muted);
  border: 1px solid var(--border);
}
.tag.accent { background: rgba(0,212,200,0.1); color: var(--accent); border-color: rgba(0,212,200,0.2); }
.tag.orange { background: rgba(255,107,53,0.1); color: var(--accent2); border-color: rgba(255,107,53,0.2); }
.tag.purple { background: rgba(124,106,247,0.1); color: var(--accent3); border-color: rgba(124,106,247,0.2); }
.card-arrow { color: var(--text-dim); transition: transform var(--transition), color var(--transition); font-size: 1.2rem; }

/* ── Tutorial layout ── */
.tutorial-layout { display: grid; grid-template-columns: 220px 1fr; gap: 3rem; padding: 3rem 0; align-items: start; }
@media (max-width: 768px) { .tutorial-layout { grid-template-columns: 1fr; } }

/* ── TOC ── */
.toc { position: sticky; top: 80px; }
.toc-title { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-dim); margin-bottom: 0.75rem; font-weight: 700; }
.toc-list { list-style: none; border-left: 1px solid var(--border); }
.toc-list li a {
  display: block; padding: 0.35rem 0.85rem;
  font-size: 0.82rem; color: var(--text-muted);
  transition: color var(--transition), border-color var(--transition);
  border-left: 2px solid transparent; margin-left: -1px;
}
.toc-list li a:hover { color: var(--accent); border-left-color: var(--accent); }
.toc-list li a.active { color: var(--accent); border-left-color: var(--accent); }
.toc-list .toc-sub a { padding-left: 1.5rem; font-size: 0.78rem; }

/* ── Content sections ── */
.content section { margin-bottom: 3.5rem; }
.section-label {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent);
  margin-bottom: 0.6rem;
}
.section-label::before { content: ''; width: 20px; height: 1px; background: var(--accent); }

/* ── Code blocks ── */
.code-wrap {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 1.25rem 0;
  font-family: var(--font-mono);
}
.code-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.5rem 1rem;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
}
.code-lang { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); font-weight: 700; }
.code-dots { display: flex; gap: 5px; }
.code-dots span { width: 10px; height: 10px; border-radius: 50%; }
.code-dots span:nth-child(1) { background: #ff5f57; }
.code-dots span:nth-child(2) { background: #ffbd2e; }
.code-dots span:nth-child(3) { background: #28ca41; }
.code-body { padding: 1.25rem 1.5rem; overflow-x: auto; }
.code-body pre { font-size: 0.82rem; line-height: 1.8; color: #c9d1e0; white-space: pre; }

/* SQL syntax colors */
.kw  { color: #7c6af7; font-weight: 600; } /* keywords */
.fn  { color: #00d4c8; }                    /* functions */
.str { color: #86efac; }                    /* strings */
.cm  { color: #4a6080; font-style: italic; }/* comments */
.op  { color: #94a3b8; }                    /* operators */
.nn  { color: #fbbf24; }                    /* names/identifiers */
.py  { color: #fb923c; }                    /* python */

/* ── Inline code ── */
code {
  font-family: var(--font-mono);
  font-size: 0.83em;
  background: rgba(0,212,200,0.08);
  color: var(--accent);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  border: 1px solid rgba(0,212,200,0.15);
}

/* ── Tables ── */
.table-wrap { overflow-x: auto; margin: 1.25rem 0; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
thead { background: rgba(0,212,200,0.06); }
th { padding: 0.75rem 1rem; text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); font-weight: 700; border-bottom: 1px solid var(--border); }
td { padding: 0.75rem 1rem; color: var(--text-muted); border-bottom: 1px solid rgba(30,45,74,0.5); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }
.td-role { font-family: var(--font-mono); font-size: 0.78rem; color: var(--accent); }
.td-yes { color: var(--success); font-weight: 600; }
.td-no { color: var(--danger); }
.td-partial { color: var(--warning); }

/* ── Callouts ── */
.callout {
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  border-left: 3px solid;
  display: flex; gap: 1rem; align-items: flex-start;
}
.callout-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 0.1rem; }
.callout-body h4 { margin-bottom: 0.35rem; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; }
.callout-body p, .callout-body li { font-size: 0.875rem; margin-bottom: 0.4rem; }
.callout-body ul { padding-left: 1.25rem; color: var(--text-muted); }
.callout.info { background: rgba(0,212,200,0.06); border-color: var(--accent); }
.callout.info h4 { color: var(--accent); }
.callout.warning { background: rgba(245,158,11,0.06); border-color: var(--warning); }
.callout.warning h4 { color: var(--warning); }
.callout.danger { background: rgba(248,113,113,0.06); border-color: var(--danger); }
.callout.danger h4 { color: var(--danger); }
.callout.success { background: rgba(34,211,160,0.06); border-color: var(--success); }
.callout.success h4 { color: var(--success); }

/* ── Steps ── */
.steps { display: flex; flex-direction: column; gap: 0; position: relative; }
.step {
  display: grid; grid-template-columns: 40px 1fr;
  gap: 1.25rem; padding-bottom: 2.5rem; position: relative;
}
.step:last-child { padding-bottom: 0; }
.step-num-wrap { display: flex; flex-direction: column; align-items: center; }
.step-num {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface2); border: 2px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 0.8rem; font-weight: 700;
  color: var(--accent); flex-shrink: 0; z-index: 1;
}
.step-line { width: 1px; flex: 1; background: var(--border); margin-top: 0.5rem; }
.step:last-child .step-line { display: none; }
.step-content h3 { padding-top: 0.3rem; margin-bottom: 0.6rem; }

/* ── Prereq list ── */
.prereq-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin: 1.25rem 0; }
.prereq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}
.prereq-item h4 { font-size: 0.7rem; margin-bottom: 0.5rem; }
.prereq-item ul { list-style: none; padding: 0; }
.prereq-item li {
  font-family: var(--font-mono); font-size: 0.75rem;
  color: var(--text-muted); padding: 0.2rem 0;
  display: flex; align-items: center; gap: 0.4rem;
}
.prereq-item li::before { content: '›'; color: var(--accent); font-size: 1rem; }

/* ── Section divider ── */
.divider { border: none; border-top: 1px solid var(--border); margin: 3rem 0; }

/* ── Industry badge ── */
.industry-header {
  display: flex; align-items: center; gap: 1rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
}
.industry-icon { font-size: 1.8rem; }
.industry-header h2 { margin: 0; font-size: 1.3rem; }
.industry-header p { margin: 0; font-size: 0.85rem; }

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 4rem;
  text-align: center;
}
footer p { font-size: 0.82rem; color: var(--text-dim); margin: 0; }
footer a { color: var(--text-muted); }
footer a:hover { color: var(--accent); }

/* ── Animations ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeInUp 0.5s ease forwards; }
.fade-up-1 { animation-delay: 0.1s; opacity: 0; }
.fade-up-2 { animation-delay: 0.2s; opacity: 0; }
.fade-up-3 { animation-delay: 0.3s; opacity: 0; }
.fade-up-4 { animation-delay: 0.4s; opacity: 0; }

/* ── Responsive ── */
@media (max-width: 640px) {
  .container, .container-narrow { padding: 0 1.25rem; }
  .hero { padding: 3rem 0 2.5rem; }
  .nav-inner { padding: 0 1.25rem; }
  .code-body { padding: 1rem; }
  .code-body pre { font-size: 0.75rem; }
}
