/* ==========================================================================
   smooth — portfolio
   Design: terminal/TUI-inspired panes, keyboard-first, phosphor amber accent
   ========================================================================== */

:root {
  --bg:        #0a0e14;
  --bg-panel:  #10161f;
  --bg-raise:  #161e2a;
  --border:    #1f2a3a;
  --text:      #c9d4e3;
  --text-dim:  #6b7a8f;
  --amber:     #ffb454;
  --amber-dim: #b57e3b;
  --red:       #e5484d;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Menlo, monospace;
  --sans: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --pane-max: 960px;
  --statusbar-h: 44px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 2rem; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  padding-bottom: var(--statusbar-h);
  /* faint scanline texture */
  background-image: repeating-linear-gradient(
    0deg, transparent 0 3px, rgba(255, 255, 255, 0.012) 3px 4px);
}

::selection { background: var(--amber); color: #0a0e14; }

a { color: var(--amber); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

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

.dim { color: var(--text-dim); }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

.skip-link {
  position: absolute; left: 1rem; top: -3rem;
  background: var(--amber); color: #0a0e14;
  font-family: var(--mono); font-size: 0.85rem;
  padding: 0.4rem 0.8rem; z-index: 100;
  transition: top 120ms ease;
}
.skip-link:focus { top: 1rem; }

/* ============ HERO ============ */

.hero {
  min-height: calc(100svh - var(--statusbar-h));
  display: grid;
  place-items: center;
  padding: 3rem 1.25rem 2rem;
}

.hero-inner { width: 100%; max-width: 780px; }

.term {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(255, 180, 84, 0.04), 0 24px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.term-bar {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.55rem 0.9rem;
  background: var(--bg-raise);
  border-bottom: 1px solid var(--border);
  font-family: var(--mono); font-size: 0.75rem; color: var(--text-dim);
}
.term-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); flex: none; }
.term-title { flex: 1; }
.term-hint { color: var(--amber-dim); }

.term-body { padding: 1.4rem 1.5rem 1.7rem; font-family: var(--mono); }

.prompt { color: var(--amber); font-weight: 700; }
.term-line { font-size: 0.95rem; }

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

.term-output { margin-top: 1.1rem; }
.term-output.pending { visibility: hidden; }

.term-name {
  font-size: clamp(1.7rem, 5.5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1.15;
}
.term-name .handle { color: var(--amber); font-weight: 400; font-size: 0.55em; }

.term-tag { margin-top: 0.7rem; font-size: 0.95rem; }

.term-loc {
  margin-top: 1.1rem; font-size: 0.85rem; color: var(--text-dim);
  display: flex; align-items: center; gap: 0.5rem;
}

.dot-red {
  display: inline-block; width: 8px; height: 8px; flex: none;
  background: var(--red); border-radius: 50%;
  box-shadow: 0 0 8px rgba(229, 72, 77, 0.7);
}

.hero-cta {
  margin-top: 1.6rem;
  display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center;
}

.btn {
  font-family: var(--mono); font-size: 0.9rem;
  padding: 0.65rem 1.3rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  background: var(--bg-panel);
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}
.btn:hover { border-color: var(--amber-dim); text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--amber); border-color: var(--amber); color: #0a0e14; font-weight: 700; }
.btn-primary:hover { background: #ffc16e; border-color: #ffc16e; }

.kbd-hint { width: 100%; margin-top: 0.4rem; font-family: var(--mono); font-size: 0.78rem; color: var(--text-dim); }
kbd {
  font-family: var(--mono); font-size: 0.9em;
  border: 1px solid var(--border); border-bottom-width: 2px;
  border-radius: 4px; padding: 0 0.35em;
  background: var(--bg-raise); color: var(--amber);
}

/* ============ PANES (sections) ============ */

.pane {
  max-width: var(--pane-max);
  margin: 0 auto 4.5rem;
  padding: 0 1.25rem;
}

.pane-bar {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  background: var(--bg-raise);
  padding: 0.7rem 1.2rem;
  font-family: var(--mono);
}
.pane-bar h2 { font-size: 1.05rem; font-weight: 700; color: #fff; letter-spacing: 0.01em; }
.pane-key { color: var(--amber); margin-right: 0.5em; }
.pane-path { font-size: 0.78rem; color: var(--text-dim); white-space: nowrap; }

.pane-body {
  border: 1px solid var(--border);
  border-radius: 0 0 8px 8px;
  background: var(--bg-panel);
  padding: 2rem 1.6rem;
}

/* ---- about ---- */

.about-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 2.2rem; }
.about-text p + p { margin-top: 1rem; }
.about-text strong { color: #fff; font-weight: 600; }

.facts { font-family: var(--mono); font-size: 0.85rem; align-self: start; }
.facts div {
  display: grid; grid-template-columns: 6.5em 1fr; gap: 0.6rem;
  padding: 0.55rem 0;
  border-bottom: 1px dashed var(--border);
}
.facts div:last-child { border-bottom: none; }
.facts dt { color: var(--amber-dim); }
.facts dd { color: var(--text); }

/* ---- experience ---- */

.timeline { list-style: none; }
.timeline li {
  display: grid; grid-template-columns: 9em 1fr; gap: 1.4rem;
  padding: 1.3rem 0;
  border-bottom: 1px solid var(--border);
}
.timeline li:first-child { padding-top: 0.2rem; }
.timeline li:last-child { border-bottom: none; padding-bottom: 0.2rem; }

.tl-when { font-family: var(--mono); font-size: 0.82rem; color: var(--amber); padding-top: 0.25rem; }
.tl-what h3 { font-size: 1.05rem; color: #fff; font-weight: 600; }
.tl-org { font-family: var(--mono); font-size: 0.8rem; color: var(--text-dim); margin: 0.2rem 0 0.6rem; }
.tl-what p:last-child { font-size: 0.97rem; }
.tl-what strong { color: var(--text); font-weight: 600; }

/* ---- projects ---- */

.proj-grid {
  list-style: none;
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem;
}

.proj {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  padding: 1.2rem 1.25rem 1.1rem;
  display: flex; flex-direction: column; gap: 0.7rem;
  transition: border-color 160ms ease, transform 160ms ease;
}
.proj:hover { border-color: var(--amber-dim); transform: translateY(-2px); }

.proj-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.8rem; }
.proj-head h3 { font-family: var(--mono); font-size: 1rem; color: var(--amber); font-weight: 700; }
.proj-type { font-family: var(--mono); font-size: 0.7rem; color: var(--text-dim); white-space: nowrap; }

.proj p { font-size: 0.93rem; }
.proj strong { color: #fff; font-weight: 600; }

.proj-stack {
  font-family: var(--mono); font-size: 0.75rem !important;
  color: var(--text-dim); margin-top: auto;
}

.proj-link { font-family: var(--mono); font-size: 0.8rem; }

.proj-more { margin-top: 1.6rem; font-size: 0.9rem; color: var(--text-dim); }

/* ---- skills ---- */

.skills-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem 2.5rem; }

.skill-group h3 {
  font-family: var(--mono); font-size: 0.8rem; font-weight: 700;
  text-transform: lowercase; letter-spacing: 0.06em;
  color: var(--amber); margin-bottom: 0.9rem;
}
.skill-group h3::before { content: "## "; color: var(--text-dim); }

.gauges { list-style: none; font-family: var(--mono); font-size: 0.85rem; }
.gauges li {
  display: grid; grid-template-columns: 7em 1fr; gap: 0.8rem;
  align-items: center; padding: 0.3rem 0;
}
.g-bar { display: block; height: 10px; background: var(--bg-raise); border-radius: 2px; position: relative; overflow: hidden; }
.g-bar::after {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, var(--amber) 0 8px, transparent 8px 11px);
}
.g-bar[data-level="9"]::after { width: 90%; }
.g-bar[data-level="8"]::after { width: 80%; }
.g-bar[data-level="7"]::after { width: 70%; }
.g-bar[data-level="6"]::after { width: 60%; }
.g-bar[data-level="5"]::after { width: 50%; }

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tags li {
  font-family: var(--mono); font-size: 0.78rem;
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--border); border-radius: 4px;
  background: var(--bg); color: var(--text);
}

/* ---- contact ---- */

.contact-lead { max-width: 46ch; }

.contact-list { list-style: none; margin-top: 1.4rem; font-family: var(--mono); font-size: 0.92rem; }
.contact-list li {
  display: grid; grid-template-columns: 7em 1fr; gap: 0.8rem;
  padding: 0.6rem 0; border-bottom: 1px dashed var(--border);
}
.contact-list li:last-child { border-bottom: none; }
.c-key { color: var(--text-dim); }
.c-key::before { content: "→ "; color: var(--amber); }
.contact-list a { overflow-wrap: anywhere; }

.contact-note { margin-top: 1.4rem; font-size: 0.85rem; }

/* ============ STATUS BAR ============ */

.statusbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  height: var(--statusbar-h);
  display: flex; align-items: stretch; justify-content: space-between; gap: 1rem;
  background: rgba(13, 18, 26, 0.92);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
  font-family: var(--mono); font-size: 0.78rem;
  padding: 0 1rem;
}

.sb-left, .sb-right { display: flex; align-items: center; gap: 0.7rem; color: var(--text-dim); }
.sb-mode {
  background: var(--amber); color: #0a0e14; font-weight: 700;
  padding: 0.15rem 0.5rem; border-radius: 3px; font-size: 0.72rem;
}

.sb-tabs { list-style: none; display: flex; align-items: stretch; }
.sb-tabs a {
  display: flex; align-items: center; gap: 0.4rem;
  height: 100%; padding: 0 0.85rem;
  color: var(--text-dim);
  border-top: 2px solid transparent;
}
.sb-tabs a:hover { color: var(--text); text-decoration: none; }
.sb-tabs a.active { color: var(--amber); border-top-color: var(--amber); background: rgba(255, 180, 84, 0.06); }
.sb-num { color: var(--amber-dim); }
.sb-tabs a.active .sb-num { color: var(--amber); }

/* ============ FOOTER ============ */

.site-footer {
  max-width: var(--pane-max); margin: 0 auto;
  padding: 1rem 1.25rem 2.5rem;
  font-family: var(--mono); font-size: 0.75rem; color: var(--text-dim);
}

/* ============ RESPONSIVE ============ */

@media (max-width: 820px) {
  .about-grid, .skills-grid, .proj-grid { grid-template-columns: 1fr; }
  .timeline li { grid-template-columns: 1fr; gap: 0.3rem; }
  .pane { margin-bottom: 3rem; }
  .pane-body { padding: 1.5rem 1.1rem; }
}

@media (max-width: 560px) {
  .sb-name { display: none; }               /* tabs collapse to numbers */
  .sb-host { display: none; }
  .sb-tabs a { padding: 0 0.7rem; }
  .kbd-hint { display: none; }               /* no keyboard on mobile */
  .pane-path { display: none; }
}

/* ============ MOTION ============ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cursor { animation: none; }
  *, *::before, *::after { transition: none !important; }
}
