/* ==========================================================================
   tari.hois.ch — digital resume
   Design language adapted from /opt/odysseus/static/ (Fira Code, 1px borders,
   color-mix derived tones, domino reveals), recoloured to dark purple pastel.
   No build step: this is the whole stylesheet. Edit it directly.
   ========================================================================== */

@font-face {
  font-family: 'Fira Code';
  font-weight: 300;
  font-style: normal;
  font-display: swap;
  src: url('../fonts/FiraCode-Light.woff2') format('woff2');
}
@font-face {
  font-family: 'Fira Code';
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url('../fonts/FiraCode-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Fira Code';
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url('../fonts/FiraCode-SemiBold.woff2') format('woff2');
}

/* --- Tokens ---------------------------------------------------------------
   Contrast ratios against --bg were computed, not estimated:
     --fg     12.95:1   --accent  8.73:1   --muted  5.36:1
   --muted must not go darker than #9a82b8 (it fails AA on --bg2 below that).
   --border is 1.63:1 — decorative only. Focus rings use --accent (needs 3:1).
   -------------------------------------------------------------------------- */
:root {
  --bg: #1b1420;
  --bg2: #241a2b;
  --panel: #150f19;
  --fg: #e6d4f7;
  --muted: #9a82b8;
  --border: #4a3358;
  --accent: #c9a6f0;
  --accent2: #f5c2e7;
  --green: #9ae6b4;
  --radius: 8px;
  --wrap: 860px;

  /* Rain colour ladder — read by js/rain.js. Darkest to brightest. */
  --rain-1: #6c4675;
  --rain-2: #9a82b8;
  --rain-3: #c9a6f0;
  --rain-4: #e6d4f7;

  /* Scrim behind text so rain reads as *behind* content, never through it. */
  --scrim: color-mix(in srgb, var(--bg) 82%, transparent);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 520px at 82% -10%, rgba(201, 166, 240, 0.10), transparent 60%),
    radial-gradient(900px 520px at 0% 0%, rgba(108, 70, 117, 0.28), transparent 55%),
    var(--bg);
  color: var(--fg);
  font-family: 'Fira Code', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

/* The rain canvas is prepended to <body> by rain.js and sits behind everything.
   Capped opacity keeps bright drops from eating text contrast. */
#rain-canvas {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.62;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

nav, main, footer { position: relative; z-index: 1; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 22px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* --- Skip link ----------------------------------------------------------- */
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 10px 16px;
  background: var(--panel);
  border: 1px solid var(--accent);
  border-radius: 0 0 var(--radius) 0;
  color: var(--fg);
}
.skip:focus { left: 0; text-decoration: none; }

/* --- Nav ----------------------------------------------------------------- */
nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
nav .wrap {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.2px;
  color: var(--fg);
}
.brand:hover { text-decoration: none; }
.brand .mark { color: var(--accent); flex-shrink: 0; }
.nav-links { display: flex; align-items: center; gap: 20px; }
.nav-links a {
  color: var(--muted);
  font-size: 14px;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
}
.nav-links a:hover { color: var(--fg); text-decoration: none; border-bottom-color: var(--border); }
.nav-links a[aria-current="page"] { color: var(--fg); border-bottom-color: var(--accent); }

/* Three links do not justify a hamburger — they just wrap. */
@media (max-width: 640px) {
  nav .wrap { padding-top: 10px; padding-bottom: 10px; }
  .nav-links { gap: 16px; width: 100%; }
}

/* --- Main / sections ----------------------------------------------------- */
main { flex: 1 0 auto; padding: 0 0 72px; }

.page-head { padding: 56px 0 8px; }
.eyebrow {
  color: var(--accent);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0 0 6px;
}
h1 {
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
}
h2 {
  font-size: clamp(19px, 3vw, 23px);
  font-weight: 600;
  margin: 44px 0 14px;
}
.sub { color: var(--muted); max-width: 62ch; margin: 0 0 26px; }

/* --- Hero (homepage) ----------------------------------------------------- */
.hero {
  padding: clamp(52px, 11vh, 104px) 0 56px;
  text-align: center;
}
.hero-inner {
  background: var(--scrim);
  backdrop-filter: blur(2px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: clamp(28px, 5vw, 46px) clamp(20px, 4vw, 40px);
}
.hero-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--accent);
  margin-bottom: 10px;
}
.wordmark {
  font-size: clamp(30px, 7vw, 50px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: 0.01em;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
  border: 1px solid var(--border);
  background: var(--panel);
  padding: 5px 13px;
  border-radius: 999px;
  margin-bottom: 22px;
}
.badge .dot {
  width: 7px;
  height: 7px;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  flex-shrink: 0;
}
.tagline {
  font-style: italic;
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0.3px;
  margin: 0 0 22px;
  opacity: 0.9;
}
.lede {
  font-size: clamp(15px, 2.2vw, 17px);
  color: var(--fg);
  max-width: 60ch;
  margin: 0 auto 14px;
  text-align: left;
}
.lede + .lede { margin-top: 14px; }
.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 30px;
}

