/* ---------- tokens ---------- */
:root {
  --bg: #0a0a0a;
  --bg-elev: #111111;
  --bg-card: #0e0e0e;
  --line: #1d1d1d;
  --line-2: #2a2a2a;
  --fg: #ededed;
  --dim: #9a9a9a;
  --muted: #5a5a5a;
  --deep: #3a3a3a;
  --accent: #cfcfcf;
  --accent-soft: rgba(207, 207, 207, 0.12);
  --danger: #ff5f4a;
  --ok: #7dd87d;

  --pad-x: clamp(20px, 4vw, 64px);
  --gutter: 24px;
  --row: 32px;
  --maxw: 1240px;
  --hairline: 1px solid var(--line);
  --hairline-2: 1px solid var(--line-2);

  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --sans: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
}

[data-density="compact"] {
  --row: 22px;
  --gutter: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--fg); }
body {
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'ss01', 'cv01', 'zero';
  overflow-x: hidden;
}

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

a { color: inherit; text-decoration: none; }

/* ---------- layout ---------- */
.shell {
  min-height: 100vh;
  position: relative;
}
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

.hairline { border-top: var(--hairline); }
.hairline-b { border-bottom: var(--hairline); }

/* ---------- status bar ---------- */
.statusbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: var(--hairline);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--dim);
  text-transform: uppercase;
}
.statusbar-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 36px;
}
.statusbar .left { display: flex; gap: 18px; align-items: center; }
.statusbar .right { display: flex; gap: 18px; align-items: center; justify-content: flex-end; }
.statusbar .center { display: flex; gap: 10px; align-items: center; color: var(--fg); }
.dot {
  width: 8px; height: 8px; background: var(--accent);
  display: inline-block;
  box-shadow: 0 0 8px var(--accent);
}
.dot.pulse { animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* ---------- hero ---------- */
.hero {
  min-height: calc(100vh - 36px);
  display: grid;
  grid-template-columns: 1fr;
  position: relative;
  padding: 28px 0 60px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 56px;
  align-items: end;
  flex: 1;
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
}

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}
.eyebrow::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--muted);
  display: inline-block;
}

.hero h1 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(56px, 10vw, 140px);
  line-height: 0.92;
  letter-spacing: -0.04em;
  margin: 0 0 28px;
  color: var(--fg);
}
.hero h1 .last { color: var(--dim); }
.hero h1 .cursor {
  display: inline-block;
  width: 0.5em;
  height: 0.8em;
  background: var(--accent);
  vertical-align: -0.05em;
  margin-left: 0.06em;
  animation: blink 0.9s steps(1, end) infinite;
}
.sec-title .cursor {
  display: inline-block;
  width: 0.5ch;
  height: 0.85em;
  background: var(--accent);
  vertical-align: -0.06em;
  margin-left: 0.08em;
  animation: blink 0.9s steps(1, end) infinite;
}
.typed-name { min-height: 1.84em; }

.hero-role {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--dim);
  max-width: 540px;
  margin: 0 0 36px;
}
.hero-role .cursor {
  display: inline-block;
  width: 0.55ch;
  height: 1em;
  background: var(--accent);
  vertical-align: -0.12em;
  margin-left: 0.1em;
  animation: blink 0.9s steps(1, end) infinite;
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  border-top: var(--hairline);
  padding-top: 24px;
  max-width: 720px;
}
@media (max-width: 700px) {
  .hero-meta { grid-template-columns: repeat(2, 1fr); }
}
.meta-cell .k {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 6px;
}
.meta-cell .v {
  font-size: 13px;
  color: var(--fg);
}

