/* =========================================================
   DANIEL VISBAL — PERSONAL SITE
   Design system: dark engineering canvas + logo trajectory gradient
   Typefaces: Space Grotesk (display) / Inter (body) / JetBrains Mono (data)
   ========================================================= */

:root {
  /* ---- Color tokens ---- */
  --bg-void:      #06090d;
  --bg-panel:     #0d131a;
  --bg-panel-2:   #10171f;
  --line:         rgba(255, 255, 255, 0.08);
  --line-strong:  rgba(255, 255, 255, 0.16);
  --ink:          #edeff2;
  --ink-dim:      #8a94a3;
  --ink-faint:    #525964;

  --signal-blue:  #1391d6;
  --signal-teal:  #14b8a6;
  --signal-green: #22c55e;

  --gradient-trajectory: linear-gradient(115deg, var(--signal-blue) 0%, var(--signal-teal) 52%, var(--signal-green) 100%);
  --gradient-trajectory-soft: linear-gradient(115deg, rgba(19,145,214,0.16) 0%, rgba(20,184,166,0.16) 52%, rgba(34,197,94,0.16) 100%);

  /* ---- Type ---- */
  --font-display: "Space Grotesk", "Inter", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;

  /* ---- Layout ---- */
  --max-w: 1180px;
  --gutter: clamp(24px, 5vw, 64px);
  --radius-s: 4px;
  --radius-m: 10px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------------------------------------------------------
   Reset & base
   --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  background: var(--bg-void);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink);
}

p { margin: 0; }

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

img { max-width: 100%; display: block; }

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

button { font-family: inherit; cursor: pointer; }

::selection {
  background: var(--signal-teal);
  color: #04110d;
}

:focus-visible {
  outline: 2px solid var(--signal-teal);
  outline-offset: 3px;
  border-radius: 2px;
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.mono {
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gradient-trajectory);
  flex: none;
}

.gradient-text {
  background: var(--gradient-trajectory);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

section { position: relative; }

.section-pad {
  padding: clamp(72px, 11vw, 160px) 0;
}

.section-head {
  max-width: 640px;
  margin-bottom: clamp(40px, 6vw, 72px);
}

.section-head h2 {
  font-size: clamp(28px, 4vw, 44px);
  margin-top: 14px;
}

.section-num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-faint);
}

hr.rule {
  border: none;
  border-top: 1px solid var(--line);
  margin: 0;
}

/* ---------------------------------------------------------
   Background grid / atmosphere
   --------------------------------------------------------- */
.bg-grid {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -3;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.28;
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, black 0%, transparent 70%);
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, black 0%, transparent 70%);
}

#art-canvas {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  z-index: -2;
  pointer-events: none;
}

.bg-vignette {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 85% 46% at 50% 0%, rgba(6,9,13,0) 0%, rgba(6,9,13,0.62) 82%),
    radial-gradient(ellipse 85% 55% at 50% 100%, rgba(6,9,13,0) 0%, rgba(6,9,13,0.7) 85%);
}

/* ---------------------------------------------------------
   Nav
   --------------------------------------------------------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s var(--ease), background-color 0.4s var(--ease);
}

.nav.is-scrolled {
  background: rgba(6, 9, 13, 0.82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 18px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.brand img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  border-radius: 6px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 34px);
  font-size: 13px;
}

.nav-links a {
  font-family: var(--font-mono);
  color: var(--ink-dim);
  letter-spacing: 0.03em;
  padding: 4px 0;
  position: relative;
  transition: color 0.25s var(--ease);
}

.nav-links a:hover,
.nav-links a.is-active { color: var(--ink); }

.nav-links a.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 2px;
  background: var(--gradient-trajectory);
}

.nav-links .btn { padding: 8px 16px; font-size: 12.5px; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  width: 40px; height: 36px;
  color: var(--ink);
  align-items: center;
  justify-content: center;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.03em;
  color: var(--ink-faint);
  flex: none;
}

.lang-switch a { color: var(--ink-dim); transition: color 0.25s var(--ease); }
.lang-switch a:hover { color: var(--ink); }
.lang-switch a.is-current {
  color: var(--ink);
  background: var(--gradient-trajectory-soft);
  border: 1px solid var(--line-strong);
  padding: 3px 7px;
  border-radius: 4px;
}

/* ---------------------------------------------------------
   Buttons
   --------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--radius-s);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.03em;
  border: 1px solid var(--line-strong);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease);
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-trajectory);
  color: #05110d;
  border-color: transparent;
  font-weight: 600;
}

.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.06); }

.btn-ghost {
  color: var(--ink);
  background: transparent;
}

.btn-ghost:hover {
  border-color: var(--signal-teal);
  color: var(--ink);
  transform: translateY(-2px);
}

.btn-arrow { transition: transform 0.3s var(--ease); }
.btn:hover .btn-arrow { transform: translateX(3px); }

/* ---------------------------------------------------------
   Hero
   --------------------------------------------------------- */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 96px;
  position: relative;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--signal-teal);
  color: #04110d;
  padding: 12px 18px;
  font-family: var(--font-mono);
  font-size: 13px;
  border-radius: 0 0 6px 0;
}
.skip-link:focus {
  left: 0;
}

