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

/* ─── Tokens ──────────────────────────────────────────────── */
:root {
  --bg:       #000000;
  --surface:  #050505;
  --border:   #161616;
  --border2:  #222222;
  --ink:      #ebebeb;
  --body:     #909090;
  --secondary:#484848;
  --muted:    #1c1c1c;
  --dim:      #080808;

  /* Brand accent — terminal blue. */
  --accent:   #4a9eff;
  --accent-lo: rgba(74, 158, 255, 0.12);

  --mono: 'JetBrains Mono', 'Fira Code', monospace;
  --max-w: 980px;
  --topbar-h: 34px;
  --statusbar-h: 26px;
}

/* ─── Base ────────────────────────────────────────────────── */
body {
  font-family: var(--mono);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Subtle scanline texture on the whole page */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(255,255,255,0.014) 3px,
    rgba(255,255,255,0.014) 4px
  );
}

/* ─── Particle canvas ─────────────────────────────────────── */
#particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ─── Terminal topbar ─────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--topbar-h);
  background: var(--dim);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  pointer-events: none;
}

.topbar-left { display: flex; align-items: center; gap: 10px; }

.tb-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--border2);
  display: inline-block;
}

.tb-title {
  font-size: 10px;
  color: var(--secondary);
  letter-spacing: 0.04em;
  margin-left: 8px;
}

.topbar-right {
  font-size: 10px;
  color: var(--secondary);
  letter-spacing: 0.04em;
}

/* ─── Bento grid ──────────────────────────────────────────── */
.bento {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-areas:
    "hero  hero  hero  stats"
    "strip strip strip strip"
    "aeon  aeon  aeon  aeon"
    "exp   exp   exp   exp"
    "write write write write"
    "proj  proj  proj  proj"
    "work  work  work  work"
    "edu   edu   talk  talk";
  gap: 1px;
  background: var(--border);
  max-width: var(--max-w);
  margin: var(--topbar-h) auto 0;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

/* ─── Cell base ───────────────────────────────────────────── */
.cell {
  background: var(--surface);
  padding: 36px 40px;
  position: relative;
  overflow: hidden;
}

/* Large ghosted number — Braun-style background element */
.cell-num {
  position: absolute;
  bottom: -16px;
  right: 16px;
  font-size: 110px;
  font-weight: 700;
  color: rgba(255,255,255,0.025);
  letter-spacing: -0.06em;
  line-height: 1;
  user-select: none;
  pointer-events: none;
  z-index: 0;
}

/* ─── Cell grid areas ─────────────────────────────────────── */
.cell-hero     { grid-area: hero; }
.cell-stats    { grid-area: stats; padding: 0; }
.cell-strip    { grid-area: strip; padding: 0; height: 58px; background: var(--dim); }
.cell-aeon     { grid-area: aeon; }
.cell-exp      { grid-area: exp; padding-bottom: 0; }
.cell-writing  { grid-area: write; }
.cell-projects { grid-area: proj; padding-bottom: 0; }
.cell-clients  { grid-area: work; padding-bottom: 0; }
.cell-edu      { grid-area: edu; }
.cell-contact  { grid-area: talk; }

/* ─── Terminal command lines ──────────────────────────────── */
.cmd-line {
  font-size: 10px;
  color: var(--secondary);
  letter-spacing: 0.02em;
  margin-bottom: 16px;
  display: flex;
  align-items: baseline;
  gap: 7px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.cmd-prompt {
  color: var(--accent);
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.cmd-arg   { color: var(--body); }
.cmd-flag  { color: var(--secondary); opacity: 0.7; }

/* key-value output block — used in hero profile */
.kv-block {
  border-left: 1px solid var(--border2);
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  z-index: 1;
}

.kv-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 16px;
  font-size: 11px;
  line-height: 1.7;
  align-items: baseline;
}

.kv-key {
  color: var(--secondary);
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.kv-val  { color: var(--body); }

.kv-open { color: var(--accent); }

/* checklist — [✓] items */
.cmd-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin-top: 22px;
  position: relative;
  z-index: 1;
}

.chk-item {
  font-size: 10px;
  color: var(--secondary);
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 5px;
}

.chk-ok { color: var(--accent); }

/* inline project status */
.cmd-meta {
  font-size: 9px;
  color: var(--secondary);
  margin-top: 12px;
  letter-spacing: 0.03em;
}

.cmd-meta .cmd-flag { color: var(--secondary); opacity: 1; }

/* waiting cursor at end of contact section */
.cmd-waiting {
  margin-top: 28px;
  margin-bottom: 0;
}

.waiting-cursor {
  display: inline-block;
  color: var(--accent);
  animation: blink 1s step-end infinite;
}

/* ─── Cell label ──────────────────────────────────────────── */
/* Amber left-border instead of > prefix */
.cell-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.01em;
  padding-left: 14px;
  border-left: 2px solid var(--accent);
  margin-bottom: 32px;
  display: block;
  position: relative;
  z-index: 1;
}

/* ─── Body text ───────────────────────────────────────────── */
.body-text {
  font-size: 12px;
  line-height: 2.0;
  color: var(--body);
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.body-text:last-child { margin-bottom: 0; }

/* ─── Hero ────────────────────────────────────────────────── */
#hero-name {
  font-size: clamp(46px, 6.8vw, 70px);
  font-weight: 300;
  color: var(--ink);
  letter-spacing: -0.04em;
  line-height: 1.0;
  margin-bottom: 16px;
  min-height: 1em;
  position: relative;
  z-index: 1;
}

.type-cursor {
  display: inline-block;
  width: 3px;
  height: 0.8em;
  background: var(--accent);
  margin-left: 3px;
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.hero-output {
  border-left: 1px solid var(--border2);
  padding-left: 18px;
  position: relative;
  z-index: 1;
}

.hero-bio {
  font-size: 12px;
  line-height: 2.0;
  color: var(--body);
  margin-bottom: 14px;
}

.hero-bio:last-child { margin-bottom: 0; }

.hero-aside {
  color: var(--secondary);
  font-style: italic;
}

/* ─── Stats sidebar ───────────────────────────────────────── */
.cell-stats {
  display: flex;
  flex-direction: column;
}

.stat-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 32px;
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.stat-item:last-child { border-bottom: none; }

/* accent bar on left of each stat */
.stat-item::before {
  content: '';
  position: absolute;
  left: 0; top: 30%; bottom: 30%;
  width: 2px;
  background: var(--border2);
  transition: background 0.2s;
}

.stat-item:hover::before { background: var(--accent); }

.stat-value {
  font-size: 22px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.03em;
  display: block;
  margin-bottom: 5px;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 9px;
  color: var(--secondary);
  letter-spacing: 0.04em;
}

/* ─── Panoramic strip ─────────────────────────────────────── */
.strip-inner {
  display: flex;
  width: 200%;
  height: 100%;
  animation: pan 55s linear infinite;
}

.strip-img {
  width: 50%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) brightness(0.18);
  display: block;
  flex-shrink: 0;
  background: var(--dim);
}

/* ─── Experience grid — 2×2 ───────────────────────────────── */
.exp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  margin: 0 -40px;
  position: relative;
  z-index: 1;
}

