/* riday.space — sizes are taken from the 1920px Figma frame and scale with the viewport */
:root {
  --bg: #000;
  --tile: #131313;
  --line: #262626;
  --text: #fff;
  --soft: rgba(255, 255, 255, 0.87);
  --mute: rgba(255, 255, 255, 0.55);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --nav-h: clamp(60px, 5.78vw, 111px);
  --nav-pad: clamp(16px, 1.67vw, 32px);
  --link: clamp(15px, 1.25vw, 24px);
  --logo: clamp(22px, 2.08vw, 40px);
  --icon: clamp(20px, 1.63vw, 31px);
  --wrap: 1400px;
  --radius: 12px; /* one corner radius for every image and video */
  --gutter: clamp(1.25rem, 4vw, 4rem);
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  color-scheme: dark;
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

a { color: inherit; }
img, video, iframe { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.skip {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  z-index: 100;
  background: #fff;
  color: #000;
  padding: 0.5rem 1rem;
}
.skip:focus { left: 0.5rem; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: var(--gutter); }

/* ---------- navbar (Figma: 111px black bar, white glow underneath) ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 40;
  height: calc(var(--nav-h) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) var(--nav-pad) 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  background: #000;
  box-shadow: 0 4px 59.2px rgba(255, 255, 255, 0.25);
}

.nav-links { display: flex; gap: clamp(14px, 1.77vw, 34px); }
.nav-links a {
  font-weight: 600;
  font-size: var(--link);
  color: var(--soft);
  text-decoration: none;
  transition: color 0.25s, text-shadow 0.25s;
}
.nav-links a:hover { color: #fff; }
.nav-links a[aria-current="true"] { color: #fff; text-shadow: 0 0 26.6px #fff; }

.nav-logo {
  justify-self: center;
  font-weight: 900;
  font-size: var(--logo);
  line-height: 1;
  letter-spacing: -0.01em;
  text-decoration: none;
  text-shadow: 0 0 7.5px #fff;
  white-space: nowrap;
}

.nav-social { justify-self: end; display: flex; gap: clamp(14px, 1.3vw, 25px); }
.nav-social a, .contact-social a { display: block; color: #fff; }
.nav-social svg { width: var(--icon); height: var(--icon); display: block; }
.nav-social a:hover svg, .contact-social a:hover svg { filter: drop-shadow(0 0 6px #fff); }

@media (max-width: 700px) {
  .nav { grid-template-columns: auto 1fr; }
  .nav-logo { order: -1; justify-self: start; }
  .nav-links { justify-self: end; }
  .nav-social { display: none; }
}

/* ---------- stage: intro, desk scene and collage share one coordinate space ---------- */
.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  overflow: clip;
}

.intro {
  position: relative;
  z-index: 3;
  margin: 0 auto;
  padding-top: calc(var(--nav-h) + clamp(28px, 3.02vw, 58px));
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 1.4vw, 27px);
  width: min(100% - 2 * var(--gutter), 734px);
  width: min(calc(100% - 2 * var(--gutter)), max(38.2vw, 330px));
}

.intro-photo {
  flex: 0 0 auto;
  width: clamp(84px, 10.57vw, 203px);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  background: #1c1c1c;
  box-shadow: 0 4.46px 4.46px rgba(0, 0, 0, 0.25);
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: clamp(28px, 3.4vw, 64px);
  color: rgba(255, 255, 255, 0.25);
}
.intro-photo img { width: 100%; height: 100%; object-fit: cover; }

.intro-text {
  margin: 0;
  font-weight: 500;
  font-size: clamp(15px, 1.25vw, 24px);
  line-height: 1.21;
  max-width: 26.25em;
}

