/* Mull — the website.
   Two worlds. A dark one full of other people's words, and a sheet of paper that
   opens out of a single caret. The noise is cold and foreign; the paper is Mull's own. */

@font-face { font-family: 'Switzer'; src: url('fonts/Switzer-Variable.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Gambetta'; src: url('fonts/Gambetta-Variable.woff2') format('woff2'); font-weight: 300 700; font-display: swap; }
@font-face { font-family: 'Gambetta'; src: url('fonts/Gambetta-VariableItalic.woff2') format('woff2'); font-weight: 300 700; font-style: italic; font-display: swap; }

:root {
  /* The noise: not Mull's world, so none of Mull's colours. */
  --night: #0A0D1C;      /* the screen at 1am */
  --glow: #DDE3FF;       /* its cold light */
  --alert: #FF5A4F;      /* a notification badge */
  /* The page: Mull's own paper and ink (docs/BRAND.md, Moss). */
  --paper: #FBFAF6;
  --card: #FFFFFF;
  --ink: #1C221E;
  --ink2: #454D47;
  --ink3: #5F6760;
  --line: #DEDACF;
  --well: #ECE9E0;
  /* Mull itself: its green wherever the app is speaking or shown. */
  --moss: #2F5A3C;       /* the caret, the thread, dates */
  --forest: #1F3A2B;     /* the turn, and Where you stand */
  --deep: #13221A;       /* the foot: Mull's dark, not the screen's */
  --mark: #D9E5C6;       /* a marked line in the app */
  --on-forest: #F2EFE9;
  --on-forest2: #B8C9AE;
  /* The one colour from outside: a highlighter, for other writers' words. */
  --marker: #FFE55C;
  --sans: 'Switzer', -apple-system, system-ui, sans-serif;
  --serif: 'Gambetta', Georgia, serif;
  --out: cubic-bezier(.23, 1, .32, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.55 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3, p, figure, blockquote, dl, dd, ol { margin: 0; padding: 0; }
ol { list-style: none; }
:focus-visible { outline: 2px solid var(--moss); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--marker); color: var(--ink); }

.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }
@media (min-width: 700px) { .wrap { width: min(1200px, 100% - 112px); } }

.display { font: 600 clamp(44px, 8.4vw, 132px)/.94 var(--sans); letter-spacing: -.05em; text-wrap: balance; }
.under { font-size: clamp(18px, 1.7vw, 23px); line-height: 1.4; color: var(--ink2); max-width: 30em; margin-top: clamp(22px, 2.6vw, 36px); text-wrap: pretty; }
.meta { font: 500 12.5px/1.4 var(--sans); color: var(--ink3); }
.nb { white-space: nowrap; }
kbd { display: inline-block; font: 500 12px/1 var(--sans); padding: 4px 6px; margin: 0 1px; border-radius: 5px; background: var(--well); box-shadow: inset 0 -1px 0 rgb(0 0 0 / .1); color: var(--ink); vertical-align: 1px; }
kbd:first-of-type { margin-left: 4px; }
mark { color: inherit; background: linear-gradient(var(--marker), var(--marker)) no-repeat 0 60% / 100% 78%; border-radius: 2px; padding: 0 .12em; margin: 0 -.12em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
cite { font-style: italic; }

/* ---------- The top line: reads on night and on paper alike ---------- */

.top { position: fixed; z-index: 10; inset: 0 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 16px; color: #fff; mix-blend-mode: difference; pointer-events: none; }
@media (min-width: 700px) { .top { padding: 26px 56px; } }
.top { transition: opacity .35s; }
.top.away { opacity: 0; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo span { font: italic 400 27px/1 var(--serif); }
.top-note { font-size: 13.5px; opacity: .85; }

/* ---------- The opening scene ---------- */

.scene { height: 460vh; background: var(--paper); }
.stage { position: sticky; top: 0; height: 100vh; height: 100dvh; overflow: hidden; background: var(--night); color: #fff; }

.noise { position: absolute; inset: -12% -6%; }
.layer { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 0 3vw; transform: translate3d(calc(var(--mx, 0) * var(--k) * 1px), calc(var(--my, 0) * var(--k) * 1px), 0) scale(var(--s, 1)); opacity: var(--lo, 1); will-change: transform, opacity; }
.layer ul { list-style: none; margin: 0; padding: 0 0 var(--gap); display: flex; flex-direction: column; gap: var(--gap); animation: drift var(--t) linear infinite; animation-play-state: paused; }
.noise.live ul { animation-play-state: running; }
.layer ul:nth-child(even) { animation-direction: reverse; }
.layer li { font-size: var(--fs); font-weight: var(--fw, 400); line-height: 1.2; letter-spacing: -.01em; color: var(--glow); opacity: var(--o); align-self: var(--al, flex-start); max-width: 100%; }
.layer li.pill { display: inline-flex; align-items: center; gap: .55em; padding: .5em .9em; border-radius: 99px; background: rgb(221 227 255 / .07); box-shadow: inset 0 0 0 1px rgb(221 227 255 / .16); }
.layer li.pill::before { content: ''; flex: none; width: .5em; height: .5em; border-radius: 50%; background: var(--alert); }
@keyframes drift { to { transform: translate3d(0, -50%, 0); } }

/* A pool of dark in the middle, so the words can be read. */
.hush { position: absolute; inset: 0; background: linear-gradient(var(--night), rgb(10 13 28 / 0) 130px), radial-gradient(ellipse 66% 50% at 50% 50%, var(--night) 0, rgb(10 13 28 / .95) 50%, rgb(10 13 28 / 0) 100%); opacity: var(--hush, 1); }

.say { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; padding: 0 16px; font: 600 clamp(38px, 7vw, 108px)/.96 var(--sans); letter-spacing: -.05em; text-wrap: balance; }
.say-a { opacity: var(--a, 1); transform: translateY(calc((1 - var(--a, 1)) * -24px)); }
.say-b { opacity: var(--b, 0); transform: translateY(calc((1 - var(--b, 0)) * 24px)); color: var(--glow); font: italic 400 clamp(40px, 7.4vw, 116px)/1 var(--serif); letter-spacing: -.035em; }
.say-a, .say-b { padding-inline: max(16px, calc(50% - 6.2em)); }

.seed { position: absolute; left: 50%; top: 50%; width: 4px; height: clamp(44px, 7vw, 100px); margin: calc(clamp(44px, 7vw, 100px) / -2) 0 0 -2px; border-radius: 2px; background: var(--paper); opacity: var(--seed, 0); animation: blink 1.05s steps(1) infinite; }
@keyframes blink { 50% { visibility: hidden; } }

.sheet { position: absolute; inset: 0; background: var(--paper); color: var(--ink); clip-path: circle(calc(var(--r, 0) * 1vmax) at 50% 50%); display: grid; place-items: center; }
.sheet-in { width: min(1200px, 100% - 32px); text-align: center; }
.headline { font: 400 clamp(44px, 8.4vw, 136px)/.96 var(--serif); letter-spacing: -.035em; max-width: 9.4em; margin-inline: auto; text-wrap: balance; }
.headline .w { display: inline-block; white-space: nowrap; }
.headline .ch { position: relative; opacity: 0; }
.headline .ch.on { opacity: 1; }
.headline .cur::after { content: ''; position: absolute; right: -.08em; top: .14em; width: .045em; height: .8em; border-radius: 2px; background: var(--moss); }
.welcome { font: italic 400 clamp(21px, 2.1vw, 29px)/1.35 var(--serif); color: var(--ink2); max-width: 24em; margin: clamp(26px, 3vw, 44px) auto 0; opacity: var(--w, 0); transform: translateY(calc((1 - var(--w, 0)) * 14px)); text-wrap: balance; }

.hint { position: absolute; left: 50%; bottom: 26px; translate: -50% 0; font-size: 13px; color: var(--glow); opacity: calc(var(--a, 1) * .7); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.hint::after { content: ''; width: 1px; height: 34px; background: linear-gradient(var(--glow), transparent); animation: fall 2.2s var(--out) infinite; transform-origin: top; }
@keyframes fall { 0% { transform: scaleY(0); } 60%, 100% { transform: scaleY(1); opacity: 0; } }

/* Without the script: no scene, only the words in order. */
html:not(.js) .scene { height: auto; }
html:not(.js) .stage { position: static; height: auto; overflow: visible; }
html:not(.js) .say { position: static; padding-block: 18vh; }
html:not(.js) .say-b { opacity: 1; padding-top: 0; }
html:not(.js) .sheet { position: static; clip-path: none; padding-block: 22vh; }
html:not(.js) :is(.headline .ch, .welcome) { opacity: 1; }
html:not(.js) :is(.seed, .hint, .hush) { display: none; }

/* ---------- What writing does ---------- */

.does { padding-block: clamp(110px, 15vw, 230px) clamp(90px, 11vw, 170px); }
.does .display { max-width: 9.5em; }
.rows { margin-top: clamp(72px, 9vw, 140px); border-top: 1px solid var(--ink); }
.row { display: grid; gap: 10px 40px; padding: clamp(26px, 3vw, 40px) 0; border-bottom: 1px solid var(--line); }
@media (min-width: 800px) { .row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: baseline; } }
.row h3 { font: 600 clamp(28px, 3.4vw, 50px)/1.04 var(--sans); letter-spacing: -.04em; }
.row p { font-size: clamp(17px, 1.45vw, 20px); color: var(--ink2); max-width: 30em; text-wrap: pretty; }

/* ---------- Voices ---------- */

.voices { padding-block: clamp(60px, 8vw, 120px) clamp(110px, 14vw, 210px); }
.aside { font-size: clamp(18px, 1.7vw, 23px); color: var(--ink2); margin-bottom: clamp(48px, 6vw, 90px); }
.voice blockquote { font: 400 clamp(32px, 5.2vw, 80px)/1.06 var(--serif); letter-spacing: -.03em; text-wrap: balance; }
.voice figcaption { font-size: 14.5px; color: var(--ink3); margin-top: clamp(18px, 2vw, 28px); }
.voices .voice { padding-block: clamp(40px, 5vw, 72px); border-top: 1px solid var(--line); }
.voices .voice:nth-of-type(2) blockquote { font-style: italic; }
@media (min-width: 900px) {
  .voices .voice { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 48px; align-items: end; }
  .voices .voice figcaption { text-align: right; margin: 0 0 .9em; }
}

/* ---------- The turn: Mull speaks, in its own forest green ---------- */

.turn { background: var(--forest); color: var(--on-forest); padding-block: clamp(110px, 14vw, 220px); }
.turn ::selection { background: var(--marker); color: var(--ink); }
.again { max-width: 760px; margin-bottom: clamp(64px, 9vw, 130px); }
.again blockquote { font-size: clamp(24px, 2.7vw, 38px); font-style: italic; line-height: 1.3; letter-spacing: -.015em; }
.again mark { color: var(--ink); }
.again figcaption { color: var(--on-forest2); }
.turn .display { max-width: 8.6em; }
.two { display: grid; gap: 22px; margin-top: clamp(44px, 6vw, 84px); font-size: clamp(18px, 1.6vw, 22px); line-height: 1.5; color: rgb(242 239 233 / .86); }
@media (min-width: 800px) { .two { grid-template-columns: 1fr 1fr; gap: clamp(36px, 5vw, 80px); max-width: 1040px; margin-left: auto; } }

/* ---------- One thought, four sittings ---------- */

.grow { padding-block: clamp(120px, 15vw, 230px) clamp(80px, 10vw, 150px); }
.thread { position: relative; margin-top: clamp(80px, 10vw, 150px); display: grid; gap: clamp(110px, 14vw, 210px); }
.thread::before, .thread::after { content: ''; position: absolute; left: 5px; top: 8px; bottom: 0; width: 2px; background: var(--line); }
.thread::after { background: var(--moss); transform-origin: top; transform: scaleY(var(--t, 0)); }
.thread li { position: relative; display: grid; gap: 36px; padding-left: 36px; }
.thread li::before { content: ''; position: absolute; z-index: 1; left: 0; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 2px var(--line); transition: box-shadow .4s, background-color .4s; }
.thread li.reached::before { background: var(--moss); box-shadow: inset 0 0 0 2px var(--moss), 0 0 0 6px rgb(47 90 60 / .14); }
@media (min-width: 940px) {
  .thread li { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(48px, 7vw, 110px); padding-left: 56px; align-items: start; }
}
.date { font: 500 14px/1.4 var(--sans); color: var(--moss); }
.when h3 { font: 600 clamp(38px, 4.8vw, 68px)/.98 var(--sans); letter-spacing: -.045em; margin: 14px 0 24px; }
.when p:not(.date) { color: var(--ink2); max-width: 31em; text-wrap: pretty; }
.when p:not(.date) + p { margin-top: 14px; }

.page { background: var(--card); border-radius: 14px; padding: clamp(22px, 3.2vw, 42px); box-shadow: 0 0 0 1px rgb(16 18 24 / .07), 0 2px 4px rgb(16 18 24 / .04), 0 24px 60px -24px rgb(16 18 24 / .22); }
.writing { font: 400 clamp(19px, 1.6vw, 22px)/1.6 var(--serif); }
.writing + .writing { margin-top: .85em; }
.page > .meta + .writing { margin-top: 16px; }
#capture { min-height: 290px; }
.caret { display: inline-block; width: 2px; height: 1.1em; margin: 0 -1px 0 1px; vertical-align: -.2em; background: var(--moss); border-radius: 1px; }
.typing .caret { animation: blink 1.05s steps(1) 6; }
.todo { visibility: hidden; }

.piece { display: grid; gap: 28px; }
@media (min-width: 560px) { .piece { grid-template-columns: minmax(0, 1fr) 156px; gap: 30px; } }
.folded { border-left: 2px solid var(--line); padding-left: 16px; margin-bottom: 22px; }
.folded p:not(.meta) { font: 400 16px/1.6 var(--serif); color: var(--ink2); margin-top: 6px; }
.piece .writing { font-size: clamp(18px, 1.45vw, 20px); }
.count { display: inline-block; min-width: 1.6em; padding: 1px 6px; margin-left: 4px; border-radius: 99px; background: var(--mark); color: var(--ink); text-align: center; }
.piece mark { background-image: linear-gradient(var(--mark), var(--mark)); }
.marked .line { font: italic 400 16px/1.45 var(--serif); margin-top: 12px; }
.marked .src { font-size: 12px; color: var(--ink3); margin-top: 4px; }
.marked .src + .line { margin-top: 18px; }

.note { max-width: 420px; background: var(--marker); box-shadow: 0 24px 50px -24px rgb(16 18 24 / .35); rotate: 1.4deg; border-radius: 4px; padding: 26px 28px 34px; }
.note .meta { color: rgb(16 18 24 / .62); }
.note .line { font: italic 400 clamp(23px, 2.3vw, 29px)/1.3 var(--serif); margin-top: 14px; }

.stand { background: var(--forest); color: var(--on-forest); border-radius: 18px; padding: clamp(26px, 3.6vw, 46px); box-shadow: 0 30px 70px -30px rgb(31 58 43 / .7); }
.stand .meta { color: var(--on-forest2); }
.stand .big { font: 400 clamp(27px, 3vw, 40px)/1.16 var(--serif); letter-spacing: -.02em; margin-top: 18px; text-wrap: balance; }
.stand .rest { font: 400 17px/1.6 var(--serif); color: rgb(242 239 233 / .8); margin-top: 18px; }
.chip { display: inline-block; font: 500 13px/1 var(--sans); padding: 10px 14px; margin-top: 24px; border-radius: 99px; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .22); }

.free { margin: clamp(90px, 11vw, 160px) 0 0 auto; max-width: 21em; font: italic 400 clamp(24px, 2.6vw, 36px)/1.22 var(--serif); letter-spacing: -.02em; text-wrap: balance; }

/* ---------- Facts ---------- */

.facts { padding-bottom: clamp(110px, 14vw, 210px); }
.grid { display: grid; border-top: 1px solid var(--ink); }
.grid > div { padding: 26px 0 30px; border-bottom: 1px solid var(--line); }
@media (min-width: 700px) {
  .grid { column-gap: clamp(32px, 4vw, 64px); }
  .four { grid-template-columns: 1fr 1fr; }
  .three { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1040px) { .four { grid-template-columns: repeat(4, 1fr); } .grid > div { border-bottom: 0; } }
.grid dt, .grid h3 { font: 600 clamp(20px, 1.8vw, 24px)/1.15 var(--sans); letter-spacing: -.03em; margin-bottom: 10px; }
.grid dt kbd { vertical-align: 3px; }
.grid dd, .grid p { font-size: 15.5px; color: var(--ink2); text-wrap: pretty; }
.three { margin-top: clamp(72px, 9vw, 130px); }

/* ---------- Begin ---------- */

.begin { border-top: 1px solid var(--line); padding-block: clamp(110px, 14vw, 210px); min-height: 100vh; display: grid; align-items: center; }
.try { margin-top: clamp(56px, 8vw, 110px); }
.try .meta { display: block; color: var(--moss); }
.try textarea { display: block; width: 100%; margin-top: 14px; padding: 0; border: 0; outline: 0; resize: none; overflow: hidden; background: none; color: var(--ink); caret-color: var(--moss); font: 400 clamp(30px, 5vw, 76px)/1.1 var(--serif); letter-spacing: -.03em; }
.try textarea::placeholder { color: #B9B7AC; opacity: 1; font-style: italic; }
.try-foot { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--ink); font-size: 14.5px; color: var(--ink2); }

/* ---------- Foot ---------- */

.foot { background: var(--deep); color: var(--on-forest2); padding-block: clamp(90px, 11vw, 160px) 34px; }
.promise { font: italic 400 clamp(30px, 4.2vw, 62px)/1.1 var(--serif); letter-spacing: -.03em; max-width: 17em; color: var(--on-forest); text-wrap: balance; }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 32px; margin-top: clamp(80px, 10vw, 150px); padding-top: 26px; border-top: 1px solid rgb(184 201 174 / .2); font-size: 14px; color: var(--on-forest2); }
.foot .logo { color: var(--on-forest); }

/* ---------- Motion ----------
   The scene follows the scroll (script.js). Further down, a few things answer
   being reached: the highlighter sweeps, the thread fills, the capture types. */

.js [data-rise] { opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .js :is([data-voice], .piece) mark { background-size: 0% 78%; }
  .js .piece :is(.marked .line, .marked .src) { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .layer ul, .hint::after, .seed, .typing .caret { animation: none; }
  .thread li::before { transition: none; }
}
