/* ─────────────────────────────────────────────────────────────────
   Marco Luyckx hub (luyckx.dev)
   Catppuccin Mocha (dark) / Latte (light) · JetBrains Mono
   Designed to feel like the CV site's "home screen" at marco.luyckx.dev.
   ───────────────────────────────────────────────────────────────── */

/* 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;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

: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;
  scroll-padding-top: 52px;
}

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;
  padding-top: 44px;      /* reserve space for the fixed tab-bar */
  transition: background-color 0.3s ease, color 0.3s ease;
}

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

:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 2px;
  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; }

/* Subtle scanline overlay, same trick as the CV site ─────────── */

body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 3px
  );
}

:root[data-theme="light"] body::after {
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.015) 2px,
    rgba(0, 0, 0, 0.015) 3px
  );
}

/* Tab bar, mirrors the CV site layout ─────────────────────── */

.tab-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9998;
  background: var(--crust);
  border-bottom: 1px solid var(--surface0);
  display: flex;
  align-items: stretch;
  height: 44px;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.tab-bar::-webkit-scrollbar { display: none; }

.tab-bar a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  color: var(--overlay1);
  font-size: 0.78rem;
  text-decoration: none;
  white-space: nowrap;
  border-right: 1px solid var(--surface0);
  border-bottom: 2px solid transparent;
  transition: background 0.2s, color 0.2s, border-bottom-color 0.2s;
  flex-shrink: 0;
}

.tab-bar a:hover {
  background: var(--mantle);
  color: var(--text);
  text-decoration: none;
}

.tab-bar a.active {
  background: var(--base);
  color: var(--text);
  border-bottom: 2px solid var(--pink);
}

.tab-bar a .icon {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.tab-actions {
  display: flex;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
  border-left: 1px solid var(--surface0);
}

.tab-actions button {
  background: none;
  border: none;
  border-right: 1px solid var(--surface0);
  color: var(--overlay1);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0 12px;
  height: 44px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}

.tab-actions button:last-child { border-right: none; }
.tab-actions button:hover {
  color: var(--text);
  background: var(--mantle);
}
.tab-actions button .icon {
  width: 14px;
  height: 14px;
}

/* Terminal window ─────────────────────────────────────────────── */

.terminal-window {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 24px 48px;
}

/* Section titles, copied from cv/css/layout.css ──────────── */

.section-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.section-title .icon {
  width: 24px;
  height: 24px;
  color: var(--pink);
  flex-shrink: 0;
}

.section-divider {
  color: var(--surface2);
  margin-bottom: 16px;
  user-select: none;
  overflow: hidden;
  white-space: nowrap;
}

/* Section reveal ──────────────────────────────────────────────── */

.section {
  margin-bottom: 48px;
}

.section .stagger {
  opacity: 0;
  transform: translateY(8px);
  animation: reveal 0.6s var(--ease-out) forwards;
}

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

#hero .stagger:nth-child(1) { animation-delay: 0.20s; }
#hero .stagger:nth-child(2) { animation-delay: 0.35s; }
#hero .stagger:nth-child(3) { animation-delay: 0.50s; }

/* paths: title → divider → prompt → grid */
#paths .stagger:nth-child(1) { animation-delay: 0.70s; }
#paths .stagger:nth-child(2) { animation-delay: 0.80s; }
#paths .stagger:nth-child(3) { animation-delay: 0.95s; }
#paths .stagger:nth-child(4) { animation-delay: 1.10s; }

/* contact: title → divider → prompt → output */
#contact .stagger:nth-child(1) { animation-delay: 1.30s; }
#contact .stagger:nth-child(2) { animation-delay: 1.40s; }
#contact .stagger:nth-child(3) { animation-delay: 1.55s; }
#contact .stagger:nth-child(4) { animation-delay: 1.70s; }

/* ASCII art ─────────────────────────────────────────────────── */

.ascii-art {
  color: var(--pink);
  font-size: clamp(4px, 1.45vw, 14px);
  line-height: 1.2;
  white-space: pre;
  overflow-x: auto;
  margin: 0 0 28px 0;
  opacity: 0;
  transform: translateY(8px);
  animation: reveal 0.6s var(--ease-out) forwards;
  animation-delay: 0.05s;
}

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

.prompt {
  color: var(--subtext0);
  overflow-wrap: break-word;
  word-break: break-word;
  margin-bottom: 4px;
  font-size: clamp(0.82rem, 1.1vw, 0.92rem);
}

.hero-lines .prompt { margin-bottom: 6px; }

.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 .arg    { color: var(--peach); }
.prompt .flag   { color: var(--teal); }

.prompt.final {
  margin-top: clamp(20px, 3vh, 32px);
  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; }
}

/* Output ──────────────────────────────────────────────────────── */

.output {
  color: var(--subtext1);
  margin: 4px 0 24px 0;
}

.role-line {
  color: var(--text);
  font-size: clamp(0.92rem, 1.2vw, 1rem);
  margin: 4px 0;
}

