/* ===========================================================
   TOKENS
   =========================================================== */
:root {
  --bg: #14161c;
  --bg-elevated: #1c1f27;
  --bg-inset: #0f1116;
  --border: #2a2e38;
  --border-soft: #23262e;

  --text: #e7e5e0;
  --text-muted: #8a8f9c;
  --text-faint: #565b68;

  --accent-mint: #57e3b4;
  --accent-mint-dim: #2e5f4f;
  --accent-amber: #f2aa47;
  --accent-periwinkle: #8fa6ff;
  --accent-rose: #ef7b72;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'IBM Plex Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --titlebar-h: 44px;
  --statusbar-h: 30px;
  --sidebar-w: 236px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

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

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

:focus-visible {
  outline: 2px solid var(--accent-mint);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ===========================================================
   APP SHELL
   =========================================================== */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- Title bar ---- */
.titlebar {
  height: var(--titlebar-h);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 16px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.titlebar-left {
  display: flex;
  gap: 7px;
  flex: 0 0 auto;
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  opacity: 0.85;
}

.dot-red {
  background: #ef7b72;
}

.dot-yellow {
  background: #f2aa47;
}

.dot-green {
  background: #57e3b4;
}

.tabbar {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1 1 auto;
}

.tabbar::-webkit-scrollbar {
  display: none;
}

.tab {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease;
}

.tab:hover {
  color: var(--text);
}

.tab.is-active {
  color: var(--accent-mint);
  background: var(--bg);
  border-color: var(--border);
  border-bottom-color: var(--bg);
}

.sidebar-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
}

.sidebar-toggle:hover {
  color: var(--text);
  border-color: var(--text-faint);
}

/* ---- Workspace (sidebar + editor) ---- */
.workspace {
  flex: 1 1 auto;
  display: flex;
  min-height: 0;
}

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 auto;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  position: sticky;
  top: var(--titlebar-h);
  height: calc(100vh - var(--titlebar-h) - var(--statusbar-h));
  overflow-y: auto;
}

.sidebar-section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 10px 6px;
}

.sidebar-section-label--spaced {
  margin-top: 28px;
}

.filetree {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.filetree-root {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  padding: 6px;
  margin-bottom: 2px;
}

.filetree-item {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  padding: 6px 6px 6px 20px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  word-break: break-word;
  transition: background 0.15s ease, color 0.15s ease;
}

.filetree-item.filetree-child {
  padding-left: 34px;
  font-size: 12.5px;
}

.file-icon {
  font-size: 12px;
  flex-shrink: 0;
  margin-top: 2px;
}

.filetree-item:hover {
  background: var(--bg-inset);
  color: var(--text);
}

.filetree-item.is-active {
  color: var(--accent-mint);
  background: var(--bg-inset);
}

.sidebar-status {
  list-style: none;
  margin: 0;
  padding: 0 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.sidebar-status li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.status-key {
  color: var(--text-faint);
}

.status-val {
  color: var(--text-muted);
  text-align: right;
}

.sidebar-scrim {
  display: none;
}

/* ---- Editor / main content ---- */
.editor {
  flex: 1 1 auto;
  min-width: 0;
}

.pane {
  padding: 72px 48px 88px;
  max-width: 980px;
  position: relative;
  border-bottom: 1px solid var(--border-soft);
}

.pane:last-of-type {
  border-bottom: none;
}

.pane-header {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.pane-header-file {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--accent-mint);
  font-weight: 500;
}

.pane-header-hint {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-faint);
}

/* ===========================================================
   HERO / ABOUT
   =========================================================== */
.pane-hero {
  display: flex;
  gap: 28px;
  padding-top: 90px;
}

.gutter {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-faint);
  padding-top: 4px;
  user-select: none;
}

.gutter span {
  line-height: 1.9;
  text-align: right;
  min-width: 14px;
}

.pane-content {
  flex: 1 1 auto;
  max-width: 680px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 14px;
  margin: 0 0 6px;
}

.kw {
  color: var(--accent-periwinkle);
}

.cls {
  color: var(--accent-amber);
}

.punct {
  color: var(--text-faint);
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  font-weight: 700;
  line-height: 1;
  margin: 4px 0 10px;
  letter-spacing: -0.02em;
}

.cursor {
  color: var(--accent-amber);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.hero-role {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--accent-mint);
  margin: 0 0 24px;
}

