/* Mark Intelmann — online résumé. Dark level-scene look; text as real HTML over the canvas. */

:root {
  --bg: #07090f;
  --ink: #e6edf3;
  --ink-dim: #9aa7b8;
  --ink-faint: #5b6778;
  --line: rgba(230, 237, 243, 0.12);
  --panel: rgba(10, 14, 24, 0.62);
  --accent: #7dd3fc;
  --font: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --gutter: clamp(16px, 4vw, 48px);
  --radius: 18px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

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

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.noscript { padding: 40vh var(--gutter); text-align: center; color: var(--ink-dim); }

/* ---------- backgrounds ---------- */
#scene {
  position: fixed; inset: 0; width: 100%; height: 100%;
  display: block; z-index: 0;
}
#scene[hidden] { display: none; }

.bg2d {
  position: fixed; inset: 0; z-index: 0; overflow: hidden;
  background:
    radial-gradient(60vw 60vw at 20% 10%, rgba(125, 211, 252, 0.14), transparent 60%),
    radial-gradient(50vw 50vw at 85% 60%, rgba(192, 132, 252, 0.12), transparent 60%),
    radial-gradient(40vw 40vw at 40% 100%, rgba(74, 222, 128, 0.10), transparent 60%),
    var(--bg);
}
.bg2d[hidden] { display: none; }
.bg2d span {
  position: absolute; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); opacity: 0.5; filter: blur(0.5px);
  animation: drift 18s linear infinite;
}
.bg2d span:nth-child(1) { left: 12%; top: 20%; animation-duration: 21s; }
.bg2d span:nth-child(2) { left: 30%; top: 70%; animation-duration: 17s; background: #c084fc; }
.bg2d span:nth-child(3) { left: 55%; top: 35%; animation-duration: 25s; background: #4ade80; }
.bg2d span:nth-child(4) { left: 70%; top: 80%; animation-duration: 19s; }
.bg2d span:nth-child(5) { left: 85%; top: 15%; animation-duration: 23s; background: #f472b6; }
.bg2d span:nth-child(6) { left: 45%; top: 90%; animation-duration: 15s; background: #fbbf24; }
@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); opacity: 0.2; }
  50%  { transform: translate(40px, -60px) scale(1.6); opacity: 0.7; }
  100% { transform: translate(-30px, -120px) scale(1); opacity: 0.2; }
}
@media (prefers-reduced-motion: reduce) { .bg2d span { animation: none; } }

/* ---------- HUD ---------- */
.hud {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.02em;
  pointer-events: none;
}
.hud__progress { height: 3px; background: rgba(230, 237, 243, 0.08); }
.hud__bar { height: 100%; width: 0; background: var(--accent); transition: width 120ms linear, background 600ms var(--ease); box-shadow: 0 0 12px var(--accent); }
.hud__row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px var(--gutter);
  background: linear-gradient(to bottom, rgba(7, 9, 15, 0.92), rgba(7, 9, 15, 0.78) 70%, rgba(7, 9, 15, 0));
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent); mask-image: linear-gradient(to bottom, #000 72%, transparent);
}
.hud__left { display: flex; gap: 8px; align-items: baseline; min-width: 0; color: var(--ink-dim); white-space: nowrap; overflow: hidden; }
.hud__level { color: var(--accent); text-transform: uppercase; transition: color 600ms var(--ease); }
.hud__station { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud__sep { color: var(--ink-faint); }
.hud__right { display: flex; gap: 6px; pointer-events: auto; }
.hud__btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 44px; min-height: 44px; padding: 0 12px;
  background: rgba(10, 14, 24, 0.7); border: 1px solid var(--line); border-radius: 12px;
  color: var(--ink-dim); cursor: pointer; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: color 160ms, border-color 160ms, background 160ms;
}
.hud__btn:hover, .hud__btn:focus-visible { color: var(--ink); border-color: var(--accent); outline: none; }
.hud__btn[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
.hud__btn:not([aria-pressed="true"]) .wave { opacity: 0.25; }
.hud__btn--lang { font-weight: 500; color: var(--ink); }
@media (max-width: 720px) {
  .hud__btn--text:not(.hud__btn--lang) { display: none; }
  .hud__left { font-size: 12px; }
  .hud__year { display: none; }
}

/* ---------- sections ---------- */
.app { position: relative; z-index: 10; }

.section {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center;
  padding: 96px var(--gutter);
}
.section--left  { justify-content: flex-start; }
.section--right { justify-content: flex-end; }
.section--center { justify-content: center; }

.panel {
  width: min(600px, 100%);
  padding: clamp(22px, 3vw, 36px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  opacity: 0; transform: translateY(28px);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}
.section.is-visible .panel { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .panel { opacity: 1; transform: none; transition: none; } }

.panel__kicker {
  display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline;
  font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--ink-dim); margin-bottom: 14px;
}
.panel__kicker strong { color: var(--accent); font-weight: 500; }
/* the company's mark, top right of its panel, in the station's colour with a soft glow */
.panel { position: relative; }
.panel--logo .panel__kicker, .panel--logo h2 { padding-right: 160px; }
.panel__logo {
  position: absolute; top: clamp(18px, 3vw, 30px); right: clamp(18px, 3vw, 30px);
  width: 140px; height: 76px; display: block;
  /* the white PNG is a mask; the colour is the station's */
  -webkit-mask-size: contain; mask-size: contain; -webkit-mask-position: right top; mask-position: right top; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  background: var(--accent);
  filter: drop-shadow(0 0 5px var(--accent)) drop-shadow(0 0 14px color-mix(in srgb, var(--accent) 55%, transparent));
  opacity: 0.95; pointer-events: none;
}
@media (max-width: 720px) {
  .panel--logo .panel__kicker, .panel--logo h2 { padding-right: 100px; }
  .panel__logo { width: 88px; height: 52px; }
}
.panel h2 { margin: 0 0 4px; font-size: clamp(26px, 3.4vw, 36px); line-height: 1.1; letter-spacing: -0.01em; }
.panel__place { color: var(--ink-dim); margin: 0 0 14px; }
.panel__role { font-size: 18px; font-weight: 500; margin: 0 0 14px; }
.panel__role .arrow { color: var(--ink-faint); margin: 0 8px; }
.panel ul { margin: 0; padding-left: 20px; color: var(--ink); }
.panel li { margin: 6px 0; }
.panel li::marker { color: var(--accent); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.chip {
  font-family: var(--mono); font-size: 12.5px; padding: 6px 10px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--ink-dim); background: rgba(255, 255, 255, 0.03);
}
.chip--award { color: #fde68a; border-color: rgba(253, 230, 138, 0.35); background: rgba(253, 230, 138, 0.06); }
.chip--award::before { content: '★ '; }
@media screen { .chip--award { display: none; } }

/* hero */
.hero .panel {
  background: radial-gradient(closest-side, rgba(7, 9, 15, 0.82), rgba(7, 9, 15, 0.55) 60%, transparent);
  border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none;
  width: min(1140px, 100%); padding: 48px clamp(22px, 5vw, 64px);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: clamp(16px, 4vw, 56px);
  text-align: left;
}
.hero__facts { justify-content: flex-start; }
.hero__tagline { margin-left: 0; margin-right: 0; }
/* the portrait: the ink drawing, dark as drawn, in a bright coloured nebula with soft edges (no card) */
.hero__portrait {
  position: relative; display: block; width: clamp(300px, 38vw, 540px); aspect-ratio: 1735 / 1365; justify-self: end;
}
.hero__portrait::before {
  content: ''; position: absolute; inset: -34% -30% -26% -30%; pointer-events: none;
  /* long tails: the core stays bright, the edge melts into the dark over a wide band */
  background:
    radial-gradient(44% 46% at 56% 44%, #ffffff 0%, #eaf7ff 18%, rgba(178, 228, 255, 0.9) 36%, rgba(125, 211, 252, 0.55) 52%, rgba(125, 211, 252, 0.25) 68%, rgba(125, 211, 252, 0.08) 84%, transparent 100%),
    radial-gradient(34% 38% at 28% 70%, rgba(192, 132, 252, 0.5) 0%, rgba(192, 132, 252, 0.22) 40%, rgba(192, 132, 252, 0.06) 75%, transparent 100%),
    radial-gradient(30% 32% at 80% 72%, rgba(45, 212, 191, 0.4) 0%, rgba(45, 212, 191, 0.1) 60%, transparent 100%),
    radial-gradient(50% 50% at 50% 50%, rgba(125, 211, 252, 0.3) 0%, rgba(125, 211, 252, 0.1) 55%, transparent 100%);
  filter: blur(22px);
  animation: nebula-breathe 7s ease-in-out infinite;
}
@keyframes nebula-breathe { 50% { transform: scale(1.04); opacity: 0.92; } }
@media (prefers-reduced-motion: reduce) { .hero__portrait::before { animation: none; } }
.hero__ink {
  position: absolute; left: 4%; right: 4%; bottom: 0; top: 7%;
  /* one mask layer: the drawing, whose fade towards the bottom is baked into the PNG (same in every browser) */
  -webkit-mask-size: contain; mask-size: contain; -webkit-mask-position: center bottom; mask-position: center bottom; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  background: #0b0f17;
}
.hero__role { font-family: var(--mono); color: var(--accent); letter-spacing: 0.18em; text-transform: uppercase; font-size: 14px; margin: 0 0 18px; }
.hero h1 { margin: 0; font-size: clamp(44px, 9vw, 112px); line-height: 0.95; letter-spacing: -0.03em; font-weight: 700; }
.hero__tagline { font-size: clamp(18px, 2.2vw, 22px); color: var(--ink-dim); max-width: 640px; margin: 26px auto 0; }
.hero__facts { display: flex; justify-content: center; gap: clamp(20px, 5vw, 56px); margin: 36px 0 0; padding: 0; list-style: none; flex-wrap: wrap; }
.hero__facts strong { display: block; font-size: clamp(30px, 4vw, 44px); line-height: 1; font-weight: 700; }
.hero__facts span { font-family: var(--mono); font-size: 12.5px; color: var(--ink-dim); text-transform: uppercase; letter-spacing: 0.06em; }
.hero__hint { margin: 48px 0 0; font-family: var(--mono); font-size: 12.5px; color: var(--ink-faint); animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .hero__hint { animation: none; } }

/* ---------- shelf (track record) ---------- */
.shelf-section .panel { width: min(1100px, 100%); }
.shelf {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px;
  margin-top: 24px; perspective: 1200px;
}
.card {
  --rx: 0deg; --ry: 0deg; --glow: 0;
  position: relative; aspect-ratio: 3 / 4; border-radius: 14px; padding: 16px;
  display: flex; flex-direction: column; justify-content: flex-end;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0) 45%),
    linear-gradient(200deg, var(--card-a), var(--card-b));
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 160ms ease-out, box-shadow 160ms ease-out;
  transform-style: preserve-3d; will-change: transform;
  color: #0b0f17;
}
.card:hover { box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55); }
.card::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.45), transparent 60%);
  opacity: var(--glow); transition: opacity 160ms;
}
.card__index { position: absolute; top: 12px; left: 14px; font-family: var(--mono); font-size: 12px; opacity: 0.7; }
/* the logo is a flex item above the text: it takes only the room the text leaves, never overlaps it */
.card__logo { flex: 1 1 0; min-height: 0; width: 100%; max-height: 42%; margin: 22px 0 10px; object-fit: contain; object-position: center; filter: brightness(0); opacity: 0.88; pointer-events: none; }
.card__year { font-family: var(--mono); font-size: 12px; opacity: 0.8; }
.card__name { font-weight: 700; font-size: 17px; line-height: 1.15; margin: 4px 0 6px; }
.card__meta { font-size: 12.5px; opacity: 0.85; line-height: 1.35; }