/* ─── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--surface);
  overflow: hidden;
  transition: background 0.18s ease;
  position: relative;
}

.card:hover { background: var(--dim); }

/* Accent line appears on hover */
.card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.card:hover::after { transform: scaleX(1); }

.card-img-wrap {
  width: 100%;
  height: 145px;
  overflow: hidden;
  background: var(--muted);
  position: relative;
}

.card-img-wrap::before {
  content: '// screenshot';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--secondary);
  letter-spacing: 0.04em;
}

.card-img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(1) brightness(0.45);
  transition: filter 0.35s ease, transform 0.35s ease;
}

.card:hover .card-img {
  filter: grayscale(0.3) brightness(0.85);
  transform: scale(1.03);
}

.card-body { padding: 18px 20px 22px; }

.card-header {
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
}

.card-role {
  font-size: 9px;
  color: var(--secondary);
  font-style: italic;
}

.card-role::before {
  content: '// ';
  font-style: normal;
  color: var(--border2);
}

/* ─── Projects — full-width, prominent ───────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  margin: 0 -40px;
  position: relative;
  z-index: 1;
}

.proj-card .card-img-wrap { height: 210px; }

/* ─── Client work — 3 col ─────────────────────────────────── */
.clients-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  margin: 0 -40px;
  position: relative;
  z-index: 1;
}

/* ─── Writing ─────────────────────────────────────────────── */
.essay-list {
  border: 1px solid var(--border);
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}

.essay-row {
  display: grid;
  grid-template-columns: 24px 1fr 18px;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s ease;
}

.essay-row:last-child { border-bottom: none; }
.essay-row:hover { background: var(--dim); }