/* boot panel */
.boot {
  background: var(--bg-card);
  border: var(--hairline);
  padding: 18px 20px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--dim);
  min-height: 320px;
  position: relative;
  overflow: hidden;
}
.boot .head {
  display: flex;
  justify-content: space-between;
  border-bottom: var(--hairline);
  padding-bottom: 10px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.boot .line { display: flex; gap: 8px; white-space: pre-wrap; }
.boot .line .ts { color: var(--deep); }
.boot .line .ok { color: var(--ok); }
.boot .line .warn { color: var(--accent); }
.boot .caret {
  display: inline-block;
  width: 8px;
  height: 14px;
  background: var(--accent);
  vertical-align: -2px;
  margin-left: 2px;
  animation: blink 1s steps(1, end) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- section header ---------- */
section {
  padding: var(--row) 0;
  border-top: var(--hairline);
}
.sec-head {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 24px;
  align-items: baseline;
  padding-top: 32px;
  padding-bottom: 48px;
}
.sec-code {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.sec-title {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(34px, 5vw, 56px);
  letter-spacing: -0.02em;
  line-height: 1;
  margin: 0;
}
.sec-meta {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
@media (max-width: 700px) {
  .sec-head { grid-template-columns: 1fr; }
  .sec-head .sec-meta { display: none; }
}

/* ---------- about ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 80px 1fr 1fr;
  gap: 24px;
  padding-bottom: 80px;
}
.about-grid .spacer { display: block; }
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-grid .spacer { display: none; }
}
.prose p {
  font-family: var(--sans);
  font-size: clamp(18px, 1.8vw, 22px);
  line-height: 1.5;
  color: var(--fg);
  margin: 0 0 20px;
  text-wrap: pretty;
}
.prose p .accent { color: var(--accent); }
.prose p:last-child { margin-bottom: 0; }

.aside {
  border-left: var(--hairline);
  padding-left: 24px;
  display: grid;
  gap: 22px;
  align-content: start;
}
.aside .row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  font-size: 12px;
}
.aside .row .k { color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; font-size: 10px; align-self: center; }
.aside .row .v { color: var(--fg); }
.aside .row .v .badge { color: var(--accent); }

/* ---------- skills ---------- */
.skills {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 24px;
  padding-bottom: 80px;
}
@media (max-width: 900px) {
  .skills { grid-template-columns: 1fr; }
}
.skill-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: var(--hairline);
}
@media (max-width: 700px) {
  .skill-cols { grid-template-columns: 1fr; }
}
.skill-col {
  border-right: var(--hairline);
  padding: 28px 28px 28px 0;
}
.skill-col:last-child { border-right: none; padding-left: 28px; padding-right: 0; }
@media (max-width: 700px) {
  .skill-col { border-right: none; padding: 24px 0; border-bottom: var(--hairline); }
  .skill-col:last-child { border-bottom: none; padding-left: 0; }
}
.skill-col .label {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.skill-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
}
.skill-row:last-child { border-bottom: none; }
.skill-row .name { color: var(--fg); }
.skill-row .name .sub { color: var(--muted); margin-left: 8px; font-size: 11px; }
.skill-row .bar {
  width: 120px;
  height: 6px;
  background: var(--line);
  position: relative;
}
.skill-row .bar i {
  position: absolute; top: 0; left: 0; bottom: 0;
  background: var(--accent);
  display: block;
}
.skill-row .lvl {
  width: 40px;
  text-align: right;
  font-size: 11px;
  color: var(--muted);
}

/* ---------- terminal section ---------- */
.terminal-wrap {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 24px;
  padding-bottom: 80px;
}
@media (max-width: 900px) { .terminal-wrap { grid-template-columns: 1fr; } }
.terminal {
  background: #070707;
  border: var(--hairline-2);
  font-family: var(--mono);
  font-size: 13px;
  min-height: 360px;
  display: flex;
  flex-direction: column;
}
.terminal .tbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: var(--hairline);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.terminal .tbar .lights { display: flex; gap: 6px; }
.terminal .tbar .lights span {
  width: 9px; height: 9px; background: var(--deep); display: block;
}
.terminal .tbar .title { margin-left: auto; }
.terminal .body {
  padding: 16px 18px;
  flex: 1;
  overflow-y: auto;
  max-height: 460px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}
.terminal .body::-webkit-scrollbar { width: 8px; }
.terminal .body::-webkit-scrollbar-thumb { background: var(--line-2); }

.tline { white-space: pre-wrap; line-height: 1.6; color: var(--fg); }
.tline.dim { color: var(--dim); }
.tline.muted { color: var(--muted); }
.tline.err { color: var(--danger); }
.tline.ok { color: var(--ok); }
.tline.accent { color: var(--accent); }
.tline .prompt { color: var(--accent); user-select: none; }
.tline .you { color: var(--dim); }
.tline .arg { color: var(--fg); }

.tinput {
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: var(--hairline);
  padding: 12px 18px;
}
.tinput .p { color: var(--accent); }
.tinput input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--fg);
  font-family: var(--mono);
  font-size: 13px;
  caret-color: var(--accent);
}

.helpgrid {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 6px 16px;
  margin-top: 6px;
}
.helpgrid b { color: var(--accent); font-weight: 500; }

/* ---------- contact ---------- */
.contact {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 24px;
  padding-bottom: 60px;
}
@media (max-width: 900px) { .contact { grid-template-columns: 1fr; } }
.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: var(--hairline);
}
@media (max-width: 700px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-card {
  border-right: var(--hairline);
  border-bottom: var(--hairline);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
  text-decoration: none;
  color: inherit;
}
.contact-card:hover { background: var(--bg-elev); }
.contact-card:nth-child(2n) { border-right: none; }
@media (max-width: 700px) { .contact-card { border-right: none; } }
.contact-card .k {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.contact-card .v {
  font-family: var(--sans);
  font-size: clamp(20px, 2.4vw, 26px);
  color: var(--fg);
  letter-spacing: -0.01em;
}
.contact-card .arr {
  margin-top: auto;
  font-size: 11px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.contact-card:hover .arr { color: var(--accent); }

/* ---------- status bar buttons / lang switch ---------- */
.sb-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--fg);
  color: var(--bg);
  border: none;
  padding: 6px 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s ease;
}
.sb-btn:hover { background: var(--accent); }
.sb-btn .arr { font-size: 12px; }

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--line-2);
  height: 22px;
  overflow: hidden;
}
.lang-switch button {
  background: transparent;
  border: none;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  padding: 0 9px;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.lang-switch button.on {
  background: var(--fg);
  color: var(--bg);
}
.lang-switch button:not(.on):hover { color: var(--fg); }

.sb-time { min-width: 88px; text-align: right; display: inline-block; }

@media (max-width: 820px) {
  .statusbar .left > span:nth-child(3) { display: none; }
  .statusbar .left > span:nth-child(2) { display: none; }
  .sb-time { display: none; }
}
@media (max-width: 600px) {
  .statusbar-inner { grid-template-columns: 1fr auto; }
  .statusbar .center { display: none; }
  .sb-btn span:not(.arr) { display: none; }
  .sb-btn { padding: 6px; }
}

/* ---------- outro ---------- */
.outro {
  padding: 60px 0 120px;
  position: relative;
}
.outro-grid {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 24px;
  padding-top: 40px;
  border-top: var(--hairline);
}
@media (max-width: 900px) { .outro-grid { grid-template-columns: 1fr; } }
.outro-num {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.outro-lead {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(48px, 7vw, 96px);
  line-height: 0.96;
  letter-spacing: -0.03em;
  margin: 0 0 24px;
  max-width: 14ch;
}
.outro-lead .dim { color: var(--dim); }
.outro-sub {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--dim);
  margin: 0 0 48px;
  max-width: 56ch;
}
.outro-ctas {
  display: grid;
  grid-template-columns: 1fr;
  border-top: var(--hairline-2);
}
.cta {
  display: grid;
  grid-template-columns: 64px 1fr 32px;
  align-items: center;
  gap: 24px;
  padding: 28px 4px;
  border-bottom: var(--hairline);
  font-family: var(--sans);
  font-size: clamp(22px, 3vw, 34px);
  color: var(--fg);
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: padding-left 0.18s ease, color 0.18s ease, background 0.18s ease;
  position: relative;
}
.cta:hover {
  padding-left: 24px;
  color: var(--accent);
}
.cta:hover::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--accent);
}
.cta .ctak {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.12em;
}
.cta .ctaa {
  text-align: right;
  font-family: var(--mono);
  font-size: 20px;
  color: var(--muted);
  transition: color 0.18s ease, transform 0.18s ease;
}
.cta:hover .ctaa {
  color: var(--accent);
  transform: translateX(6px);
}
.cta.primary .ctav { font-weight: 500; }

/* ---------- footer ---------- */
footer {
  border-top: var(--hairline);
  padding: 22px 0;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
}
.footer-inner .right { display: flex; gap: 18px; justify-content: flex-end; }

/* ---------- glitch hover ---------- */
.glitch {
  position: relative;
  display: inline-block;
}
.glitch:hover { color: var(--accent); }
.glitch::before {
  content: attr(data-text);
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: 0;
}

/* ---------- scanlines overlay ---------- */
.scanlines {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 100;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.018) 0,
    rgba(255,255,255,0.018) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
}
.vignette {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 99;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.6) 100%);
}

/* ---------- ascii corner mark ---------- */
.corner-mark {
  position: fixed;
  bottom: 18px;
  left: 18px;
  font-size: 10px;
  color: var(--deep);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  z-index: 40;
  pointer-events: none;
}

/* utility */
.flex-row { display: flex; align-items: center; gap: 10px; }
.spacer-grow { flex: 1; }
