:root {
  --bg: #0a0e0d;
  --panel: #101715;
  --panel-2: #131c19;
  --border: #1c2523;
  --border-bright: #2a3833;
  --text: #e8f2ed;
  --muted: #8fa39b;
  --dim: #5c6f68;
  --green: #63e6a4;
  --green-dim: #2e7d55;
  --amber: #e6c463;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sans: "Inter", -apple-system, system-ui, sans-serif;
}

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

/* ---------- password gate ---------- */
#gate {
  position: fixed; inset: 0; z-index: 9999; visibility: visible;
  background: #0a0e0d; display: flex; align-items: center; justify-content: center;
  padding: 24px; font-family: var(--mono);
}
#gate::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(99,230,164,0.03) 0, rgba(99,230,164,0.03) 1px, transparent 1px, transparent 3px);
}
#gate.gate-out { animation: gateOut 0.62s ease forwards; }
@keyframes gateOut { to { opacity: 0; visibility: hidden; transform: scale(1.04); } }
.gate-term {
  width: 100%; max-width: 560px; position: relative;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; box-shadow: 0 24px 70px rgba(0,0,0,0.6), 0 0 0 1px rgba(99,230,164,0.04);
}
.gate-term.shake { animation: gateShake 0.42s; }
@keyframes gateShake { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-8px)} 40%{transform:translateX(8px)} 60%{transform:translateX(-6px)} 80%{transform:translateX(5px)} }
.gate-bar { display: flex; align-items: center; gap: 6px; padding: 11px 14px; border-bottom: 1px solid var(--border); }
.gate-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--border-bright); display: inline-block; }
.gate-bar em { font-style: normal; font-size: 12px; color: var(--dim); margin-left: 8px; }
.gate-body { padding: 22px 22px 24px; font-size: 13.5px; line-height: 1.85; }
.gate-log div { color: var(--muted); text-shadow: 0 0 8px rgba(99,230,164,0.06); }
.gate-log .ok { color: var(--green); text-shadow: 0 0 10px rgba(99,230,164,0.25); }
.gate-log .err { color: #e2554a; text-shadow: 0 0 10px rgba(226,85,74,0.25); }
.gate-form { display: flex; align-items: center; gap: 9px; margin-top: 12px; }
.gate-form .p { color: var(--green); white-space: nowrap; }
#gate-input {
  flex: 1; min-width: 0; background: transparent; border: none; outline: none;
  color: var(--text); font-family: var(--mono); font-size: 15px; letter-spacing: 3px;
  caret-color: var(--green);
}
.gate-caret { width: 9px; height: 17px; background: var(--green); display: inline-block; animation: gateBlink 1.1s steps(1) infinite; }
@keyframes gateBlink { 50% { opacity: 0; } }
.gate-hint { margin-top: 16px; font-size: 11.5px; color: var(--dim); }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--green); color: var(--bg); }

.wrap { max-width: 1060px; margin: 0 auto; padding: 0 24px; }

/* ---------- nav ---------- */
nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 14, 13, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 24px; max-width: 1060px; margin: 0 auto;
}
.prompt { font-family: var(--mono); font-size: 14px; color: var(--green); text-decoration: none; }
.prompt .tilde { color: var(--muted); }
.nav-links { display: flex; gap: 28px; }
.nav-links a {
  font-family: var(--mono); font-size: 13px; color: var(--muted);
  text-decoration: none; transition: color 0.15s;
}
.nav-links a:hover { color: var(--green); }

/* ---------- hero ---------- */
.hero { padding: 96px 0 64px; display: flex; align-items: center; gap: 56px; }
.hero-text { flex: 1 1 auto; min-width: 0; }
.hero-art { flex: 0 0 auto; width: 340px; }
.hero-art svg { width: 100%; height: auto; display: block; overflow: visible; }
@media (max-width: 860px) {
  .hero { flex-direction: column; align-items: flex-start; gap: 40px; padding-top: 72px; }
  .hero-art { width: 260px; align-self: center; }
}
@media (max-width: 480px) {
  .hero-art { display: none; }
}
.kicker {
  font-family: var(--mono); font-size: 14px; color: var(--green);
  margin-bottom: 20px; letter-spacing: 0.02em;
}
.cursor { display: inline-block; width: 9px; height: 18px; background: var(--green);
  vertical-align: -3px; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
h1 {
  font-family: var(--mono); font-weight: 600;
  font-size: clamp(34px, 6vw, 58px); line-height: 1.15; letter-spacing: -0.02em;
  max-width: 800px;
}
h1 .hl { color: var(--green); }
.hero p.sub { font-size: 18px; color: var(--muted); max-width: 560px; margin-top: 24px; }
.hero .brands {
  font-family: var(--mono); font-size: 13px; color: var(--dim); margin-top: 28px;
}
.hero .brands span { color: var(--muted); }

/* ---------- stat strip ---------- */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  margin: 24px 0 0;
}
.stat { padding: 24px 20px; border-right: 1px solid var(--border); }
.stat:last-child { border-right: none; }
.stat b { font-family: var(--mono); font-size: 26px; font-weight: 600; color: var(--green); display: block; }
.stat span { font-size: 13px; color: var(--dim); }

