/* arthurvandevelde.ch

   Layout: a live Geneva sky across the top, then one reading column with two
   small working models (case routing, the microscope) set into it.
   The page has two lights, day and night. Without scripts it follows the
   visitor's system; with app.js it follows the sun in the sky above, and the
   accent warms from lake blue to evening orange as the sun goes down. */

:root {
  --bg: #f3f5f6;
  --ink: #15191d;
  --muted: #58626c;
  --line: #dbe1e5;
  --card: #ffffff;
  --accent: #1d5fa6;
  --accent-ink: #ffffff;
  --sky-ink: #ffffff;
  --topic-o: #2f6fd6;
  --topic-r: #c2410c;
  --topic-p: #0f8a5f;
  --scope: #05070a;              /* the microscope is always dark */

  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: "Literata", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1018; --ink: #e7e9ef; --muted: #9ba2b3; --line: #242a3a; --card: #151a26;
    --accent: #ffb27a; --accent-ink: #1b1006;
    --topic-o: #7aa7ff; --topic-r: #ff9a6b; --topic-p: #5fd3a2;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1018; --ink: #e7e9ef; --muted: #9ba2b3; --line: #242a3a; --card: #151a26;
  --accent: #ffb27a; --accent-ink: #1b1006;
  --topic-o: #7aa7ff; --topic-r: #ff9a6b; --topic-p: #5fd3a2;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 18px/1.65 var(--body);
  -webkit-font-smoothing: antialiased;
}
/* Only fade between day and night once the page is up, not on the first paint. */
.ready body { transition: background-color .8s ease, color .8s ease; }
@media (prefers-reduced-motion: reduce) { .ready body { transition: none; } }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.08; margin: 0; text-wrap: balance; }
p { margin: 0; }

.wrap {
  max-width: 1080px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.mono { font-family: var(--mono); font-size: 13px; letter-spacing: .02em; }

/* ── header ─────────────────────────────────────────────── */
header.site { position: absolute; inset: 0 0 auto; z-index: 5; }
header.site .wrap { display: flex; align-items: center; gap: 20px; min-height: 64px; }
.brand { font-family: var(--display); font-weight: 700; font-size: 17px;
         color: var(--sky-ink); text-decoration: none; }
nav.main { margin-left: auto; display: flex; gap: 22px; align-items: center; }
nav.main a { color: var(--sky-ink); text-decoration: none; font-family: var(--display);
             font-size: 15px; opacity: .85; }
nav.main a:hover { opacity: 1; }
nav.main .lang { border: 1px solid currentColor; border-radius: 6px; padding: 1px 8px;
                 font-size: 13px; font-weight: 600; }
@media (max-width: 720px) { nav.main a:not(.lang) { display: none; } }

/* ── the sky ────────────────────────────────────────────── */
.sky { position: relative; height: clamp(360px, 54vw, 560px); background: #2c4f7a;
       overflow: hidden; touch-action: pan-y; }
.sky canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; }
.sky canvas.dragging { cursor: grabbing; }
.sky .hello { position: absolute; left: 0; right: 0; top: clamp(84px, 13vw, 140px);
              pointer-events: none; color: var(--sky-ink); }
.sky h1 { font-size: clamp(44px, 9vw, 112px); font-weight: 800; letter-spacing: -.03em;
          font-variation-settings: "opsz" 96; }
.sky .hello p { font-family: var(--display); font-size: clamp(17px, 2vw, 22px); margin-top: 10px;
                max-width: 26em; opacity: .9; }

.dial { border-bottom: 1px solid var(--line); }
.dial .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px;
              padding-block: 14px; }
.dial .clock { font-family: var(--mono); font-size: 28px; font-weight: 600;
               font-variant-numeric: tabular-nums; min-width: 4.2ch; }
.dial .phase { font-family: var(--mono); font-size: 13px; color: var(--muted); min-width: 0; }
.dial .phase strong { color: var(--accent); font-weight: 600; }
.dial .phase .slot { display: inline-block; min-width: 17ch; }
.dial label { flex: 1 1 260px; display: flex; align-items: center; gap: 10px; min-width: 0; }
.dial input[type="range"] { flex: 1; min-width: 0; accent-color: var(--accent); height: 28px; }
.button {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-family: var(--display); font-weight: 600; font-size: 15px;
  background: var(--accent); color: var(--accent-ink); text-decoration: none;
  border: 1px solid var(--accent); border-radius: 8px; padding: 8px 16px;
  transition: background-color .3s, color .3s;
}
.button:hover { color: var(--accent-ink); filter: brightness(1.08); }
.button.quiet { background: transparent; color: var(--ink); border-color: var(--line); }
.button.quiet:hover { border-color: var(--muted); color: var(--ink); }
.button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* ── reading column ─────────────────────────────────────── */
section { padding-block: 64px; }
section + section { border-top: 1px solid var(--line); }
.kicker { font-family: var(--mono); font-size: 13px; color: var(--muted); margin-bottom: 12px;
          letter-spacing: .04em; }
