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

:root {
  --bg:      #070d09;
  --bg2:     #0c1710;
  --bg3:     #04342C;
  --border:  #0F6E56;
  --border2: #1D9E75;
  --accent:  #1D9E75;
  --accent2: #5DCAA5;
  --dim:     #9FE1CB;
  --text:    #E1F5EE;
  --muted:   #5DCAA5;
  --faint:   #085041;
  --red:     #e05c5c;
  --yellow:  #e0c05c;
  --green:   #5ce08a;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  min-height: 100vh;
  overflow-x: hidden;
}

/* scanline */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.04) 2px, rgba(0,0,0,0.04) 4px);
  pointer-events: none;
  z-index: 200;
}

/* grid bg */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(29,158,117,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29,158,117,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

.container {
  position: relative;
  z-index: 1;
  max-width: 740px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

/* ── Topbar ── */
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0.5rem;
  opacity: 0;
  animation: fadeUp 0.5s ease 0.05s forwards;
}
.terminal-icon {
  width: 28px; height: 28px;
  background: var(--border);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--text);
  flex-shrink: 0;
}
.topbar-host { font-size: 12px; color: var(--muted); }
.topbar-status { font-size: 12px; color: var(--accent); margin-left: auto; display: flex; align-items: center; gap: 5px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulse 2s ease-in-out infinite; flex-shrink: 0; }
.uptime-display { font-size: 11px; color: var(--faint); margin-left: 8px; }

/* ── Hero ── */
.hero {
  margin: 2rem 0 2.5rem;
  opacity: 0;
  animation: fadeUp 0.5s ease 0.15s forwards;
}
.prompt-line { font-size: 11px; color: var(--faint); letter-spacing: 0.06em; margin-bottom: 0.75rem; }
.prompt-line span { color: var(--muted); }

h1 {
  font-size: clamp(1.8rem, 6vw, 2.8rem);
  font-weight: 700; color: var(--text);
  line-height: 1.1; margin-bottom: 0.4rem;
}
.cursor {
  display: inline-block; width: 3px; height: 0.85em;
  background: var(--accent); vertical-align: middle; margin-left: 4px;
  animation: blink 1s step-end infinite;
}
.subtitle { font-size: clamp(0.85rem, 2.5vw, 1rem); color: var(--accent); font-weight: 500; min-height: 1.4em; }

/* ── Current role ── */
.current-role {
  margin-top: 1rem;
  display: flex; align-items: flex-start; gap: 8px;
  opacity: 0;
  animation: fadeUp 0.5s ease 0.25s forwards;
}
.current-role .prompt-line { margin: 0; white-space: nowrap; padding-top: 1px; }
.role-text { font-size: 12px; color: var(--dim); line-height: 1.6; }
.role-text strong { color: var(--accent2); font-weight: 500; }

/* ── Section ── */
section { margin-bottom: 2.25rem; }
.section-label { font-size: 11px; color: var(--faint); letter-spacing: 0.06em; margin-bottom: 0.75rem; }
.section-label span { color: var(--muted); }

.anim { opacity: 0; }
.anim.a1 { animation: fadeUp 0.5s ease 0.3s forwards; }
.anim.a2 { animation: fadeUp 0.5s ease 0.45s forwards; }
.anim.a3 { animation: fadeUp 0.5s ease 0.6s forwards; }
.anim.a4 { animation: fadeUp 0.5s ease 0.75s forwards; }
.anim.a5 { animation: fadeUp 0.5s ease 0.9s forwards; }
.anim.a6 { animation: fadeUp 0.5s ease 1.05s forwards; }
.anim.a7 { animation: fadeUp 0.5s ease 1.2s forwards; }
.anim.a8 { animation: fadeUp 0.5s ease 1.35s forwards; }

/* ── Pipeline ── */
.pipeline-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 8px; padding-right: 1.5rem; margin-right: -1.5rem; }
.pipeline { display: flex; align-items: center; min-width: max-content; padding-right: 1.5rem; }
.pipe-step {
  background: var(--bg2); border: 0.5px solid var(--border);
  border-radius: 4px; padding: 6px 14px;
  font-size: 12px; color: var(--dim); white-space: nowrap; flex-shrink: 0;
}
.pipe-step.active { background: var(--border); border-color: var(--accent); color: var(--text); font-weight: 700; }
.pipe-arrow { flex-shrink: 0; width: 32px; position: relative; height: 20px; }
.pipe-arrow::before {
  content: ''; position: absolute;
  top: 50%; left: 0; right: 12px; height: 1px;
  background-image: repeating-linear-gradient(90deg, var(--border) 0, var(--border) 4px, transparent 4px, transparent 8px);
  animation: dash 0.8s linear infinite;
}
.pipe-arrow::after {
  content: ''; position: absolute;
  top: 50%; right: 4px; transform: translateY(-50%);
  border-top: 4px solid transparent; border-bottom: 4px solid transparent;
  border-left: 6px solid var(--border);
}

