/* ════════════════════════════════════════
   DESIGN SYSTEM — CSS VARIABLES
   ════════════════════════════════════════ */
:root {
  --bg:          #0a0a0f;
  --bg-sidebar:  #0d0d14;
  --bg-card:     #111118;
  --bg-hover:    #16161f;
  --border:      #1e1e2e;
  --border-mid:  #2a2a3e;
  --accent:      #818cf8;
  --white:       #f8fafc;
  --muted:       #64748b;
  --hint:        #334155;
}

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

html {
  scroll-behavior: smooth;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

body {
  background: var(--bg);
  color: var(--muted);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  zoom: 1;
  -webkit-text-size-adjust: 100%;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { text-decoration: none; color: inherit; }

/* ════════════════════════════════════════
   SIDEBAR — fixed left, 260px
   ════════════════════════════════════════ */
.sidebar {
  position: relative;
  width: 260px;
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  z-index: 100;
  transition: transform 280ms ease;
}

/* ════════════════════════════════════════
   TERMINAL BODY — sidebar + main, in-flow row
   ════════════════════════════════════════ */
.terminal-body {
  display: flex;
  min-height: calc(100vh - 64px);
}

/* Top — avatar + name */
.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 22px;
}

.sidebar__avatar {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 600;
  color: var(--white);
  background: linear-gradient(135deg, var(--accent), #4f46e5);
}

.sidebar__name {
  font-size: 15px;
  font-weight: 600;
  color: var(--white);
}

/* Section labels */
.sidebar__label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--hint);
  padding: 16px 12px 8px;
}

/* Nav links */
.sidebar__link {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 13px;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 7px;
  border-left: 2px solid transparent;
  transition: background 160ms ease, color 160ms ease;
}

.sidebar__link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke: currentColor;
}

.sidebar__link:hover {
  background: var(--bg-hover);
  color: var(--white);
}

.sidebar__link.active {
  background: var(--bg-card);
  border-left: 2px solid var(--accent);
  color: var(--white);
}

/* Bottom */
.sidebar__footer {
  margin-top: auto;
  padding: 16px 12px 0;
  font-size: 11px;
  color: var(--hint);
}

/* ════════════════════════════════════════
   HAMBURGER — mobile only
   ════════════════════════════════════════ */
.hamburger {
  display: none;
  margin-left: auto;
  z-index: 200;
  width: 34px;
  height: 28px;
  padding: 0;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-mid);
  border-radius: 6px;
  cursor: pointer;
}

.hamburger svg { width: 20px; height: 20px; stroke: var(--white); }

/* Mobile backdrop behind open sidebar */
.backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 90;
}

/* ════════════════════════════════════════
   MAIN PANEL — offset by sidebar width
   ════════════════════════════════════════ */
.main {
  flex: 1;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* ════════════════════════════════════════
   HERO
   ════════════════════════════════════════ */
.hero {
  position: relative;
  height: 65vh;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
}

/* Background image layer */
@keyframes bgDrift {
  0%   { background-position: 50% 50%; background-size: 110%; }
  25%  { background-position: 55% 48%; background-size: 115%; }
  50%  { background-position: 48% 53%; background-size: 112%; }
  75%  { background-position: 52% 47%; background-size: 116%; }
  100% { background-position: 50% 50%; background-size: 110%; }
}

#hero-bg-img {
  background-size: 110%;
  background-position: 50% 50%;
  animation: bgDrift 12s ease-in-out infinite;
}

/* Dark overlay — above image, below content */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(7, 8, 10, 0.55);
}

.hero__content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1000px;
  padding: 0 clamp(32px, 6vw, 96px);
  text-align: left;
}

/* 1 — Monospace eyebrow label */
.hero__eyebrow {
  font-family: "Courier New", monospace;
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

/* 2 — Name (single flowing line, wraps naturally) */
.hero__name {
  font-family: "Playfair Display", serif;
  font-size: clamp(42px, 5.5vw, 80px);
  font-weight: 700;
  line-height: 1.0;
  letter-spacing: -0.02em;
  color: var(--white);
}

.hero__name span { color: var(--accent); }

/* 3 — Italic subtext */
.hero__subtext {
  font-family: "Playfair Display", serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(16px, 2vw, 22px);
  line-height: 1.6;
  color: rgba(248, 250, 252, 0.65);
  margin-top: 1.5rem;
  max-width: 680px;
}

/* ════════════════════════════════════════
   TERMINAL — code runner (Piston API)
   ════════════════════════════════════════ */
.terminal-section {
  padding: clamp(48px, 8vw, 96px) clamp(32px, 6vw, 96px);
}

.terminal-section__title {
  font-family: "Playfair Display", serif;
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 700;
  color: var(--white);
  margin-bottom: 8px;
}

.terminal-section__sub {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 28px;
}

.code-runner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  max-width: 820px;
}

