:root {
  --bg: #0b0e14;
  --bg-panel: #11151c;
  --bg-titlebar: #05070c;
  --bg-inset: #0d1017;
  --border: #1f2430;
  --border-soft: #171b24;

  --text: #cbccc6;
  --text-bright: #eef0f2;
  --muted: #5c6773;

  --blue: #5ccfe6;
  --green: #a6e22e;
  --purple: #d4bfff;
  --amber: #ffcc66;
  --red: #f28779;

  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --radius: 6px;
  --radius-lg: 10px;
  --gutter-w: 2.75em;

  --ease: cubic-bezier(.2,.8,.2,1);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 1px 1px, rgba(92,103,115,0.18) 1px, transparent 0);
  background-size: 28px 28px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p { margin: 0; }

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

/* ============================================
   TITLEBAR (fake macOS window chrome)
   ============================================ */
.titlebar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 18px;
  background: var(--bg-titlebar);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.titlebar-dots { display: flex; gap: 7px; }
.dot { width: 11px; height: 11px; border-radius: 50%; opacity: 0.85; }
.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }

.titlebar-name {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.titlebar-branch {
  font-size: 12px;
  color: var(--green);
  opacity: 0.8;
}

/* ============================================
   TAB STRIP / NAV
   ============================================ */
.tabbar {
  position: sticky;
  top: 33px;
  z-index: 49;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  padding: 0 14px;
  overflow-x: auto;
}

.tabbar-inner { display: flex; }

.tab {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 14px;
  font-size: 12.5px;
  color: var(--muted);
  border-right: 1px solid var(--border-soft);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
}

.tab:hover { color: var(--text); background: rgba(255,255,255,0.02); }

.tab-active {
  color: var(--text-bright);
  background: var(--bg);
  border-bottom: 2px solid var(--amber);
}

.tab-icon {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  font-size: 9px;
  font-weight: 700;
  border-radius: 3px;
}
.tab-icon.js { background: rgba(255,204,102,0.15); color: var(--amber); }
.tab-icon.md { background: rgba(92,207,230,0.15); color: var(--blue); }
.tab-icon.json { background: rgba(212,191,255,0.15); color: var(--purple); font-size: 8px; }
.tab-icon.log { background: rgba(166,226,46,0.15); color: var(--green); }
.tab-icon.sh { background: rgba(242,135,121,0.15); color: var(--red); }

.btn {
  font-family: var(--font-mono);
  font-size: 12.5px;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 14px;
  white-space: nowrap;
}

.btn-hire {
  background: var(--amber);
  color: #12140f;
  border-color: var(--amber);
  font-weight: 700;
  margin-left: 12px;
}
.btn-hire:hover { filter: brightness(1.08); }

/* ============================================
   MAIN LAYOUT / EDITOR PANELS
   ============================================ */
main {
  max-width: 880px;
  margin: 0 auto;
  padding: 40px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 56px;
}

.editor {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  scroll-margin-top: 90px;
}
.editor.visible { opacity: 1; transform: translateY(0); }

.editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  font-size: 12px;
}
.editor-head-file { color: var(--text-bright); font-weight: 600; }
.editor-head-tag { color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-size: 10.5px; }

.editor-body {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  padding: 20px 20px 20px 0;
  overflow-x: auto;
}

/* Section 01 headline treatment (h1) lives inside hero editor as comment-like eyebrow */
#hero .editor-body { padding-top: 24px; }

/* ============================================
   CODE LINES (numbered via CSS counters)
   ============================================ */
.code-lines { counter-reset: line; }

.code-lines .line,
.code-lines.line-container {
  counter-increment: line;
  position: relative;
  padding-left: var(--gutter-w);
  white-space: pre-wrap;
  font-size: 13.5px;
}

.code-lines .line::before {
  content: counter(line);
  position: absolute;
  left: 0;
  width: 2.1em;
  text-align: right;
  color: var(--muted);
  opacity: 0.45;
  font-size: 12px;
}

.code-lines .line.indent { padding-left: calc(var(--gutter-w) + 1.4em); }
.code-lines .line.comment { color: var(--muted); font-style: italic; }

