/* ================= THEME TOKENS ================= */
:root, html[data-theme="dark"] {
  --bg: #0a0e16;
  --panel: #101624;
  --panel-2: #0d1320;
  --line: #212b40;
  --text: #e9edf5;
  --muted: #9aa6ba;
  --blue: #5b9dff;
  --blue-strong: #7db1ff;
  --green: #3ddc84;
  --amber: #ffc24b;
  --key: #7db1ff;      /* yaml key */
  --str: #3ddc84;      /* yaml string */
  --cmt: #5b6b85;      /* yaml comment */
  --on-blue: #06101f;
  --shadow: rgba(0,0,0,0.35);
  --topbar: rgba(10,14,22,0.88);
}
html[data-theme="light"] {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --panel-2: #eef1f6;
  --line: #d5dce8;
  --text: #17202e;
  --muted: #46536a;
  --blue: #1d5fd6;
  --blue-strong: #1a4fb0;
  --green: #0b7c47;
  --amber: #965f00;
  --key: #1a4fb0;
  --str: #0d7a46;
  --cmt: #7a879c;
  --on-blue: #ffffff;
  --shadow: rgba(23,32,46,0.08);
  --topbar: rgba(244,246,249,0.92);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth; background: var(--bg);
  /* Base size for the whole site. Every rem value scales from this.
     17px on phones, growing smoothly to 20px on a wide monitor. */
  font-size: clamp(17px, 15px + 0.33vw, 20px);
}
.site { background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
.site > main { flex: 1 0 auto; }
.site > .footer { margin-top: auto; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s, color 0.25s;
}
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; }
.dim { color: var(--muted); }
h1, h2, h3 { font-family: "Sora", sans-serif; letter-spacing: -0.01em; }

/* ================= TOP BAR ================= */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.05rem 1.25rem;
  background: var(--topbar);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand {
  font-family: "JetBrains Mono", monospace; font-size: 1.02rem; font-weight: 700;
  color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 0.6rem;
  letter-spacing: -0.01em;
}
.brand .k8s { color: var(--blue); font-size: 1.45em; line-height: 1; }
.topbar-right { display: flex; align-items: center; gap: 0.7rem; }
.nav { display: flex; gap: 1.4rem; }
.nav a { color: var(--muted); text-decoration: none; font-size: 0.9rem; font-weight: 500; }
.nav a:hover, .nav a:focus-visible { color: var(--blue-strong); }
.icon-btn {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); font-size: 0.95rem; padding: 0.32rem 0.62rem; cursor: pointer;
}
.icon-btn:hover { border-color: var(--blue); }
.menu-btn { display: none; }

/* ================= HERO ================= */
.hero {
  max-width: 1060px; margin: 0 auto;
  padding: 4.5rem 1.25rem 3.5rem;
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 2.5rem; align-items: center;
}
.avail {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: "JetBrains Mono", monospace; font-size: 0.74rem; font-weight: 500;
  color: var(--green);
  border: 1px solid var(--green); border-radius: 999px;
  padding: 0.32rem 0.85rem; margin-bottom: 1.4rem;
}
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: pulse 2s infinite; }
@keyframes pulse { 0%{opacity:1} 50%{opacity:0.35} 100%{opacity:1} }
.hero h1 { font-size: clamp(2.1rem, 5.5vw, 3.2rem); line-height: 1.12; }
.typed { color: var(--blue-strong); }
.caret { display: inline-block; width: 3px; height: 0.85em; background: var(--blue); margin-left: 4px; vertical-align: -0.08em; animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .pulse, .caret { animation: none; } html { scroll-behavior: auto; } }
.bio { margin-top: 1.1rem; color: var(--muted); max-width: 560px; }
.hero-actions { display: flex; gap: 0.7rem; margin-top: 1.6rem; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 0.6rem 1.15rem; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel);
  color: var(--text); text-decoration: none; font-size: 0.9rem; font-weight: 600;
  transition: border-color 0.15s, transform 0.15s;
}
.btn:hover { border-color: var(--blue); transform: translateY(-1px); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: var(--on-blue); }
.btn.primary:hover { filter: brightness(1.07); }

/* ---- YAML manifest card (signature) ---- */
.manifest {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 30px var(--shadow);
  overflow: hidden;
}
.manifest-bar {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.6rem 0.9rem;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
  font-family: "JetBrains Mono", monospace; font-size: 0.72rem; color: var(--muted);
}
.wdot { width: 10px; height: 10px; border-radius: 50%; opacity: 0.85; }
.manifest pre {
  padding: 1rem 1.1rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  line-height: 1.75;
  overflow-x: auto;
  color: var(--text);
}
.yk { color: var(--key); }
.ys { color: var(--str); }
.yc { color: var(--cmt); font-style: italic; }

/* ================= SECTIONS ================= */
.section { max-width: 1060px; margin: 0 auto; padding: 3.25rem 1.25rem; border-top: 1px solid var(--line); }
.sec-head { display: flex; align-items: baseline; gap: 0.9rem; margin-bottom: 1.6rem; flex-wrap: wrap; }
.sec-head h2 { font-size: 1.55rem; }
.sec-tag {
  font-family: "JetBrains Mono", monospace; font-size: 0.7rem; font-weight: 500;
  color: var(--blue-strong); background: var(--panel);
  border: 1px solid var(--line); border-radius: 6px; padding: 0.16rem 0.55rem;
}

