:root {
  color-scheme: light;
  --paper: #FBF7FF;
  --ink: #2E2250;
  --muted: #675A8C;
  --violet: #6E4FD8;
  --rose: #B0487E;
  --line: #E7DEFA;
  --night: #1E1645;
  --night-ink: #F4ECFF;
  --night-muted: #B9AEDB;
  --gold: #FFD9A0;
  --grad: linear-gradient(135deg, #FFC6A8 0%, #F59BC0 55%, #B892FF 100%);
  --display: Literata, Georgia, serif;
  --body: Nunito, system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 500 1.0625rem/1.6 var(--body); }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--violet); text-underline-offset: 0.18em; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; margin: 0; text-wrap: balance; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 10; background: var(--paper); padding: 0.5rem 1rem; border-radius: 8px; }
.skip:focus { top: 1rem; }

/* Hero: the craft table, with one page on it that colors in as you drag. */
.hero {
  /* A wash of the table's own color keeps the supplies at the left edge out from under the words. */
  background:
    linear-gradient(90deg, #F4EEE7F2 0%, #F4EEE7D9 30%, #F4EEE700 52%),
    #F3EEE8 url(/img/desk.webp) center / cover no-repeat;
  padding: clamp(2rem, 5vw, 4.5rem) max(5vw, 1.25rem) clamp(2.5rem, 6vw, 5rem);
}
.hero-inner {
  max-width: 76rem; margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 5rem); align-items: center;
}
.intro { max-width: 34rem; }
.brand { display: flex; align-items: center; gap: 0.6rem; margin: 0 0 clamp(1.5rem, 4vw, 3rem); font: 500 1.25rem var(--display); }
.brand img { border-radius: 10px; box-shadow: 0 2px 8px #2E225026; }
h1 { font-size: clamp(2.5rem, 5.2vw, 4.4rem); line-height: 1.04; letter-spacing: -0.015em; }
.lede { font-size: clamp(1.0625rem, 1.5vw, 1.25rem); line-height: 1.55; margin: 1.4rem 0 2rem; max-width: 30rem; }
.stores { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.stores a { display: block; border-radius: 9px; }
.stores img { height: 50px; width: auto; }
.free { margin: 1rem 0 0; color: var(--muted); font-size: 0.95rem; }

.stage { display: grid; justify-items: center; gap: 1.25rem; }
.sheet {
  position: relative; margin: 0; width: min(100%, 30rem); aspect-ratio: 1000 / 1272;
  transform: rotate(1.6deg);
}
.sheet img { position: absolute; inset: 0; width: 100%; height: 100%; }
.sheet .color { clip-path: inset(0 calc(100% - var(--p)) 0 0); }
.sheet .edge {
  position: absolute; top: 3%; bottom: 1%; left: var(--p); width: 3px; margin-left: -1.5px;
  background: #fff; box-shadow: 0 0 0 1px #2E22501F; pointer-events: none;
  opacity: 0; transition: opacity 0.2s;
}
.sheet .edge::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: 2.75rem; height: 2.75rem; margin: -1.375rem;
  border-radius: 50%; background: var(--grad); border: 3px solid #fff; box-shadow: 0 4px 14px #2E225055;
}
.sheet.ready .edge { opacity: 1; }
.sheet .tape {
  position: absolute; top: -1.6rem; left: 50%; width: 2.6rem; height: 9rem; margin-left: -1.3rem;
  background: url(/img/tape.webp) center / 100% 100% no-repeat; transform: rotate(84deg); opacity: 0.92; pointer-events: none;
}
.sheet input {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; touch-action: pan-y;
}
.sheet:has(input:focus-visible) .edge::after { outline: 3px solid var(--violet); outline-offset: 3px; }

.looks { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; max-width: 30rem; }
.looks legend { width: 100%; text-align: center; padding: 0; margin-bottom: 0.6rem; font-size: 0.95rem; color: var(--muted); }
.looks button {
  font: 700 0.95rem var(--body); color: var(--ink); background: #FFFFFFE6; border: 1px solid var(--line);
  padding: 0.55rem 1rem; border-radius: 999px; cursor: pointer;
}
.looks button:hover { border-color: #C9B8F5; }
.looks button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

/* How it works: a real sequence, so it is numbered. */
.how { max-width: 76rem; margin: 0 auto; padding: clamp(4rem, 9vw, 7.5rem) max(5vw, 1.25rem) clamp(3rem, 6vw, 5rem); }
.how h2, .shading h2 { font-size: clamp(2rem, 3.6vw, 3rem); line-height: 1.1; letter-spacing: -0.01em; }
.how h2 { max-width: 22ch; }
.how ol { list-style: none; counter-reset: step; margin: clamp(2.5rem, 5vw, 4rem) 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.5rem, 4vw, 3.5rem); }
.how li { counter-increment: step; }
.how li img { width: min(100%, 17rem); border-radius: 2.1rem; border: 6px solid #fff; box-shadow: 0 1px 0 var(--line), 0 24px 50px -28px #2E225080; margin-bottom: 1.75rem; }
.how h3 { font-size: 1.5rem; line-height: 1.2; display: flex; align-items: baseline; gap: 0.6rem; }
.how h3::before { content: counter(step); font: 500 2.6rem/1 var(--display); color: var(--rose); }
.how li p { margin: 0.6rem 0 0; color: var(--muted); max-width: 30ch; }

.shading { max-width: 76rem; margin: 0 auto; padding: clamp(2rem, 5vw, 4rem) max(5vw, 1.25rem) clamp(4rem, 9vw, 7rem);
  display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 2fr); gap: clamp(2rem, 5vw, 4rem); align-items: end; }
.shading-text p { color: var(--muted); margin: 1rem 0 0; max-width: 32ch; }
.shading ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(0.75rem, 1.6vw, 1.25rem); }
.shading li img { border-radius: 4px; box-shadow: 0 1px 2px #2E22501F, 0 12px 26px -16px #2E225066; margin-bottom: 0.9rem; }
.shading b { display: block; font: 500 1.2rem var(--display); }
.shading li span { display: block; color: var(--muted); font-size: 0.9rem; line-height: 1.4; margin-top: 0.15rem; }

/* The end: the app's night theme. */
.end { background: var(--night); color: var(--night-ink); padding: clamp(4rem, 8vw, 6rem) max(5vw, 1.25rem) 2.5rem; text-align: center; }
.end-inner { max-width: 40rem; margin: 0 auto; display: grid; justify-items: center; gap: 0.75rem; }
.end-inner > img { border-radius: 18px; box-shadow: 0 0 0 1px #FFFFFF2E, 0 10px 30px -8px #00000080; }
.end .end-title { color: var(--night-ink); font: 500 clamp(2rem, 4vw, 2.75rem)/1.1 var(--display); margin: 0.5rem 0 0; }
.end p { margin: 0; color: var(--night-muted); }
.end .stores { justify-content: center; margin: 1rem 0 2.5rem; }
.end nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 1.75rem; }
.end nav a { color: var(--night-ink); }
.end nav a:hover { color: var(--gold); }
.end :focus-visible { outline-color: var(--gold); }
.end .small { font-size: 0.875rem; margin-top: 1.25rem; }

@media (max-width: 900px) {
  .hero { background:
    linear-gradient(180deg, #F4EEE7F2 0%, #F4EEE7E6 34%, #F4EEE700 52%),
    #F3EEE8 url(/img/desk-tall.webp) center top / cover no-repeat; }
  .hero-inner { grid-template-columns: 1fr; }
  .intro { max-width: 36rem; }
  .brand { margin-bottom: 1.5rem; }
  .stage { order: 0; }
  .how ol { grid-template-columns: 1fr; max-width: 30rem; }
  .how li { display: grid; grid-template-columns: 9rem 1fr; grid-template-rows: auto 1fr; gap: 0 1.25rem; align-items: start; }
  .how li img { grid-row: span 2; width: 9rem; border-radius: 1.4rem; border-width: 4px; margin: 0; }
  .shading { grid-template-columns: 1fr; }
  .shading ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  .how li { grid-template-columns: 7rem 1fr; }
  .how li img { width: 7rem; }
}
@media (prefers-reduced-motion: reduce) {
  .sheet .edge { transition: none; }
}
