/* Shared design tokens, base layout, animated background and chrome.
   Used by both index.html and portfolio-page-cv.html. */

:root {
  --bg: #111622;
  --bg-2: #151b2a;
  --panel: #1a2032;
  --panel-2: #1f2638;
  --border: #2a3148;
  --border-2: #363e57;
  --text: #e8ecf5;
  --muted: #9aa3bd;
  --dim: #6b7594;
  --accent-a: #5ad1ff;   /* cyan   */
  --accent-b: #ffb86b;   /* amber  */
  --accent-c: #b488ff;   /* violet */
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
}

body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0.005em;
  min-height: 100vh;
}

::selection { background: rgba(124, 92, 255, 0.35); color: var(--text); }

/* ─── Animated background ─── */
#neural {
  position: fixed; inset: 0; z-index: 0;
  opacity: 0.75; pointer-events: none;
}

.vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 20% 10%, rgba(90, 209, 255, 0.10), transparent 55%),
    radial-gradient(ellipse 70% 50% at 85% 85%, rgba(255, 184, 107, 0.08), transparent 55%),
    radial-gradient(ellipse 50% 40% at 60% 40%, rgba(180, 136, 255, 0.06), transparent 60%),
    linear-gradient(180deg, rgba(17,22,34,0.35), rgba(17,22,34,0.75));
}

.grain {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  opacity: 0.04; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.7'/></svg>");
}

/* ─── Top brand chrome ─── */
.chrome {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  padding: 18px 28px;
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--mono); font-size: 12px; color: var(--muted);
}

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-a), var(--accent-b));
  box-shadow: 0 0 12px rgba(90, 209, 255, 0.6);
}

/* ─── Hero shared bits (typing caret + status pulse) ─── */
.caret {
  display: inline-block; width: 8px; height: 15px;
  background: var(--accent-b); vertical-align: -2px; margin-left: 2px;
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent-b); box-shadow: 0 0 10px var(--accent-b);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ─── Social links (hero) ─── */
.socials {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  margin-top: 6px;
}
.soc {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(26,32,50,0.5);
  color: var(--muted);
  text-decoration: none;
  font-family: var(--mono); font-size: 11.5px;
  transition: color .2s, border-color .2s, background .2s;
}
.soc:hover {
  color: var(--text);
  border-color: var(--accent-a);
  background: rgba(90, 209, 255, 0.08);
}
.soc svg { opacity: 0.8; width: 13px; height: 13px; }
.soc:hover svg { opacity: 1; color: var(--accent-a); }
/* cv.html — tiled workspace layout. Hero uses the same styling as index. */

.chrome {
  padding: 16px 28px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  background: linear-gradient(180deg, rgba(17,22,34,0.78), rgba(17,22,34,0));
}

/* ─── Stage layout: hero row + workspace row ─── */
.stage {
  position: relative;
  z-index: 3;
  width: 100%;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 24px;
  padding: 80px 40px 40px;
  max-width: 1280px;
  margin: 0 auto;
}

/* ─── Hero (mirrors index) ─── */
.hero {
  width: 100%; max-width: 760px;
  margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 18px;
}

.greeting {
  font-family: var(--mono); font-size: 12px; color: var(--accent-a);
  letter-spacing: 0.1em;
}
.greeting .prompt { color: var(--accent-b); margin-right: 6px; }

.hero h1 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}
.hero h1 .accent {
  background: linear-gradient(135deg, var(--accent-a), var(--accent-b));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.typed-row {
  font-family: var(--mono); font-size: 13px; color: var(--muted);
  min-height: 18px;
}
.typed-row .arrow { color: var(--accent-a); margin-right: 8px; }

.meta {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 8px 24px;
  font-family: var(--mono); font-size: 11.5px; color: var(--muted);
  padding-top: 14px; border-top: 1px dashed var(--border);
  width: 100%;
}
.meta .row { display: inline-flex; gap: 8px; align-items: center; white-space: nowrap; }
.meta .key { color: var(--dim); text-transform: uppercase; letter-spacing: 0.1em; font-size: 10.5px; }
.meta .val { color: var(--text); }

/* ─── Tiled workspace (grid of "panes") ─── */
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  grid-template-areas:
    "about about"
    "stack exp"
    "certs certs";
  gap: 14px;
  align-items: stretch;
}
.pane-certs { grid-area: certs; }
.pane-about { grid-area: about; }
.pane-stack { grid-area: stack; }
.pane-exp   { grid-area: exp; }

.pane {
  position: relative;
  background: linear-gradient(180deg, rgba(15,17,23,0.82), rgba(15,17,23,0.6));
  border: 1px solid var(--border);
  border-radius: 10px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex; flex-direction: column;
  min-height: 0; overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.35);
  transition: border-color .25s, box-shadow .25s;
}
.pane:hover {
  border-color: rgba(124, 92, 255, 0.35);
  box-shadow: 0 20px 50px rgba(0,0,0,0.45), 0 0 0 1px rgba(124, 92, 255, 0.15);
}

.pane-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(26,29,40,0.95), rgba(20,23,31,0.9));
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  flex-shrink: 0;
}
.pane-bar .pane-path { flex: 1; text-align: left; letter-spacing: 0.06em; color: var(--text); }
.pane-bar .pane-path .tilde { color: var(--accent-a); }
.pane-bar .pane-path .ext { color: var(--dim); }

.pane-body {
  padding: 18px 18px;
  scroll-behavior: smooth;
}
.pane-body::-webkit-scrollbar { width: 6px; }
.pane-body::-webkit-scrollbar-track { background: transparent; }
.pane-body::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }

