/* Vipassanapp website. One column of text, one colour, one slow circle.
   Tokens follow docs/VISUAL_DIRECTION.md ("Quiet paper"). Change them here only.
   The page has one job: to be calm. Add nothing that does not serve that. */

/* Values come from design/tokens.json (see assets/tokens.css and docs/DESIGN_SYSTEM.md).
   These are the names this stylesheet uses for them. */
:root {
  --ground: var(--paper);
  --text: var(--ink);
  --quiet: var(--ink-soft);
  --mark: var(--accent); /* the one accent. Used for the circle only. */
  --rule: var(--line);
  --display: var(--font-display);
  --sans: var(--font-body);
  --edge: clamp(1.5rem, 7vw, 4rem);
}

/* Young Serif (SIL Open Font License, see assets/fonts/OFL.txt). Wordmark and headings only,
   never below 20px. Served from this site, as a Latin subset. */
@font-face {
  font-family: "Young Serif";
  src: url("fonts/YoungSerif-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font: 400 var(--text-body)/var(--leading-body) var(--sans);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ol, ul { margin: 0; padding: 0; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 4px; }

/* The column. On wide screens it sits left of centre, with room to breathe on the right. */
.col {
  width: 100%;
  max-width: calc(var(--measure) + 2 * var(--edge));
  padding-inline: var(--edge);
  margin-inline: auto;
}
@media (min-width: 62rem) {
  .col { margin-left: 18vw; margin-right: auto; }
}

.skip { position: absolute; left: -999px; top: 0; background: var(--ground); padding: 0.5rem 1rem; }
.skip:focus { left: 0.5rem; top: 0.5rem; }

.top, .last.maker { padding-top: 0; }
.foot { font: 400 0.9375rem/1.5 var(--sans); color: var(--quiet); }
.top { display: flex; justify-content: space-between; align-items: baseline; padding-top: 2rem; }
.top a { text-decoration: none; }
.top a:hover { text-decoration: underline; }
.top .name { font: 400 1.3125rem/1.2 var(--display); color: var(--text); }

h1, h2 { font-family: var(--display); font-weight: 400; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: clamp(var(--text-title-min), 5.5vw, var(--text-title-max)); line-height: var(--leading-title); }

/* The hero title ends with a reason to learn. The reason changes slowly: one fades out, the next
   fades in. All reasons sit in the same place, so the page never moves. */
.turn { display: grid; }
.turn span { grid-area: 1 / 1; opacity: 0; transition: opacity var(--fade) var(--ease); }
.turn span.on { opacity: 1; transition-delay: calc(var(--fade) * 0.6); }
h2 { font-size: var(--text-heading); line-height: 1.25; margin-bottom: 0.6rem; }
h3 { font-size: 1.125rem; line-height: 1.6; font-weight: 500; }
p + p { margin-top: 1.1em; }
h1 + p { margin-top: 1.5rem; }
.small { font: 400 0.875rem/1.5 var(--sans); color: var(--quiet); }

section { padding-block: clamp(2.25rem, 6vw, 3.5rem); }
.first { padding-top: clamp(4rem, 16vh, 9rem); padding-bottom: clamp(4rem, 14vh, 8rem); }

/* The only graphic: a thin circle that breathes, about five seconds in, five seconds out. */
.dot {
  width: 4.5rem; height: 4.5rem; border-radius: 50%; border: 1.5px solid var(--mark);
  margin-bottom: clamp(2.5rem, 8vh, 4.5rem);
  animation: breathe var(--breath) var(--ease) infinite;
}
@keyframes breathe {
  0%, 100% { transform: scale(0.8); }
  50% { transform: scale(1); }
}

.actions { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem; align-items: baseline; }
.promise { margin-top: 0.75rem; }
.actions span { font: 400 0.9375rem/1.5 var(--sans); color: var(--quiet); }
button {
  font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em;
}
button:hover { text-decoration-thickness: 2px; }

/* You set each sit */
.set { margin-top: 0.25rem; }
select {
  font: inherit; color: inherit; background: none; border: 0; border-bottom: 1px solid var(--text); border-radius: 0;
  padding: 0 0.1em; margin: 0; cursor: pointer; -webkit-appearance: none; appearance: none;
}
.line.line-live { margin-block: 2rem 1.5rem; height: 1.5rem; }
.line-live + p { margin-top: 0; }
#set-result + .small { margin-top: 1rem; }
.note { margin-top: 0.75rem; }

.tiers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 2.5rem; margin-block: 1.75rem; font-size: 1rem; line-height: 1.5; }
.tiers h3 { font-weight: 400; color: var(--quiet); font-size: inherit; line-height: inherit; }
.tiers ul { list-style: none; margin-top: 0.5rem; display: grid; gap: 0.5rem; }
@media (max-width: 30rem) { .tiers { grid-template-columns: 1fr; } }

/* The seven stages */
.stages { list-style: none; margin-top: 2.25rem; display: grid; gap: 1.25rem; }
.stages li { display: grid; grid-template-columns: 1.75rem minmax(0, 1fr); }
.stages .n { color: var(--quiet); font-variant-numeric: tabular-nums; }
.stages b { font-weight: 400; display: block; }
.line { position: relative; height: 0.9rem; margin-top: 0.5rem; min-width: 1.25rem; }
.line::before { content: ""; position: absolute; inset: 50% 0 auto 0; height: 1px; background: var(--rule); }
.line i { position: absolute; top: 0; bottom: 0; min-width: 1.5px; background: var(--text); opacity: 0.75; }
.stages + .small { margin-top: 1.75rem; padding-left: 1.75rem; }

/* Screenshots: small, plain, no device frame. */
.shots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(0.75rem, 2.5vw, 1.5rem); padding-block: clamp(1.5rem, 4vw, 2.5rem); }
.shots img, .slot { border-radius: 10% / 4.6%; border: 1px solid var(--rule); width: 100%; }
.slot {
  aspect-ratio: 603 / 1311; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 0.5rem;
  padding: 0.75rem; text-align: center; font: 400 0.75rem/1.4 var(--sans); color: var(--quiet);
}
.slot code { font-size: 0.625rem; word-break: break-all; }

