/* ─────────────────────────────────────────────────────────────────
   Marco Luyckx — hub (luyckx.dev)
   Catppuccin Mocha (dark) / Latte (light) · JetBrains Mono
   ───────────────────────────────────────────────────────────────── */

/* Fonts ─────────────────────────────────────────────────────────── */

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/JetBrainsMono-Latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/JetBrainsMono-LatinExt.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Palette (Catppuccin Mocha) ────────────────────────────────────── */

:root {
  --base: #1e1e2e;
  --mantle: #181825;
  --crust: #11111b;
  --surface0: #313244;
  --surface1: #45475a;
  --surface2: #585b70;
  --overlay0: #6c7086;
  --overlay1: #7f849c;
  --text: #cdd6f4;
  --subtext0: #a6adc8;
  --subtext1: #bac2de;
  --pink: #f5c2e7;
  --mauve: #cba6f7;
  --green: #a6e3a1;
  --blue: #89b4fa;
  --yellow: #f9e2af;
  --peach: #fab387;
  --red: #f38ba8;
  --teal: #94e2d5;
  --lavender: #b4befe;

  /* Motion tokens */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --fade-dist: 8px;
}

:root[data-theme="light"] {
  --base: #eff1f5;
  --mantle: #e6e9ef;
  --crust: #dce0e8;
  --surface0: #ccd0da;
  --surface1: #bcc0cc;
  --surface2: #acb0be;
  --overlay0: #6e7186;
  --overlay1: #626579;
  --text: #4c4f69;
  --subtext0: #5e6175;
  --subtext1: #5c5f77;
  --pink: #ea76cb;
  --mauve: #8839ef;
  --green: #40a02b;
  --blue: #1e66f5;
  --yellow: #df8e1d;
  --peach: #fe640b;
  --red: #d20f39;
  --teal: #179299;
  --lavender: #7287fd;
}

/* Reset ─────────────────────────────────────────────────────────── */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-feature-settings: 'liga' 1, 'calt' 1;
  background: var(--base);
  color: var(--text);
  line-height: 1.7;
  min-height: 100svh;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
  /* Subtle scanline-esque horizontal noise — evokes CV site without copying it */
  background-image:
    radial-gradient(ellipse at 20% 0%, color-mix(in oklab, var(--mauve) 6%, transparent) 0%, transparent 55%),
    radial-gradient(ellipse at 100% 100%, color-mix(in oklab, var(--pink) 5%, transparent) 0%, transparent 50%);
  background-attachment: fixed;
}

::selection {
  background: var(--surface2);
  color: var(--pink);
}

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

.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;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 10001;
  padding: 8px 16px;
  background: var(--pink);
  color: var(--crust);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 4px;
}

.skip-link:focus { top: 8px; }

/* Controls (theme + language) ──────────────────────────────────── */

.controls {
  position: fixed;
  top: clamp(16px, 3vw, 28px);
  right: clamp(16px, 3vw, 28px);
  z-index: 10;
  display: flex;
  gap: 8px;
}

.control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: color-mix(in oklab, var(--mantle) 85%, transparent);
  backdrop-filter: blur(8px);
  border: 1px solid var(--surface0);
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.72rem;
  line-height: 1;
  color: var(--subtext0);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.control:hover {
  border-color: var(--pink);
  color: var(--text);
}

.control-key {
  color: var(--overlay1);
}

.control-value {
  color: var(--pink);
  font-weight: 600;
  min-width: 2.2ch;
  text-align: left;
}

/* Layout ───────────────────────────────────────────────────────── */

.stage {
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: clamp(24px, 6vw, 64px) clamp(24px, 6vw, 80px);
  gap: clamp(40px, 6vh, 80px);
  max-width: 1100px;
  margin: 0 auto;
}

/* Prompt / terminal syntax ─────────────────────────────────────── */

.prompt {
  font-size: clamp(0.78rem, 1.2vw, 0.92rem);
  margin-bottom: 12px;
  color: var(--subtext0);
  letter-spacing: 0.01em;
}

.prompt .user   { color: var(--pink); }
.prompt .at     { color: var(--subtext0); }
.prompt .host   { color: var(--blue); }
.prompt .colon  { color: var(--subtext0); }
.prompt .path   { color: var(--mauve); }
.prompt .dollar { color: var(--text); padding: 0 4px 0 2px; }
.prompt .cmd    { color: var(--yellow); }

.prompt.final {
  margin-top: clamp(28px, 5vh, 48px);
  margin-bottom: 0;
}

.cursor {
  display: inline-block;
  width: 0.55ch;
  height: 1em;
  background: var(--text);
  vertical-align: -0.15em;
  margin-left: 0.2ch;
  animation: blink 1.05s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0; }
}

/* Intro ────────────────────────────────────────────────────────── */

.intro {
  align-self: end;
  padding-top: clamp(80px, 14vh, 140px);
}

.name {
  font-family: inherit;
  font-weight: 700;
  font-size: clamp(2.6rem, 9vw, 7.5rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--text);
  margin: 4px 0 18px;
}

.name-dot {
  color: var(--pink);
}

.role {
  font-size: clamp(0.92rem, 1.4vw, 1.08rem);
  color: var(--subtext1);
  max-width: 52ch;
}

