:root {
  --bg: #0a2015;
  --surface: rgba(8, 30, 19, 0.62);
  --text: #f2fff8;
  --muted: #d0e9db;
  --line: rgba(210, 240, 224, 0.34);
  --accent: #5fd89a;
  --accent-strong: #bbf9d8;
  --warm: #e5f58d;
  --terminal-bg: #0b1a13;
  --terminal-line: #1f3f31;
  --terminal-text: #d9f8e7;
  --max-width: 1080px;
  --radius: 16px;
  --shadow: 0 14px 35px rgba(3, 10, 6, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: #0a2015;
}

body {
  margin: 0;
  color: var(--text);
  background: transparent;
  font-family: "Archivo", sans-serif;
  line-height: 1.6;
}

.page-bg {
  position: fixed;
  inset: 0;
  background:
    linear-gradient(rgba(6, 30, 18, 0.58), rgba(6, 30, 18, 0.58)),
    var(
        --bg-image,
        url("https://images.unsplash.com/photo-1448375240586-882707db888b?auto=format&fit=crop&w=2200&q=80")
      )
      center center / cover no-repeat;
  z-index: -1;
  overflow: hidden;
}

.page-bg::before,
.page-bg::after {
  content: "";
  position: absolute;
  left: -10%;
  width: 120%;
  pointer-events: none;
  display: none;
}

.page-bg::before {
  bottom: 0;
  height: 36vh;
  background:
    radial-gradient(
      ellipse at 6% 100%,
      rgba(18, 71, 44, 0.6) 0 9%,
      transparent 10%
    ),
    radial-gradient(
      ellipse at 14% 100%,
      rgba(20, 78, 48, 0.6) 0 10%,
      transparent 11%
    ),
    radial-gradient(
      ellipse at 23% 100%,
      rgba(24, 84, 52, 0.58) 0 12%,
      transparent 13%
    ),
    radial-gradient(
      ellipse at 33% 100%,
      rgba(22, 81, 50, 0.62) 0 10%,
      transparent 11%
    ),
    radial-gradient(
      ellipse at 45% 100%,
      rgba(18, 74, 46, 0.64) 0 12%,
      transparent 13%
    ),
    radial-gradient(
      ellipse at 56% 100%,
      rgba(23, 85, 52, 0.58) 0 11%,
      transparent 12%
    ),
    radial-gradient(
      ellipse at 69% 100%,
      rgba(20, 79, 49, 0.6) 0 12%,
      transparent 13%
    ),
    radial-gradient(
      ellipse at 81% 100%,
      rgba(18, 73, 45, 0.64) 0 11%,
      transparent 12%
    ),
    radial-gradient(
      ellipse at 92% 100%,
      rgba(15, 67, 41, 0.67) 0 10%,
      transparent 11%
    );
}

.page-bg::after {
  bottom: 0;
  height: 28vh;
  background:
    linear-gradient(
      180deg,
      rgba(33, 94, 60, 0),
      rgba(16, 60, 37, 0.5) 35%,
      rgba(13, 50, 31, 0.7) 100%
    ),
    repeating-linear-gradient(
      90deg,
      rgba(17, 63, 39, 0.22) 0 8px,
      rgba(12, 53, 32, 0.18) 8px 17px,
      transparent 17px 30px
    );
  opacity: 0.55;
}

.site-header {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.2rem 1rem 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(6px);
  transition:
    opacity 280ms ease,
    transform 280ms ease;
}

body.in-intro .site-header {
  display: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  line-height: 1;
  font-family: "Newsreader", serif;
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--text);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.25);
  text-decoration: none;
}

.brand-avatar {
  display: block;
  flex-shrink: 0;
  align-self: center;
  position: relative;
  bottom: 3px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(180, 241, 208, 0.55);
  object-fit: cover;
  background: rgba(7, 26, 17, 0.9);
  box-shadow: 0 4px 10px rgba(3, 15, 9, 0.35);
}

.brand span {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  transform: translateY(-1px);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.site-nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.9rem;
  font-family:
    "JetBrains Mono", "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  transition: color 0.2s ease;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.25);
}

.site-nav a:hover {
  color: var(--accent-strong);
}

.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 1rem 0;
  color: var(--text);
}

.hero {
  padding-top: 4.5rem;
}

.terminal-intro {
  min-height: 100dvh;
  max-width: 1280px;
  margin: 0 auto;
  padding: calc(1rem + env(safe-area-inset-top)) 1rem
    calc(1rem + env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.55rem;
}

.intro-avatar-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 1.75rem;
  margin-bottom: 1.75rem;
}

.hero-photo-wrap {
  display: flex;
  justify-content: center;
}

.hero-photo {
  width: 220px;
  height: 220px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid #9bc6ae;
  box-shadow: 0 12px 28px rgba(8, 60, 30, 0.22);
  background: #eef8f1;
}

h1,
h2,
h3 {
  margin: 0 0 0.6rem;
  line-height: 1.15;
}

h1,
h2 {
  font-family: "Newsreader", serif;
  letter-spacing: -0.015em;
}

h1 {
  font-size: clamp(2rem, 4.9vw, 4.2rem);
  max-width: 16ch;
}