/* ---------- skills ---------- */
.skills-section .panel { width: min(960px, 100%); }
.net { display: block; width: 100%; height: auto; margin-top: 12px; }
.net line { stroke: rgba(230, 237, 243, 0.14); stroke-width: 1.2; transition: stroke 160ms, stroke-width 160ms; }
.net .node { cursor: default; }
.net .node circle { fill: var(--bg); stroke: var(--c); stroke-width: 1.6; transition: r 160ms, fill 160ms; }
.net .node text { fill: var(--ink); font-size: 12.5px; font-family: var(--font); pointer-events: none; }
.net .hub circle { fill: var(--c); stroke: none; }
.net .hub text { font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em; fill: var(--c); }
.net.is-focused .node:not(.is-active) { opacity: 0.28; }
.net.is-focused line:not(.is-active) { opacity: 0.15; }
.net line.is-active { stroke: var(--ink); stroke-width: 2; }
.net .node.is-active circle { fill: var(--c); }
.net .node.is-focus circle { r: 9; }
.net .node { animation: float 6s ease-in-out infinite; animation-delay: var(--d, 0s); }
@keyframes float { 50% { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .net .node { animation: none; } }
.languages { display: flex; gap: 24px; flex-wrap: wrap; margin: 20px 0 0; padding: 0; list-style: none; }
.languages strong { display: block; }
.languages span { color: var(--ink-dim); font-size: 14px; }

/* ---------- contact ---------- */
.contact .panel { text-align: center; }
.contact__email { display: inline-flex; align-items: center; min-height: 44px; padding: 4px 8px; font-size: clamp(20px, 3vw, 30px); font-weight: 500; margin: 6px 0 10px; word-break: break-all; }
.contact__meta { color: var(--ink-dim); margin: 0; }
.contact__actions { margin-top: 24px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.contact__actions--left { justify-content: flex-start; }
.btn {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 12px;
  border: 1px solid var(--accent); background: transparent; color: var(--ink); cursor: pointer; text-decoration: none;
  transition: background 160ms, color 160ms;
}
.btn:hover, .btn:focus-visible { background: var(--accent); color: #07090f; outline: none; }
.btn--primary { background: var(--accent); color: #07090f; }
.btn--primary:hover { filter: brightness(1.1); }

/* ---------- toasts ---------- */
.toasts { position: fixed; left: var(--gutter); bottom: 24px; z-index: 30; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast {
  display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: center;
  width: min(360px, calc(100vw - 2 * var(--gutter)));
  padding: 12px 14px; border-radius: 14px;
  background: rgba(10, 14, 24, 0.9); border: 1px solid rgba(253, 230, 138, 0.4);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 24px rgba(253, 230, 138, 0.15);
  animation: toast-in 500ms var(--ease) both;
}
.toast.is-leaving { animation: toast-out 400ms var(--ease) both; }
.toast__icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(160deg, #fde68a, #f59e0b); color: #1a1200; font-size: 20px; }
.toast__icon img { width: 30px; height: 30px; object-fit: contain; }
.toast__kicker { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: #fde68a; }
.toast__title { font-weight: 500; line-height: 1.25; }
.toast__detail { font-size: 13px; color: var(--ink-dim); }
@keyframes toast-in { from { opacity: 0; transform: translateX(-24px) scale(0.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(12px); } }

.fallback-note { position: fixed; right: var(--gutter); bottom: 20px; z-index: 20; font-family: var(--mono); font-size: 11.5px; color: var(--ink-faint); }

/* ---------- mobile ---------- */
@media (max-width: 720px) {
  .hero .panel { grid-template-columns: 1fr; text-align: center; gap: 8px; padding-top: 24px; }
  .hero__portrait { order: -1; width: min(60vw, 260px); justify-self: center; }
  .hero__facts { justify-content: center; }
  .hero__tagline { margin-left: auto; margin-right: auto; }
  body { font-size: 16px; }
  .section { padding: 84px var(--gutter) 48px; min-height: 0; }
  .hero.section { min-height: 100svh; }
  .section--left, .section--right { justify-content: center; }
  .panel { width: 100%; }
  .shelf { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .toasts { bottom: 16px; }
  .fallback-note { display: none; }
}

/* ---------- skills as a list: print and small screens ---------- */
.skills-list { display: none; margin: 12px 0 0; }
.skills-list dt { font-family: var(--mono); font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); margin-top: 12px; }
.skills-list dd { margin: 2px 0 0; color: var(--ink); }
.skills-intro--touch { display: none; }
@media (max-width: 720px) { .net { display: none; } .skills-list { display: block; } .skills-intro--touch { display: block; } .skills-intro--hover { display: none; } }
