/* MORVELLA site v1. Two surfaces (Dubina, Biser), one accent (Meduza, flat only). */

/* ---------- tokens ---------- */
:root {
  --dubina: #0A1024;
  --struja: #1B2444;
  --biser: #F3EFE7;
  --meduza: #B8A1FF;
  --plima: #6FE3D4;
  --magla: #8E96AD;
  --tinta: #5A3FD0;
  --line: #2A3355;
  --ink-soft: rgba(10, 16, 36, .74);
  --ink-line: rgba(10, 16, 36, .2);

  --font-display: "Jost", "Inter Display", "Century Gothic", "Avenir Next", sans-serif;
  --font-text: "Inter", system-ui, sans-serif;

  --header-h: 68px;
  --pad: clamp(20px, 5vw, 56px);
  --rail: 0px;
  --gap: 24px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
/* Wide screens keep a 72px lane on the right for the jellyfish; the page sits beside it. */
@media (min-width: 1100px) {
  :root { --rail: 72px; }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  padding-right: var(--rail);
  background: var(--dubina);
  color: var(--biser);
  font: 400 1.0625rem/1.55 var(--font-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--biser); color: var(--dubina); }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--biser); outline-offset: 3px; }
[tabindex="-1"]:focus { outline: none; }

.wrap { width: min(1320px, 100% - 2 * var(--pad)); margin-inline: auto; }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); }

.skip {
  position: absolute; left: var(--pad); top: -80px; z-index: 60;
  padding: 12px 16px; background: var(--biser); color: var(--dubina); text-decoration: none;
}
.skip:focus { top: 12px; }

.label {
  font: 500 .75rem/1.2 var(--font-text);
  letter-spacing: .08em; text-transform: uppercase; color: var(--magla);
}
.label__num { color: var(--meduza); }

