/* Home page: a background project fills the screen; identity on the left, five big section links on the right,
   both centered vertically over a dimmed band so bright backgrounds don't wash out the text. */
:root {
  --bg: #07080d;
  --text: #e6e8ef;
  --soft: #c9ccd8;
  --muted: #8a8fa3;
  --line: rgba(255, 255, 255, 0.14);
  --chip: rgba(14, 15, 22, 0.78);
  --dim: 7, 8, 13; /* rgb of the scrim */
  --glyph-shadow:
    0 0 2px rgba(var(--dim), 0.9),
    0 1px 4px rgba(var(--dim), 0.9),
    0 0 16px rgba(var(--dim), 0.85),
    0 0 36px rgba(var(--dim), 0.6);

  /* one color per section */
  --k-projects: #8b99ff;
  --k-blog: #5fcfa6;
  --k-videos: #f2a65a;
  --k-music: #e8cf5c;
  --k-art: #ee90ba;

  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --body: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(20px, 5vw, 80px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--k-projects); outline-offset: 4px; border-radius: 3px; }

/* ---------- background ---------- */
#background {
  position: fixed; inset: 0; width: 100%; height: 100%;
  border: 0; display: block; z-index: 0;
  opacity: 0; transition: opacity 0.6s ease;
  filter: brightness(0.85); /* takes the edge off near-white backgrounds like the sorting visualizer */
}
#background.ready { opacity: 1; }

/* An even dim with no edges to it, a touch darker toward the middle. Legibility over bright spots
   comes from the text's own shadow (see --glyph-shadow), so the darkening follows the letters. */
.scrim {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 80% at 50% 50%, rgba(var(--dim), 0.22), rgba(var(--dim), 0) 100%),
    rgba(var(--dim), 0.42);
}

/* Everything above the background lets the pointer through to it, except the things you can click. */
main, .credit { pointer-events: none; }
main a, .credit a, .credit button { pointer-events: auto; }

/* ---------- credit chip ---------- */
.credit {
  position: fixed; z-index: 3;
  top: calc(16px + env(safe-area-inset-top, 0px));
  right: calc(16px + env(safe-area-inset-right, 0px));
  display: flex; align-items: center; gap: 10px;
  font-size: 0.85rem;
  background: var(--chip);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  padding: 5px 5px 5px 14px;
  max-width: calc(100vw - 32px);
}
.credit[hidden] { display: none; }
.credit-label { color: var(--muted); }
.credit a { font-weight: 600; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.credit a:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.credit button {
  font: inherit; color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 0; border-radius: 99px; padding: 5px 12px; cursor: pointer;
  touch-action: manipulation;
}
.credit button:hover { background: rgba(255, 255, 255, 0.14); }

/* ---------- main ---------- */
main {
  position: relative; z-index: 2;
  min-height: 100vh; min-height: 100dvh;
  max-width: 1600px; margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(32px, 6vw, 112px);
  align-content: center; align-items: center;
  padding-block: calc(80px + env(safe-area-inset-top, 0px)) calc(56px + env(safe-area-inset-bottom, 0px));
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
  text-shadow: var(--glyph-shadow);
}

.me {
  display: block;
  width: clamp(110px, 13vw, 200px); height: auto; aspect-ratio: 1;
  object-fit: cover; object-position: 50% 30%;
  border-radius: clamp(12px, 1.4vw, 20px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  margin-bottom: clamp(18px, 2.2vw, 32px);
}
h1 {
  font-family: var(--display); font-weight: 800;
  /* The name is ~4.7em wide, so it fills its column exactly at 8.4vw. Stop growing where main stops
     (1600px, i.e. 8.4vw = 134px); past that the column is fixed and a bigger name would run into the links. */
  font-size: clamp(3.4rem, 8.4vw, 134px);
  line-height: 0.9; letter-spacing: -0.035em;
  margin: 0;
}

/* ---------- socials: small, muted, under the name ---------- */
.socials {
  list-style: none; margin: clamp(18px, 2vw, 28px) 0 0; padding: 0;
  display: flex; gap: clamp(14px, 1.4vw, 20px);
}
.socials a {
  display: block; color: var(--muted);
  padding: 4px; margin: -4px; /* bigger tap target without moving the icon */
  transition: color 0.15s ease;
}
.socials a:hover, .socials a:focus-visible { color: var(--text); }
.socials svg {
  display: block; width: clamp(20px, 1.6vw, 26px); height: auto;
  fill: currentColor;
  filter: drop-shadow(0 1px 6px rgba(var(--dim), 0.9));
}

/* ---------- sections ---------- */
.sections { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.sections li { border-bottom: 1px solid var(--line); }
.sections a {
  display: block;
  padding: clamp(14px, 2.3vh, 26px) 0;
  font-family: var(--display); font-weight: 700;
  font-size: clamp(1.7rem, 3.4vw, 3.3rem);
  line-height: 1.05; letter-spacing: -0.02em;
  color: var(--kind);
  text-decoration: none;
  transition: transform 0.18s ease;
}
.sections a:hover, .sections a:focus-visible { transform: translateX(0.25em); }
.kind-projects { --kind: var(--k-projects); }
.kind-blog { --kind: var(--k-blog); }
.kind-videos { --kind: var(--k-videos); }
.kind-music { --kind: var(--k-music); }
.kind-art { --kind: var(--k-art); }

/* ---------- narrow ---------- */
@media (max-width: 820px) {
  main { grid-template-columns: 1fr; gap: 36px; align-content: center; }
  h1 { font-size: clamp(3rem, 15vw, 5rem); }
  .me { width: clamp(96px, 26vw, 140px); }
  .sections a { font-size: clamp(1.6rem, 7.6vw, 2.4rem); padding: 14px 0; }
  .credit-label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  #background, .sections a { transition: none; }
}