/* --- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid var(--border);
  color: var(--fg);
  background: var(--panel);
  transition: transform .14s ease, border-color .14s ease, background .14s ease;
}
.btn:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  text-decoration: none;
}
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #1b1420;
  border-color: transparent;
}
.btn.primary:hover { filter: brightness(1.07); }

/* --- Career timeline ----------------------------------------------------- */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 26px;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border);
}
.role {
  position: relative;
  background: var(--scrim);
  backdrop-filter: blur(2px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 18px;
  transition: transform .14s ease, border-color .14s ease;
}
.role:hover { transform: translateY(-2px); border-color: var(--accent); }
/* Hard-edged square node, echoing the rain's pixel grid — not a round dot. */
.role::before {
  content: "";
  position: absolute;
  left: -27px;
  top: 26px;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 0;
}
.role-when {
  color: var(--accent);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.role-title { font-size: 17px; font-weight: 600; margin: 0 0 3px; }
.role-org { color: var(--muted); font-size: 13.5px; margin-bottom: 10px; }
.role-blurb { margin: 0 0 10px; }
.role-points { margin: 0; padding-left: 20px; color: var(--muted); }
.role-points li { margin-bottom: 4px; }
.role-points li::marker { color: var(--accent); }

@media (max-width: 560px) {
  .timeline { padding-left: 18px; }
  .role { padding: 16px 16px; }
  .role::before { left: -19px; top: 22px; }
}

/* --- Contact cards ------------------------------------------------------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}
.card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--scrim);
  backdrop-filter: blur(2px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  color: var(--fg);
  height: 100%;
  transition: transform .14s ease, border-color .14s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--accent); text-decoration: none; }
.card .ico {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(201, 166, 240, 0.18), rgba(108, 70, 117, 0.30));
  border: 1px solid var(--border);
  color: var(--accent);
}
.card-label { font-size: 12px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }
.card-value { font-weight: 600; font-size: 14.5px; word-break: break-word; }

/* --- Footer -------------------------------------------------------------- */
footer {
  border-top: 1px solid var(--border);
  padding: 26px 0;
  color: var(--muted);
  font-size: 13px;
  background: color-mix(in srgb, var(--panel) 70%, transparent);
}
footer .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* --- Domino reveals ------------------------------------------------------
   Gated on .js (added by js/boot.js before first paint). Without JS these
   rules never apply, so content is visible rather than trapped invisible. */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s cubic-bezier(.2, .7, .2, 1), transform .6s cubic-bezier(.2, .7, .2, 1);
}
.js .reveal.in { opacity: 1; transform: none; }
/* Stagger children ~45ms apart, matching Odysseus' domino cascade. */
.js .reveal.in:nth-child(1) { transition-delay: .04s; }
.js .reveal.in:nth-child(2) { transition-delay: .09s; }
.js .reveal.in:nth-child(3) { transition-delay: .13s; }
.js .reveal.in:nth-child(4) { transition-delay: .18s; }
.js .reveal.in:nth-child(5) { transition-delay: .22s; }
.js .reveal.in:nth-child(6) { transition-delay: .27s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal, .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .btn:hover, .role:hover, .card:hover { transform: none; }
}

/* --- Print: make Ctrl+P a usable PDF resume ------------------------------ */
@media print {
  #rain-canvas, nav, footer, .hero-cta, .skip, .badge, .tagline { display: none !important; }
  /* Reveal animations must never hide printed content. A visitor who prints
     without scrolling would otherwise lose every entry below the fold, and a
     printed resume cannot depend on a JS timer having fired. */
  .js .reveal, .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  html, body {
    background: #fff !important;
    color: #000 !important;
    font-size: 11pt;
  }
  body { display: block; }
  main { padding: 0; }
  a { color: #000 !important; text-decoration: none; }
  /* Spell out link targets, since a printed page cannot be clicked. */
  .card a::after, .card::after { content: ""; }
  .wrap { max-width: none; padding: 0; }
  .hero { padding: 0 0 12pt; text-align: left; }
  .hero-inner, .role, .card {
    background: transparent !important;
    backdrop-filter: none !important;
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
  }
  .wordmark {
    -webkit-text-fill-color: #000 !important;
    background: none !important;
    color: #000 !important;
    font-size: 22pt;
  }
  .lede { text-align: left; max-width: none; }
  .eyebrow, .role-when, .role-points li::marker { color: #000 !important; }
  .role-org, .role-points, .sub, footer { color: #333 !important; }
  .timeline { padding-left: 0; }
  .timeline::before { display: none; }
  .role::before { display: none; }
  .role { margin-bottom: 14pt; break-inside: avoid; page-break-inside: avoid; }
  h1, h2 { break-after: avoid; page-break-after: avoid; }
  .cards { display: block; }
  .card { margin-bottom: 6pt; }
  .card .ico { display: none; }
}