/* ── Skills ── */
.skills { display: flex; flex-wrap: wrap; gap: 8px; }
.skill {
  font-size: 11px; padding: 4px 10px; border-radius: 3px;
  background: var(--bg3); color: var(--accent2);
  border: 0.5px solid var(--border);
  transition: background 0.15s, color 0.15s; cursor: default;
}
.skill:hover { background: var(--accent); color: var(--bg); }

/* ── Metrics ── */
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.metric { background: var(--bg3); border: 0.5px solid var(--border); border-radius: 6px; padding: 0.85rem 1rem; }
.metric-label { font-size: 9px; color: var(--muted); letter-spacing: 0.08em; margin-bottom: 6px; }
.metric-value { font-size: clamp(1rem, 3.5vw, 1.4rem); font-weight: 700; color: var(--text); }
.metric-note { font-size: 9px; color: var(--faint); margin-top: 3px; }

/* ── Status board ── */
.status-board {
  background: var(--bg2); border: 0.5px solid var(--border);
  border-radius: 8px; overflow: hidden;
}
.status-board-header {
  background: var(--bg3); padding: 8px 14px;
  font-size: 10px; color: var(--muted); letter-spacing: 0.06em;
  border-bottom: 0.5px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.status-board-header .dot { width: 5px; height: 5px; }
.status-rows { padding: 6px 0; }
.status-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 14px; font-size: 12px;
  border-bottom: 0.5px solid rgba(15,110,86,0.2);
}
.status-row:last-child { border-bottom: none; }
.status-key { color: var(--dim); }
.status-val { font-weight: 500; display: flex; align-items: center; gap: 6px; }
.status-val.ok   { color: var(--green); }
.status-val.warn { color: var(--yellow); }
.status-val.crit { color: var(--red); }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 2s ease-in-out infinite; }

