/* UniDevelopers – home. Direction: the name as a monument. One family, one accent, flat colour. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../assets/fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --surface: #f4f4f2;
  --ink: #1f2b4d;
  --muted: #5d657d;
  --accent: #f7941d;
  --accent-ink: #1f2b4d;
  --field-1: #05070a;
  --field-1-ink: #ffffff;
  --field-1-muted: #a4abbf;
  --field-2: #e3e1dc;
  --field-2-alt: #d8d5ce;
  --field-2-ink: #1f2b4d;
  --field-2-muted: #4a5269;

  /* five steps: monument (fitted by script), big, lead, body, small */
  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.5rem, 1.1rem + 1.2vw, 2.25rem);
  --step-big: clamp(2.75rem, 1.4rem + 4.6vw, 5.5rem);

  --pad: clamp(16px, 1.6vw, 28px);
  --gap-section: clamp(96px, 13vw, 200px);
  --player-h: 52px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

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

html {
  scroll-behavior: auto;
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--ink) var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: var(--step-body);
  line-height: 1.5;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

h1, h2, p, ul { margin: 0; padding: 0; }
ul { list-style: none; }
img, svg { display: block; max-width: 100%; }

a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 0.08em; }
::selection { background: var(--ink); color: #fff; }

:focus-visible { outline: 3px solid currentColor; outline-offset: 4px; }

.sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; /* taste-skill-ignore: visually hidden text, not a rule */
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: fixed; left: var(--pad); top: -80px; z-index: 20;
  background: var(--ink); color: #fff; padding: 12px 18px; text-decoration: none;
}
.skip:focus { top: var(--pad); }

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  background: var(--ink); color: #fff;
  padding: 14px 24px;
  font-size: var(--step-body); font-weight: 500;
  text-decoration: none;
  border-radius: 0;
  transition: transform 160ms var(--ease-out), background-color 160ms ease;
}
.btn:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: #121a33; }
}

/* ---------- the page sits above the footer, which it uncovers ---------- */
.page { position: relative; z-index: 1; background: var(--bg); overflow-x: clip; }

/* ---------- monument ---------- */
.wordmark {
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 0.84;
  white-space: nowrap;
  transform-origin: 50% 60%;
  will-change: transform;
}
.wm { display: block; }
.wm-line { display: block; width: max-content; overflow: hidden; padding: 0.02em 0.07em 0.2em 0; margin-bottom: -0.2em; }
.ch { display: inline-block; }

/* ---------- hero ---------- */
.hero {
  min-height: 100svh;
  padding: var(--pad);
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto 1fr auto;
  align-items: start;
}
.hero-top { grid-column: 1; grid-row: 1; display: grid; gap: 16px; justify-items: start; }
.hero-sentence { font-size: 18px; line-height: 1.3; max-width: 36ch; }
.hero-nav { grid-column: 2; grid-row: 1; justify-self: end; display: flex; gap: 22px; font-size: 15px; }
.hero-nav a, .hero-foot-r a { text-decoration: none; }
.hero .wordmark { grid-column: 1 / -1; grid-row: 2; align-self: center; width: 100%; }
.hero-foot-l { grid-column: 1; grid-row: 3; align-self: end; font-size: 16px; padding-bottom: 8px; }
.hero-foot-r { grid-column: 2; grid-row: 3; align-self: end; justify-self: end; display: flex; gap: 22px; font-size: 15px; padding-bottom: 8px; }
@media (hover: hover) and (pointer: fine) {
  .hero-nav a:hover, .hero-foot-r a:hover { text-decoration: underline; }
}

.hero-peek { display: none; }

/* letters rise out of their line */
.js .ch { transform: translateY(104%); }
.js.ready .ch {
  transform: none;
  transition: transform 900ms var(--ease-out);
  transition-delay: calc(var(--i, 0) * 45ms + 120ms);
}

/* ---------- section heading ---------- */
.sec-h { font-size: var(--step-lead); font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; }

