/* Visual Meditation home
   One real session plays behind the whole page. Each screen holds one sentence over it.
   The last screen shows the app itself. */

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("assets/fonts/plus-jakarta-sans.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --night: #0a111d;
  --light: #ffffff;
  --dim: rgba(255, 255, 255, 0.88);
  --line: rgba(255, 255, 255, 0.28);
  --veil: rgba(10, 17, 29, 0.7);
  --veil-soft: rgba(10, 17, 29, 0.34);
  --veil-deep: rgba(10, 17, 29, 0.8);

  --s-sentence: clamp(2.25rem, 5.6vw, 5.5rem);
  --s-text: 1.25rem;
  --s-small: 1rem;

  --face: "Plus Jakarta Sans", -apple-system, "Segoe UI", sans-serif;
  --guide: min(22vw, 40vh);
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --radius: 6px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html { scrollbar-color: var(--line) var(--night); }

body {
  margin: 0;
  background: var(--night);
  color: var(--light);
  font-family: var(--face);
  font-size: var(--s-text);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, video { display: block; }
h1, h2, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--light); outline-offset: 4px; }
::selection { background: var(--light); color: var(--night); }

/* ---------- the session behind everything ---------- */

.stage { position: fixed; inset: 0; overflow: hidden; background: var(--night); transform: translateZ(0); }
.stage video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.6s ease;
}
.stage video.on { opacity: 1; }
/* the veil keeps every line readable over bright water and grass */
.stage::before, .stage::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.stage::before { background: linear-gradient(90deg, var(--veil) 0%, var(--veil-soft) 70%); } /* taste-skill-ignore: neutral scrim over footage */
.stage::after { background: var(--veil-deep); opacity: 0; transition: opacity 0.8s ease; }
.at-end .stage::after { opacity: 1; }

/* the app's breathing guide: a ring, a circle that grows on the inhale, the word and the count.
   In the app it sits in the middle of the screen; here it moves right on wide windows to clear the text. */
.guide {
  position: absolute;
  top: 50%;
  left: 78%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: var(--guide);
  height: var(--guide);
  margin: calc(var(--guide) / -2) 0 0 calc(var(--guide) / -2);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  font-size: calc(var(--guide) * 0.13);
  font-weight: 500;
  line-height: 1.3;
  transition: opacity 0.4s ease;
}
.guide-fill {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  transform: scale(0.6);
  will-change: transform;
}
.guide span:not(.guide-fill) { position: relative; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); } /* same shadow as the app's guide */
.guide-count { font-size: 1.1em; font-variant-numeric: tabular-nums; }
.at-end .guide { opacity: 0; }

/* ---------- chrome ---------- */

.bar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem var(--gutter);
}
.wordmark { display: flex; align-items: center; min-height: 44px; }
.wordmark img { width: auto; height: 26px; filter: invert(1); }

.button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 1.25rem;
  border-radius: var(--radius);
  background: var(--light);
  color: var(--night);
  font-size: var(--s-small);
  font-weight: 600;
  transition: transform 0.25s var(--ease);
}
.button:hover { transform: translateY(-2px); }
.button:active { transform: translateY(0); }
.button:focus-visible { outline-offset: 3px; }

.cue {
  position: fixed;
  inset: auto auto 1.25rem var(--gutter);
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: var(--s-small);
  transition: opacity 0.4s ease, visibility 0.4s;
}
.cue-label { color: var(--dim); }
#cue-title { font-weight: 600; }
.cue button {
  min-height: 44px;
  padding: 0 0.5rem;
  border: 0;
  background: none;
  cursor: pointer;
  text-decoration: underline 1px var(--line);
  text-underline-offset: 0.35em;
}
.cue button:hover { text-decoration-color: currentColor; }
/* the last screen can be taller than the window: the bar turns solid so nothing shows through it */
.bar { transition: background-color 0.4s ease; }
.at-end .bar { background: var(--night); }
.at-end .cue { opacity: 0; visibility: hidden; }
/* over the solid catalogue band the cue would sit on a caption, so it steps aside there too */
.over-band .cue { opacity: 0; visibility: hidden; }

/* ---------- one sentence per screen ---------- */

main { position: relative; z-index: 2; }

.screen {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.5rem;
  min-height: 100svh;
  padding: 6rem var(--gutter);
}

h1, h2 {
  max-width: min(14em, 60vw);
  font-size: var(--s-sentence);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.05;
  text-wrap: balance;
}
.screen p { max-width: min(34rem, 56vw); color: var(--dim); text-wrap: pretty; }

