:root {
  --bg: #1F1620;
  --bg-alt: #2B1B2E;
  --card: #33212F;
  --cream: #F5EBE0;
  --cream-dim: #cbb8b0;
  --blush: #E8A6B8;
  --rose: #C97C92;
  --gold: #D8B76A;
  --gold-soft: #E8D2A0;
  --border: rgba(216, 183, 106, 0.18);
  --mono: 'JetBrains Mono', monospace;
  --serif: 'Cormorant Garamond', serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: radial-gradient(ellipse at top, var(--bg-alt) 0%, var(--bg) 60%);
  color: var(--cream);
  font-family: var(--mono);
  line-height: 1.6;
  overflow-x: hidden;
}

::selection { background: var(--rose); color: var(--bg); }

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--blush); }

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Terminal window chrome ---------- */
.term-window {
  background: var(--card);
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.02) inset;
  overflow: hidden;
  margin: 40px 0;
}
.term-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(0,0,0,0.15);
  border-bottom: 1px solid var(--border);
}
.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot.blush { background: var(--blush); }
.dot.rose { background: var(--rose); }
.dot.gold { background: var(--gold); }
.term-titlebar span.label {
  margin-left: 10px;
  font-size: 12px;
  color: var(--cream-dim);
  letter-spacing: 0.02em;
}
.term-body { padding: 28px clamp(18px, 4vw, 40px); }

.prompt {
  color: var(--gold);
  font-weight: 600;
}
.prompt .path { color: var(--blush); }
.prompt .sigil { color: var(--cream-dim); }

.rule {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold) 20%, var(--gold) 80%, transparent);
  opacity: 0.35;
  margin: 48px 0;
  border: none;
}

.cursor {
  display: inline-block;
  width: 9px;
  height: 1.1em;
  background: var(--gold);
  vertical-align: text-bottom;
  margin-left: 2px;
}
.cursor.blink { animation: blink 1s steps(1) infinite; }
.cursor.static { opacity: 0.9; animation: none; }
.cursor.hidden { display: none; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Sticky cd nav ---------- */
#cd-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(31, 22, 32, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.cd-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 14px 24px;
}
.cd-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  flex-wrap: wrap;
}
#cd-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--cream);
  font-family: var(--mono);
  font-size: 15px;
  flex: 1;
  min-width: 80px;
  caret-color: var(--gold);
}
#cd-input::placeholder { color: var(--cream-dim); opacity: 0.5; }
.cd-list {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 13px;
}
.cd-item {
  color: var(--cream-dim);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.cd-item:hover, .cd-item.active-match {
  color: var(--gold-soft);
  background: rgba(216, 183, 106, 0.08);
}
.cd-item.dimmed { opacity: 0.25; }
.cd-hint { color: var(--cream-dim); opacity: 0.45; font-size: 12px; margin-top: 4px; }

.cd-toggle {
  display: none;
}

@media (max-width: 640px) {
  .cd-list { display: none; }
  .cd-list.open { display: flex; }
  .cd-toggle {
    display: inline-block;
    margin-left: auto;
    color: var(--gold);
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 3px 8px;
    font-family: var(--mono);
    font-size: 12px;
    cursor: pointer;
  }
}

/* ---------- Hero ---------- */
.hero {
  padding: 64px 0 24px;
}
.hero-name {
  font-family: var(--serif);
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 18px 0 4px;
  background: linear-gradient(120deg, var(--gold-soft), var(--blush) 60%, var(--rose));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  min-height: 1.2em;
}
.hero-title {
  font-size: clamp(1rem, 2.4vw, 1.25rem);
  color: var(--blush);
  margin: 0 0 18px;
  min-height: 1.4em;
}
.hero-summary {
  max-width: 620px;
  color: var(--cream-dim);
  font-size: 15px;
  min-height: 2.6em;
}
.hero-cta {
  display: flex;
  gap: 16px;
  margin-top: 28px;
  flex-wrap: wrap;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.hero-cta.show { opacity: 1; }
.btn {
  font-family: var(--mono);
  font-size: 13px;
  padding: 11px 20px;
  border-radius: 8px;
  border: 1px solid var(--gold);
  color: var(--gold-soft);
  background: transparent;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.btn:hover { background: var(--gold); color: var(--bg); transform: translateY(-1px); }
.btn.solid {
  background: linear-gradient(120deg, var(--gold), var(--blush));
  color: var(--bg);
  border: none;
  font-weight: 600;
}
.btn.solid:hover { filter: brightness(1.08); }

/* ---------- Sections general ---------- */
section { padding: 20px 0; }
.section-head {
  font-size: 14px;
  color: var(--gold);
  margin-bottom: 18px;
}
.section-head .cmt { color: var(--cream-dim); }

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.in { opacity: 1; transform: translateY(0); }

/* About */
.about-out { color: var(--cream-dim); }
.about-out .k { color: var(--rose); }
.about-body { margin-top: 12px; color: var(--cream); font-size: 15.5px; max-width: 680px; }
.about-body.muted { color: var(--cream-dim); font-style: italic; font-size: 14.5px; }

/* Skills */
.skill-group { margin-bottom: 22px; }
.skill-group .grp-label { color: var(--rose); font-size: 13px; margin-bottom: 10px; }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  font-size: 12.5px;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  color: var(--cream-dim);
  background: rgba(216,183,106,0.04);
  transition: border-color 0.2s, color 0.2s;
}
.pill:hover { border-color: var(--gold); color: var(--gold-soft); }

/* Portfolio — two-pane file-manager style (list + preview) */
.pf-hint {
  color: var(--cream-dim);
  font-size: 12px;
  opacity: 0.5;
  margin: -8px 0 16px;
}
.pf-wrap {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--card);
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  min-height: 260px;
}
.pf-list {
  flex: 0 0 240px;
  border-right: 1px solid var(--border);
  padding: 10px;
}
.pf-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--cream-dim);
  border-left: 2px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.pf-row .pf-name { display: flex; align-items: center; gap: 6px; }