/* ================= PROJECTS = deployments ================= */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 1rem; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  display: flex; flex-direction: column;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  overflow: hidden;
}
.card:hover { border-color: var(--blue); transform: translateY(-2px); box-shadow: 0 10px 24px var(--shadow); }
.dep-head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: var(--panel-2); border-bottom: 1px solid var(--line);
  font-family: "JetBrains Mono", monospace; font-size: 0.72rem;
}
.dep-name { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dep-name b { color: var(--text); font-weight: 500; }
.status { display: inline-flex; align-items: center; gap: 0.35rem; font-weight: 700; white-space: nowrap; }
.status.ok { color: var(--green); }
.status.run { color: var(--amber); }
.card-body { padding: 1rem 1rem 1.1rem; display: flex; flex-direction: column; gap: 0.65rem; flex: 1; }
.card-body h3 { font-size: 1.02rem; line-height: 1.35; }
.card-body p { font-size: 0.87rem; color: var(--muted); }
.highlights { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; }
.highlights li { font-size: 0.82rem; color: var(--muted); padding-left: 1.05rem; position: relative; }
.highlights li::before { content: "›"; position: absolute; left: 0; color: var(--blue); font-weight: 700; }
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tag {
  font-family: "JetBrains Mono", monospace; font-size: 0.68rem; font-weight: 500;
  color: var(--blue-strong); background: var(--panel-2);
  border: 1px solid var(--line); padding: 0.16rem 0.5rem; border-radius: 6px;
}
.repo-link { margin-top: auto; font-size: 0.83rem; color: var(--blue-strong); text-decoration: none; font-weight: 600; }
.repo-link:hover { text-decoration: underline; }

/* ================= EXPERIENCE = pipeline ================= */
.pipeline { position: relative; padding-left: 2rem; }
.pipeline::before { content: ""; position: absolute; left: 11px; top: 10px; bottom: 10px; width: 2px; background: var(--line); }
.stage { position: relative; padding-bottom: 2rem; }
.stage:last-child { padding-bottom: 0; }
.stage-icon {
  position: absolute; left: -2rem; top: 2px;
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700;
  background: var(--bg); z-index: 1;
}
.stage-icon.pass { border: 2px solid var(--green); color: var(--green); }
.stage-icon.running { border: 2px solid var(--amber); color: var(--amber); }
.stage-meta { font-family: "JetBrains Mono", monospace; font-size: 0.73rem; color: var(--muted); margin-bottom: 0.25rem; }
.stage h3 { font-size: 1.02rem; margin-bottom: 0.45rem; }
.at { color: var(--muted); font-family: "Inter", sans-serif; font-weight: 500; }
.stage ul { list-style: none; display: flex; flex-direction: column; gap: 0.35rem; }
.stage li { font-size: 0.86rem; color: var(--muted); padding-left: 1rem; position: relative; }
.stage li::before { content: "–"; position: absolute; left: 0; color: var(--blue); }

/* ================= SKILLS = k8s labels ================= */
.skills { display: flex; flex-direction: column; gap: 1.4rem; }
.skill-key { font-family: "JetBrains Mono", monospace; font-size: 0.78rem; color: var(--key); font-weight: 500; margin-bottom: 0.55rem; }
.label-chip {
  font-family: "JetBrains Mono", monospace; font-size: 0.72rem;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 6px; padding: 0.2rem 0.55rem; color: var(--text);
}
.label-chip span { color: var(--muted); }

/* ================= CERTS ================= */
.certs .card { text-decoration: none; color: var(--text); padding: 1.15rem; gap: 0.45rem; }
.cert-short { font-family: "JetBrains Mono", monospace; color: var(--green); font-size: 0.92rem; font-weight: 700; }
.certs h3 { font-size: 1rem; line-height: 1.4; }
.certs p { font-size: 0.83rem; }

/* ================= CONTACT / FOOTER ================= */
.contact { text-align: center; padding-bottom: 4.5rem; border-top: 1px solid var(--line); }
.contact h2 { font-size: 1.55rem; }
.contact p { margin: 0.7rem auto 1.4rem; max-width: 480px; color: var(--muted); }
.contact .hero-actions { justify-content: center; }
.footer {
  border-top: 1px solid var(--line); padding: 1.2rem 1.25rem;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem;
  font-family: "JetBrains Mono", monospace; font-size: 0.75rem; color: var(--muted);
}
.up { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--green); }

/* ================= LARGE DESKTOP / MONITOR ================= */
@media (min-width: 1200px) {
  .hero { max-width: 1240px; gap: 3.5rem; padding-top: 5.5rem; }
  .section { max-width: 1240px; padding-top: 4rem; padding-bottom: 4rem; }

  .bio { max-width: 640px; font-size: 1.02rem; }
  .brand { font-size: 1.12rem; }
  .nav a { font-size: 0.95rem; }

  .tag, .label-chip {
    font-size: 0.85rem;
    padding: 0.32rem 0.75rem;
  }
  .tags { gap: 0.55rem; }
  .skills { gap: 1.8rem; }
  .skill-key { font-size: 0.92rem; margin-bottom: 0.75rem; }

  .card-body { padding: 1.3rem 1.3rem 1.4rem; gap: 0.85rem; }
  .card-body h3 { font-size: 1.15rem; }
  .card-body p { font-size: 0.95rem; }
  .highlights li { font-size: 0.9rem; }
  .dep-head { padding: 0.75rem 1.2rem; font-size: 0.8rem; }

  .stage h3 { font-size: 1.15rem; }
  .stage li { font-size: 0.94rem; }
  .stage-meta { font-size: 0.8rem; }

  .certs h3 { font-size: 1.08rem; }
  .certs p { font-size: 0.9rem; }
}

/* ================= MOBILE ================= */
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; gap: 2rem; padding-top: 3.25rem; }
  .menu-btn { display: block; }
  .nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--panel); border-bottom: 1px solid var(--line);
  }
  .nav.open { display: flex; }
  .nav a { padding: 0.9rem 1.25rem; border-top: 1px solid var(--line); }
}