.h2 {
  font: 300 clamp(2.125rem, 4.6vw, 4.25rem)/1.02 var(--font-display);
  letter-spacing: -.02em; text-wrap: balance;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 28px;
  border: 1px solid transparent; border-radius: 2px;
  font: 500 .9375rem/1 var(--font-text); letter-spacing: .01em;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
.btn--primary { background: var(--meduza); color: var(--dubina); }
.btn--primary:hover { background: var(--biser); }
.btn--sm { min-height: 40px; padding: 0 18px; font-size: .875rem; }
.btn--line { background: transparent; color: var(--biser); border-color: var(--line); }
.btn--line:hover { border-color: var(--biser); }

.link { color: var(--tinta); text-underline-offset: .2em; text-decoration-thickness: 1px; }
.link:hover { text-decoration-thickness: 2px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  margin-right: calc(var(--rail) * -1); padding-right: var(--rail);      /* the bar runs over the lane, its content does not */
  background: var(--dubina); border-bottom: 1px solid var(--line);
}
.site-header__in { display: flex; align-items: center; gap: 28px; height: var(--header-h); }
.logo { display: block; margin-right: auto; color: var(--biser); }
.logo svg { display: block; height: 34px; width: auto; }
.nav { display: flex; gap: 28px; }
.nav a { padding: 8px 0; font-size: .875rem; text-decoration: none; }
.nav a:hover { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }

.lang { display: flex; flex-wrap: wrap; }
.lang__btn {
  appearance: none; background: none; border: 0; cursor: pointer;
  padding: 10px 6px; color: var(--magla);
  font: 500 .75rem/1 var(--font-text); letter-spacing: .08em;
}
.lang__btn:hover { color: var(--biser); }
.lang__btn[aria-pressed="true"] { color: var(--biser); text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: clip; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 719px) {
  .site-header__in { gap: 10px; }
  .nav { display: none; }
  .logo svg { height: 28px; }
  .site-header .lang:not([data-count="2"]):not([data-count="3"]) { display: none; }
}

/* ---------- the living jellyfish (scroll progress, wide screens only) ---------- */
.rail { display: none; }
@media (min-width: 1100px) {
  .rail {
    display: block; position: fixed; z-index: 40;
    top: var(--header-h); right: 0; bottom: 0; width: var(--rail);
    border-left: 1px solid rgba(142, 150, 173, 0.28); pointer-events: none;
  }
  .rail__lane { position: absolute; inset: 28px 0; }
  .jelly { position: absolute; top: 0; left: 50%; width: 40px; margin-left: -20px; color: var(--biser); will-change: transform; transition: color .3s var(--ease); }
  .jelly.is-on-light { color: var(--dubina); }
}

/* ---------- hero ---------- */
.hero { padding-block: clamp(28px, 5vh, 56px) clamp(32px, 6vh, 64px); }
.hero__in { display: grid; row-gap: clamp(40px, 5vh, 56px); }
.hero__title {
  font: 300 clamp(2.75rem, 8.4vw, 8.25rem)/.98 var(--font-display);
  letter-spacing: -.02em; text-wrap: balance;
}
.hero__foot { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 28px var(--gap); align-items: end; }
.hero__sub { grid-column: 1 / span 6; max-width: 34em; font-size: clamp(1.0625rem, 1.3vw, 1.25rem); line-height: 1.5; }
@media (max-width: 899px) {
  .hero__sub { grid-column: 1 / -1; }
}

/* ---------- 01 stage ---------- */
.stage__grid { display: grid; gap: 32px var(--gap); padding-block: clamp(56px, 10vw, 96px); }
.stage__side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.stage__meta { display: flex; flex-direction: column; gap: 14px; }
.stage__caption { max-width: 34em; font-size: .9375rem; line-height: 1.5; color: var(--magla); }

.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.chip {
  appearance: none; cursor: pointer; text-align: left;
  min-height: 52px; padding: 10px 14px;
  background: transparent; color: var(--biser);
  border: 1px solid var(--line); border-radius: 2px;
  font: 400 1rem/1.2 var(--font-text);
  transition: background-color .2s, color .2s, border-color .2s, padding .35s var(--ease);
}
.chip:hover { border-color: var(--magla); }
.chip[aria-pressed="true"] { background: var(--meduza); border-color: var(--meduza); color: var(--dubina); }

.device { display: none; gap: 20px; }
.device__btn {
  appearance: none; background: none; border: 0; cursor: pointer; padding: 8px 0;
  color: var(--magla); font: 500 .75rem/1.2 var(--font-text); letter-spacing: .08em; text-transform: uppercase;
}
.device__btn:hover { color: var(--biser); }
.device__btn[aria-pressed="true"] { color: var(--biser); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
@media (min-width: 720px) { .device { display: flex; } }
.no-js .chips, .no-js .device { display: none; }

.frame-area { display: flex; justify-content: center; min-width: 0; }
.frame {
  container: frame / inline-size;
  display: flex; flex-direction: column; width: 100%; min-width: 0;
  border: 1px solid var(--line); border-radius: 4px; background: var(--dubina);
  transition: width .7s var(--ease);
}
.frame[data-device="phone"] { width: min(390px, 100%); }
.frame__bar {
  position: relative; flex: none;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 40px; padding: 0 14px; border-bottom: 1px solid var(--line);
  font-size: .75rem; line-height: 1; white-space: nowrap; color: var(--magla);
}
.frame__url { min-width: 0; overflow: clip; text-overflow: ellipsis; color: var(--biser); }
.frame__tag { display: flex; align-items: center; gap: 8px; letter-spacing: .08em; text-transform: uppercase; font-weight: 500; }
.frame__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--plima); }
@container frame (max-width: 460px) {
  .frame__bar { flex-direction: column; align-items: flex-start; justify-content: center; gap: 8px; height: auto; padding-block: 10px; }
  .frame__url { max-width: 100%; }
}
.frame__progress {
  position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: var(--biser); transform: scaleX(0); transform-origin: 0 50%;
}
.frame__viewport {
  container: concept / inline-size;
  position: relative; display: grid; overflow: clip;
  border-radius: 0 0 3px 3px; background: var(--struja);
}
.frame__layer { grid-area: 1 / 1; position: relative; min-width: 0; }
.frame__layer.is-leaving { position: absolute; inset: 0 0 auto 0; }
.frame__layer.is-entering { z-index: 2; }
.frame__wipe {
  position: absolute; z-index: 1; left: 0; top: 0; width: 0; height: 0;
  border-radius: 50%; background: var(--meduza); transform: scale(0); pointer-events: none;
}

/* Under 900px the frame shows about 1,400px of concept (stage.js sets --clip, zoom included) and cuts
   it off cleanly; "Show the whole page" opens it. Then the next step and the four trades again. */