/* ── Certs ── */
.certs { display: flex; flex-wrap: wrap; gap: 10px; }
.cert {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg2); border: 0.5px solid var(--border);
  border-radius: 6px; padding: 8px 14px;
  font-size: 11px; color: var(--dim);
  transition: border-color 0.15s;
}
.cert:hover { border-color: var(--accent); }
.cert-badge {
  width: 28px; height: 28px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; flex-shrink: 0;
}
.cert-badge.aws { background: #1a2535; color: #FF9900; border: 0.5px solid #FF9900; }
.cert-badge.k8s { background: #0d1b2e; color: #326CE5; border: 0.5px solid #326CE5; }
.cert-badge.tf  { background: #1a1228; color: #7B42BC; border: 0.5px solid #7B42BC; }
.cert-name { color: var(--text); font-size: 11px; }
.cert-issuer { color: var(--faint); font-size: 10px; margin-top: 1px; }

/* ── Projects ── */
.projects { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.project {
  background: var(--bg2); border: 0.5px solid var(--border);
  border-radius: 8px; padding: 1rem 1.1rem;
  transition: border-color 0.15s;
  text-decoration: none; display: block;
}
.project:hover { border-color: var(--accent); }
.project-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.project-name { font-size: 13px; font-weight: 700; color: var(--accent2); }
.project-arrow { font-size: 12px; color: var(--faint); }
.project:hover .project-arrow { color: var(--accent); }
.project-desc { font-size: 11px; color: var(--dim); line-height: 1.6; margin-bottom: 10px; }
.project-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.project-tag {
  font-size: 10px; padding: 2px 7px; border-radius: 2px;
  background: var(--bg3); color: var(--muted); border: 0.5px solid var(--faint);
}

/* ── TIL ── */
.til-list { list-style: none; }
.til-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 10px 0; border-bottom: 0.5px solid rgba(15,110,86,0.25);
}
.til-item:last-child { border-bottom: none; }
.til-date { font-size: 10px; color: var(--faint); white-space: nowrap; padding-top: 2px; min-width: 68px; }
.til-text { font-size: 12px; color: var(--dim); line-height: 1.6; }
.til-text strong { color: var(--accent2); font-weight: 500; }
.til-tag {
  display: inline-block; font-size: 9px; padding: 1px 6px;
  border-radius: 2px; background: var(--bg3); color: var(--muted);
  border: 0.5px solid var(--faint); margin-left: 6px; vertical-align: middle;
}

/* ── Interactive Terminal ── */
.terminal-window {
  background: var(--bg2); border: 0.5px solid var(--border);
  border-radius: 8px; overflow: hidden;
}
.terminal-titlebar {
  background: var(--bg3); padding: 8px 12px;
  display: flex; align-items: center; gap: 6px;
  border-bottom: 0.5px solid var(--border);
}
.tb-dot { width: 9px; height: 9px; border-radius: 50%; }
.tb-dot.r { background: #e05c5c; }
.tb-dot.y { background: #e0c05c; }
.tb-dot.g { background: #5ce08a; }
.terminal-titlebar-label { font-size: 11px; color: var(--faint); margin-left: auto; margin-right: auto; }

.terminal-output {
  padding: 12px 14px; min-height: 120px; max-height: 280px;
  overflow-y: auto; font-size: 12px; line-height: 1.7;
}
.terminal-output::-webkit-scrollbar { width: 4px; }
.terminal-output::-webkit-scrollbar-track { background: transparent; }
.terminal-output::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.t-line { margin: 0; }
.t-prompt { color: var(--accent); }
.t-cmd { color: var(--text); }
.t-out { color: var(--dim); }
.t-err { color: var(--red); }
.t-hi { color: var(--accent2); }
.t-comment { color: var(--faint); }

.terminal-input-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-top: 0.5px solid var(--border);
  background: var(--bg);
}
.t-ps1 { color: var(--accent); font-size: 12px; white-space: nowrap; flex-shrink: 0; }
.terminal-input {
  background: transparent; border: none; outline: none;
  color: var(--text); font-family: inherit; font-size: 12px;
  flex: 1; caret-color: var(--accent);
}
.terminal-input::placeholder { color: var(--faint); }

/* ── Footer ── */
.divider { border: none; border-top: 0.5px solid var(--border); margin: 2rem 0; }
.footer {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  opacity: 0; animation: fadeUp 0.5s ease 1.5s forwards;
}
.footer-prompt { font-size: 11px; color: var(--faint); margin-right: 4px; white-space: nowrap; }
.footer-prompt span { color: var(--muted); }
.connect-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-family: inherit; color: var(--accent);
  text-decoration: none; border: 0.5px solid var(--border);
  padding: 5px 12px; border-radius: 4px;
  transition: background 0.15s, color 0.15s; white-space: nowrap;
}
.connect-link:hover { background: var(--bg3); color: var(--dim); }
.connect-link svg { width: 13px; height: 13px; fill: currentColor; flex-shrink: 0; }

/* ── Animations ── */
@keyframes blink   { 0%,100%{opacity:1} 50%{opacity:0} }
@keyframes fadeUp  { from{opacity:0;transform:translateY(12px)} to{opacity:1;transform:translateY(0)} }
@keyframes pulse   { 0%,100%{opacity:1} 50%{opacity:0.3} }
@keyframes dash    { from{background-position:0 0} to{background-position:16px 0} }
@keyframes typing  { from{width:0} to{width:100%} }

/* ── Responsive ── */
@media (max-width: 640px) {
  .container { padding: 2rem 1.1rem 4rem; }
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metric { padding: 0.65rem 0.6rem; }
  .certs { gap: 8px; }
  .projects { grid-template-columns: 1fr; }
  .pipeline { flex-direction: column; padding-right: 0; padding-left: 12px; position: relative; }
  .pipeline-wrap { margin-right: 0; padding-right: 0; overflow-x: visible; }
  .pipe-step { font-size: 11px; padding: 5px 10px; margin: 6px 0; }
  .pipe-arrow { width: 20px; height: 20px; margin: 0 0 0 -4px; position: relative; }
  .pipe-arrow::before { content: ''; position: absolute; top: 0; left: 50%; width: 1px; height: 20px; transform: translateX(-50%); background-image: repeating-linear-gradient(180deg, var(--border) 0, var(--border) 4px, transparent 4px, transparent 8px); background-size: 1px 8px; background-position: 0 0; animation: dashVertical 0.8s linear infinite; }
  .pipe-arrow::after { content: ''; position: absolute; top: 16px; left: 50%; transform: translateX(-50%); border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 6px solid var(--border); }
}
@keyframes dashVertical { from{background-position:0 0} to{background-position:0 8px} }
@media (max-width: 380px) {
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric:last-child { grid-column: span 2; }
  .topbar-status .uptime-display { display: none; }
}