/* Amber left accent on essay row hover */
.essay-row {
  border-left: 2px solid transparent;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.essay-row:hover { border-left-color: var(--accent); }

.essay-idx {
  font-size: 9px;
  color: var(--secondary);
  letter-spacing: 0.04em;
  display: block;
  text-align: right;
}

.essay-content { display: flex; flex-direction: column; gap: 5px; }

.essay-title {
  font-size: 12px;
  color: var(--body);
  font-style: italic;
  line-height: 1.5;
  transition: color 0.12s ease;
}

.essay-row:hover .essay-title { color: var(--ink); }

.essay-desc {
  font-size: 10px;
  color: var(--secondary);
  line-height: 1.7;
  font-style: normal;
}

.essay-arrow {
  font-size: 12px;
  color: var(--secondary);
  transition: color 0.12s ease;
  text-align: right;
}

.essay-row:hover .essay-arrow { color: var(--accent); }

.view-all {
  font-size: 10px;
  color: var(--secondary);
  text-decoration: none;
  transition: color 0.12s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  letter-spacing: 0.02em;
  position: relative;
  z-index: 1;
}

.view-all::before { content: '$ '; color: var(--border2); }
.view-all:hover { color: var(--accent); }

/* ─── Social / Contact ────────────────────────────────────── */
.social-links {
  display: flex;
  margin-top: 24px;
  border: 1px solid var(--border);
  width: fit-content;
  position: relative;
  z-index: 1;
}

.social-link {
  font-size: 10px;
  color: var(--secondary);
  text-decoration: none;
  background: none;
  border: none;
  border-right: 1px solid var(--border);
  cursor: pointer;
  padding: 10px 14px;
  font-family: var(--mono);
  font-weight: 400;
  letter-spacing: 0.02em;
  transition: color 0.12s ease, background 0.12s ease;
  display: flex;
  align-items: center;
  gap: 5px;
  line-height: 1;
}

.social-link::before { content: './'; color: var(--border2); font-size: 9px; }
.social-link:last-child { border-right: none; }
.social-link:hover { color: var(--accent); background: var(--dim); }

.email-link { position: relative; }

.tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 9px;
  padding: 4px 8px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.tooltip.show { opacity: 1; }

/* ─── Cursor dot ──────────────────────────────────────────── */
#cursor {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  position: fixed;
  pointer-events: none;
  z-index: 99;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s ease;
  will-change: left, top;
}

/* ─── VSCode-style status bar ─────────────────────────────── */
.statusbar {
  position: relative;
  z-index: 2;
  max-width: var(--max-w);
  margin: 0 auto;
  background: var(--accent);
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 14px;
  height: var(--statusbar-h);
  font-size: 10px;
  color: rgba(255,255,255,0.85);
  letter-spacing: 0.04em;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  overflow: hidden;
}

.sb-item { white-space: nowrap; padding: 0 8px; }

.sb-name { font-weight: 500; color: #fff; padding-left: 0; }

.sb-sep { color: rgba(255,255,255,0.35); }

.sb-push { margin-left: auto; display: flex; align-items: center; gap: 0; }

.sb-exit { color: #fff; font-weight: 500; }

/* ─── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); }

/* ─── Responsive — tablet ─────────────────────────────────── */
@media (max-width: 860px) {
  .bento {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "hero  hero"
      "stats stats"
      "strip strip"
      "aeon  aeon"
      "exp   exp"
      "write write"
      "proj  proj"
      "work  work"
      "edu   talk";
  }

  .cell-stats { flex-direction: row; }
  .stat-item  { border-bottom: none; border-right: 1px solid var(--border); padding: 20px 24px; }
  .stat-item:last-child { border-right: none; }
  .stat-value { font-size: 18px; }

  .exp-grid, .projects-grid, .clients-grid { margin: 0 -40px; }
}

/* ─── Responsive — mobile ─────────────────────────────────── */
@media (max-width: 560px) {
  .bento {
    grid-template-columns: 1fr;
    grid-template-areas:
      "hero"
      "stats"
      "strip"
      "aeon"
      "exp"
      "write"
      "proj"
      "work"
      "edu"
      "talk";
  }

  .cell { padding: 28px 22px; }

  #hero-name { font-size: clamp(36px, 11vw, 52px); }

  .exp-grid, .projects-grid { grid-template-columns: 1fr; margin: 0 -22px; }

  .clients-grid { grid-template-columns: 1fr; margin: 0 -22px; }

  .cell-stats { flex-direction: column; }
  .stat-item  { border-right: none; border-bottom: 1px solid var(--border); padding: 16px 22px; }
  .stat-item:last-child { border-bottom: none; }

  .social-links { flex-wrap: wrap; width: 100%; }
  .social-link  { flex: 1 1 40%; border-bottom: 1px solid var(--border); }
  .social-link:nth-last-child(-n+2) { border-bottom: none; }

  #cursor { display: none; }
}

@media (hover: none) { #cursor { display: none; } }