.pane-stack .stack-grid { grid-template-columns: 1fr; }

/* Inline links inside the about prose */
.prose a {
  color: var(--accent-a);
  text-decoration: none;
  border-bottom: 1px dashed var(--border-2);
  transition: color .2s, border-color .2s;
}
.prose a:hover {
  color: var(--accent-b);
  border-bottom-color: var(--accent-b);
}

/* Education line under workspace, intentionally muted */
.education {
  margin-top: 16px;
  padding: 10px 14px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  letter-spacing: 0.02em;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  border-top: 1px dashed var(--border);
  opacity: 0.85;
}
.education .key { color: var(--accent-a); }
.education .val { color: var(--muted); }
@media (max-width: 640px) {
  .education { font-size: 10.5px; }
}

@media (max-width: 900px) {
  .workspace {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
    grid-template-areas: "about" "stack" "exp" "certs";
  }
}

/* ─── Prose ─── */
.prose { color: var(--text); font-size: 14.5px; line-height: 1.72; }
.prose p { margin: 0 0 14px; }
.prose p:last-child { margin-bottom: 0; }
.prose .mono { font-family: var(--mono); color: var(--accent-b); font-size: 0.95em; }

/* ─── Stack grid ─── */
.stack-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--border); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden;
}
.stack-card { background: var(--panel); padding: 18px 18px 16px; transition: background .25s; }
.stack-card:hover { background: var(--panel-2); }
.stack-card .head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.stack-card .name { font-family: var(--mono); font-size: 14px; font-weight: 500; color: var(--text); }
.stack-card .years { font-family: var(--mono); font-size: 10.5px; color: var(--dim); letter-spacing: 0.05em; white-space: nowrap; }
.stack-card .desc { font-size: 12.5px; color: var(--muted); line-height: 1.55; margin-bottom: 12px; }
.stack-card .desc em { color: var(--accent-b); font-style: normal; }
.stack-card .desc .mono { font-family: var(--mono); color: var(--accent-a); font-size: 0.95em; }
.stack-card .bar { height: 2px; background: var(--border-2); border-radius: 2px; overflow: hidden; position: relative; }
.stack-card .bar::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: var(--w, 70%);
  background: linear-gradient(90deg, var(--accent-a), var(--accent-b));
  border-radius: 2px;
}

/* ─── Timeline / experience ─── */
.timeline { position: relative; padding-left: 20px; }
.timeline::before {
  content: ""; position: absolute; left: 4px; top: 6px; bottom: 6px;
  width: 1px; background: linear-gradient(180deg, var(--border-2), var(--border));
}
.job { position: relative; padding-bottom: 24px; }
.job:last-child { padding-bottom: 0; }
.job::before {
  content: ""; position: absolute; left: -20px; top: 6px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--panel); border: 2px solid var(--accent-b);
  box-shadow: 0 0 8px rgba(255, 184, 107, 0.4);
}
.job .when { font-family: var(--mono); font-size: 10.5px; color: var(--dim); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 4px; }
.job .title { font-family: var(--mono); font-size: 14px; font-weight: 500; color: var(--text); margin-bottom: 2px; }
.job .title .at { color: var(--muted); font-weight: 400; }
.job .title .company { color: var(--accent-b); }
.job .desc { font-size: 13px; color: var(--muted); line-height: 1.65; margin-top: 6px; max-width: 62ch; }
.job .tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.tag {
  font-family: var(--mono); font-size: 10px; padding: 3px 7px; border-radius: 4px;
  background: rgba(124, 92, 255, 0.08); color: var(--muted);
  border: 1px solid var(--border);
  letter-spacing: 0.03em;
}

/* ─── Open source / certifications ─── */
.certs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (max-width: 1100px) {
  .certs-grid { grid-template-columns: 1fr; }
}
.cert {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: background .2s, border-color .2s, transform .2s;
}
.cert:hover {
  background: var(--panel-2);
  border-color: rgba(124, 92, 255, 0.35);
  transform: translateY(-1px);
}
.cert-badge {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: linear-gradient(135deg, oklch(0.35 0.15 var(--h, 200)), oklch(0.22 0.08 var(--h, 200)));
  color: oklch(0.92 0.12 var(--h, 200));
  border: 1px solid oklch(0.5 0.15 var(--h, 200) / 0.4);
  flex-shrink: 0;
}
.cert-badge[data-hue="200"] { --h: 200; }
.cert-badge[data-hue="30"]  { --h: 30; }
.cert-badge[data-hue="270"] { --h: 270; }
.cert-badge[data-hue="140"] { --h: 140; }
.cert-badge svg { width: 20px; height: 20px; }
.cert-body { min-width: 0; }
.cert-name {
  font-family: var(--mono); font-size: 12.5px; color: var(--text);
  margin-bottom: 4px; line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cert-meta {
  font-family: var(--mono); font-size: 10.5px; color: var(--dim);
  letter-spacing: 0.04em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cert-meta .sep { color: var(--border-2); margin: 0 6px; }
.cert-id {
  font-family: var(--mono); font-size: 10px; color: var(--muted);
  padding: 3px 8px; border: 1px dashed var(--border-2); border-radius: 4px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ─── Responsive ─── */
@media (max-width: 900px) {
  body { overflow-y: auto; }
  .stage { height: auto; padding: 100px 24px 60px; gap: 24px; }
}
@media (max-width: 640px) {
  .stack-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 32px; }
}
