@property --drawn { syntax: "<number>"; inherits: false; initial-value: 1; }
@font-face {
  font-family: "Onest";
  src: url("fonts/onest.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --ink: #160c14;
  --cherry: #2f1d2b;
  --wine: #7a2a4d;
  --plum: #5a346b;
  --lilac: #b8a4e1;
  --bone: #efe6ea;
  --quiet: #a8949f;
  --line: rgba(239, 230, 234, 0.12);
  --pad: clamp(1.25rem, 4.5vw, 4.5rem);
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}

* { box-sizing: border-box; }
/* Type and controls grow with the window: about 1.3 times at 1920 wide (his 13-inch screen), plain 16 px on a phone. */
html { font-size: clamp(16px, 11px + 0.5vw, 24px); }
html { background: var(--ink); color: var(--bone); scroll-behavior: smooth; overscroll-behavior-y: none; }
body {
  margin: 0;
  font-family: "Onest", system-ui, sans-serif;
  font-size: clamp(1rem, 0.94rem + 0.25vw, 1.125rem);
  line-height: 1.55;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--lilac); outline-offset: 4px; border-radius: 4px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* Bar */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem var(--pad);
  background: linear-gradient(to bottom, rgba(22, 12, 20, 0.7), rgba(22, 12, 20, 0));
}
.mark { font-weight: 600; font-size: 1.2rem; letter-spacing: -0.03em; text-decoration: none; padding: 0.5rem 0.75rem; margin-left: -0.75rem; }
.bar nav { display: flex; gap: clamp(0.25rem, 1.5vw, 1.25rem); font-size: 0.95rem; margin-right: -0.75rem; }
.bar nav a { text-decoration: none; color: var(--quiet); transition: color 0.2s; padding: 0.6rem 0.75rem; }
.bar nav a:hover { color: var(--bone); }

/* Hero */
.hero {
  position: relative; min-height: 100svh; overflow: hidden;
  display: grid; align-items: end;
  padding: 7rem var(--pad) clamp(3rem, 9vh, 6.5rem);
}
.hero-art { position: absolute; inset: 0; }
.hero-art {
  background:
    radial-gradient(ellipse 55% 60% at 72% 38%, rgba(90, 52, 107, 0.55), transparent 70%),
    radial-gradient(ellipse 60% 55% at 85% 75%, rgba(122, 42, 77, 0.35), transparent 70%),
    linear-gradient(to right, #1b0f19, #2f1d2b 60%, #3a2236);
}
.art { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 0.5s ease; }
.art[data-live] { opacity: 1; }



.hero-words { position: relative; z-index: 1; max-width: 62rem; }
.slogan {
  font-size: clamp(3.4rem, 10.5vw, 10.5rem);
  font-weight: 460;
  line-height: 0.9;
  letter-spacing: -0.055em;
  margin-left: -0.05em;
  text-wrap: balance;
}
.lead {
  max-width: 34rem; margin-top: clamp(1.5rem, 3vw, 2.25rem);
  font-size: clamp(1.1rem, 1rem + 0.45vw, 1.35rem); line-height: 1.45; color: #d9cbd2;
}
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.75rem; margin-top: 2.25rem; }
.button {
  display: inline-block; padding: 0.95rem 1.6rem; border-radius: 999px;
  background: var(--bone); color: var(--ink); font-weight: 520; text-decoration: none;
  transition: transform 0.25s var(--ease), background 0.25s;
}
.button:hover { background: #fff; transform: translateY(-1px); }
.quiet { color: var(--bone); text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 2px; transition: border-color 0.2s; }
.quiet:hover { border-color: var(--bone); }

/* Load: one orchestrated moment — the slogan rises line by line, then the rest. */
@media (prefers-reduced-motion: no-preference) {
  .slogan, .lead, .actions { animation: rise 1.1s var(--ease) both; }
  .lead { animation-delay: 0.35s; }
  .actions { animation-delay: 0.5s; }
  @keyframes rise { from { opacity: 0; transform: translateY(0.6em); filter: blur(6px); } }
}

/* Sections */
section:not(.hero) { padding: clamp(5rem, 13vh, 10rem) var(--pad); }
h2 {
  font-size: clamp(2.2rem, 4.6vw, 4.6rem); font-weight: 460; line-height: 1; letter-spacing: -0.045em;
  max-width: 16ch; text-wrap: balance;
}

.planning { border-top: 1px solid var(--line); }
.chain {
  list-style: none; padding: 0; margin: clamp(3rem, 7vh, 5rem) 0 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(1.5rem, 3vw, 3rem);
  counter-reset: step;
}
.chain li { position: relative; padding-top: 2.25rem; counter-increment: step; }
.chain li::before {
  content: counter(step); position: absolute; top: 0; left: 0;
  font-size: 0.95rem; color: var(--lilac); font-variant-numeric: tabular-nums;
}
.chain li::after {
  content: ""; position: absolute; top: 0.8rem; left: 1.6rem; right: -1rem; height: 1px;
  background: linear-gradient(to right, var(--lilac), transparent);
  transform-origin: left; transform: scaleX(var(--drawn, 1)); opacity: 0.55;
}
.chain h3 { font-size: 1.3rem; font-weight: 520; letter-spacing: -0.02em; line-height: 1.2; }
.chain p { margin-top: 0.75rem; color: var(--quiet); max-width: 30ch; }
.proof { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 5rem); align-items: center; margin-top: clamp(3.5rem, 8vh, 6rem); }
.proof .plate { aspect-ratio: 891 / 750; background: var(--cherry); border-radius: 14px; box-shadow: 0 40px 120px -50px rgba(122, 42, 77, 0.6); }
.proof .plate { margin: 0; overflow: hidden; }
.proof .plate img { display: block; width: 100%; height: 100%; object-fit: contain; }
.proof .measure { margin-top: 0; }
.hero-short { min-height: 78svh; }
.contact-mail { display: inline-block; margin-top: clamp(2rem, 5vh, 3.5rem); font-size: clamp(1.6rem, 1rem + 2.6vw, 3.4rem); letter-spacing: -0.035em; text-decoration: none; border-bottom: 1px solid rgba(239, 230, 234, 0.35); padding-bottom: 0.1em; transition: border-color 0.2s; }
.contact-mail:hover { border-color: var(--bone); }
.foot-links { display: flex; gap: 1.75rem; }
.foot-links a { color: var(--quiet); font-size: 1rem; }
.foot-links a:hover { color: var(--bone); }
.measure {
  margin-top: clamp(3.5rem, 8vh, 6rem); max-width: 40rem;
  font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.9rem); line-height: 1.3; letter-spacing: -0.02em; color: var(--bone);
}