.picks { display: flex; flex-wrap: wrap; gap: 0.25rem 2.5rem; }
.picks button {
  min-height: 48px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--dim);
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
  font-weight: 500;
  letter-spacing: -0.015em;
  text-align: left;
  cursor: pointer;
  text-decoration: underline 2px transparent;
  text-underline-offset: 0.4em;
  transition: color 0.3s ease, text-decoration-color 0.3s ease;
}
.picks button:hover { color: var(--light); text-decoration-color: var(--line); }
.picks button[aria-pressed="true"] { color: var(--light); font-weight: 600; text-decoration-color: currentColor; }


/* ---------- the catalogue: a solid band of the app's own session pictures ---------- */

.band { display: flex; flex-direction: column; gap: 3rem; padding: clamp(5rem, 10vw, 9rem) var(--gutter); background: var(--night); }
.shelf { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem 1.5rem; }
.shelf img { width: 100%; height: auto; border-radius: var(--radius); }
.shelf span { display: block; margin-top: 0.75rem; font-size: var(--s-text); }

/* ---------- the end: the app itself, and the way in ---------- */

.screen.last { justify-content: space-between; gap: 3rem; padding-bottom: 1.5rem; }
.close {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  margin-block: auto;
}
.close-text { display: flex; flex-direction: column; gap: 1.5rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.5rem; margin-top: 0.5rem; }
.actions .button { min-height: 52px; padding: 0 1.75rem; font-size: var(--s-text); }
.quiet, .foot a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--light);
  text-decoration: underline 1px var(--line);
  text-underline-offset: 0.35em;
  transition: text-decoration-color 0.3s ease;
}
.quiet:hover, .foot a:hover { text-decoration-color: currentColor; }
.screen .note { font-size: var(--s-small); }

.tv video { width: 100%; height: auto; border-radius: var(--radius); outline: 1px solid var(--line); outline-offset: -1px; background: var(--night); }
.tv figcaption { margin-top: 0.75rem; font-size: var(--s-small); color: var(--dim); }

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 2rem;
  font-size: var(--s-small);
  color: var(--dim);
}
.foot .links { display: flex; flex-wrap: wrap; gap: 0 1.75rem; }

/* ---------- motion: the first sentence comes into focus, once ---------- */

.ready [data-words] .w {
  display: inline-block;
  opacity: 0;
  filter: blur(12px);
  transition: opacity 1s var(--ease), filter 1s var(--ease);
  transition-delay: calc(var(--i) * 140ms);
}
.ready [data-words].in .w { opacity: 1; filter: blur(0); }

@media (prefers-reduced-motion: reduce) {
  .ready [data-words] .w { opacity: 1; filter: none; transition: none; }
  .stage video, .stage::after, .button, .cue, .bar, .guide { transition: none; }
  .button:hover { transform: none; }
}

/* ---------- narrow and short windows ---------- */

@media (max-width: 900px) {
  .close { grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }
  .foot { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 700px) {
  :root { --s-sentence: clamp(2rem, 9.4vw, 2.75rem); --s-text: 1.125rem; --s-small: 1rem; }
  .wordmark img { height: 20px; }
  .picks { flex-direction: column; }
  .cue-label { display: none; }
  .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.75rem 1rem; }
  .shelf span { font-size: var(--s-small); }
}

/* upright phone: the session fills the screen as it does in the app. The sentence sits at the top,
   the breathing circle below it, so the footage stays visible between them. */
@media (max-width: 700px) and (orientation: portrait) {
  .stage video { object-position: 68% 50%; }
  .stage video[data-shot="meadow"] { object-position: 42% 50%; }
  .stage::before { background: linear-gradient(180deg, var(--veil-deep) 0%, var(--veil) 34%, var(--veil-soft) 58%, var(--veil-soft) 82%, var(--veil) 100%); } /* taste-skill-ignore: neutral scrim over footage */
  .guide { top: 69%; left: 50%; --guide: min(52vw, 25vh); }
  h1, h2, .screen p { max-width: none; }
  .screen { justify-content: flex-start; padding: 6.5rem var(--gutter) 5rem; }
  .screen.last { gap: 2.5rem; }
  .band { padding-block: 4rem; gap: 2rem; }
  .close { margin-block: 0; }
}

@media (max-width: 360px) { :root { --s-text: 1rem; } }

@media (max-height: 520px) {
  .screen { padding-block: 5rem; }
  .cue-label { display: none; }
}