/* ---------- sections ---------- */
section { padding: 116px 0 72px; }
.sec-label {
  font-family: var(--mono); font-size: 13px; color: var(--green-dim);
  margin-top: 24px; margin-bottom: 8px;
  letter-spacing: 0.08em; text-transform: uppercase;
}
h2 { font-family: var(--mono); font-size: 28px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 36px; }

/* ---------- work grid ---------- */
.work-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.card {
  display: block; text-decoration: none; color: inherit;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; transition: border-color 0.2s, transform 0.2s;
}
.card:hover { border-color: var(--green-dim); transform: translateY(-3px); }
.card .thumb { aspect-ratio: 16 / 9; overflow: hidden; background: var(--panel-2); border-bottom: 1px solid var(--border); }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-term { display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: 20px 22px; }
.tt-pipe { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; flex-wrap: wrap; }
.tt-pipe span { color: var(--muted); border: 1px solid var(--border); border-radius: 5px; padding: 3px 9px; }
.tt-pipe span.on { color: var(--bg); background: var(--green); border-color: var(--green); font-weight: 600; }
.tt-pipe i { color: var(--green-dim); font-style: normal; }
.tt-log { font-family: var(--mono); font-size: 11.5px; color: var(--dim); line-height: 1.9; }
.tt-log em { color: var(--green-dim); font-style: normal; margin-right: 6px; }
.card .body { padding: 20px; }
.card .path { font-family: var(--mono); font-size: 12px; color: var(--dim); }
.card h3 { font-family: var(--mono); font-size: 17px; font-weight: 600; margin: 6px 0 8px; }
.card p { font-size: 14px; color: var(--muted); line-height: 1.6; }
.badges { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.badge {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em;
  padding: 3px 9px; border-radius: 4px;
  color: var(--green); border: 1px solid var(--green-dim);
}
.badge.solid { background: var(--green); color: var(--bg); border-color: var(--green); }
.badge.amber { color: var(--amber); border-color: #8a7638; }

/* ---------- method ---------- */
.method-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 24px;
}
.step .n { font-family: var(--mono); font-size: 13px; color: var(--green); }
.step h3 { font-family: var(--mono); font-size: 16px; font-weight: 600; margin: 10px 0 8px; }
.step p { font-size: 14px; color: var(--muted); }

/* ---------- terminal block ---------- */
.term {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  font-family: var(--mono); font-size: 13.5px; overflow: hidden;
}
.term-bar { display: flex; gap: 6px; padding: 11px 14px; border-bottom: 1px solid var(--border); align-items: center; }
.term-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--border-bright); display: inline-block; }
.term-bar em { font-style: normal; font-size: 11px; color: var(--dim); margin-left: 8px; }
.term-body { padding: 20px 22px; line-height: 1.9; }
.term-body .c { color: var(--dim); }
.term-body .g { color: var(--green); }
.term-body .o { color: var(--text); }

/* ---------- about / contact ---------- */
.about-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: start; }
.about-grid p { color: var(--muted); margin-bottom: 16px; }
.about-grid p b { color: var(--text); font-weight: 600; }
.info-card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 6px 20px; }
.info-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.info-row:last-child { border-bottom: none; }
.info-row span { font-family: var(--mono); font-size: 12px; color: var(--green); letter-spacing: 0.04em; }
.info-row b { font-size: 13.5px; font-weight: 500; color: var(--text); text-align: right; }

