:root {
  --bg:          #0a0a0a;
  --card:        rgba(13,13,15,0.94);
  --card-border: rgba(56,189,248,0.12);
  --accent:      #38bdf8;
  --text:        #e0e0e0;
  --mid:         #aaa;
  --low:         #888;
  --border:      rgba(255,255,255,0.07);
  --grid:        rgba(255,255,255,0.022);

  --font-display: 'Bebas Neue', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;
  --font-prose:   'Inter', sans-serif;

  --sz-name:         50px;
  --sz-tagline:      13px;
  --sz-bio:          15px;
  --sz-skill-label:  10px;
  --sz-skill-pill:   12px;
  --sz-cert-pill:    10px;
  --sz-proj-name:    13px;
  --sz-proj-meta:    10px;
  --sz-link:         13px;
  --sz-expand-title: 30px;
  --sz-expand-desc:  12px;
  --sz-expand-tag:   10px;
  --sz-nav-btn:      10px;
  --sz-chrome:       11px;
  --sz-term:         12px;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  font-family: var(--font-mono);
  color: var(--text);
}

body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 52px 52px;
  pointer-events: none;
  z-index: 0;
}

/* ── LAYOUT ── */
.shell {
  position: fixed; inset: 0; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 20px 24px; overflow: auto;
}