h2 {
  font-size: clamp(1.7rem, 3vw, 2.6rem);
}

h3 {
  font-size: 1.13rem;
}

p {
  margin-top: 0;
  max-width: 72ch;
}

.console-shell {
  background: var(--terminal-bg);
  border: 1px solid var(--terminal-line);
  border-radius: 14px;
  color: var(--terminal-text);
  padding: 0.9rem 1rem;
  margin-bottom: 1.1rem;
  font-family:
    "JetBrains Mono", "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  box-shadow: 0 10px 30px rgba(4, 8, 14, 0.2);
}

.terminal {
  max-width: 980px;
  margin: 0;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  background: var(--terminal-bg);
  border: 0;
  border-radius: 14px;
  box-shadow: 0 16px 38px rgba(4, 8, 14, 0.28);
  overflow: hidden;
}

.terminal-main {
  max-width: 1080px;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

@media (min-width: 1025px) {
  .terminal-intro {
    max-width: 1180px;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    padding-top: calc(1rem + env(safe-area-inset-top));
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-height: 100dvh;
    align-content: stretch;
    justify-items: center;
    gap: 0.7rem;
  }

  .terminal-main {
    max-width: 1080px;
    width: 100%;
    flex: 1;
    margin: 0;
  }
}

.terminal-topbar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--terminal-line);
  background: rgba(255, 255, 255, 0.03);
}

.terminal-topbar span {
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 50%;
}

.terminal-topbar span:nth-child(1) {
  background: #f87171;
}
.terminal-topbar span:nth-child(2) {
  background: #fbbf24;
}
.terminal-topbar span:nth-child(3) {
  background: #34d399;
}

.terminal-topbar p {
  margin: 0 0 0 0.35rem;
  font-size: 0.74rem;
  color: #8dd1a9;
  font-family:
    "JetBrains Mono", "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
}

.terminal-screen {
  height: auto;
  min-height: 0;
  flex: 1;
  overflow: hidden;
  padding: 0;
  font-family:
    "JetBrains Mono", "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  color: var(--terminal-text);
}

.xterm-shell {
  padding: 1rem 0.55rem 0.2rem;
  overflow: hidden;
}

.xterm-shell .xterm-rows {
  padding-left: 2px;
}

.xterm-shell .xterm {
  height: 100%;
}

.xterm-shell .xterm-viewport {
  background: transparent !important;
  border-radius: 8px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.xterm-shell .xterm-viewport::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.xterm-shell .xterm-screen,
.xterm-shell .xterm-helper-textarea {
  outline: none;
  border: 0;
}

@media (min-width: 761px) {
  .terminal {
    border: 0 !important;
  }

  .xterm-shell,
  .xterm-shell .xterm,
  .xterm-shell .xterm-viewport,
  .xterm-shell .xterm-screen,
  .xterm-shell .xterm-helper-textarea,
  .xterm-shell canvas {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
  }

  .xterm-shell .xterm-viewport {
    border-radius: 0;
  }
}

.terminal-screen p {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.65;
  max-width: none;
}

.terminal-line {
  margin-bottom: 0.42rem !important;
}

.terminal-line:last-child {
  margin-bottom: 0 !important;
}

.terminal-line-user {
  color: #c6f5d9;
}

.terminal-line-heber {
  color: #9cdab7;
}

.terminal-line-system {
  color: #74a48a;
}

.terminal-role {
  color: #8ff0b8;
  font-weight: 500;
  margin-right: 0.3rem;
}

.terminal-muted {
  color: #9cdab7;
  margin-bottom: 0.5rem !important;
}

.terminal-form {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  border-top: 1px solid var(--terminal-line);
  padding: 0.85rem 1.2rem;
  font-family:
    "JetBrains Mono", "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
}

.terminal-form .prompt {
  white-space: nowrap;
  font-size: 0.82rem;
}

.terminal-form input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--terminal-text);
  font-size: 0.96rem;
  font-family: inherit;
}

.terminal-form input::placeholder {
  color: #74a48a;
}

.console-shell p {
  margin: 0;
  font-size: 0.87rem;
  line-height: 1.5;
}

.prompt {
  color: #8ff0b8;
  margin-right: 0.35rem;
}

.intro-hint {
  text-align: center;
  font-family:
    "JetBrains Mono", "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.03em;
  margin: 0;
}

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

.hero-copy {
  font-size: 1.1rem;
  color: var(--muted);
}

.signal-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 1rem 0 0;
}

.signal-row span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.6rem;
  background: rgba(8, 30, 19, 0.52);
  font-size: 0.82rem;
  color: var(--text);
}

.hero-actions {
  margin-top: 1.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.72rem 1.15rem;
  border: 1px solid transparent;
  transition:
    transform 0.2s ease,
    background-color 0.2s ease,
    color 0.2s ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  background: var(--accent);
  color: #f9fdfd;
}

.button-primary:hover {
  background: var(--accent-strong);
}

.button-ghost {
  border-color: var(--line);
  color: var(--text);
  background: rgba(8, 30, 19, 0.58);
}

.section-command {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--accent-strong);
  text-transform: lowercase;
  font-family:
    "JetBrains Mono", "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
}