.code-runner__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
}

.code-runner__select {
  background: var(--bg);
  color: var(--white);
  border: 1px solid var(--border-mid);
  border-radius: 6px;
  padding: 6px 10px;
  font-family: "Inter", sans-serif;
  font-size: 13px;
  cursor: pointer;
}

.code-runner__run {
  margin-left: auto;
  background: var(--accent);
  color: #07080a;
  border: none;
  border-radius: 6px;
  padding: 7px 16px;
  font-family: "Inter", sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 160ms ease;
}

.code-runner__run:hover { opacity: 0.85; }
.code-runner__run:disabled { opacity: 0.5; cursor: not-allowed; }

.code-runner__editor {
  width: 100%;
  min-height: 220px;
  resize: vertical;
  display: block;
  background: #07080a;
  color: #e2e8f0;
  border: none;
  padding: 16px;
  font-family: "Courier New", monospace;
  font-size: 13px;
  line-height: 1.6;
  tab-size: 2;
}

.code-runner__editor:focus { outline: none; }

.code-runner__output {
  margin: 0;
  padding: 16px;
  background: #0d0d14;
  border-top: 1px solid var(--border);
  color: #e2e8f0;
  font-family: "Courier New", monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 60px;
  max-height: 280px;
  overflow: auto;
}

.code-runner__note {
  font-family: "Inter", sans-serif;
  font-size: 12px;
  color: var(--hint);
  margin-top: 8px;
}

/* ════════════════════════════════════════
   BELOW-HERO — two-column grid (Latest / Building)
   ════════════════════════════════════════ */
.hero-grid {
  background: var(--bg);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 35vh;
}

.hero-grid__col { padding: 2rem; }
.hero-grid__col--left { border-right: 1px solid var(--border); }

.hero-grid__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.hero-grid__label {
  font-family: "Inter", sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.hero-grid__viewall {
  font-family: "Inter", sans-serif;
  font-size: 12px;
  color: var(--muted);
  margin-left: auto;
  transition: color 160ms ease;
}
.hero-grid__viewall:hover { color: var(--white); }

/* ── Article cards (Latest) ── */
.article-card__date {
  font-family: "Inter", sans-serif;
  font-size: 11px;
  color: var(--hint);
  margin-bottom: 6px;
}

.article-card__title {
  font-family: "Playfair Display", serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 8px;
  cursor: pointer;
  transition: color 160ms ease;
}
.article-card__title:hover { color: var(--accent); }

.article-card__desc {
  font-family: "Inter", sans-serif;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}

.article-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.25rem 0;
}

/* ── Project list (Building) ── */
.project-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.project-item__title {
  display: flex;
  align-items: center;
  font-family: "Courier New", monospace;
  font-size: 15px;
  font-weight: 600;
  color: var(--white);
}

.project-item__badge {
  background: var(--accent);
  color: #0a0a0f;
  font-size: 8px;
  padding: 2px 8px;
  border-radius: 3px;
  margin-left: 8px;
}

.project-item__sub {
  font-family: "Inter", sans-serif;
  font-size: 12px;
  color: var(--hint);
  margin-top: 3px;
}

.project-item__arrow {
  color: var(--muted);
  transition: color 160ms ease;
}
.project-item__arrow:hover { color: var(--white); }

/* ════════════════════════════════════════
   PAGE PLACEHOLDER — scaffolded pages
   ════════════════════════════════════════ */
.page-placeholder {
  min-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(48px, 8vw, 96px) clamp(32px, 6vw, 96px);
}

.page-placeholder__title {
  font-family: "Playfair Display", serif;
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--white);
  margin-bottom: 0.75rem;
}

.page-placeholder__sub {
  font-family: "Inter", sans-serif;
  font-size: 16px;
  color: var(--muted);
  max-width: 560px;
}

/* ════════════════════════════════════════
   RESPONSIVE — Mobile
   ════════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); }
  .hamburger { display: flex; }
  .backdrop.show { display: block; }

  /* Stack the Latest / Building columns */
  .hero-grid { grid-template-columns: 1fr; }
  .hero-grid__col--left {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}