/* ---------- experience timeline ---------- */
.timeline { border-left: 1px solid var(--border); margin: 8px 0 0 6px; }
.tl-company { position: relative; padding: 0 0 34px 30px; }
.tl-company:last-child { padding-bottom: 4px; }
.tl-company::before {
  content: ""; position: absolute; left: -6px; top: 6px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--green); border: 2px solid var(--bg);
}
.tl-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.tl-co { font-family: var(--mono); font-size: 18px; font-weight: 600; color: var(--text); }
.tl-meta { font-family: var(--mono); font-size: 12px; color: var(--dim); }
.tl-role { padding: 8px 0; border-top: 1px solid var(--border); }
.tl-role:first-of-type { border-top: none; }
.tl-role-top { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.tl-role b { font-size: 15px; font-weight: 500; color: var(--text); }
.tl-role .date { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.tl-note { font-size: 13.5px; color: var(--muted); margin-top: 4px; line-height: 1.55; }
.tl-brands { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tl-brands span {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.04em;
  color: var(--muted); border: 1px solid var(--border); border-radius: 4px; padding: 2px 8px;
}
@media (max-width: 800px) {
  .tl-role-top { flex-direction: column; gap: 2px; }
}

.contact { text-align: left; padding-bottom: 110px; }
.contact h2 { margin-bottom: 12px; }
.contact p { color: var(--muted); max-width: 520px; margin-bottom: 28px; }
.btn {
  display: inline-block; font-family: var(--mono); font-size: 14px; text-decoration: none;
  padding: 12px 22px; border-radius: 6px; transition: opacity 0.15s;
}
.btn.primary { background: var(--green); color: var(--bg); font-weight: 600; }
.btn.ghost { color: var(--green); border: 1px solid var(--green-dim); margin-left: 10px; }
.btn:hover { opacity: 0.85; }

footer {
  border-top: 1px solid var(--border); padding: 28px 0;
  font-family: var(--mono); font-size: 12px; color: var(--dim);
}
footer .wrap { display: flex; justify-content: space-between; }

/* ---------- case study pages ---------- */
.case-hero { padding: 72px 0 40px; }
.crumb { font-family: var(--mono); font-size: 13px; color: var(--dim); margin-bottom: 24px; }
.crumb a { color: var(--dim); text-decoration: none; }
.crumb a:hover { color: var(--green); }
.crumb .here { color: var(--green); }
.case-hero h1 { font-size: clamp(30px, 5vw, 46px); }
.case-hero .sub { font-size: 18px; color: var(--muted); max-width: 640px; margin-top: 18px; }
.meta-row {
  display: flex; gap: 36px; flex-wrap: wrap; margin-top: 32px;
  padding: 18px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.meta-row div span { font-family: var(--mono); font-size: 11px; color: var(--dim); display: block; letter-spacing: 0.06em; }
.meta-row div b { font-family: var(--mono); font-size: 14px; font-weight: 500; color: var(--text); }

.cover { margin: 48px 0; }

/* ---------- device (laptop/browser) mockup — silver ---------- */
.device { max-width: 940px; margin: 52px auto; }
.device-screen {
  margin: 0 20px;
  background: var(--bg);
  border: 12px solid #c4c9cf;
  border-bottom: none;
  border-radius: 16px 16px 0 0;
  overflow: hidden;
}
.device-bar {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  padding: 11px 16px;
  background: #eceef1; border-bottom: 1px solid #d5d9de;
}
.device-bar i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.device-bar i:nth-child(1) { background: #ff5f57; }
.device-bar i:nth-child(2) { background: #febc2e; }
.device-bar i:nth-child(3) { background: #28c840; }
.device-url {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  max-width: 60%; box-sizing: border-box;
  font-family: var(--mono); font-size: 11.5px; color: #6b7178;
  background: #ffffff; border: 1px solid #d5d9de; border-radius: 7px;
  padding: 5px 22px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.device-screen img { width: 100%; display: block; }
.device-base {
  height: 16px; background: #b7bcc3;
  border-radius: 0 0 16px 16px;
  position: relative;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
}
.device-base::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 104px; height: 7px; background: #8b9199; border-radius: 0 0 9px 9px;
}

/* compact device inside a work-card thumbnail */
.thumb-device { position: relative; display: flex; align-items: center; justify-content: center; padding: 16px; }
.thumb-device::before {
  content: ""; position: absolute; width: 172px; height: 172px;
  border-radius: 58% 42% 45% 55% / 52% 58% 42% 48%;
  background: #63e6a4; opacity: 0.09; bottom: -42px; left: -36px; transform: rotate(8deg);
}
.thumb-device::after {
  content: ""; position: absolute; width: 126px; height: 126px; border-radius: 50%;
  border: 1.5px solid #2e7d55; opacity: 0.42; top: -40px; right: -30px;
}
.thumb-device .device { position: relative; z-index: 1; }
.device-sm { max-width: 374px; width: 100%; margin: 0; }
.device-sm .device-screen { margin: 0 16px; border-width: 8px; border-radius: 11px 11px 0 0; }
.device-sm .device-bar { padding: 6px 9px; }
.device-sm .device-bar i { width: 7px; height: 7px; }
.device-sm .device-url { font-size: 8.5px; padding: 3px 10px; border-radius: 5px; }
.device-sm .device-base { height: 13px; border-radius: 0 0 12px 12px; box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4); }
.device-sm .device-base::before { width: 74px; height: 5px; }
.card .thumb-device .device-screen img { width: 100%; height: auto; object-fit: fill; }

/* browser-window-only mockup with abstract backdrop */
.thumb-browser { position: relative; display: flex; align-items: center; justify-content: center; padding: 24px; overflow: hidden; }
.thumb-browser::before {
  content: ""; position: absolute; width: 168px; height: 168px;
  border-radius: 42% 58% 55% 45% / 48% 42% 58% 52%;
  background: #63e6a4; opacity: 0.10; top: -38px; right: -30px; transform: rotate(-10deg);
}
.thumb-browser::after {
  content: ""; position: absolute; width: 132px; height: 132px; border-radius: 50%;
  border: 1.5px solid #2e7d55; opacity: 0.45; bottom: -42px; left: -32px;
}
.browser {
  position: relative; z-index: 1; width: 100%; max-width: 306px;
  border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border-bright);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}
.thumb-browser .device-bar { padding: 6px 9px; }
.thumb-browser .device-bar i { width: 7px; height: 7px; }
.thumb-browser .device-url { font-size: 8.5px; padding: 3px 10px; border-radius: 5px; max-width: 72%; }
.card .thumb-browser .browser img { width: 100%; height: auto; display: block; object-fit: fill; }

@media (max-width: 640px) {
  .device { margin: 36px auto; }
  .device-screen { margin: 0 8px; border-width: 8px; }
  .device-url { font-size: 10px; padding: 4px 12px; }
}
.cover img, .fig img {
  width: 100%; border-radius: 10px; border: 1px solid var(--border); display: block;
}
.fig { margin: 40px 0; }
.fig figcaption { font-family: var(--mono); font-size: 12px; color: var(--dim); margin-top: 10px; }
.fig.white img { background: #f5f5f2; padding: 24px; }

article { max-width: 720px; }
article h2 { font-size: 22px; margin: 56px 0 18px; }
article p { color: var(--muted); margin-bottom: 18px; }
article p b, article li b { color: var(--text); font-weight: 600; }
article ol, article ul { margin: 0 0 18px 22px; color: var(--muted); }
article li { margin-bottom: 10px; }

.case-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 40px 0; max-width: 720px; }
.case-stat { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 18px 20px; }
.case-stat b { font-family: var(--mono); font-size: 22px; color: var(--green); display: block; font-weight: 600; }
.case-stat span { font-size: 12.5px; color: var(--dim); }

/* ---------- diagrams (built, not screenshotted) ---------- */
.diagram { margin: 44px 0; max-width: 720px; }
.diagram-cap { font-family: var(--mono); font-size: 12px; color: var(--dim); margin-top: 14px; }

.pipe { display: flex; align-items: stretch; gap: 0; flex-wrap: wrap; }
.pipe-node {
  flex: 1; min-width: 118px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px 14px; text-align: center;
}
.pipe-node .ico { font-family: var(--mono); font-size: 12px; color: var(--green); display: block; margin-bottom: 8px; }
.pipe-node b { font-family: var(--mono); font-size: 13.5px; font-weight: 600; color: var(--text); display: block; }
.pipe-node span { font-size: 12px; color: var(--dim); display: block; margin-top: 4px; line-height: 1.4; }
.pipe-node.accent { border-color: var(--green-dim); background: #0f1c15; }
.pipe-arrow { display: flex; align-items: center; padding: 0 10px; color: var(--green-dim); font-family: var(--mono); font-size: 18px; }

.mock-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; margin: 0;
}
.mock-head {
  display: flex; align-items: center; gap: 8px; padding: 11px 16px;
  border-bottom: 1px solid var(--border); font-family: var(--mono); font-size: 12px; color: var(--muted);
}
.mock-head .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); display: inline-block; }
.mock-head .tag { margin-left: auto; font-size: 10.5px; letter-spacing: 0.06em; color: var(--green); border: 1px solid var(--green-dim); padding: 2px 8px; border-radius: 4px; }
.mock-body { padding: 16px 18px; font-family: var(--mono); font-size: 13px; line-height: 1.85; }
.mock-body .u { color: var(--muted); }
.mock-body .k { color: var(--dim); }
.mock-body .g { color: var(--green); }
.mock-body .o { color: var(--text); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.next-proj {
  margin: 80px 0 0; border-top: 1px solid var(--border); padding: 36px 0 90px;
  font-family: var(--mono);
}
.next-proj a { color: var(--green); text-decoration: none; font-size: 16px; }
.next-proj a:hover { text-decoration: underline; }
.next-proj span { display: block; font-size: 12px; color: var(--dim); margin-bottom: 8px; }

@media (max-width: 800px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat { border-bottom: 1px solid var(--border); }
  .work-grid, .method-grid, .about-grid { grid-template-columns: 1fr; }
  .case-stats { grid-template-columns: 1fr; }
  .nav-links { gap: 16px; }
}
