/* ==========================================================
   cv.phil-ee.com — terminal / technical theme
   ========================================================== */
:root {
  --bg: #06080b;
  --bg-2: #0b0f14;
  --panel: rgba(13, 18, 24, .72);
  --line: rgba(120, 255, 190, .12);
  --line-2: rgba(120, 255, 190, .28);
  --fg: #d7e2dc;
  --dim: #6f7f78;
  --g: #3dfc9a;      /* phosphor green */
  --c: #29d3ff;      /* cyan */
  --m: #ff3d8b;      /* magenta (glitch) */
  --a: #ffb547;      /* amber */
  --mono: ui-monospace, "JetBrains Mono", "Cascadia Code", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --r: 10px;
  --mx: 50%; --my: 30%;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 70px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.65 var(--mono);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: var(--g); color: var(--bg); }
a { color: inherit; text-decoration: none; }
em { color: var(--g); font-style: normal; }
code { color: var(--g); background: rgba(61,252,154,.08); padding: 1px 6px; border-radius: 4px; }
.dim { color: var(--dim); }
.g { color: var(--g); }
.ok { color: var(--g); text-shadow: 0 0 8px var(--g); }

/* ---------- background layers ---------- */
.bg-grid {
  position: fixed; inset: 0; z-index: -3;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 85%);
  opacity: .55;
}
.bg-spot {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(600px circle at var(--mx) var(--my), rgba(61,252,154,.09), transparent 60%),
    radial-gradient(900px circle at 85% -10%, rgba(41,211,255,.10), transparent 60%);
}
.scanlines {
  position: fixed; inset: 0; z-index: 50; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,.025) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}

/* ---------- boot ---------- */
#boot {
  position: fixed; inset: 0; z-index: 100;
  background: var(--bg);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 28px; cursor: pointer;
  transition: opacity .5s ease, visibility .5s;
}
#boot.done { opacity: 0; visibility: hidden; }
#boot pre { margin: 0; font: 13px/1.6 var(--mono); color: var(--g); white-space: pre-wrap; text-shadow: 0 0 6px rgba(61,252,154,.5); }
#boot pre .w { color: var(--fg); }
#boot pre .o { color: var(--g); }
#boot pre .c { color: var(--c); }
.boot-skip { position: absolute; top: 24px; right: 28px; color: var(--dim); font-size: 12px; }

/* ---------- status bar ---------- */
.statusbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 24px;
  padding: 12px clamp(16px, 4vw, 48px);
  background: rgba(6,8,11,.78);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.sb-host { display: flex; align-items: center; gap: 8px; color: var(--g); font-weight: 700; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--g); box-shadow: 0 0 10px var(--g); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.statusbar nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.statusbar nav a { padding: 4px 10px; border-radius: 6px; color: var(--dim); transition: color .2s, background .2s; }
.statusbar nav a:hover, .statusbar nav a.active { color: var(--g); background: rgba(61,252,154,.08); }
.sb-clock { color: var(--c); font-variant-numeric: tabular-nums; }

/* ---------- layout ---------- */
main { max-width: 1120px; margin: 0 auto; padding: 0 clamp(18px, 4vw, 40px); }
.block { padding: 90px 0 20px; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 24px 26px;
  backdrop-filter: blur(6px);
  position: relative;
}

/* section header */
.sec {
  display: flex; align-items: baseline; gap: 16px;
  font-size: clamp(20px, 2.6vw, 26px); font-weight: 700; margin: 0 0 32px;
}
.sec .num { color: var(--g); font-size: .7em; padding: 2px 8px; border: 1px solid var(--line-2); border-radius: 5px; }
.sec .cmd::before { content: "$ "; color: var(--dim); }
.sec::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-2), transparent); align-self: center; }