/* ---------- scroll entrance ---------- */
.js.ready [data-reveal] { opacity: 0; transform: translateY(24px); }
.js.ready [data-reveal].in {
  opacity: 1; transform: none;
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
  transition-delay: calc(var(--d, 0) * 70ms);
}

/* ---------- work: names are the index ---------- */
.work {
  background: var(--field-1); color: var(--field-1-ink);
  padding: var(--gap-section) var(--pad);
  --rows: 4;
}
.work .sec-h { margin-bottom: 48px; }

.work-list {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(var(--rows), auto);
  column-gap: var(--pad);
}
.proj { display: contents; }

.proj-name {
  grid-column: 1 / 9;
  display: flex; align-items: baseline; justify-content: space-between; gap: 24px;
  padding-top: 10px;
  text-decoration: none;
  color: var(--field-1-muted);
  transition: color 200ms ease;
}
.proj-name .name {
  font-size: var(--step-big); font-weight: 600; letter-spacing: -0.04em; line-height: 1;
}
.proj-name .kind { font-size: var(--step-small); white-space: nowrap; }
.proj-desc {
  grid-column: 1 / 8;
  max-width: 52ch;
  padding: 8px 0 56px;
  color: var(--field-1-muted);
  transition: color 200ms ease;
}
.proj[data-active="true"] .proj-name,
.proj[data-active="true"] .proj-desc { color: var(--field-1-ink); }
.proj-name:focus-visible { outline-color: #fff; }

.ui {
  grid-column: 9 / 13;
  grid-row: 1 / -1;
  align-self: start;
  position: sticky; top: 15vh;
  width: min(100%, 26vw);
  min-width: 300px;
  justify-self: end;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  container-type: inline-size;
  transition: opacity 200ms ease, visibility 0s linear 0s;
}
.proj[data-active="false"] .ui { opacity: 0; visibility: hidden; transition: opacity 200ms ease, visibility 0s linear 200ms; }

/* ---------- product interface fragments (drawn in code, in the products' own colours) ---------- */
.ui { font-size: 4.4cqw; line-height: 1.25; }
.ui p, .ui li { margin: 0; }

.ui-ramp { background: #ffe14d; color: #000; border: 0.9cqw solid #000; font-weight: 700; display: flex; flex-direction: column; }
.ui-ramp .ui-bar { background: #000; color: #ffe14d; display: flex; justify-content: space-between; align-items: center; padding: 3.4cqw 4.4cqw; }
.ui-ramp .ui-brand { font-size: 6cqw; font-weight: 800; letter-spacing: -0.02em; }
.ui-ramp .ui-chip { border: 0.7cqw solid #ffe14d; padding: 0.6cqw 2.4cqw; font-size: 3.6cqw; }
.ui-ramp .ui-body { padding: 4.4cqw; display: grid; gap: 1.6cqw; align-content: start; flex: 1; }
.ui-ramp .ui-label { font-size: 3.8cqw; font-weight: 600; }
.ui-ramp .ui-big { font-size: 21cqw; font-weight: 800; letter-spacing: -0.05em; line-height: 0.95; }
.ui-ramp .ui-track { height: 3.4cqw; background: #000; margin: 1.6cqw 0 2cqw; }
.ui-ramp .ui-fill { height: 100%; background: #fff; transform-origin: left; }
.ui-ramp .ui-fill-63 { width: 63%; }
.ui-ramp .ui-lessons { display: grid; gap: 1.6cqw; font-size: 4cqw; font-weight: 600; }
.ui-ramp .ui-lessons li { display: flex; align-items: center; gap: 2.4cqw; }
.ui-ramp .ui-lessons svg { width: 4.4cqw; height: 4.4cqw; flex: none; }
.ui-ramp .ui-lessons b { margin-left: auto; font-weight: 800; }
.ui-ramp .ui-dot { width: 4.4cqw; height: 4.4cqw; flex: none; border: 0.8cqw solid #000; border-radius: 50%; }
.ui-ramp .now .ui-dot { background: #000; }
.ui-ramp .queue { opacity: 0.7; }
.ui-ramp .ui-btn { margin-top: 2.6cqw; background: #000; color: #ffe14d; padding: 2.8cqw 4.4cqw; font-size: 4.4cqw; font-weight: 800; justify-self: start; }

.ui-wis { background: #f6eef3; color: #3d2236; display: flex; flex-direction: column; font-weight: 500; }
.ui-wis .ui-bar { background: #8b4b76; color: #fff; display: flex; justify-content: space-between; align-items: center; padding: 3.4cqw 4.4cqw; }
.ui-wis .ui-brand { font-size: 6cqw; font-weight: 700; letter-spacing: -0.02em; }
.ui-wis .ui-chip { background: #fff; color: #8b4b76; padding: 0.8cqw 2.6cqw; font-size: 3.6cqw; font-weight: 600; }
.ui-wis .ui-body { padding: 4.4cqw; display: grid; gap: 3cqw; align-content: start; }
.ui-wis .ui-models { display: flex; flex-wrap: wrap; gap: 1.8cqw; }
.ui-wis .ui-models li { padding: 1.8cqw 3cqw; background: #fff; border: 0.5cqw solid #d9bccf; font-size: 3.6cqw; font-weight: 600; }
.ui-wis .ui-models .on { background: #8b4b76; color: #fff; border-color: #8b4b76; }
.ui-wis .ui-q { background: #fff; padding: 3.4cqw; font-size: 4.2cqw; justify-self: end; max-width: 86%; }
.ui-wis .ui-a-label { font-size: 3.4cqw; color: #8b4b76; font-weight: 700; }
.ui-wis .ui-a { font-size: 12cqw; font-weight: 700; letter-spacing: -0.04em; line-height: 1; margin-top: -1.6cqw; }
.ui-wis .ui-hint { font-size: 3.8cqw; color: #6a4a60; }

/* ---------- about ---------- */
.about { padding: var(--gap-section) var(--pad); display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--pad); row-gap: 56px; }
.about .sec-h { grid-column: 1 / 3; }
.statement { grid-column: 3 / 13; font-size: var(--step-lead); line-height: 1.2; letter-spacing: -0.015em; max-width: 34em; }
.facts { grid-column: 3 / 13; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--pad); margin-top: 24px; }
.facts li { background: var(--surface); padding: 24px; display: grid; gap: 8px; align-content: start; min-height: 168px; }
.facts strong { font-weight: 600; font-size: var(--step-body); }
.facts span { color: var(--muted); }

/* ---------- contact: address in display rows ---------- */
.contact { background: var(--field-2); color: var(--field-2-ink); padding: var(--gap-section) 0 0; }
.contact .sec-h { padding: 0 var(--pad); margin-bottom: 48px; }
.contact .row {
  font-size: var(--step-big); font-weight: 500; letter-spacing: -0.035em; line-height: 1;
  padding: clamp(28px, 4vw, 56px) var(--pad) clamp(16px, 2vw, 28px);
  min-height: clamp(84px, 10.4vw, 150px);
  display: flex; align-items: flex-end;
}
.contact .row:nth-child(even) { background: var(--field-2-alt); }
.contact .row a { text-decoration: none; }
.contact .row-cta { background: var(--accent); color: var(--accent-ink); padding-block: clamp(24px, 3vw, 40px); align-items: center; min-height: 0; }
.contact .row-cta:nth-child(even) { background: var(--accent); }
.row-link { display: flex; align-items: center; gap: 0.35em; width: 100%; }
.arrow { margin-left: 0.2em; width: 0.9em; height: 0.9em; background: var(--ink); color: #fff; display: grid; place-items: center; transition: transform 200ms var(--ease-out); }
.arrow svg { width: 52%; height: 52%; }
@media (hover: hover) and (pointer: fine) {
  .contact .row a:hover { text-decoration: underline; text-decoration-thickness: 0.05em; text-underline-offset: 0.12em; }
  .row-link:hover .arrow { transform: translateX(8px); }
}
.row-link:active .arrow { transform: scale(0.94); }

/* ---------- footer: the name returns, inverted ---------- */
.foot {
  position: sticky; bottom: 0; z-index: 0;
  min-height: 100svh;
  overflow-x: clip;
  background: var(--ink); color: #fff;
  padding: 40px var(--pad) calc(var(--player-h) + 16px);
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr auto;
}
.foot-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--pad); font-size: 15px; }
.foot-cols a { overflow-wrap: anywhere; }
.foot-h { color: #cfd4e4; margin-bottom: 8px; }
.foot-cols li { padding: 2px 0; }
.foot-cols a { text-decoration: none; }
.foot-mark { grid-row: 3; }
.wordmark-foot { width: 100%; transform-origin: 50% 100%; }
.legal { font-size: var(--step-small); margin-top: 20px; color: #cfd4e4; }
@media (hover: hover) and (pointer: fine) {
  .foot-cols a:hover { text-decoration: underline; }
}
.foot :focus-visible { outline-color: #fff; }

/* ---------- product dialogs ---------- */
.ui, .hero-peek { cursor: pointer; }
.pdialog {
  border: 0; padding: 0; margin: auto;
  width: min(640px, calc(100vw - 2 * var(--pad)));
  max-height: calc(100svh - 2 * var(--pad));
  background: var(--bg); color: var(--ink);
  opacity: 0; transform: translateY(16px);
  transition: opacity 240ms var(--ease-out), transform 240ms var(--ease-out), overlay 240ms allow-discrete, display 240ms allow-discrete;
}
.pdialog[open] { opacity: 1; transform: none; }
@starting-style { .pdialog[open] { opacity: 0; transform: translateY(16px); } }
.pdialog::backdrop {
  background: rgba(5, 7, 10, 0.72); opacity: 0;
  transition: opacity 240ms ease, overlay 240ms allow-discrete, display 240ms allow-discrete;
}
.pdialog[open]::backdrop { opacity: 1; }
@starting-style { .pdialog[open]::backdrop { opacity: 0; } }

.pd-body { padding: clamp(24px, 4vw, 44px); display: grid; gap: 16px; }
.pd-body h3 { margin: 0; font-size: var(--step-big); font-weight: 600; letter-spacing: -0.04em; line-height: 1; padding-right: 5.5rem; }
.pd-body p { margin: 0; max-width: 52ch; }
.pd-kind { font-size: var(--step-small); color: var(--muted); }
.pd-note { font-weight: 500; }
.pd-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: 8px; }
.pd-link { font-size: var(--step-body); }
.pd-close {
  position: absolute; top: 12px; right: 12px;
  background: var(--ink); color: #fff; border: 0; border-radius: 0;
  font: inherit; font-size: var(--step-small); font-weight: 500;
  padding: 10px 16px; cursor: pointer;
  transition: transform 160ms var(--ease-out);
}
.pd-close:active { transform: scale(0.97); }
.pdialog :focus-visible { outline-color: var(--ink); }

/* ---------- the player: scroll as lesson progress ---------- */
.player {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  height: var(--player-h);
  background: var(--ink); color: #fff;
  display: flex; align-items: center; gap: 20px;
  padding: 0 var(--pad);
  font-size: var(--step-small);
}
.js .player { transform: translateY(100%); transition: transform 500ms var(--ease-out); }
.js .player.on { transform: none; }

.play {
  display: inline-flex; align-items: center; gap: 10px;
  height: 36px; padding: 0 14px 0 10px;
  background: transparent; color: inherit; font: inherit; font-weight: 500;
  border: 0; border-radius: 0; cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 160ms ease, color 160ms ease;
}
.play svg { width: 18px; height: 18px; }
.play .i-pause { display: none; }
.play[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.play[aria-pressed="true"] .i-play { display: none; }
.play[aria-pressed="true"] .i-pause { display: block; }
.play:active { transform: scale(0.97); }
.player :focus-visible { outline-color: #fff; }
.play[aria-pressed="true"]:focus-visible { outline-color: #fff; }
@media (hover: hover) and (pointer: fine) {
  .play:hover { background: rgba(255, 255, 255, 0.14); }
  .play[aria-pressed="true"]:hover { background: var(--accent); filter: brightness(0.96); }
}

.chapter { margin-left: auto; font-weight: 500; }
.pct { font-variant-numeric: tabular-nums; min-width: 4ch; text-align: right; font-weight: 500; }
.bar { position: absolute; left: 0; right: 0; top: 0; height: 4px; background: rgba(255, 255, 255, 0.2); }
.fill { height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; will-change: transform; }

/* ---------- phone: its own composition ---------- */
@media (max-width: 899px) {
  .hero {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto 1fr auto;
    padding-bottom: calc(var(--player-h) + 16px);
  }
  .hero-nav { grid-column: 1; grid-row: 1; justify-self: end; }
  .hero-top { grid-column: 1; grid-row: 3; margin-top: 28px; }
  .hero .wordmark { grid-row: 2; align-self: start; margin-top: 14svh; }
  .hero-peek {
    display: block; grid-column: 1; grid-row: 4;
    position: relative; overflow: hidden; min-height: 200px; margin-top: 32px;
  }
  .hero-peek .ui {
    position: static; width: 100%; min-width: 0;
    opacity: 1; visibility: visible;
  }
  .hero-peek .ui { aspect-ratio: auto; height: auto; }
  .hero-sentence { font-size: 18px; }
  .hero .btn { width: 100%; text-align: center; }
  .hero-foot-l { grid-column: 1; grid-row: 5; }
  .hero-foot-r { display: none; }

  .work-list { display: block; }
  .proj { display: block; margin-bottom: 40px; }
  .proj .ui {
    position: static; width: 100%; min-width: 0; aspect-ratio: 4 / 3; margin-bottom: 16px;
    opacity: 1 !important; visibility: visible !important;
  }
  /* a 16:10 crop of the interface keeps only its top half */
  .proj .ui-lessons, .proj .ui-btn, .proj .ui-hint, .proj .ui-a-label { display: none; }
  .proj .ui-wis .ui-body { gap: 2.4cqw; padding-top: 3cqw; }
  .proj .ui-wis .ui-q { padding: 2.4cqw 3cqw; }
  .proj .ui-wis .ui-a { font-size: 10cqw; margin-top: 0; }
  .proj .ui-ramp .ui-big { font-size: 17cqw; }
  .proj-name { display: block; padding-top: 0; color: var(--field-1-ink) !important; }
  .proj-name .name { display: block; font-size: 9.5vw; }
  .proj-name .kind { display: block; margin-top: 4px; }
  .proj-desc { padding: 8px 0 0; color: var(--field-1-ink) !important; }

  .about { display: block; }
  .about .sec-h { margin-bottom: 24px; }
  .statement { margin-bottom: 32px; }
  .facts { grid-template-columns: 1fr; margin-top: 0; }
  .facts li { min-height: 0; }

  .contact .row { font-size: 7vw; min-height: 84px; }

  .foot-cols { grid-template-columns: 1fr 1fr; row-gap: 32px; }

  .play-label { display: none; }
  .chapter { margin-left: auto; }
}

/* ---------- reduced motion: keep content, drop the travel ---------- */
@media (prefers-reduced-motion: reduce) {
  .js .ch { transform: none; transition: none; }
  .js.ready [data-reveal] { transform: none; }
  .js.ready [data-reveal].in { transition: opacity 300ms ease; transition-delay: 0s; }
  .wordmark { will-change: auto; }
  .player { transition: none !important; }
  .arrow { transition: none; }
  .pdialog { transform: none; transition: opacity 160ms ease; }
}

/* script never loaded: show everything */
.reveal-fallback [data-reveal] { opacity: 1 !important; transform: none !important; }
.reveal-fallback .ch { transform: none !important; }