.last { padding-block: clamp(1.5rem, 5vw, 3rem); font: 400 0.9375rem/1.5 var(--sans); color: var(--quiet); }
.foot { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; padding-top: 1.5rem; padding-bottom: 4rem; }

/* One minute of sitting */
dialog {
  width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; border: 0;
  padding: var(--edge); background: var(--ground); color: var(--text);
}
dialog[open] { display: grid; grid-template-rows: 1fr auto auto 1fr; justify-items: center; text-align: center; animation: arrive 1.2s ease both; }
dialog::backdrop { background: var(--ground); }
dialog .dot { width: 7rem; height: 7rem; margin: 0; align-self: end; }
dialog p { max-width: 24rem; margin-top: 3rem; min-height: 5.5em; transition: opacity 1.5s ease; }
dialog p.out { opacity: 0; }
dialog a { margin-top: 1.5rem; animation: arrive 1.5s ease both; }
dialog a[hidden] { display: none; }
dialog button { grid-row: 4; align-self: end; font: 400 0.9375rem/1.5 var(--sans); color: var(--quiet); padding: 0.75rem 1rem; }
@keyframes arrive { from { opacity: 0; } }

/* Privacy and terms */
.prose { padding-block: clamp(3rem, 10vh, 5rem); }
.prose h1 { font-size: clamp(2rem, 5vw, 2.5rem); }
.prose h2 { margin-top: 2.25rem; }
.prose p, .prose ul { margin-top: 0.75rem; }
.prose ul { padding-left: 1.25rem; }
.prose li + li { margin-top: 0.4rem; }
.prose .updated { font: 400 0.875rem/1.5 var(--sans); color: var(--quiet); }
.prose .todo { border-left: 2px solid var(--mark); padding-left: 1rem; }

@media (prefers-reduced-motion: reduce) {
  .dot { animation: none; }
  .turn span { transition: none; }
  dialog[open] { animation: none; }
  dialog p { transition: none; }
}