.kw { color: var(--purple); }
.var { color: var(--blue); }
.key { color: var(--blue); }
.str { color: var(--green); }
.fn { color: var(--amber); }
.bool { color: var(--purple); font-weight: 700; }

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

/* Hero */
h1 { display: none; } /* headline expressed as code above; kept for future use */

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 18px 0 4px;
}

.btn-primary { background: var(--green); color: #10130a; border-color: var(--green); font-weight: 700; }
.btn-primary:hover { filter: brightness(1.08); }

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

.prompt { color: var(--green); margin-right: 4px; }

/* ============================================
   CARDS / GRIDS
   ============================================ */
.grid {
  display: grid;
  gap: 16px;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  padding: 18px;
}
.grid.two { grid-template-columns: repeat(2, 1fr); }
.grid.three { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-left: 2px solid var(--purple);
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease);
}
.hover-lift:hover { transform: translateY(-3px); border-left-color: var(--amber); }

.card h3 { font-size: 14.5px; color: var(--text-bright); margin: 4px 0 6px; }
.card-key { font-size: 11.5px; color: var(--green); margin-bottom: 2px; }
.muted { color: var(--muted); font-size: 12.5px; }

.kv { display: flex; gap: 6px; font-size: 12.5px; margin-top: 6px; }
.kv .key { color: var(--blue); }
.kv .val { color: var(--text); }
.kv .val.num { color: var(--amber); }

.card ul { margin-top: 10px; display: flex; flex-direction: column; gap: 5px; }
.card ul li { font-size: 12.5px; color: var(--text); position: relative; padding-left: 14px; }
.card ul li::before { content: '›'; position: absolute; left: 0; color: var(--blue); }

.commit { font-size: 13px; color: var(--text-bright); }
.hash { color: var(--amber); margin-right: 8px; font-size: 12px; }

.tag {
  font-size: 10px;
  color: var(--blue);
  border: 1px solid var(--blue);
  border-radius: 4px;
  padding: 1px 6px;
  margin-left: 8px;
  vertical-align: middle;
}

/* Projects */
.project {
  border-left-color: var(--green);
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0 18px 18px;
}
.project ul { padding-left: var(--gutter-w); }
.project ul.code-lines li.line::before { content: counter(line); }

.project-file-label {
  margin: -4px 18px 0;
  font-size: 11.5px;
}

.project-chips {
  padding: 4px 0 0;
  background: none;
  border: none;
  margin-top: 8px;
}
.project-chips span {
  font-size: 11px;
  padding: 4px 10px;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Skills chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 18px 20px;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.chips span {
  font-size: 12px;
  color: var(--blue);
  background: rgba(92,207,230,0.08);
  border: 1px solid rgba(92,207,230,0.25);
  border-radius: 999px;
  padding: 5px 12px;
}

/* Skills editor body should not have its own bottom radius since chips follow */
#skills .editor-body { border-radius: 0; border-bottom: none; }

/* ============================================
   TERMINAL (contact)
   ============================================ */
.terminal {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  padding: 20px;
  font-size: 13.5px;
}
.terminal .line { margin-bottom: 8px; }
.terminal .out { color: var(--text); padding-left: 18px; }
.contact-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-left: 18px;
  margin-bottom: 8px;
}
.contact-links a { color: var(--green); font-size: 13px; width: fit-content; }
.contact-links a:hover { color: var(--amber); text-decoration: underline; }

/* ============================================
   FOOTER
   ============================================ */
footer {
  max-width: 880px;
  margin: 0 auto;
  padding: 10px 20px 50px;
}
footer .comment { color: var(--muted); font-size: 12px; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 720px) {
  .grid.two, .grid.three { grid-template-columns: 1fr; }
  .titlebar-branch { display: none; }
  .tabbar { top: 33px; }
  main { padding-top: 24px; gap: 40px; }
  .code-lines .line { font-size: 12.5px; }
}

@media (max-width: 480px) {
  .titlebar-name { font-size: 11px; }
  .btn-hire { margin-left: 6px; }
}