.role-sep {
  color: var(--overlay0);
  margin: 0 8px;
}

.status {
  margin-top: 18px;
  font-size: clamp(0.82rem, 1.1vw, 0.92rem);
  color: var(--subtext0);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--green) 50%, transparent); }
  50%      { box-shadow: 0 0 0 6px color-mix(in oklab, var(--green) 0%, transparent); }
}

/* Paths ────────────────────────────────────────────────────────── */

.paths {
  align-self: start;
}

.section-label {
  font-size: clamp(0.78rem, 1vw, 0.88rem);
  color: var(--overlay1);
  letter-spacing: 0.04em;
  margin-bottom: 18px;
}

.section-label .comment {
  color: var(--overlay0);
  margin-right: 8px;
}

.path-list {
  display: grid;
  gap: clamp(14px, 2vh, 22px);
  max-width: 720px;
}

.path-item {
  display: grid;
  grid-template-columns: minmax(min-content, max-content) 1fr;
  align-items: baseline;
  gap: clamp(16px, 3vw, 32px);
  padding: 14px clamp(14px, 2vw, 20px);
  border: 1px solid var(--surface0);
  border-radius: 6px;
  background: color-mix(in oklab, var(--mantle) 65%, transparent);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s var(--ease-out), background 0.2s var(--ease-out), transform 0.2s var(--ease-out);
  position: relative;
  overflow: hidden;
}

.path-item::before {
  /* Pink gutter that grows on hover — the "cursor follows you" detail */
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--pink);
  transform: scaleY(0);
  transform-origin: center;
  transition: transform 0.25s var(--ease-out);
}

.path-item:hover,
.path-item:focus-visible {
  border-color: var(--surface1);
  background: color-mix(in oklab, var(--mantle) 85%, transparent);
  transform: translateX(2px);
}

.path-item:hover::before,
.path-item:focus-visible::before {
  transform: scaleY(1);
}

.path-cmd {
  font-size: clamp(0.95rem, 1.4vw, 1.1rem);
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}

.prompt-inline .dollar {
  color: var(--text);
  opacity: 0.6;
}

.path-cmd .cmd {
  color: var(--yellow);
  font-weight: 600;
}

.path-cmd .arg {
  color: var(--peach);
  font-weight: 600;
}

.path-cmd .caret {
  color: var(--pink);
  margin-left: 6px;
  transform: translateX(-4px);
  opacity: 0;
  transition: transform 0.25s var(--ease-out), opacity 0.25s var(--ease-out);
}

.path-item:hover .caret,
.path-item:focus-visible .caret {
  transform: translateX(0);
  opacity: 1;
}

.path-desc {
  font-size: clamp(0.82rem, 1.1vw, 0.92rem);
  color: var(--subtext0);
  line-height: 1.55;
}

/* Contact footer ───────────────────────────────────────────────── */

.contact {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(14px, 2vw, 28px);
  padding-top: clamp(20px, 3vh, 32px);
  border-top: 1px dashed var(--surface0);
  font-size: clamp(0.78rem, 1vw, 0.88rem);
}

.contact-link {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  color: var(--subtext0);
  text-decoration: none;
  transition: color 0.2s;
}

.contact-link:hover,
.contact-link:focus-visible {
  color: var(--text);
}

.contact-key {
  color: var(--overlay1);
}

.contact-link:hover .contact-key,
.contact-link:focus-visible .contact-key {
  color: var(--pink);
}

.contact-value {
  color: var(--blue);
}

:root[data-theme="light"] .contact-value {
  color: var(--blue);
}

.contact-link:hover .contact-value {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Load choreography ────────────────────────────────────────────── */

.intro > *,
.paths > *,
.contact {
  opacity: 0;
  transform: translateY(var(--fade-dist));
  animation: reveal 0.7s var(--ease-out) forwards;
}

.intro > .prompt         { animation-delay: 0.05s; }
.intro > .name           { animation-delay: 0.25s; }
.intro > .role           { animation-delay: 0.45s; }
.intro > .status         { animation-delay: 0.65s; }

.paths > .section-label  { animation-delay: 0.90s; }
.paths > .path-list      { animation-delay: 1.05s; }
.paths > .prompt.final   { animation-delay: 1.25s; }

.contact                 { animation-delay: 1.45s; }

.path-list .path-item {
  opacity: 0;
  transform: translateY(var(--fade-dist));
  animation: reveal 0.6s var(--ease-out) forwards;
}

.path-list .path-item:nth-child(1) { animation-delay: 1.1s; }
.path-list .path-item:nth-child(2) { animation-delay: 1.25s; }

@keyframes reveal {
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive ───────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .stage {
    padding: clamp(20px, 5vw, 28px);
    gap: 36px;
  }
  .intro { padding-top: 48px; }
  .role { max-width: 34ch; }
  .contact { flex-direction: column; gap: 10px; }
}

/* Reduced motion ──────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-delay: 0s !important;
    transition-duration: 0.001s !important;
  }
  .intro > *, .paths > *, .contact, .path-list .path-item {
    opacity: 1;
    transform: none;
  }
  .status-dot { animation: none; }
  .cursor { animation: none; opacity: 1; }
}