h2 { font-size: clamp(30px, 4.4vw, 46px); font-weight: 750; letter-spacing: -.02em;
     margin-bottom: 20px; }
.prose { max-width: 36em; display: grid; gap: 16px; }
.prose p { color: var(--ink); }

.intro .wrap { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 48px; align-items: start; }
.intro .lead { font-size: clamp(21px, 2.5vw, 26px); line-height: 1.5; }
.me { display: grid; gap: 12px; justify-items: start; }
.me img { width: 168px; height: 168px; border-radius: 50%; background: var(--card); }
.me .mono { color: var(--muted); line-height: 1.7; }
.facts { margin-top: 24px; font-family: var(--mono); font-size: 14px; color: var(--muted);
         display: flex; flex-wrap: wrap; gap: 6px 18px; }
.facts b { color: var(--ink); font-weight: 600; }
.cta { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px; }

/* CV button: pick the English or French PDF */
.pick { position: relative; }
.pick > summary { list-style: none; }
.pick > summary::-webkit-details-marker { display: none; }
.pick > summary::after { content: "▾"; font-size: 12px; color: var(--muted); }
.pick-menu {
  position: absolute; z-index: 5; top: calc(100% + 6px); left: 0; min-width: 100%;
  display: grid; padding: 6px; background: var(--card); border: 1px solid var(--line);
  border-radius: 8px; box-shadow: 0 8px 24px rgb(0 0 0 / .12);
}
.pick-menu a { padding: 8px 12px; border-radius: 6px; color: var(--ink); text-decoration: none;
               font-family: var(--display); font-weight: 600; font-size: 15px; white-space: nowrap; }
.pick-menu a:hover, .pick-menu a:focus-visible { background: var(--line); }
@media (max-width: 760px) {
  .intro .wrap { grid-template-columns: 1fr; gap: 28px; }
  .me { order: -1; grid-template-columns: auto 1fr; align-items: center; }
  .me img { width: 96px; height: 96px; }
}

/* ── case routing model ─────────────────────────────────── */
.model { margin-top: 32px; border: 1px solid var(--line); border-radius: var(--radius);
         background: var(--card); padding: 20px; display: grid; gap: 18px; }
.model-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.model-bar .spacer { flex: 1; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; padding: 3px; gap: 3px; }
.seg button { font-family: var(--display); font-size: 14px; font-weight: 600; cursor: pointer;
              background: transparent; color: var(--muted); border: 0; border-radius: 6px; padding: 7px 12px; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: -1px; margin-right: 6px; }
.t-o { background: var(--topic-o); }
.t-r { background: var(--topic-r); }
.t-p { background: var(--topic-p); }