.role-sep {
  color: var(--overlay0);
  padding: 0 6px;
}

.status {
  font-size: 0.9rem;
  color: var(--subtext0);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 0 0;
}

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

/* Path cards ───────────────────────────────────────────────── */

.prompt .prompt-hint {
  color: var(--overlay0);
  padding-left: 10px;
  font-style: italic;
}

.paths-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin: 14px 0 8px;
}

.path-card {
  position: relative;
  display: block;
  padding: 18px 20px;
  background: color-mix(in oklab, var(--mantle) 55%, transparent);
  border: 1px solid var(--surface0);
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition:
    border-color 0.25s var(--ease-out),
    background   0.25s var(--ease-out),
    transform    0.25s var(--ease-out),
    box-shadow   0.25s var(--ease-out);
}

/* Left accent, always visible so the card reads as actionable */
.path-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--surface2);
  transition: background 0.25s var(--ease-out);
}

@media (hover: hover) {
  .path-card:hover {
    border-color: var(--pink);
    background: color-mix(in oklab, var(--mantle) 90%, transparent);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  }
  .path-card:hover::before { background: var(--pink); }
  .path-card:hover .path-card-caret {
    color: var(--pink);
    transform: translateX(4px);
  }
}

.path-card:focus-visible {
  border-color: var(--pink);
  outline: none;
}
.path-card:focus-visible::before { background: var(--pink); }

.path-card-head {
  display: grid;
  grid-template-columns: min-content 1fr min-content;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.path-card-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.path-card-icon.folder { color: var(--mauve); }
.path-card-icon.pen    { color: var(--teal); }

.path-card-label {
  font-size: clamp(1rem, 1.3vw, 1.12rem);
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}
.path-card-label .dollar { color: var(--overlay1); font-weight: 500; }
.path-card-label .cmd    { color: var(--yellow); }
.path-card-label .arg    { color: var(--peach); }

.path-card-caret {
  width: 18px;
  height: 18px;
  color: var(--overlay1);
  transition: transform 0.25s var(--ease-out), color 0.25s var(--ease-out);
}

.path-card-desc {
  color: var(--subtext0);
  font-size: clamp(0.86rem, 1.05vw, 0.94rem);
  line-height: 1.55;
  padding-left: 32px;         /* align under the label, past the icon */
}

/* Contact, mirrors cv/css/components.css exactly ─────────── */

.contact-row {
  display: flex;
  gap: 12px;
  margin: 6px 0;
  align-items: baseline;
}

.contact-label {
  color: var(--pink);
  min-width: 120px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.contact-label .icon {
  width: 14px;
  height: 14px;
  color: var(--pink);
  flex-shrink: 0;
}

.contact-value a {
  color: var(--blue);
  position: relative;
  text-decoration: none;
}

.contact-value a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--lavender);
  transition: width 0.3s ease;
}

.contact-value a:hover { text-decoration: none; }
.contact-value a:hover::after { width: 100%; }

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

@media (max-width: 760px) {
  .terminal-window {
    padding: 36px 16px 40px;
  }

  .paths-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .path-card {
    padding: 16px 18px;
  }

  .path-card-desc {
    padding-left: 0;
  }

  .contact-row {
    grid-template-columns: min-content min-content 1fr;
    gap: 10px;
    width: 100%;
  }
}

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-delay: 0s !important;
    transition-duration: 0.001s !important;
  }
  .section .stagger,
  .ascii-art {
    opacity: 1;
    transform: none;
  }
  .status-dot, .cursor { animation: none; }
}

/* Icon sprite ───────────────────────────────────────────────── */

/* The inline <symbol> sprite must not occupy layout space. Set here rather
   than as a style attribute so the CSP can stay `style-src 'self'`. */
.icon-sprite {
  position: absolute;
  overflow: hidden;
}

/* Error page (404) ──────────────────────────────────────────── */

/* Previously an inline <style> block plus three style attributes, all of
   which the `style-src 'self'` CSP blocked, so the page rendered unstyled. */
.stage.err-stage {
  place-content: center;
  text-align: left;
}

.err {
  max-width: 560px;
}

.err .name {
  font-size: clamp(3rem, 12vw, 7rem);
}

.err-code {
  color: var(--peach);
}

.err-actions {
  margin-top: 24px;
}

.err-back {
  color: var(--pink);
  text-decoration: none;
  border-bottom: 1px dashed var(--pink);
}

/* Security policy page ──────────────────────────────────────── */

.policy {
  max-width: 720px;
}

.policy-h {
  color: var(--mauve);
  font-size: 1rem;
  font-weight: 600;
  margin: 28px 0 8px;
}

.policy-h::before {
  content: "## ";
  color: var(--surface2);
}

.policy-p {
  color: var(--subtext0);
  margin-bottom: 10px;
  line-height: 1.75;
}

.policy code {
  color: var(--teal);
  font-size: 0.92em;
}