.pf-row .pf-name::before { content: '▸'; font-size: 10px; opacity: 0.6; }
.pf-row .pf-type { font-size: 11px; opacity: 0.5; padding-left: 16px; }
.pf-row:hover { background: rgba(216,183,106,0.06); color: var(--gold-soft); }
.pf-row.active {
  background: rgba(216,183,106,0.1);
  color: var(--gold-soft);
  border-left-color: var(--gold);
}
.pf-preview {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.pf-preview .term-titlebar { background: rgba(0,0,0,0.15); }
#pf-preview-body {
  padding: 22px clamp(16px, 3vw, 28px);
  font-size: 14px;
}
.pf-title { color: var(--blush); font-weight: 600; font-size: 16px; margin-bottom: 8px; }
.pf-desc { color: var(--cream); font-size: 14.5px; margin-bottom: 14px; max-width: 480px; }
.pf-link { font-size: 13px; display: inline-flex; align-items: center; gap: 4px; margin-bottom: 18px; }
.pf-changelog-label { color: var(--rose); font-size: 12px; margin: 4px 0 10px; }

.pf-changelog-scroll {
  max-height: 220px;
  overflow-y: auto;
  padding: 14px 16px;
  background: rgba(0,0,0,0.18);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 12.5px;
}
.pf-changelog-scroll::-webkit-scrollbar { width: 6px; }
.pf-changelog-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.pf-cl-version {
  color: var(--gold);
  font-weight: 600;
  margin: 14px 0 6px;
}
.pf-cl-version:first-child { margin-top: 0; }
.pf-cl-line { color: var(--cream-dim); padding: 2px 0 2px 4px; }
.pf-cl-line.cl-empty { font-style: italic; opacity: 0.6; }
.pf-cl-line .cl-add { color: var(--blush); }
.pf-cl-line .cl-change { color: var(--gold-soft); }
.pf-cl-line .cl-remove { color: var(--rose); }

@media (max-width: 640px) {
  .pf-wrap { flex-direction: column; }
  .pf-list {
    flex: none;
    border-right: none;
    border-bottom: 1px solid var(--border);
    display: flex;
    overflow-x: auto;
    gap: 4px;
  }
  .pf-row { flex: 0 0 auto; border-left: none; border-bottom: 2px solid transparent; }
  .pf-row.active { border-left: none; border-bottom-color: var(--gold); }
}

/* Articles */
.empty-state {
  color: var(--cream-dim);
  font-style: italic;
  font-size: 14px;
}

/* Contact */
.contact-out .row { display: flex; gap: 10px; padding: 4px 0; font-size: 14.5px; }
.contact-out .arrow { color: var(--gold); }
.contact-out .k2 { color: var(--rose); min-width: 76px; display: inline-block; }

footer {
  text-align: center;
  padding: 32px 0 48px;
  color: var(--cream-dim);
  font-size: 12px;
  opacity: 0.6;
}

.ascii-flourish {
  color: var(--gold);
  opacity: 0.25;
  font-size: 11px;
  white-space: pre;
  line-height: 1.2;
  margin: 24px 0;
  user-select: none;
}