.agents { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.agent { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; gap: 8px;
         align-content: start; min-height: 168px; }
.agent h3 { font-size: 17px; font-weight: 700; display: flex; justify-content: space-between; gap: 8px; }
.agent h3 span { font-family: var(--mono); font-size: 12px; font-weight: 400; color: var(--muted); }
.agent .skills { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.agent .now { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.agent .now i { display: block; height: 100%; width: 0; background: var(--muted); }
.agent .now i.slow { background: repeating-linear-gradient(45deg, var(--topic-r) 0 4px, transparent 4px 7px); }
.agent .queue { display: flex; flex-wrap: wrap; gap: 4px; }
.agent .queue .dot { margin: 0; width: 11px; height: 11px; }
.agent .more { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.agent.overloaded { border-color: var(--topic-r); }
@media (max-width: 760px) { .agents { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px;
         border-top: 1px solid var(--line); padding-top: 14px; }
.stats div { display: grid; }
.stats span { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.stats b { font-family: var(--mono); font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.model .note { font-size: 15px; color: var(--muted); }

/* ── projects ───────────────────────────────────────────── */
.project { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 40px;
           align-items: start; margin-top: 36px; }
.project + .project { margin-top: 64px; }
.project h3 { font-size: 28px; font-weight: 750; margin-bottom: 4px; }
.project .kicker { margin-bottom: 14px; }
.project .prose { gap: 12px; }
.project .prose p { font-size: 17px; }
.scope { background: var(--scope); border-radius: var(--radius); overflow: hidden; display: grid; }
.scope canvas { width: 100%; aspect-ratio: 4 / 3; display: block; cursor: crosshair; max-width: 100%; }
.scope .readout { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
                  padding: 10px 14px; color: #c8d2d8; border-top: 1px solid #1a2026; }
.scope ol { list-style: none; margin: 0; padding: 0 14px 12px; color: #8f9ba3; min-height: 5.2em; }
.scope ol li:first-child { color: #ff6fbf; }
.caption { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 8px; }
.up { font-family: var(--mono); font-size: 13px; color: var(--muted); }
@media (max-width: 820px) { .project { grid-template-columns: 1fr; gap: 20px; } }

/* ── experience ─────────────────────────────────────────── */
.jobs { list-style: none; margin: 8px 0 0; padding: 0; display: grid; }
.jobs li { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 24px; padding-block: 22px;
           border-bottom: 1px solid var(--line); }
.jobs li:last-child { border-bottom: 0; }
.jobs .when { font-family: var(--mono); font-size: 13px; color: var(--muted); padding-top: 5px;
              font-variant-numeric: tabular-nums; }
.jobs h3 { font-size: 21px; font-weight: 700; }
.jobs .where { font-family: var(--display); color: var(--muted); font-size: 15px; margin: 2px 0 8px; }
.jobs p { max-width: 38em; font-size: 17px; }
@media (max-width: 640px) { .jobs li { grid-template-columns: 1fr; gap: 4px; } }

.extras { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; margin-top: 40px; }
.extras h3 { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--muted);
             letter-spacing: .04em; margin-bottom: 8px; }
.extras p { font-size: 16px; }
@media (max-width: 760px) { .extras { grid-template-columns: 1fr; gap: 22px; } }

/* ── contact ────────────────────────────────────────────── */
.contact .email { font-family: var(--display); font-weight: 700; font-size: clamp(24px, 5vw, 48px);
                  letter-spacing: -.02em; overflow-wrap: anywhere; user-select: all; }
.contact .cta { align-items: center; }
.copied { font-family: var(--mono); font-size: 13px; color: var(--muted); }

footer.site { padding-block: 28px 40px; border-top: 1px solid var(--line); }
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between;
                    font-family: var(--mono); font-size: 13px; color: var(--muted); }
footer.site a { color: var(--muted); }

/* Sunset Atlas screenshots */
.shots { margin: 0; display: grid; gap: 10px; }
.shots .tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.shots .tabs button { font-family: var(--display); font-size: 14px; font-weight: 600; cursor: pointer;
                      background: transparent; color: var(--muted); border: 1px solid var(--line);
                      border-radius: 999px; padding: 5px 12px; }
.shots .tabs button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.shots img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radius);
             border: 1px solid var(--line); background: var(--card); max-width: 100%; }
.shots .caption { margin-top: 0; }
.project .prose p.press, .project .prose p.up { font-family: var(--mono); font-size: 13px; color: var(--muted); line-height: 1.7; }

.project .more { font-family: var(--display); font-weight: 650; }

/* ── project write-ups (/sunset-atlas/) ─────────────────── */
.post { padding-block: 32px 72px; }
/* Project pages: the same sky, shorter, with the page's own title on it. */
.sky.short { height: clamp(280px, 34vw, 380px); }
.sky.short .hello { top: clamp(80px, 11vw, 120px); }
.sky.short h1 { font-size: clamp(42px, 7vw, 80px); }
.sky .back { font-family: var(--mono); font-size: 13px; color: var(--sky-ink); opacity: .85; text-decoration: none; pointer-events: auto; }
.sky .back:hover { opacity: 1; }
.sky.short .back + h1 { margin-top: 10px; }
.post .links { font-family: var(--mono); font-size: 14px; margin-top: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.post article { max-width: 40em; }
.post h2 { font-size: clamp(26px, 3.4vw, 34px); font-weight: 750; letter-spacing: -.015em; margin: 56px 0 14px; }
.post h3 { font-size: 20px; font-weight: 700; margin: 28px 0 8px; }
.post article p + p { margin-top: 14px; }
.post figure { margin: 28px 0; }
.post figure img, .post figure video { width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); background: var(--card); }
.post figcaption { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 8px; }
.post .wide { max-width: 900px; }
.post .row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.post .row { margin-block: 28px; }
.post .row figure { margin: 0; }
.post blockquote { margin: 24px 0; padding-left: 18px; border-left: 2px solid var(--accent); font-family: var(--display); font-size: 21px; line-height: 1.4; }
.post blockquote cite { display: block; font-family: var(--mono); font-size: 12px; font-style: normal; color: var(--muted); margin-top: 6px; }
@media (max-width: 560px) { .post .row { gap: 6px; } }
.post article ol { padding-left: 1.3em; margin: 14px 0; display: grid; gap: 6px; }
.post .scope { border: 1px solid var(--line); }
.post figure:has(.scope) { max-width: 720px; }
.post .sheet { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.post .sheet table { border-collapse: collapse; width: 100%; font-family: var(--mono); font-size: 13px; white-space: nowrap; }
.post .sheet th, .post .sheet td { padding: 8px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.post .sheet th { color: var(--muted); font-weight: 600; }
.post .sheet tr:last-child td { border-bottom: 0; }
.post .split { margin: 14px 0; display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 24px; align-items: start; }
.post .split figure { margin: 4px 0 0; }
@media (max-width: 560px) { .post .split { grid-template-columns: 1fr; } .post .split figure { max-width: 240px; } }