.scene {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
}
.scene.is-in { opacity: 1; }
.scene-art, .scene-art img, .scene-art svg { width: 100%; height: 100%; display: block; }
.scene.is-placeholder.is-in .scene-art { animation: scene-in 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes scene-in {
  from { opacity: 0; transform: translateY(4%) scale(0.96); }
  to { opacity: 1; transform: none; }
}
.scene-screen {
  position: absolute;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.scene-screen.is-in { opacity: 1; }
.scene-screen img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- collage ---------- */
.collage { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; z-index: 2; pointer-events: none; }

.tile {
  position: absolute;
  pointer-events: auto;
  will-change: transform;
}
.tile:hover, .tile:focus-within { z-index: 5; }

.tile-pop { width: 100%; height: 100%; opacity: 0; }
.tile.is-in .tile-pop { opacity: 1; animation: pop 0.75s cubic-bezier(0.34, 1.5, 0.64, 1) both; animation-delay: var(--delay, 0ms); }
.tile.is-static .tile-pop { opacity: 1; animation: none; }
@keyframes pop {
  from { opacity: 0; transform: scale(0.55); }
  40% { opacity: 1; }
  to { opacity: 1; transform: none; }
}

.tile-a {
  position: relative;
  display: block;
  border-radius: var(--radius);
  width: 100%;
  height: 100%;
  text-decoration: none;
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.tile-a:hover, .tile-a:focus-visible { transform: scale(var(--hover, 1.06)); }
.tile-a:focus-visible { outline-offset: 6px; }

/* Figma: a 20px-blurred copy of the image sits behind it as a halo */
.tile-glow {
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  overflow: hidden;
  opacity: 0;
  filter: blur(var(--blur, 20px));
  transition: opacity 0.45s ease;
  pointer-events: none;
}
.tile-glow img { width: 100%; height: 100%; object-fit: cover; }
.tile-glow.is-blank { background: rgba(255, 255, 255, 0.22); }
.tile-a:hover .tile-glow, .tile-a:focus-visible .tile-glow { opacity: 1; }

.tile-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--tile);
}
.tile-media img { width: 100%; height: 100%; object-fit: cover; }
.tile-label {
  position: absolute;
  left: 0.75em;
  right: 0.75em;
  bottom: 0.6em;
  font-size: clamp(10px, var(--label, 13px), 15px);
  font-weight: 500;
  line-height: 1.25;
  color: rgba(255, 255, 255, 0.28);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ---------- about ---------- */
.glow-title {
  margin: 0;
  font-weight: 900;
  font-size: clamp(2.5rem, 6vw, 5.5rem);
  line-height: 1;
  letter-spacing: -0.03em;
  text-shadow: 0 0 18px rgba(255, 255, 255, 0.55);
}
.sub-title {
  margin: clamp(3rem, 7vw, 6rem) 0 0;
  font-weight: 900;
  font-size: clamp(1.6rem, 3vw, 2.5rem);
  letter-spacing: -0.02em;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.45);
}

.about { padding: clamp(5rem, 10vw, 9rem) 0 clamp(3rem, 6vw, 5rem); }
.about-lead {
  margin: 1.75rem 0 0;
  max-width: 34em;
  font-weight: 500;
  font-size: clamp(1.15rem, 1.8vw, 1.6rem);
  line-height: 1.35;
  color: var(--soft);
}

.roles { list-style: none; margin: 2.5rem 0 0; padding: 0; }
.roles li {
  display: grid;
  gap: 0.1rem 2rem;
  padding: 0.95rem 0;
  border-top: 1px solid var(--line);
}
.roles li:last-child { border-bottom: 1px solid var(--line); }
.roles strong { font-weight: 600; }
.roles span { color: var(--mute); }
@media (min-width: 800px) {
  .roles li { grid-template-columns: 1.1fr 1.1fr 1fr; align-items: baseline; }
  .roles li span:last-child { text-align: right; }
}

.ops-intro { margin: 1rem 0 2rem; max-width: 40rem; color: var(--mute); }
.op {
  display: grid;
  gap: 0.75rem 3rem;
  padding: 1.75rem 0;
  border-top: 1px solid var(--line);
}
.op:last-child { border-bottom: 1px solid var(--line); }
.op h4 { margin: 0; font-weight: 600; font-size: 1.35rem; }
.op-role { margin: 0.3rem 0 0; color: var(--soft); }
.op-meta { margin: 0.1rem 0 0; color: var(--mute); font-size: 0.95rem; }
.op ul { margin: 0; padding-left: 1.1rem; max-width: 40rem; color: var(--soft); }
.op li { margin-bottom: 0.5rem; }
.op li::marker { color: var(--mute); }
@media (min-width: 800px) { .op { grid-template-columns: 5fr 7fr; } }

/* ---------- contact ---------- */
.contact { padding: clamp(4rem, 9vw, 8rem) 0 clamp(4rem, 8vw, 6rem); }
.contact-mail {
  display: inline-block;
  margin-top: 1.5rem;
  font-weight: 900;
  font-size: clamp(1.5rem, 5.4vw, 4.5rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: text-shadow 0.3s;
}
.contact-mail:hover { text-shadow: 0 0 20px #fff; }
.contact-social { display: flex; gap: 1.25rem; margin-top: 2rem; }
.contact-social svg { width: 28px; height: 28px; }
.contact-meta { margin: 1.5rem 0 0; color: var(--mute); }

.foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem var(--gutter) calc(1.5rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  color: var(--mute);
  font-size: 0.9rem;
}

/* ---------- project viewer ---------- */
.viewer {
  width: min(1100px, 100%);
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  background: #000;
  color: #fff;
  box-shadow: 0 0 60px rgba(255, 255, 255, 0.12);
}
.viewer[open] { animation: slide 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); }
.viewer::backdrop { background: rgba(0, 0, 0, 0.75); }
@keyframes slide { from { transform: translateX(3rem); opacity: 0; } to { transform: none; opacity: 1; } }

.viewer-inner { padding: clamp(1.25rem, 4vw, 3rem); }
.viewer-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; font-weight: 900; text-shadow: 0 0 7.5px #fff; }
.viewer-bar button, .viewer-nav a {
  font: 600 0.95rem var(--font);
  color: #fff;
  background: none;
  border: 1px solid #333;
  padding: 0.5rem 1.1rem;
  cursor: pointer;
  text-decoration: none;
  text-shadow: none;
}
.viewer-bar button:hover, .viewer-nav a:hover { border-color: #fff; box-shadow: 0 0 14px rgba(255, 255, 255, 0.3); }
.viewer h2 { margin: 0; font-weight: 900; font-size: clamp(2rem, 4.5vw, 3.5rem); line-height: 1.02; letter-spacing: -0.03em; max-width: 18ch; }
.viewer-meta { margin: 1rem 0 0; color: var(--mute); }
.viewer-desc { max-width: 40rem; margin-top: 1.5rem; color: var(--soft); }
.viewer-desc p { margin: 0 0 1rem; }
.viewer-media { margin-top: 2.5rem; display: grid; gap: 1.5rem; }
.viewer-media figure { margin: 0; }
.viewer-media img, .viewer-media video { width: 100%; height: auto; border-radius: var(--radius); }
.viewer-media iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--radius); }
.viewer-media figcaption { margin-top: 0.5rem; color: var(--mute); font-size: 0.95rem; }
.viewer-empty { margin-top: 2.5rem; color: var(--mute); }
.viewer-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; flex-wrap: wrap; }