.hero-bio {
  font-size: 16.5px;
  color: var(--text-muted);
  max-width: 56ch;
  margin: 0 0 32px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.btn {
  font-family: var(--font-mono);
  font-size: 13.5px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

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

.btn-primary {
  background: var(--accent-mint);
  color: #0b1712;
  font-weight: 600;
}

.btn-primary:hover {
  background: #6fe9c1;
}

.btn-ghost {
  border-color: var(--border);
  color: var(--text);
  background: transparent;
}

.btn-ghost:hover {
  border-color: var(--accent-mint);
  color: var(--accent-mint);
}

.closing-brace {
  margin: 0;
  font-size: 14px;
}

/* ===========================================================
   SKILLS
   =========================================================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 40px;
}

.skill-key {
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--accent-periwinkle);
  margin: 0 0 12px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-row--tight {
  gap: 6px;
}

.chip {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text);
  background: var(--bg-inset);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 999px;
}

.chip--sm {
  font-size: 11.5px;
  padding: 4px 10px;
  color: var(--text-muted);
}

/* ===========================================================
   PROJECTS
   =========================================================== */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

.project-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.project-card:hover {
  border-color: var(--accent-mint);
  transform: translateY(-3px);
}

.phone-mock {
  background: var(--bg-inset);
  padding: 26px 26px 0;
  display: flex;
  justify-content: center;
}

.phone-notch {
  width: 44px;
  height: 5px;
  background: var(--border);
  border-radius: 4px;
  position: relative;
  top: 14px;
}

.phone-screen {
  width: 150px;
  height: 190px;
  border-radius: 18px 18px 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: linear-gradient(160deg, #1a2620 0%, var(--bg-inset) 65%);
}

.phone-screen--live {
  background: linear-gradient(160deg, #241e14 0%, var(--bg-inset) 65%);
}

.phone-screen--concept {
  background: linear-gradient(160deg, #171a26 0%, var(--bg-inset) 65%);
}

.app-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--accent-mint);
  color: #0b1712;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.app-icon--alt {
  background: var(--accent-amber);
  color: #2a1a04;
}

.app-icon--alt2 {
  background: var(--accent-periwinkle);
  color: #12183a;
}

.screen-bar {
  height: 7px;
  border-radius: 4px;
  background: rgba(231, 229, 224, 0.14);
}

.screen-bar--wide {
  width: 85%;
}

.screen-bar--mid {
  width: 55%;
}

.screen-row {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.screen-card {
  flex: 1;
  height: 44px;
  border-radius: 8px;
  background: rgba(231, 229, 224, 0.07);
  border: 1px solid rgba(231, 229, 224, 0.08);
}

.project-body {
  padding: 20px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.project-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.project-title-row h3 {
  font-family: var(--font-display);
  font-size: 17px;
  margin: 0;
  line-height: 1.3;
}

.badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 4px 9px;
  border-radius: 999px;
  white-space: nowrap;
  flex: 0 0 auto;
}

.badge-live {
  background: rgba(87, 227, 180, 0.14);
  color: var(--accent-mint);
}

.badge-progress {
  background: rgba(242, 170, 71, 0.14);
  color: var(--accent-amber);
}

.badge-concept {
  background: rgba(143, 166, 255, 0.14);
  color: var(--accent-periwinkle);
}

.project-body p {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
  flex: 1;
}

.project-links {
  margin-top: 4px;
}

.link-arrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--accent-mint);
  border-bottom: 1px solid transparent;
}

.link-arrow:hover {
  border-color: var(--accent-mint);
}

/* ===========================================================
   CONTACT
   =========================================================== */
.contact-content {
  max-width: 640px;
}

.md-hash {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--accent-amber);
  margin: 0 0 16px;
}

.contact-lede {
  color: var(--text-muted);
  font-size: 16px;
  margin: 0 0 32px;
  max-width: 55ch;
}

.contact-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.contact-link {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.contact-link:hover {
  border-color: var(--accent-mint);
  background: var(--bg-elevated);
}

.contact-link-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

.contact-link-value {
  font-size: 14.5px;
  color: var(--text);
}

/* ===========================================================
   STATUS BAR
   =========================================================== */
.statusbar {
  height: var(--statusbar-h);
  flex: 0 0 auto;
  background: var(--accent-mint-dim);
  color: #d6f7ea;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 16px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  overflow-x: auto;
  white-space: nowrap;
  position: sticky;
  bottom: 0;
  z-index: 40;
}

.status-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-item--spacer {
  flex: 1;
}

.status-item svg {
  opacity: 0.85;
}

/* ===========================================================
   RESPONSIVE
   =========================================================== */
@media (max-width: 900px) {
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 760px) {
  .sidebar-toggle {
    display: flex;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: var(--titlebar-h);
    height: calc(100vh - var(--titlebar-h));
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: 8px 0 24px rgba(0, 0, 0, 0.35);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-scrim {
    display: none;
    position: fixed;
    inset: var(--titlebar-h) 0 0 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 45;
  }

  .sidebar-scrim.is-visible {
    display: block;
  }

  .tabbar {
    gap: 0;
  }

  .tab {
    padding: 8px 10px;
    font-size: 12px;
  }

  .pane {
    padding: 48px 22px 64px;
  }

  .pane-hero {
    padding-top: 56px;
    gap: 14px;
  }

  .gutter {
    display: none;
  }

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

  .contact-links {
    grid-template-columns: 1fr;
  }
}