.hero-inner {
  position: relative;
  z-index: 1;
}

.hero-hud {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--signal-teal);
  min-height: 78px;
  margin-bottom: 28px;
  white-space: pre-wrap;
}

.hero-hud .cursor {
  display: inline-block;
  width: 7px; height: 14px;
  background: var(--signal-teal);
  margin-left: 2px;
  animation: blink 1s steps(1) infinite;
  vertical-align: -2px;
}

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

.hero h1 {
  font-size: clamp(40px, 8vw, 96px);
  max-width: 16ch;
}

.hero-sub {
  margin-top: 26px;
  max-width: 620px;
  font-size: clamp(16px, 1.6vw, 19px);
  color: var(--ink-dim);
  line-height: 1.65;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 44px;
}

.hero-stats {
  margin-top: clamp(56px, 8vw, 96px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
}

.hero-stat {
  padding: 22px 20px 0 0;
  border-left: 1px solid var(--line);
}
.hero-stat:first-child { border-left: none; padding-left: 0; }

.hero-stat b {
  display: block;
  font-family: var(--font-mono);
  font-size: clamp(20px, 2.6vw, 30px);
  font-weight: 600;
}

.hero-stat span {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--ink-dim);
  letter-spacing: 0.02em;
}

.scroll-cue {
  position: absolute;
  bottom: 28px;
  left: var(--gutter);
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.1em;
  z-index: 1;
}

.scroll-cue .line {
  width: 1px;
  height: 30px;
  background: var(--ink-faint);
  position: relative;
  overflow: hidden;
}
.scroll-cue .line::after {
  content: "";
  position: absolute;
  top: -100%;
  left: 0; right: 0;
  height: 100%;
  background: var(--gradient-trajectory);
  animation: cue-fall 2.2s var(--ease) infinite;
}
@keyframes cue-fall {
  0% { top: -100%; }
  60%, 100% { top: 100%; }
}

/* ---------------------------------------------------------
   Reveal-on-scroll
   --------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ---------------------------------------------------------
   Manifesto
   --------------------------------------------------------- */
.manifesto {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.manifesto-inner {
  max-width: 900px;
}

.manifesto p.lead {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(24px, 4vw, 40px);
  line-height: 1.28;
  letter-spacing: -0.01em;
}

.manifesto .support {
  margin-top: 32px;
  max-width: 640px;
  color: var(--ink-dim);
  font-size: 16px;
  line-height: 1.75;
}

/* ---------------------------------------------------------
   Capabilities grid
   --------------------------------------------------------- */
.cap-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.cap-card {
  background: var(--bg-panel);
  padding: 34px 30px;
  transition: background 0.35s var(--ease);
  position: relative;
}

.cap-card:hover { background: var(--bg-panel-2); }

.cap-index {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-faint);
}

.cap-card h3 {
  font-size: 19px;
  margin-top: 18px;
  font-weight: 600;
}

.cap-card p {
  margin-top: 12px;
  color: var(--ink-dim);
  font-size: 14.5px;
  line-height: 1.6;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-dim);
  border: 1px solid var(--line-strong);
  padding: 5px 9px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

/* ---------------------------------------------------------
   Timeline
   --------------------------------------------------------- */
.timeline {
  position: relative;
  padding-left: 34px;
}

.timeline-track {
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--line);
  overflow: hidden;
}

.timeline-track-fill {
  position: absolute;
  left: 0; top: 0; right: 0;
  height: 0%;
  background: var(--gradient-trajectory);
  transition: height 0.2s linear;
}

.tl-item {
  position: relative;
  padding-bottom: 44px;
}
.tl-item:last-child { padding-bottom: 0; }

.tl-dot {
  position: absolute;
  left: -34px;
  top: 6px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--bg-void);
  border: 2px solid var(--ink-faint);
  transition: border-color 0.4s var(--ease), background 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.tl-item.is-visible .tl-dot {
  border-color: var(--signal-teal);
  background: var(--signal-teal);
  box-shadow: 0 0 0 4px rgba(20,184,166,0.15);
}

.tl-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
  justify-content: space-between;
}

.tl-dates {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--signal-teal);
  white-space: nowrap;
}

.tl-role {
  font-family: var(--font-display);
  font-size: clamp(19px, 2.2vw, 24px);
  font-weight: 600;
  margin-top: 6px;
}

.tl-org {
  color: var(--ink-dim);
  font-size: 14.5px;
  margin-top: 6px;
}