.smile { display: grid; grid-template-columns: minmax(16rem, 0.8fr) 2fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; border-top: 1px solid var(--line); }
.smile { overflow: hidden; position: relative; }
.smile-art { position: relative; aspect-ratio: 1; width: 135%; margin: -14% -30% -22% -5%; mix-blend-mode: screen; pointer-events: none; }
.smile-art img, .smile-art canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.smile-art img { object-fit: contain; opacity: 0.55; mask-image: linear-gradient(to bottom, #000 52%, transparent 86%); }
.smile-art[data-live] img { opacity: 0; }
.smile-words p { margin: 1.25rem 0 2rem; color: var(--quiet); max-width: 28rem; }

.ways { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.5rem, 4vw, 4rem); border-top: 1px solid var(--line); }
.ways h3 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2.2rem); font-weight: 460; letter-spacing: -0.035em; line-height: 1.1; }
.ways p { margin-top: 0.9rem; color: var(--quiet); max-width: 30ch; }

.foot {
  display: grid; grid-template-columns: 1fr auto; gap: 1rem 2rem; align-items: end;
  padding: clamp(4rem, 10vh, 7rem) var(--pad) 2.5rem; border-top: 1px solid var(--line);
}
.foot-mark { font-size: clamp(4rem, 16vw, 15rem); font-weight: 500; letter-spacing: -0.07em; line-height: 0.8; color: var(--cherry); }
.foot a { color: var(--bone); text-decoration: none; font-size: 1.1rem; }
.foot-note { grid-column: 1 / -1; color: var(--quiet); font-size: 0.85rem; max-width: 60rem; }


@media (max-width: 56rem) {
  .proof { grid-template-columns: 1fr; }
  .chain { grid-template-columns: 1fr 1fr; }
  .smile { grid-template-columns: 1fr; }
  .ways { grid-template-columns: 1fr; }
  .bar nav a:not(:last-child) { display: none; }
}
@media (max-width: 34rem) {
  .chain { grid-template-columns: 1fr; }
  .foot { grid-template-columns: 1fr; }
}

/* Moving between pages (Shared): the bar stays, the title of one page becomes the title of the next,
   the rest dissolves into the next page. */