@media (max-width: 899px) {
  .js .frame:not(.is-open) .frame__viewport { max-height: var(--clip, 1400px); }
}
.stage__after { display: grid; justify-items: start; margin-top: -20px; }
.stage__more {
  appearance: none; cursor: pointer; justify-self: stretch;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 18px;
  background: transparent; color: var(--biser); border: 1px solid var(--line); border-radius: 2px;
  font: 500 .9375rem/1.2 var(--font-text);
  transition: border-color .2s;
}
.stage__more:hover { border-color: var(--magla); }
.stage__more svg { width: 14px; flex: none; transition: transform .3s var(--ease); }
.stage__more[aria-expanded="true"] svg { transform: rotate(180deg); }
.stage__more[aria-expanded="true"] .stage__more-open, .stage__more[aria-expanded="false"] .stage__more-shut { display: none; }
.stage__grid:has(.frame[data-device="phone"]) .stage__more { justify-self: center; width: min(390px, 100%); }
.stage__ask { margin-top: 44px; max-width: 14em; font: 300 clamp(1.75rem, 7vw, 2.5rem)/1.08 var(--font-display); letter-spacing: -.015em; text-wrap: balance; }
.stage__cta { margin-top: 20px; }
.stage__again { margin-top: 44px; }
.chips--again { justify-self: stretch; margin-top: 12px; }
.no-js .stage__more, .no-js .stage__again { display: none; }
@media (min-width: 900px) { .stage__after { display: none; } }

/* 900px and up: heading, chips (one row), toggle and caption sit above a full-width frame,
   so the concept is shown close to its real size. */