/* ── CARD ── */
.card {
  width: min(1040px, 100%);
  background: var(--card);
  border: 1px solid var(--card-border);
  overflow: hidden;
  display: flex; flex-direction: column;
  animation: fadeUp .45s cubic-bezier(.22,1,.36,1) both;
  box-shadow: 0 0 0 1px rgba(56,189,248,0.07), 0 0 80px rgba(56,189,248,0.05), 0 24px 64px rgba(0,0,0,0.55);
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.card-body { position: relative; overflow: hidden; }

/* ── CHROME ── */
.card-chrome {
  height: 36px;
  background: #0d0d0d;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex; align-items: center;
  padding: 0 16px; gap: 8px;
  flex-shrink: 0;
}
.cdots { display: flex; gap: 6px; cursor: pointer; background: none; border: 0; padding: 0; }
.cdot  { width: 10px; height: 10px; border-radius: 50%; transition: opacity .15s; }
.cdots:hover .cdot { opacity: .7; }
.chrome-label {
  font-size: var(--sz-chrome);
  color: #5a8a5a; letter-spacing: .1em; margin-left: 8px;
}
.chrome-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.view-toggle {
  font-size: var(--sz-chrome); color: #5a8a5a; letter-spacing: .1em;
  background: none; border: 1px solid rgba(255,255,255,0.08);
  padding: 3px 10px; cursor: pointer; font-family: var(--font-mono);
  transition: color .15s, border-color .15s;
}
.view-toggle:hover { color: var(--accent); border-color: rgba(56,189,248,0.2); }

/* ── VIEWS ── */
.view { padding: 32px 36px 28px; }
.view.hidden  { display: none; }
.view.visible { animation: viewIn .2s ease both; }
@keyframes viewIn { from { opacity: 0; } to { opacity: 1; } }

#portfolio-view.visible { display: flex; flex-direction: column; }

/* ── ROW TOP ── */
.row-top {
  display: flex; align-items: flex-start;
  justify-content: space-between; margin-bottom: 18px;
}
.name {
  font-family: var(--font-display);
  font-size: var(--sz-name);
  line-height: 1; letter-spacing: .02em; margin-bottom: 10px;
}
.name .n1 { color: var(--text); }
.name .n2 { color: var(--accent); }
.tagline {
  font-size: var(--sz-tagline); color: var(--low);
  display: flex; align-items: center; gap: 10px;
}
.tagline .caret { color: var(--accent); }
.tagline span { display: inline-flex; align-items: center; }
.tagline .separator { color: #555; }
/* header right: links */
.header-right {
  display: flex; flex-direction: column;
  align-items: flex-end;
  padding-top: 4px;
}

.social-row { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.ext-link {
  font-family: var(--font-mono);
  font-size: var(--sz-link); letter-spacing: .08em; text-transform: uppercase;
  color: var(--mid); border: 1px solid rgba(255,255,255,0.12); padding: 7px 13px;
  text-decoration: none; transition: color .18s, border-color .18s;
  display: inline-flex; align-items: center; gap: 5px;
}
.ext-link:hover { color: var(--accent); border-color: rgba(56,189,248,0.3); }

/* ── RULE + BIO ── */
.rule { height: 1px; background: var(--border); margin-bottom: 22px; }
.bio {
  font-family: var(--font-prose); font-size: var(--sz-bio);
  color: var(--mid); line-height: 1.8; margin-bottom: 24px;
  max-width: 72ch;
}
.bio strong { color: var(--text); font-weight: 500; }

/* ── BOTTOM SPLIT ── */
.bottom-split {
  display: grid; grid-template-columns: 1fr 1px 1fr;
  border-top: 1px solid var(--border);
}
.vdivider { background: var(--border); }

/* ── LEFT: skills + certs ── */
.left-col { padding: 18px 24px 18px 0; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; }
.skill-groups { display: flex; flex-direction: column; gap: 13px; }
.skill-group  { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sg-label {
  font-size: var(--sz-skill-label); letter-spacing: .16em; color: var(--accent);
  text-transform: uppercase; flex-shrink: 0; min-width: 68px;
}
.sg-pills { display: flex; flex-wrap: wrap; gap: 5px; }
.sg-pill {
  font-size: var(--sz-skill-pill); color: var(--low);
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06);
  padding: 3px 9px; transition: color .15s, border-color .15s;
}
.sg-pill:hover { color: var(--accent); border-color: rgba(56,189,248,0.2); }

/* cert pills — row, text only, no icon */
.certs-section { border-top: 1px solid var(--border); padding-top: 16px; }
.cert-pills-row { display: flex; flex-wrap: wrap; gap: 8px; }
.cert-pill {
  font-family: var(--font-mono); font-size: var(--sz-cert-pill);
  color: var(--accent); border: 1px solid rgba(56,189,248,0.3);
  background: rgba(56,189,248,0.04); padding: 4px 11px;
  letter-spacing: .04em; cursor: default;
  transition: background .15s, border-color .15s;
}
.cert-pill[href] { cursor: pointer; text-decoration: none; }
.cert-pill:hover {
  background: rgba(56,189,248,0.09); border-color: rgba(56,189,248,0.5);
}

/* ── RIGHT: project list ── */
.right-col { padding: 18px 0 18px 24px; display: flex; flex-direction: column; }
.proj-footer { margin-top: auto; padding-top: 12px; text-align: right; }
.proj-footer a {
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: #888; text-decoration: none;
  transition: color .18s;
  display: inline-flex; align-items: center; gap: 4px;
}
.proj-footer a:hover { color: var(--accent); }
.proj-footer a svg { width: 10px; height: 10px; fill: currentColor; flex-shrink: 0; }
.proj-content { position: relative; flex: 1; }
.proj-panel { transition: opacity .22s ease, transform .22s ease, visibility .22s; }
.proj-panel.p-hidden {
  opacity: 0; pointer-events: none; visibility: hidden;
  position: absolute; inset: 0; transform: translateX(8px);
}
.proj-panel.p-visible { opacity: 1; pointer-events: all; visibility: visible; transform: translateX(0); }

/* project rows */
.proj-row {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 9px 0;
  color: inherit; background: none; border: 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-family: var(--font-mono); text-align: left; appearance: none;
  cursor: pointer; transition: color .15s, border-color .15s;
}
.proj-row:last-child { border-bottom: none; }
.proj-row:hover .proj-name { color: var(--accent); }
.proj-row:hover .proj-arr  { color: var(--accent); }
.proj-dot  {
  width: 4px; height: 4px; border-radius: 50%;
  background: rgba(56,189,248,0.25); flex-shrink: 0;
  transition: background .15s;
}
.proj-row:hover .proj-dot { background: var(--accent); }
.proj-copy  { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.proj-name  { font-size: var(--sz-proj-name); color: var(--mid); transition: color .15s; }
.proj-outcome { font-size: var(--sz-proj-meta); color: var(--low); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-stack { font-size: var(--sz-proj-meta); color: var(--low); margin-left: auto; padding-right: 6px; white-space: nowrap; }
.proj-arr   { font-size: 16px; color: rgba(56,189,248,0.4); transition: color .15s; flex-shrink: 0; }

/* ── EXPANDED PROJECT ── */
.proj-exp-inner {
  display: flex; flex-direction: column;
  background: rgba(8,18,30,0.92);
  border: 1px solid rgba(56,189,248,0.18);
  padding: 16px; position: relative;
}
.proj-exp-close {
  position: absolute; top: 8px; right: 8px;
  font-size: 14px; color: rgba(56,189,248,0.5);
  background: none; border: none; cursor: pointer;
  font-family: var(--font-mono); line-height: 1;
  transition: color .15s; padding: 8px 10px;
}
.proj-exp-close:hover { color: var(--accent); }
.proj-exp-title { font-family: var(--font-display); font-size: var(--sz-expand-title); color: var(--text); line-height: 1; margin-bottom: 10px; }
.proj-exp-desc  { font-size: var(--sz-expand-desc); color: var(--low); line-height: 1.8; margin-bottom: 12px; }
.proj-exp-tags  { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }
.proj-exp-tags span {
  font-size: var(--sz-expand-tag); color: var(--accent);
  background: rgba(56,189,248,0.05); border: 1px solid rgba(56,189,248,0.13); padding: 2px 7px;
}
.proj-exp-link {
  font-family: var(--font-mono); font-size: var(--sz-nav-btn);
  color: var(--accent); text-decoration: none; letter-spacing: .08em;
  display: inline-block;
}

/* ── CLI VIEW ── */
#term-view { padding: 0; }
#term-view.visible { display: flex; flex-direction: column; }
.term-inner {
  padding: 14px 20px; flex: 1; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: rgba(56,189,248,0.1) transparent;
}
.term-inner::-webkit-scrollbar { width: 3px; }
.term-inner::-webkit-scrollbar-thumb { background: rgba(56,189,248,0.12); }
.tline { font-size: var(--sz-term); line-height: 1.9; }
.tinput-wrap {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-top: 1px solid rgba(255,255,255,0.05);
}
.tprompt { font-size: var(--sz-term); color: var(--accent); flex-shrink: 0; }
.tinput  {
  flex: 1; background: none; border: none; outline: none;
  font-family: var(--font-mono); font-size: var(--sz-term); color: #d0d0d0;
}
/* ── ACCESSIBILITY ── */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
/* ── FOCUS ── */
:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 2px; }

/* ── REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
  .card { animation: none; }
  .view.visible { animation: none; }
  .proj-panel { transition: opacity .1s ease, visibility .1s; }
}

/* Keep the full card reachable in short landscape windows. */
@media (max-height: 560px) and (min-width: 621px) {
  .shell { align-items: flex-start; }
}

@media (max-width: 820px) and (min-width: 621px) {
  .proj-stack { display: none; }
}

/* ── MOBILE ── */
@media (max-width: 620px) {
  .shell { padding: 0; align-items: flex-start; min-height: 100dvh; }
  .card  { height: auto; min-height: 100dvh; border-left: none; border-right: none; border-radius: 0; }
  .card-body { overflow: visible; }
  .view  { padding: 20px 18px 16px; }
  .name  { font-size: 38px; }
  .row-top { flex-direction: column; gap: 10px; }
  .header-right { flex-direction: row; align-items: center; justify-content: flex-start; gap: 6px; padding-top: 0; }
  .social-row { flex-wrap: wrap; justify-content: flex-start; }
  .bottom-split { grid-template-columns: 1fr; }
  .vdivider { display: none; }
  .left-col  { padding: 14px 0 0 0; }
  .right-col { padding: 14px 0 0 0; border-top: 1px solid var(--border); }
  .proj-outcome { white-space: normal; }
  .proj-footer { text-align: left; }
  #term-view.visible { min-height: calc(100dvh - 36px); }
}