.tl-sector {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tl-metric {
  margin-top: 16px;
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  color: var(--ink);
  background: var(--gradient-trajectory-soft);
}

.tl-details {
  margin-top: 18px;
}

.tl-details summary {
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-dim);
  letter-spacing: 0.03em;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.25s var(--ease);
}
.tl-details summary::-webkit-details-marker { display: none; }
.tl-details summary::before {
  content: "+";
  font-size: 14px;
  color: var(--signal-teal);
  transition: transform 0.3s var(--ease);
}
.tl-details[open] summary::before { content: "–"; }
.tl-details summary:hover { color: var(--ink); }

.tl-details ul {
  margin-top: 16px;
  padding-left: 18px;
  border-left: 1px solid var(--line);
  display: grid;
  gap: 10px;
}

.tl-details li {
  font-size: 14.5px;
  color: var(--ink-dim);
  line-height: 1.6;
  padding-left: 4px;
}

/* ---------------------------------------------------------
   Ventures
   --------------------------------------------------------- */
.venture-lead {
  max-width: 720px;
  color: var(--ink-dim);
  font-size: 16px;
  line-height: 1.75;
  margin-bottom: clamp(40px, 6vw, 64px);
}

.venture-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.venture-card {
  background: var(--bg-panel);
  padding: 32px;
  display: flex;
  flex-direction: column;
  transition: background 0.35s var(--ease), transform 0.35s var(--ease);
}

.venture-card:hover {
  background: var(--bg-panel-2);
}

.venture-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.venture-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 20px;
  border: 1px solid var(--line-strong);
  color: var(--ink-dim);
}

.venture-status {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--signal-green);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.venture-status::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--signal-green);
  box-shadow: 0 0 0 3px rgba(34,197,94,0.18);
}

.venture-card h3 {
  margin-top: 22px;
  font-size: 22px;
}

.venture-card p {
  margin-top: 12px;
  color: var(--ink-dim);
  font-size: 14.5px;
  line-height: 1.65;
  flex: 1;
}

.venture-stat {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink);
}

.venture-stat b { color: var(--signal-teal); }

/* ---------------------------------------------------------
   Credentials
   --------------------------------------------------------- */
.cred-split {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(40px, 6vw, 80px);
}

.cred-list { display: grid; gap: 22px; }

.cred-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 16px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.cred-row:last-child { border-bottom: none; }

.cred-year {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-faint);
  padding-top: 3px;
}

.cred-row h4 {
  font-family: var(--font-body);
  font-size: 15.5px;
  font-weight: 600;
}

.cred-row span {
  display: block;
  margin-top: 4px;
  color: var(--ink-dim);
  font-size: 13.5px;
}

.badge-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.badge {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-m);
  padding: 18px;
  background: var(--bg-panel);
}

.badge h4 {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.badge .valid {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--signal-teal);
}

/* ---------------------------------------------------------
   Stack
   --------------------------------------------------------- */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.stack-col {
  background: var(--bg-panel);
  padding: 26px 22px;
}

.stack-col h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  margin-bottom: 16px;
}

.stack-col ul { display: grid; gap: 10px; }
.stack-col li {
  font-size: 14px;
  color: var(--ink-dim);
  padding-left: 14px;
  position: relative;
}
.stack-col li::before {
  content: "";
  position: absolute;
  left: 0; top: 8px;
  width: 5px; height: 5px;
  background: var(--signal-teal);
}

/* ---------------------------------------------------------
   Contact / footer
   --------------------------------------------------------- */
.contact {
  border-top: 1px solid var(--line);
  text-align: center;
}

.contact h2 {
  font-size: clamp(32px, 6vw, 60px);
  max-width: 16ch;
  margin: 0 auto;
}

.contact-sub {
  margin: 22px auto 0;
  max-width: 520px;
  color: var(--ink-dim);
  font-size: 16px;
}

.contact-cta {
  margin-top: 40px;
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

footer {
  border-top: 1px solid var(--line);
  padding: 40px 0;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-faint);
}

.footer-links {
  display: flex;
  gap: 22px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-dim);
}

.footer-links a { transition: color 0.25s var(--ease); }
.footer-links a:hover { color: var(--ink); }

/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */
@media (max-width: 900px) {
  .cap-grid { grid-template-columns: 1fr; }
  .venture-grid { grid-template-columns: 1fr; }
  .cred-split { grid-template-columns: 1fr; }
  .stack-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-stats { grid-template-columns: repeat(2, 1fr); row-gap: 22px; }
  .hero-stat:nth-child(3) { border-left: none; padding-left: 0; }
}

@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }

  .nav-links.is-open {
    display: flex;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    background: var(--bg-void);
    border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 24px;
  }
  .nav-links.is-open a { padding: 12px 0; width: 100%; }

  .badge-grid { grid-template-columns: 1fr; }
  .stack-grid { grid-template-columns: 1fr; }
  .tl-head { flex-direction: column; align-items: flex-start; }
}