/* ---------- hero ---------- */
.hero {
  min-height: calc(100vh - 60px);
  display: grid; grid-template-columns: 1.35fr 1fr; gap: clamp(30px, 5vw, 70px);
  align-items: center; padding: 40px 0;
}
.prompt { color: var(--dim); margin: 0 0 10px; }
.glitch {
  position: relative;
  font-family: var(--sans);
  font-size: clamp(42px, 7.2vw, 88px);
  line-height: 1.05; letter-spacing: -.03em; font-weight: 800;
  margin: 0 0 14px; padding-bottom: .1em;
  background: linear-gradient(100deg, #fff 30%, var(--g) 70%, var(--c));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute; inset: 0;
  background: inherit; -webkit-background-clip: text; background-clip: text;
  opacity: 0;
}
.glitch::before { text-shadow: -2px 0 var(--m); color: transparent; animation: glitch-a 4.2s infinite steps(1); }
.glitch::after  { text-shadow:  2px 0 var(--c); color: transparent; animation: glitch-b 4.2s infinite steps(1); }
@keyframes glitch-a {
  0%, 88%, 100% { opacity: 0; clip-path: none; transform: none; }
  89% { opacity: 1; clip-path: inset(10% 0 60% 0); transform: translate(-4px, -1px); }
  91% { opacity: 1; clip-path: inset(55% 0 20% 0); transform: translate(3px, 1px); }
  93% { opacity: 1; clip-path: inset(30% 0 45% 0); transform: translate(-2px, 0); }
  95% { opacity: 0; }
}
@keyframes glitch-b {
  0%, 89%, 100% { opacity: 0; clip-path: none; transform: none; }
  90% { opacity: 1; clip-path: inset(65% 0 5% 0); transform: translate(4px, 1px); }
  92% { opacity: 1; clip-path: inset(5% 0 75% 0); transform: translate(-3px, -1px); }
  94% { opacity: 0; }
}
.role { font-size: clamp(16px, 1.8vw, 20px); color: var(--c); margin: 0 0 22px; min-height: 1.6em; }
.caret { color: var(--g); animation: blink 1s steps(1) infinite; margin-left: 2px; }
@keyframes blink { 50% { opacity: 0; } }
.lead { max-width: 56ch; color: #b9c6bf; font-family: var(--sans); font-size: 17px; line-height: 1.7; margin: 0 0 34px; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border-radius: 8px;
  border: 1px solid var(--line-2); color: var(--fg);
  transition: transform .15s, border-color .2s, box-shadow .2s, background .2s;
}
.btn:hover { border-color: var(--g); color: var(--g); box-shadow: 0 0 0 3px rgba(61,252,154,.1); transform: translateY(-2px); }
.btn-primary { background: var(--g); color: var(--bg); border-color: var(--g); font-weight: 700; }
.btn-primary:hover { color: var(--bg); box-shadow: 0 0 24px rgba(61,252,154,.45); }

/* photo */
.hero-card { display: flex; flex-direction: column; gap: 20px; max-width: 360px; justify-self: end; width: 100%; }
.photo-frame {
  position: relative; aspect-ratio: 1 / 1; overflow: hidden;
  border-radius: 6px;
  background:
    radial-gradient(circle at 50% 45%, rgba(61,252,154,.14), transparent 65%),
    repeating-linear-gradient(0deg, rgba(61,252,154,.05) 0 1px, transparent 1px 14px),
    var(--bg-2);
  outline: 1px solid var(--line); outline-offset: 8px;
  display: grid; place-items: center;
}
.monogram {
  margin: 0; font: 700 clamp(13px, 1.9vw, 19px)/1.05 var(--mono);
  color: var(--g); text-shadow: 0 0 14px rgba(61,252,154,.6);
  transition: color .4s, text-shadow .4s, transform .4s;
}
.photo-frame:hover .monogram { color: var(--c); text-shadow: 2px 0 var(--m), -2px 0 var(--c), 0 0 18px rgba(41,211,255,.6); transform: scale(1.04); }
.scan {
  position: absolute; left: 0; right: 0; height: 30%; top: -30%; z-index: 2; pointer-events: none;
  background: linear-gradient(to bottom, transparent, rgba(61,252,154,.22), transparent);
  border-bottom: 1px solid rgba(61,252,154,.6);
  animation: scan 3.8s ease-in-out infinite;
}
@keyframes scan { 0% { top: -30%; } 60%, 100% { top: 100%; } }
.corner { position: absolute; width: 18px; height: 18px; border: 2px solid var(--g); z-index: 3; }
.corner.tl { top: 8px; left: 8px; border-right: 0; border-bottom: 0; }
.corner.tr { top: 8px; right: 8px; border-left: 0; border-bottom: 0; }
.corner.bl { bottom: 8px; left: 8px; border-right: 0; border-top: 0; }
.corner.br { bottom: 8px; right: 8px; border-left: 0; border-top: 0; }
.photo-tag {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 3;
  font-size: 11px; letter-spacing: .15em; white-space: nowrap; color: var(--bg); background: var(--g); padding: 2px 8px; border-radius: 3px;
}

.sysinfo { margin: 0; font-size: 13px; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 18px; background: var(--panel); }
.sysinfo div { display: grid; grid-template-columns: 90px 1fr; padding: 3px 0; }
.sysinfo dt { color: var(--g); }
.sysinfo dt::after { content: ":"; color: var(--dim); }
.sysinfo dd { margin: 0; }

/* ---------- about ---------- */
.about-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; }
.about-grid p { font-family: var(--sans); font-size: 16.5px; color: #c3cfc9; margin: 0 0 14px; }
.about-grid p:last-child { margin: 0; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.stat { display: flex; flex-direction: column; }
.stat-n { font-size: 38px; font-weight: 800; color: var(--g); line-height: 1.1; text-shadow: 0 0 18px rgba(61,252,154,.35); }
.stat-l { font-size: 12px; color: var(--dim); }

/* ---------- timeline ---------- */
/* --tl-x = horizontal centre of the line; line and dots are both centred on it */
.timeline { --tl-x: 151px; list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
  content: ""; position: absolute; left: var(--tl-x); top: 8px; bottom: 8px; width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(to bottom, var(--g), var(--c) 60%, transparent);
}
.timeline li { display: grid; grid-template-columns: 150px 1fr; gap: 34px; padding-bottom: 30px; position: relative; }
.timeline li::before {
  content: ""; position: absolute; left: var(--tl-x); top: 6px; width: 14px; height: 14px; border-radius: 50%;
  box-sizing: border-box; transform: translateX(-50%);
  background: var(--bg); border: 2px solid var(--g); box-shadow: 0 0 12px var(--g);
}
.t-date { color: var(--c); font-size: 13px; padding-top: 2px; text-align: right; padding-right: 22px; white-space: nowrap; }
.t-body {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px 20px; transition: border-color .25s, transform .25s;
}
.t-body:hover { border-color: var(--line-2); transform: translateX(4px); }
.t-hash { font-size: 12px; color: var(--a); }
.t-body h3 { margin: 4px 0 6px; font-family: var(--sans); font-size: 17px; }
.t-body p { margin: 0 0 10px; color: #aab7b0; font-size: 14px; }
.t-tag { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--g); }
.t-tag-work { color: var(--a); border-color: rgba(255,181,71,.4); }
.t-ref { font-size: 11px; color: var(--bg); background: var(--c); padding: 1px 7px; border-radius: 3px; margin-left: 6px; }
.t-head .t-body { border-color: var(--line-2); box-shadow: 0 0 30px -12px rgba(61,252,154,.5); }
.t-head::before { background: var(--g); animation: pulse 2s infinite; }
.t-head .t-date { color: var(--g); font-weight: 700; }

/* ---------- skills ---------- */
.skills-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.ph { margin: 0 0 16px; font-size: 14px; color: var(--c); letter-spacing: .05em; }
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  padding: 5px 12px; border-radius: 6px; font-size: 13px;
  border: 1px solid var(--line-2); background: rgba(61,252,154,.04);
  transition: background .2s, color .2s, transform .2s;
}
.tags li:hover { background: var(--g); color: var(--bg); transform: translateY(-2px); }
.langs { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.langs li { display: grid; grid-template-columns: 80px 1fr 52px; gap: 12px; align-items: center; font-size: 13px; }
.bar { height: 8px; border-radius: 4px; background: rgba(255,255,255,.06); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--g), var(--c)); box-shadow: 0 0 10px var(--g); transition: width 1.4s cubic-bezier(.2,.8,.2,1); }
.in-view .bar i { width: var(--w); }
.w-100 { --w: 100%; } .w-95 { --w: 95%; } .w-25 { --w: 25%; }
.lvl { color: var(--dim); text-align: right; }