.timeline {
  border-left: 2px solid var(--line);
  padding-left: 1.1rem;
  display: grid;
  gap: 1rem;
}

.timeline-item {
  background: rgba(8, 30, 19, 0.58);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
}

.grid {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.values-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.projects-grid,
.future-grid {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

@media (min-width: 1025px) {
  .future-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.card {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 1rem;
  color: var(--text);
}

.project-brand {
  margin-bottom: 0.55rem;
}

.project-logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(138, 203, 168, 0.45);
  background: rgba(8, 28, 19, 0.8);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  object-fit: cover;
}

.project-logo-fallback {
  color: #c6f5d9;
  font-family:
    "JetBrains Mono", "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.project-logo-on-white {
  background: #ffffff;
}

.project-logo-babymode {
  width: 44px;
  height: 44px;
  padding: 0;
  background: #ffffff;
  object-fit: contain;
}

.card-tag {
  margin: 0 0 0.45rem;
  color: var(--warm);
  text-transform: uppercase;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.ingenuity-text {
  font-size: 0.93rem;
}

.site-footer {
  padding-bottom: 6rem;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.contact-links a {
  color: var(--accent-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.footer-note {
  color: var(--muted);
  font-size: 0.92rem;
}

.reveal {
  opacity: 0;
  transform: translateY(26px);
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 600ms ease,
    transform 600ms ease;
}

@media (max-width: 1024px) {
  .section {
    padding-top: 3.2rem;
  }

  .terminal-main {
    max-width: 100%;
  }

  .terminal-screen {
    min-height: 0;
  }
}

@media (max-width: 760px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    padding-bottom: 0;
  }

  .hero {
    padding-top: 2.4rem;
  }

  .terminal-intro {
    height: 100svh;
    min-height: 100svh;
    padding-top: calc(0.8rem + env(safe-area-inset-top));
    padding-bottom: calc(0.8rem + env(safe-area-inset-bottom));
    gap: 0.45rem;
    overflow: hidden;
  }

  .intro-avatar-wrap {
    margin-top: 0.35rem;
    margin-bottom: 0.35rem;
  }

  .hero-photo {
    width: 148px;
    height: 148px;
    border-radius: 50%;
  }

  .terminal-main {
    max-width: 100%;
    min-height: 0;
    flex: 1 1 auto;
    align-self: stretch;
    width: 100%;
    max-height: none;
  }

  .terminal {
    flex: 1 1 auto;
    height: 100%;
  }

  .terminal-screen {
    min-height: 0;
    height: auto;
    max-height: none;
  }

  .xterm-shell {
    padding: 0.72rem 0.45rem 0.14rem;
  }

  .intro-hint {
    margin-top: 0.08rem;
  }

  .terminal-screen p,
  .terminal-form input {
    font-size: 0.9rem;
  }

  .terminal-form .prompt {
    font-size: 0.7rem;
  }

  h1 {
    max-width: 100%;
  }

  .hero-copy {
    font-size: 1rem;
  }

  .projects-grid,
  .future-grid,
  .values-grid {
    grid-template-columns: 1fr;
  }

  .site-nav {
    width: 100%;
    gap: 0.5rem 0.85rem;
    padding-bottom: 0.25rem;
  }

  .site-nav a {
    font-size: 0.83rem;
  }
}

@media (max-width: 520px) {
  .section {
    padding: 2.8rem 0.85rem 0;
  }

  .terminal-intro {
    padding-left: 0.65rem;
    padding-right: 0.65rem;
    padding-top: calc(0.75rem + env(safe-area-inset-top));
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
    gap: 0.4rem;
  }

  .intro-avatar-wrap {
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
  }

  .hero-photo {
    width: 132px;
    height: 132px;
  }

  .terminal-topbar p {
    font-size: 0.68rem;
  }

  .terminal-screen {
    min-height: 0;
    height: auto;
    max-height: none;
    padding: 0.35rem;
  }

  .xterm-shell {
    padding: 0.6rem 0.38rem 0.1rem;
  }

  .intro-hint {
    font-size: 0.72rem;
  }

  .site-footer {
    padding-bottom: 4.5rem;
  }
}

@media (max-width: 390px) {
  .terminal-intro {
    padding-top: calc(0.65rem + env(safe-area-inset-top));
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    padding-bottom: calc(0.65rem + env(safe-area-inset-bottom));
  }

  .hero-photo {
    width: 116px;
    height: 116px;
  }

  .terminal {
    border-radius: 12px;
  }

  .terminal-topbar {
    padding: 0.45rem 0.55rem;
    gap: 0.28rem;
  }

  .terminal-topbar span {
    width: 0.52rem;
    height: 0.52rem;
  }

  .terminal-topbar p {
    font-size: 0.62rem;
    margin-left: 0.24rem;
  }

  .terminal-screen {
    min-height: 0;
    height: auto;
    max-height: none;
    padding: 0.25rem;
  }

  .site-nav {
    gap: 0.4rem 0.62rem;
  }

  .site-nav a {
    font-size: 0.78rem;
  }

  .button {
    width: 100%;
  }
}
