/* ==============================================================================
   emilianodesu.github.io — Obsidian & Emerald Design System
   Minimal Technical Aesthetic (WCAG 2.1 AA/AAA)
   ============================================================================== */

:root {
  --bg-primary: #09090b;
  --bg-surface: #111114;
  --bg-elevated: #18181b;
  --border-subtle: #27272a;
  --border-strong: #3f3f46;

  --text-main: #fafafa;
  --text-muted: #a1a1aa;
  --text-dim: #71717a;

  --emerald: #10b981;
  --emerald-soft: rgba(16, 185, 129, 0.14);
  --emerald-border: rgba(16, 185, 129, 0.35);
  --sky: #38bdf8;
  --sky-soft: rgba(56, 189, 248, 0.12);
  --sky-border: rgba(56, 189, 248, 0.38);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(circle at 14% 12%, rgba(16, 185, 129, 0.08) 0%, transparent 38%),
    radial-gradient(circle at 86% 24%, rgba(56, 189, 248, 0.06) 0%, transparent 40%),
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 48px 48px, 48px 48px;
}

a {
  color: var(--sky);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--emerald);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 10px;
  background: var(--emerald);
  color: #04120c;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 8px;
  z-index: 1000;
}

.skip-link:focus {
  left: 16px;
  text-decoration: none;
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ==================== NAVBAR ==================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 9, 11, 0.84);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
  flex-wrap: wrap;
  padding: 8px 0;
}

.brand {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

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

.brand-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--emerald);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.75);
}

.brand-accent {
  color: var(--emerald);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 24px;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

.nav-links a:hover {
  color: var(--text-main);
  text-decoration: none;
}

.nav-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
  font-family: var(--font-sans);
}

.btn:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.btn-sm {
  padding: 7px 13px;
  font-size: 0.84rem;
}

.btn-primary {
  background: var(--emerald);
  color: #03130d;
  border-color: var(--emerald);
}

.btn-primary:hover {
  background: #34d399;
  border-color: #34d399;
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
}

.icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ==================== HERO ==================== */
.hero {
  padding: 64px 0 48px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--bg-surface);
  border: 1px solid var(--emerald-border);
  color: var(--emerald);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  margin-bottom: 22px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--emerald);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse 2.2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.65); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.hero-title {
  font-size: clamp(2.1rem, 4.6vw, 3.35rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
  font-weight: 800;
  max-width: 860px;
  margin-bottom: 20px;
}

.text-gradient {
  background: linear-gradient(95deg, var(--emerald) 0%, var(--sky) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 780px;
  margin-bottom: 28px;
}

.hero-subtitle strong {
  color: var(--text-main);
  font-weight: 600;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 40px;
}

.metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 20px;
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
}

.metric-value.emerald { color: var(--emerald); }
.metric-value.sky { color: var(--sky); }

.metric-label {
  font-size: 0.86rem;
  color: var(--text-muted);
}

/* ==================== SECTIONS ==================== */
.section {
  padding: 56px 0;
  border-top: 1px solid var(--border-subtle);
}

.section-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--emerald);
  margin-bottom: 8px;
}

.section-title {
  font-size: clamp(1.55rem, 3vw, 2.05rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.section-desc {
  color: var(--text-muted);
  max-width: 760px;
  margin-bottom: 28px;
  font-size: 0.98rem;
}

/* ==================== PROJECTS GRID ==================== */
.project-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.filter-btn {
  background: var(--bg-surface);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  padding: 8px 15px;
  border-radius: 8px;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all 0.15s ease;
}

.filter-btn:hover {
  color: var(--text-main);
  border-color: var(--border-strong);
}

.filter-btn[aria-pressed="true"] {
  background: var(--emerald-soft);
  color: var(--emerald);
  border-color: var(--emerald-border);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 20px;
}

.project-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.18s ease, transform 0.15s ease;
}

.project-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.project-card.flagship {
  border-color: rgba(16, 185, 129, 0.28);
}

.project-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.project-category {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--sky);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ci-pill {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--emerald-soft);
  color: var(--emerald);
  border: 1px solid var(--emerald-border);
}