/* ---------- projects ---------- */
.projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.proj {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  padding: 24px; border-radius: var(--r);
  background: var(--panel); border: 1px solid var(--line);
  overflow: hidden; isolation: isolate;
  transition: transform .25s, border-color .25s;
}
.proj::before { /* hover glow follows mouse */
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .3s;
  background: radial-gradient(400px circle at var(--px, 50%) var(--py, 50%), rgba(61,252,154,.14), transparent 50%);
}
.proj:hover { transform: translateY(-4px); border-color: var(--line-2); }
.proj:hover::before { opacity: 1; }
.proj-top { display: flex; justify-content: space-between; align-items: center; }
.proj-icon { font-size: 26px; color: var(--g); }
.lang { font-size: 11px; padding: 2px 9px; border-radius: 99px; border: 1px solid; }
.lang-py { color: #ffd65a; border-color: rgba(255,214,90,.4); }
.lang-ts { color: #5aa9ff; border-color: rgba(90,169,255,.4); }
.lang-js { color: #f7e35a; border-color: rgba(247,227,90,.4); }
.lang-rs { color: #ff8a4c; border-color: rgba(255,138,76,.45); }

/* featured project */
.proj-feat {
  grid-column: 1 / -1; padding: 30px 32px;
  border-color: rgba(255,138,76,.35);
  background:
    linear-gradient(120deg, rgba(255,138,76,.08), transparent 45%),
    var(--panel);
}
.proj-feat:hover { border-color: rgba(255,138,76,.7); }
.proj-feat::before { background: radial-gradient(500px circle at var(--px, 50%) var(--py, 50%), rgba(255,138,76,.14), transparent 50%); }
.proj-feat h3 { font-size: 28px; }
.proj-feat p { max-width: 70ch; font-size: 15.5px; }
.proj-feat strong { color: var(--fg); }
.proj-badge { font-size: 12px; color: #ff8a4c; letter-spacing: .05em; }
.proj-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.proj-links a {
  font-size: 13px; padding: 7px 12px; border-radius: 6px;
  border: 1px solid rgba(255,138,76,.35); color: var(--fg);
  transition: border-color .2s, color .2s, background .2s;
}
.proj-links a:hover { border-color: #ff8a4c; color: #ff8a4c; background: rgba(255,138,76,.08); }
.proj h3 { margin: 4px 0 0; font-size: 20px; }
.proj p { margin: 0; flex: 1; font-family: var(--sans); font-size: 14.5px; color: #aab7b0; }
.proj-link { font-size: 12px; color: var(--dim); transition: color .2s; }
.proj:hover .proj-link { color: var(--g); }

/* ---------- terminal ---------- */
.term {
  border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line-2);
  background: rgba(4,6,8,.92);
  box-shadow: 0 30px 80px -30px rgba(61,252,154,.25), 0 0 0 1px rgba(0,0,0,.5);
}
.term-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: #0d1217; border-bottom: 1px solid var(--line); }
.tb-dot { width: 12px; height: 12px; border-radius: 50%; }
.tb-dot.r { background: #ff5f57; } .tb-dot.y { background: #febc2e; } .tb-dot.g { background: #28c840; }
.tb-title { margin: 0 auto; color: var(--dim); font-size: 12px; transform: translateX(-26px); }
.term-body { height: 360px; overflow-y: auto; padding: 16px 18px; font-size: 14px; cursor: text; }
.term-body::-webkit-scrollbar { width: 8px; }
.term-body::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 4px; }
#term-out div { white-space: pre-wrap; word-break: break-word; }
.term-line { display: flex; gap: 10px; }
.tp, #term-out .tp { color: var(--g); white-space: nowrap; }
#term-in {
  flex: 1; background: transparent; border: 0; outline: 0;
  color: var(--fg); font: inherit; caret-color: var(--g);
}
#term-out .err { color: var(--m); }
#term-out .c { color: var(--c); }
#term-out .a { color: var(--a); }
#term-out .g { color: var(--g); }
#term-out a { color: var(--c); text-decoration: underline; text-underline-offset: 3px; }
.hint { font-size: 13px; margin-top: 14px; }

/* ---------- contact ---------- */
.contact { text-align: center; padding: 50px 26px; }
.contact-big { font-family: var(--sans); font-size: clamp(28px, 4vw, 44px); font-weight: 800; margin: 0 0 8px; letter-spacing: -.02em; }
.hl { color: var(--g); text-shadow: 0 0 24px rgba(61,252,154,.5); }
.contact-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.c-link {
  display: flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; font-size: 14px;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.c-k { background: rgba(61,252,154,.12); color: var(--g); padding: 10px 14px; }
.c-v { padding: 10px 16px; }
.c-link:hover { border-color: var(--g); box-shadow: 0 0 22px rgba(61,252,154,.25); transform: translateY(-2px); }

/* ---------- footer ---------- */
.foot {
  max-width: 1120px; margin: 80px auto 0; padding: 26px clamp(18px, 4vw, 40px) 40px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  font-size: 12px; border-top: 1px solid var(--line);
}

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in-view { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 50px; }
  .hero-card { justify-self: start; flex-direction: row; max-width: none; align-items: stretch; }
  .photo-frame { width: 42%; flex-shrink: 0; }
  .sysinfo { flex: 1; }
  .about-grid, .skills-grid { grid-template-columns: 1fr; }
  .projects { grid-template-columns: 1fr; }
  .statusbar nav { display: none; }
  .sb-clock { margin-left: auto; }
}
@media (max-width: 560px) {
  .hero-card { flex-direction: column; }
  .photo-frame { width: 70%; }
  .timeline { --tl-x: 8px; }
  .timeline li { grid-template-columns: 1fr; gap: 6px; padding-left: 30px; }
  .t-date { text-align: left; }
  .sysinfo div { grid-template-columns: 80px 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .bar i { width: var(--w); }
}
