@font-face {
  font-family: 'JetBrains Mono';
  src: url('fonts/jetbrains-mono-latin-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('fonts/jetbrains-mono-latin-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #050505;
  --text: #ededed;
  --muted: #8c8c8c;
  --accent: #ffffff;
  --red: #ff6188;
  --orange: #fc9867;
  --yellow: #ffd866;
  --purple: #ab9df2;
  --cyan: #78dce8;
  --glow-text: 0 0 6px rgba(255, 255, 255, 0.18);
  --glow-accent: 0 0 1px rgba(255, 255, 255, 0.8), 0 0 10px rgba(255, 255, 255, 0.3);
  --font: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --font-ascii: ui-monospace, 'SF Mono', Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', monospace;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: radial-gradient(ellipse at center, #101010 0%, var(--bg) 70%) fixed;
  font: 17px/1.75 var(--font);
  text-shadow: var(--glow-text);
  font-variant-ligatures: none;
  -webkit-font-smoothing: antialiased;
  overflow-anchor: none;
}

::selection {
  background: var(--accent);
  color: var(--bg);
  text-shadow: none;
}

p,
ul,
h1,
h2,
h3 {
  margin: 0 0 1em;
}

ul {
  padding: 0;
  list-style: none;
}

h1 {
  font-weight: normal;
}

h2,
h3 {
  font-weight: 700;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.75em;
  line-height: 1.2;
  margin-bottom: 0.7em;
  color: var(--accent);
  text-shadow: var(--glow-accent);
}

h3 {
  font-size: 1.2em;
  line-height: 1.3;
  margin-bottom: 0.25em;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-style: dashed;
  text-underline-offset: 5px;
}

a:hover,
a:focus-visible {
  background: var(--accent);
  color: var(--bg);
  text-shadow: none;
  outline: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.dim {
  color: var(--muted);
}

/* CRT overlay: scanlines, vignette, a slow rolling band and a faint flicker. */
.crt {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0) 2px, rgba(0, 0, 0, 0.22) 3px),
    radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.6) 100%);
  animation: flicker 7s infinite steps(1);
}

.crt::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 22vh;
  top: -22vh;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0));
  animation: roll 9s linear infinite;
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  41% { opacity: 0.88; }
  42% { opacity: 1; }
  77% { opacity: 0.94; }
  78% { opacity: 1; }
}

@keyframes roll {
  to { transform: translateY(144vh); }
}

/* Layout */
.page {
  max-width: 1140px;
  margin: 0 auto;
  padding: 110px 24px 120px;
}

.block {
  margin-bottom: 24vh;
}

.venture,
.chapter {
  margin-bottom: 14vh;
}

.chapter h3 {
  margin-bottom: 0.7em;
}

.block.section-end {
  margin-bottom: 24vh;
}

.hero {
  min-height: calc(100vh - 150px);
  margin-bottom: 10vh;
}

.footer {
  margin-top: -12vh;
  font-size: 0.85em;
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: 'text portrait';
  column-gap: 56px;
  align-items: center;
  align-content: center;
}

.hero-text {
  grid-area: text;
  min-width: 0;
}

.hero .ascii {
  font-size: clamp(6px, 1.4vw, 18px);
}

.portrait {
  grid-area: portrait;
  margin: 0;
  font-family: var(--font-ascii);
  font-size: min(9.5px, calc((100vw - 40px) / 40));
  line-height: 1;
  color: #dcdcdc;
  text-shadow: 0 0 4px rgba(255, 255, 255, 0.35);
  overflow: hidden;
}

.hello {
  font-size: 1.2em;
  color: var(--muted);
  margin-bottom: 0.6em;
}

.name {
  margin: 0 0 0.8em;
}

.ascii {
  margin: 0;
  font-family: var(--font-ascii);
  font-size: clamp(6px, 1.95vw, 18px);
  line-height: 1.08;
  overflow: hidden;
  color: var(--accent);
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.45), 0 0 18px rgba(255, 255, 255, 0.2);
}

.surname {
  display: block;
  margin-top: 0.5em;
  font-size: clamp(16px, 3.4vw, 30px);
  font-weight: 700;
  letter-spacing: 0.35em;
  text-transform: uppercase;
}

.tagline {
  font-size: 1.1em;
  color: var(--accent);
  text-shadow: var(--glow-accent);
}

.hint {
  margin-top: 3em;
}

/* Ventures */
.meta {
  color: var(--muted);
  margin-bottom: 1em;
  font-size: 0.9em;
}

.state.live {
  color: var(--cyan);
  text-shadow: 0 0 8px rgba(120, 220, 232, 0.4);
}