/* ---------- tuning panel (open the site with ?tune) ---------- */
.tune {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 60;
  width: min(320px, calc(100vw - 24px));
  max-height: calc(100vh - var(--nav-h) - 24px);
  overflow: auto;
  padding: 14px 16px 16px;
  background: rgba(14, 14, 14, 0.94);
  border: 1px solid #2a2a2a;
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.08);
  font-size: 13px;
  backdrop-filter: blur(8px);
}
.tune h2 { margin: 0 0 4px; font-size: 14px; font-weight: 900; }
.tune p { margin: 0 0 10px; color: var(--mute); line-height: 1.4; }
.tune label { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; margin: 10px 0 0; color: var(--soft); }
.tune output { font-variant-numeric: tabular-nums; color: #fff; }
.tune input[type="range"] { grid-column: 1 / -1; width: 100%; accent-color: #fff; }
.tune-curve { display: block; width: 100%; height: 90px; margin: 6px 0 2px; border: 1px solid #222; }
.tune-row { display: flex; gap: 8px; margin-top: 14px; }
.tune button {
  flex: 1;
  font: 600 12px var(--font);
  color: #fff;
  background: #1d1d1d;
  border: 1px solid #333;
  padding: 7px 8px;
  cursor: pointer;
}
.tune button:hover { border-color: #fff; }
.tune pre { margin: 10px 0 0; padding: 8px; background: #0a0a0a; border: 1px solid #222; color: var(--soft); font-size: 11.5px; white-space: pre-wrap; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tile.is-in .tile-pop { animation: none; }
  .scene.is-placeholder.is-in .scene-art, .viewer[open] { animation: none; }
  .tile-a, .tile-glow { transition: none; }
}