.project-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 10px;
  line-height: 1.3;
}

.project-desc {
  font-size: 0.91rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.project-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.metric-chip {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-main);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  padding: 4px 8px;
  border-radius: 6px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.project-tag {
  font-size: 0.76rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  padding: 3px 8px;
  border-radius: 5px;
}

.project-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

/* ==================== FLAGSHIP DAG INSPECTOR ==================== */
.dag-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.dag-switch-btn {
  cursor: pointer;
  padding: 10px 16px;
  border-radius: 9px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  font-family: var(--font-sans);
  transition: all 0.15s ease;
}

.dag-switch-btn:hover {
  color: var(--text-main);
  border-color: var(--border-strong);
}

.dag-switch-btn[aria-selected="true"] {
  background: var(--bg-elevated);
  color: var(--text-main);
  border-color: var(--emerald);
  box-shadow: 0 0 0 1px var(--emerald-border);
}

.dag-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 24px;
}

.dag-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}

.dag-title {
  font-size: 1.08rem;
  font-weight: 700;
}

.dag-subtitle {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.dag-pipeline-flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 20px;
  position: relative;
  margin-bottom: 26px;
  min-height: 102px;
}

.dag-node {
  text-align: left;
  cursor: pointer;
  position: relative;
  background: linear-gradient(180deg, rgba(24, 24, 27, 0.95) 0%, rgba(17, 17, 20, 0.95) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 18px 16px;
  color: var(--text-main);
  font-family: var(--font-sans);
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.dag-node::after {
  content: '→';
  position: absolute;
  right: -16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--emerald);
  opacity: 0.55;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.05rem;
  z-index: 2;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.dag-node:last-child::after {
  display: none;
}

.dag-node:hover {
  border-color: var(--emerald-border);
  transform: translateY(-3px);
  box-shadow: 0 10px 26px rgba(16, 185, 129, 0.14);
}

.dag-node:hover::after {
  opacity: 1;
}

.dag-node[aria-pressed="true"] {
  border-color: var(--emerald);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.14) 0%, rgba(17, 17, 20, 0.98) 100%);
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.22), inset 0 1px 0 rgba(16, 185, 129, 0.35);
}

.dag-node[aria-pressed="true"]::after {
  opacity: 1;
  color: var(--sky);
}

.dag-node-step {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--emerald);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dag-node-step::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--border-strong);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.dag-node[aria-pressed="true"] .dag-node-step::before {
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
}

.dag-node-name {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.dag-node-tech {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.dag-inspector {
  background: rgba(9, 9, 11, 0.92);
  border: 1px solid rgba(16, 185, 129, 0.26);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(16, 185, 129, 0.15);
  border-radius: 12px;
  padding: 24px;
  min-height: 240px;
}

.inspector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.inspector-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-main);
}

.inspector-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  color: var(--sky);
  background: var(--sky-soft);
}

.inspector-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.inspector-detail-box h4 {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--emerald);
  margin-bottom: 6px;
}

.inspector-detail-box p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.inspector-detail-box p:last-child {
  margin-bottom: 0;
}

.code-preview {
  background: #050507;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 16px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.81rem;
  line-height: 1.55;
  color: #e4e4e7;
}

/* ==================== TIMELINE ==================== */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.timeline-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 22px 24px;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.timeline-role {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.timeline-company {
  color: var(--emerald);
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.timeline-body ul {
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timeline-body li {
  font-size: 0.92rem;
  color: var(--text-muted);
}

.timeline-body strong {
  color: var(--text-main);
  font-weight: 600;
}

.timeline-body a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ==================== FOOTER ==================== */
.footer {
  border-top: 1px solid var(--border-subtle);
  padding: 36px 0 52px;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-muted);
}

.footer-links a:hover {
  color: var(--emerald);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 920px) {
  .dag-pipeline-flow {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
  }
  .dag-node::after {
    display: none;
  }
  .inspector-body {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .hero { padding: 40px 0 32px; }
  .section { padding: 40px 0; }
  .dag-container { padding: 16px; }
  .nav-links { gap: 14px; }
}