.state.building {
  color: var(--yellow);
  text-shadow: 0 0 8px rgba(255, 216, 102, 0.4);
}

.state.soon {
  color: var(--red);
  text-shadow: 0 0 8px rgba(255, 97, 136, 0.45);
}

/* Contact */
.contact li {
  display: grid;
  grid-template-columns: 7em 1fr;
  column-gap: 1em;
  margin-bottom: 0.3em;
}

.contact a {
  justify-self: start;
  overflow-wrap: anywhere;
}

.label {
  color: var(--purple);
  text-shadow: 0 0 8px rgba(171, 157, 242, 0.35);
}

/* Terminal-style highlight colors */
.c-red {
  color: var(--red);
  text-shadow: 0 0 8px rgba(255, 97, 136, 0.45);
}

.c-orange {
  color: var(--orange);
  text-shadow: 0 0 8px rgba(252, 152, 103, 0.4);
}

.c-yellow {
  color: var(--yellow);
  text-shadow: 0 0 8px rgba(255, 216, 102, 0.4);
}

.c-purple {
  color: var(--purple);
  text-shadow: 0 0 8px rgba(171, 157, 242, 0.35);
}

.c-cyan {
  color: var(--cyan);
  text-shadow: 0 0 8px rgba(120, 220, 232, 0.4);
}

/* Typing state: untyped text keeps its layout but stays invisible. */
.js .page {
  visibility: hidden;
}

.js.ready .page {
  visibility: visible;
}

.ghost {
  color: transparent;
  text-shadow: none;
}

.pending a,
.typing a {
  text-decoration: none;
  pointer-events: none;
}

.cursor {
  display: inline-block;
  position: relative;
  width: 0;
}

.cursor::after {
  content: '';
  position: absolute;
  left: 2px;
  bottom: -0.25em;
  width: 0.6em;
  height: 1.2em;
  background: var(--accent);
  box-shadow: var(--glow-accent);
  animation: blink 1s steps(1) infinite;
}

pre .cursor::after {
  height: 1.05em;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* Navigation */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  gap: 1.8em;
  align-items: center;
  padding: 16px max(24px, calc((100vw - 1140px) / 2 + 24px));
  background: linear-gradient(to bottom, rgba(5, 5, 5, 0.96) 60%, rgba(5, 5, 5, 0));
  font-size: 14px;
  white-space: nowrap;
}

.navbar a {
  text-decoration: none;
  color: var(--muted);
}

.navbar a:hover,
.navbar a:focus-visible,
.navbar a[aria-current='true'] {
  background: none;
  color: var(--text);
}

.navbar a[aria-current='true'] {
  text-decoration: underline;
  text-decoration-color: var(--orange);
  text-underline-offset: 6px;
}

.navbar .brand {
  margin-right: auto;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

/* Keyboard shortcuts bar */
.keys {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  display: flex;
  gap: 1.6em;
  align-items: center;
  padding: 26px 32px 14px;
  background: linear-gradient(to top, rgba(5, 5, 5, 0.96) 55%, rgba(5, 5, 5, 0));
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
  text-shadow: none;
}

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

.keys a:hover,
.keys a:focus-visible,
.keys a[aria-current='true'] {
  background: none;
  color: var(--text);
}

.keys a[aria-current='true'] kbd {
  border-color: var(--yellow);
  color: var(--yellow);
  box-shadow: 0 0 8px rgba(255, 216, 102, 0.35);
}

.keys-gap {
  margin-left: auto;
}

kbd {
  display: inline-block;
  min-width: 1.7em;
  margin-right: 0.5em;
  padding: 0 0.4em;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  line-height: 1.6;
  text-align: center;
}

kbd + kbd {
  margin-left: -0.2em;
}

@media (max-width: 1000px) {
  .hero {
    grid-template-columns: 1fr;
    grid-template-areas: 'portrait' 'text';
    align-content: start;
  }

  .hero .ascii {
    font-size: clamp(6px, 1.95vw, 18px);
  }

  .portrait {
    font-size: min(8px, calc((100vw - 40px) / 40));
    margin-bottom: 1.6em;
  }
}

@media (max-width: 900px), (hover: none) and (pointer: coarse) {
  .keys {
    display: none;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 15px;
  }

  .page {
    padding: 90px 18px 100px;
  }

  .navbar {
    gap: 1.1em;
    padding: 14px 18px;
    font-size: 13px;
  }

  .navbar .brand {
    display: none;
  }

  .navbar a:nth-child(2) {
    margin-left: auto;
  }

  .contact li {
    grid-template-columns: 1fr;
    margin-bottom: 0.6em;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .crt,
  .cursor::after {
    animation: none;
  }

  .crt::after {
    display: none;
  }
}