@media (min-width: 900px) {
  .stage__grid { grid-template-columns: minmax(0, 1fr); align-items: start; row-gap: 24px; }
  .stage__side { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px 48px; }
  .stage__side > .label { grid-column: 1 / -1; grid-row: 1; }
  .stage__title { grid-column: 1; grid-row: 2; font-size: clamp(2rem, min(3.4vw, 5.6vh), 3.25rem); }
  .stage__meta { display: contents; }
  .stage__caption { grid-column: 2; grid-row: 2; max-width: 27em; padding-bottom: .25em; }
  /* The chips take the whole row; the toggle sits at its right end, clear of the caption's column. */
  .chips { grid-column: 1 / -1; grid-row: 3; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
  .chip { min-height: 44px; padding: 0 18px; font: 400 1.125rem/1.1 var(--font-display); white-space: nowrap; }
  .device { grid-column: 2; grid-row: 3; align-self: center; justify-self: end; margin-top: 10px; }
}

/* Pinned: the page scroll drives the concept inside the frame. */
@media (min-width: 900px) and (min-height: 600px) and (prefers-reduced-motion: no-preference) {
  .js .stage__track { height: calc(220vh - var(--header-h)); }
  .js .stage__pin {
    position: sticky; top: var(--header-h);
    height: calc(100vh - var(--header-h));
    height: calc(100svh - var(--header-h));
  }
  .js .stage__grid { height: 100%; padding-block: clamp(16px, 3vh, 28px); grid-template-rows: auto minmax(0, 1fr); align-items: stretch; row-gap: clamp(12px, 2.2vh, 20px); }
  .js .frame-area { min-height: 0; }
  .js .frame { height: 100%; }
  .js .frame__viewport { flex: 1 1 0; min-height: 0; }
  .js .concept { will-change: transform; }
}

/* ---------- sections ---------- */
.section { padding-block: clamp(72px, 11vw, 152px); }
.section__in { border-top: 1px solid var(--line); padding-top: 20px; }
.section__head { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 20px; }
[id] { scroll-margin-top: var(--header-h); }

@media (min-width: 900px) {
  .section__in.grid > .section__head { grid-column: 1 / span 4; align-self: start; position: sticky; top: calc(var(--header-h) + 28px); }
}

/* 02 what you get: an editorial list, not cards */
.gets { grid-column: 1 / -1; list-style: none; margin: 48px 0 0; padding: 0; counter-reset: get; }
.get {
  counter-increment: get;
  display: grid; grid-template-columns: 56px minmax(0, 1fr); column-gap: var(--gap);
  padding-block: 28px 34px; border-top: 1px solid var(--line);
}
.get::before {
  content: "2." counter(get);
  padding-top: .85em;
  font: 500 .75rem/1.2 var(--font-text); letter-spacing: .08em; color: var(--magla);
}
.get__t { grid-column: 2; font: 400 clamp(1.5rem, 2.5vw, 2.125rem)/1.12 var(--font-display); letter-spacing: -.01em; }
.get__d { grid-column: 2; margin-top: 10px; max-width: 46ch; color: var(--magla); }
@media (min-width: 900px) {
  .gets { grid-column: 6 / -1; margin-top: 0; }
  .get { grid-template-columns: 72px minmax(0, 1fr); }
  .get:first-child { border-top: 0; padding-top: 0; }
}

/* 03 how it goes: the Biser surface. It runs under the lane to the right edge; its content does not. */
.section--biser { margin-right: calc(var(--rail) * -1); padding-right: var(--rail); background: var(--biser); color: var(--dubina); }
.section--biser .section__in { border-top: 0; padding-top: 0; }
.section--biser .label { color: var(--ink-soft); }
.section--biser .label__num { color: var(--tinta); }
.section--biser ::selection { background: var(--dubina); color: var(--biser); }
.section--biser :focus-visible { outline-color: var(--tinta); }

.steps { list-style: none; margin: clamp(40px, 6vw, 80px) 0 0; padding: 0; border-top: 1px solid var(--ink-line); }
.step {
  display: grid; grid-template-columns: 64px minmax(0, 1fr); column-gap: var(--gap); align-items: baseline;
  padding-block: clamp(22px, 3.2vw, 40px); border-bottom: 1px solid var(--ink-line);
}
.step__n { font: 300 clamp(3.5rem, 9vw, 8rem)/.82 var(--font-display); letter-spacing: -.04em; }
.step__t { font: 400 clamp(1.5rem, 2.7vw, 2.375rem)/1.1 var(--font-display); letter-spacing: -.01em; }
.step__d { grid-column: 2; margin-top: 10px; max-width: 38ch; color: var(--ink-soft); }
.process__next { margin-top: 28px; color: var(--ink-soft); }
@media (min-width: 900px) {
  .step { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .step__n { grid-column: 1 / span 2; }
  .step__t { grid-column: 3 / span 5; }
  .step__d { grid-column: 8 / -1; margin-top: 0; }
}

/* 04 who is behind it */
.statement {
  grid-column: 1 / -1; margin-top: 40px;
  font: 300 clamp(1.625rem, 3.2vw, 3rem)/1.16 var(--font-display); letter-spacing: -.015em; text-wrap: pretty;
}
@media (min-width: 900px) { .statement { grid-column: 6 / -1; margin-top: 0; } }

/* contact */
.section--contact { padding-bottom: clamp(72px, 9vw, 128px); }
.contact__line {
  margin-top: 28px; max-width: 15.5em;
  font: 300 clamp(1.875rem, 5.6vw, 5.25rem)/1.03 var(--font-display); letter-spacing: -.02em;
}
.contact__mail { overflow-wrap: anywhere; text-decoration-thickness: 1px; text-underline-offset: .14em; text-decoration-color: var(--magla); }
.contact__mail:hover { text-decoration-color: var(--biser); }
.contact__grid { margin-top: clamp(48px, 7vw, 96px); row-gap: 32px; }
.contact__hint { grid-column: 1 / -1; max-width: 30em; font-size: .9375rem; color: var(--magla); }
.form { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr; gap: 28px var(--gap); }
@media (min-width: 900px) {
  .contact__hint { grid-column: 1 / span 4; }
  .form { grid-column: 6 / -1; grid-template-columns: 1fr 1fr; }
  .field--wide, .form__foot, .note { grid-column: 1 / -1; }
}
.field label { display: flex; align-items: baseline; gap: 8px; font: 500 .75rem/1.2 var(--font-text); letter-spacing: .08em; text-transform: uppercase; color: var(--magla); }
.field__opt { font-weight: 400; letter-spacing: 0; text-transform: none; }
.field input, .field textarea {
  display: block; width: 100%; margin-top: 4px; padding: 10px 0 12px;
  background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  font-size: 1.0625rem; line-height: 1.4;
}
.field textarea { min-height: 7.5em; resize: vertical; field-sizing: content; }
.field input:hover, .field textarea:hover { border-bottom-color: var(--magla); }
.field input:focus-visible, .field textarea:focus-visible { outline: none; border-bottom-color: var(--biser); }
.field input:-webkit-autofill { -webkit-text-fill-color: var(--biser); transition: background-color 600000s 0s; }
.note { padding-top: 20px; border-top: 1px solid var(--line); }
.note__text { max-width: 34em; }
.note__mail { white-space: nowrap; }
.note__row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 16px; }
.note__state { font-size: .875rem; color: var(--magla); }
.note__state--ok { color: var(--plima); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 36px 48px; font-size: .875rem; line-height: 1.6; color: var(--magla); }
.site-footer__in { display: grid; grid-template-columns: 1fr; gap: 24px var(--gap); align-items: start; }
.site-footer__mark { color: var(--biser); }
.site-footer__mark svg { display: block; height: 30px; width: auto; }
.site-footer__legal { color: var(--biser); }
.site-footer__end { display: flex; flex-direction: column; gap: 6px; }
.site-footer .lang { margin-left: -6px; }
@media (min-width: 900px) {
  .site-footer__in { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .site-footer__mark { grid-column: 1 / span 2; }
  .site-footer__text { grid-column: 3 / span 6; }
  .site-footer__end { grid-column: 10 / -1; align-items: flex-end; }
  .site-footer .lang { margin: 0 -6px 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* The four concept sites live in concepts.css. */