@view-transition { navigation: auto; }
.bar { view-transition-name: bar; }
.slogan { view-transition-name: title; }
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-group(title) { animation-duration: 0.8s; animation-timing-function: var(--ease); }
  ::view-transition-old(root) { animation: page-out 0.35s ease both; }
  ::view-transition-new(root) { animation: page-in 0.5s 0.15s ease both; }
  @keyframes page-out { to { opacity: 0; filter: blur(10px); transform: scale(0.985); } }
  @keyframes page-in { from { opacity: 0; filter: blur(10px); transform: scale(1.015); } }
  /* arriving by a transition, the title is already moving: it does not rise as well */
  html[data-arrived] .slogan { animation: none; }
}
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }
.bar nav a[aria-current="page"] { color: var(--bone); }

/* Medyre page */
.page-medyre .art-c { filter: hue-rotate(-22deg) saturate(1.15); }
.page-medyre .slogan { font-size: clamp(4.5rem, 17vw, 17rem); letter-spacing: -0.065em; }
.mission { height: 230svh; padding: 0 var(--pad) !important; }
.mission-stick { position: sticky; top: 0; height: 100svh; display: grid; align-items: center; }
.mission-text {
  max-width: 20ch; font-size: clamp(2.4rem, 6.4vw, 6.6rem); font-weight: 460; line-height: 1.02; letter-spacing: -0.045em; text-wrap: balance;
}
.mission-text span { opacity: calc(0.16 + 0.84 * var(--lit, 0)); filter: blur(calc((1 - var(--lit, 0)) * 3px)); transition: opacity 0.2s, filter 0.2s; }
.facts { border-top: 1px solid var(--line); }
.figures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.5rem, 4vw, 4rem); margin: clamp(3rem, 7vh, 5rem) 0 0; }
.figures dt { font-size: clamp(3.2rem, 7vw, 7rem); font-weight: 460; letter-spacing: -0.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.figures dd { margin: 1rem 0 0; color: var(--quiet); max-width: 24ch; }
.demo-frame {
  position: relative; aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden; display: grid; place-items: center; align-content: center; gap: 1.25rem;
  background: radial-gradient(ellipse 80% 70% at 70% 30%, rgba(122, 42, 77, 0.55), transparent 70%), radial-gradient(ellipse 60% 60% at 20% 90%, rgba(90, 52, 107, 0.5), transparent 70%), var(--cherry);
  box-shadow: inset 0 0 0 1px var(--line), 0 60px 160px -60px rgba(122, 42, 77, 0.7);
}
.demo-play { width: clamp(4rem, 8vw, 6rem); aspect-ratio: 1; border-radius: 50%; background: rgba(239, 230, 234, 0.12); box-shadow: inset 0 0 0 1px rgba(239, 230, 234, 0.4); position: relative; backdrop-filter: blur(8px); }
.demo-play::after { content: ""; position: absolute; left: 54%; top: 50%; translate: -50% -50%; border-left: 1.1rem solid var(--bone); border-top: 0.7rem solid transparent; border-bottom: 0.7rem solid transparent; }
.demo-frame p { color: var(--quiet); }
.ask { display: grid; justify-items: start; gap: 2rem; border-top: 1px solid var(--line); }
.ask h2 { font-size: clamp(3rem, 8vw, 8rem); max-width: none; }
@media (max-width: 56rem) { .figures { grid-template-columns: 1fr; } }
.proof { grid-template-columns: 1fr; }
.proof .plate { width: 100%; max-width: 72rem; justify-self: center; aspect-ratio: 16 / 9; }


/* Intro: the first page of a visit comes up out of the dark */
@media (prefers-reduced-motion: no-preference) {
  html[data-intro] body::before { content: ""; position: fixed; inset: 0; z-index: 60; background: #000; pointer-events: none; animation: intro-out 1.8s 0.15s var(--ease) forwards; }
  html[data-intro] .slogan { animation-duration: 1.6s; animation-delay: 0.6s; }
  html[data-intro]:not([data-ready]) body::before, html[data-intro]:not([data-ready]) .slogan { animation-play-state: paused; }
  @keyframes intro-out { to { opacity: 0; visibility: hidden; } }
}

/* Arch turn: the hologram arch turns slowly as its block passes, on the compositor. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .smile { view-timeline-name: --smile; }
    .smile-art { animation: arch-turn linear both; animation-timeline: --smile; will-change: transform; }
    @keyframes arch-turn {
      0% { transform: translateY(60px) rotate(-12deg); }
      50% { transform: scale(1.06); }
      100% { transform: translateY(-60px) rotate(12deg); }
    }
  }
}
