/* Swap these once the brand colors and fonts are final. */
:root {
  --surface: #fdfbf3;
  --surface-2: #ffffff;
  --surface-3: #f3eee0;
  --line: #cfc8b4;
  --text: #1b1a22;
  --text-soft: #5b5766;
  --on-paint: #120f16;
  --light: #f6f2e7;
  --teal: #0b7285;
  --rule: #c4d8e8;
  --margin: #f2a5a5;
  --cover: #15141a;
  --orange: #ff9a1f;
  --red: #ff5a47;
  --pink: #ff4fa3;
  --violet: #b892ff;
  --lime: #8cf542;
  --cyan: #35e0ff;
  --yellow: #ecff3d;
  --danger: #b3261e;
  /* Free stand-in for Storm Gust. To switch, change this one line. */
  --display: "Protest Revolution", "Impact", sans-serif;
  --hand: "Sedgwick Ave", "Comic Sans MS", cursive;
  --plain: "Figtree", system-ui, sans-serif;
  --radius: 6px;
  --rough: 255px 15px 225px 15px / 15px 225px 15px 255px;
  --spiral: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='40'%3E%3Ccircle cx='14' cy='21' r='5' fill='%2315141a'/%3E%3Ccircle cx='50' cy='21' r='5' fill='%2315141a'/%3E%3Cpath d='M14 22C22 9 42 9 50 22' fill='none' stroke='%2356545e' stroke-width='6' stroke-linecap='round'/%3E%3Cpath d='M14 21C22 8 42 8 50 21' fill='none' stroke='%23d5d7de' stroke-width='3.5' stroke-linecap='round'/%3E%3C/svg%3E");
  --drips: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 60' preserveAspectRatio='none'%3E%3Cpath fill='%23ff4fa3' d='M0 0H400V10H372c-5 0-6 3-6 8v26c0 8-11 8-11 0V20c0-6-4-10-10-10H300c-5 0-6 3-6 7v9c0 6-8 6-8 0v-9c0-4-2-7-6-7H214c-5 0-6 4-6 8v34c0 9-12 9-12 0V20c0-6-3-10-9-10H120c-5 0-6 3-6 7v12c0 6-8 6-8 0V18c0-5-3-8-7-8H62c-5 0-6 4-6 8v20c0 8-10 8-10 0V20c0-6-4-10-9-10H0Z'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cover);
  color: var(--text);
  font: 400 1.25rem/1.35 var(--hand);
}

h1, h2, h3 { font-weight: 400; line-height: 1.15; margin: 0 0 .5em; }
h1, h2, h3, legend, th, .brand, .tab, .btn, .pill, .sample-note, label.field { text-transform: uppercase; letter-spacing: .02em; }
h1 { font: 400 3.4rem/1.05 var(--display); color: var(--on-paint); text-shadow: 3px 3px 0 var(--pink); }
h2 { font-family: var(--display); font-size: 1.75rem; color: var(--teal); }
h3 { font-family: var(--display); font-size: 1.3rem; }
p { margin: 0 0 1em; }
a { color: inherit; text-underline-offset: 3px; }
main:focus { outline: none; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }

/* Scale everything to the window so both pages fit without scrolling */
@media (min-width: 821px) and (min-height: 560px) {
  html { font-size: clamp(11px, min(1.2vw, 1.95vh), 18px); }
}

/* Layout: the first screen is only the open book. The footer sits below it. */
.screen { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.demo-bar { flex: none; }

.binder {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 3.2rem;
  grid-template-rows: minmax(0, 1fr);
  padding: .6rem 0 .6rem .6rem;
}

.page { grid-column: 1; grid-row: 1; position: relative; min-height: 0; }
.sheet { position: relative; height: 100%; }
main { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); height: 100%; }

/* The spiral binding down the middle */
.page::before {
  content: "";
  position: absolute;
  inset: 6px auto 6px calc(50% - 32px);
  z-index: 8;
  width: 64px;
  background: var(--spiral) 0 0 / 64px 40px repeat-y;
  pointer-events: none;
}

/* One sheet of ruled paper with a red margin line */
.leaf {
  --margin-x: 1.3rem;
  --gutter: linear-gradient(90deg, transparent 90%, rgb(0 0 0 / .13));
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  padding: .8rem 3rem .4rem 2rem;
  background:
    var(--gutter),
    linear-gradient(90deg, transparent var(--margin-x), var(--margin) var(--margin-x) calc(var(--margin-x) + 2px), transparent calc(var(--margin-x) + 2px)),
    repeating-linear-gradient(transparent 0 1.9rem, var(--rule) 1.9rem 2rem),
    var(--surface);
  scrollbar-width: thin;
}
.leaf.left { border-radius: 8px 0 0 8px; }
.leaf.right {
  --margin-x: 3rem;
  --gutter: linear-gradient(270deg, transparent 90%, rgb(0 0 0 / .13));
  border-radius: 0 8px 8px 0;
  padding: .8rem 1.5rem .4rem 3.6rem;
}
.leaf-body { flex: 1; min-height: 0; display: flex; flex-direction: column; padding-top: .5rem; }

/* Turning pages */
.flip-layer { position: absolute; inset: 0; z-index: 7; perspective: 2800px; pointer-events: none; }
.flip-staying { position: absolute; top: 0; bottom: 0; width: 50%; overflow: hidden; }
.flip-staying.on-left { left: 0; }
.flip-staying.on-right { right: 0; }
.flipper { position: absolute; top: 0; bottom: 0; width: 50%; transform-style: preserve-3d; }
.flipper.forward { left: 50%; transform-origin: left center; animation: flip-forward .6s ease-in-out both; }
.flipper.back { left: 0; transform-origin: right center; animation: flip-back .6s ease-in-out both; }
.flip-face { position: absolute; inset: 0; overflow: hidden; backface-visibility: hidden; }
.flip-back { transform: rotateY(180deg); }
@keyframes flip-forward { to { transform: rotateY(-180deg); } }
@keyframes flip-back { to { transform: rotateY(180deg); } }

/* Phones show one page at a time, so one page swings */
.sheet-copy { position: absolute; top: 0; right: 0; left: 0; z-index: 1; display: block; overflow: hidden; pointer-events: none; }
.turn-away, .turn-in { z-index: 2; transform-origin: left center; box-shadow: 0 0 40px rgb(0 0 0 / .35); }
.turn-away { animation: turn-away .55s ease-in both; }
.turn-in { animation: turn-in .55s ease-out both; }
@keyframes turn-away {
  from { transform: perspective(2400px) rotateY(0); }
  to { transform: perspective(2400px) rotateY(-90deg); }
}
@keyframes turn-in {
  from { transform: perspective(2400px) rotateY(-90deg); }
  to { transform: perspective(2400px) rotateY(0); }
}

/* The closed cover sits on the right. Opening swings it over the spine. */
.sheet .leaf.left { transition: opacity .15s; }
.sheet.closed .leaf.left { opacity: 0; pointer-events: none; }
.cover {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 50%;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem 3rem 2rem 4rem;
  background: var(--drips) 0 0 / 400px 52px repeat-x, #24222b;
  border-radius: 0 8px 8px 0;
  color: var(--light);
  cursor: pointer;
  text-align: center;
  transform-origin: left center;
  backface-visibility: hidden;
}
.cover[hidden] { display: none; }
.cover.opening { animation: cover-open .7s ease-in-out both; }
@keyframes cover-open {
  from { transform: perspective(2800px) rotateY(0); }
  to { transform: perspective(2800px) rotateY(-180deg); }
}
.cover-title { font: 400 5.2rem/1 var(--display); color: var(--pink); text-shadow: 4px 4px 0 var(--yellow); text-transform: uppercase; }
.cover-sub { font: 400 1.8rem var(--hand); }

.page-foot { flex: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: .3rem; font: 400 1.05rem var(--display); letter-spacing: .02em; text-transform: uppercase; }
.page-foot a { color: var(--teal); text-decoration: none; }
.page-foot a:hover { text-decoration: underline; }
.page-number { color: var(--text-soft); font: 400 1.05rem var(--hand); text-transform: none; }
.page-aside { color: var(--text-soft); }

/* Cardstock divider tabs stepping down the outer edge of the right page */
.tabs {
  grid-column: 2;
  grid-row: 1;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  padding: 1rem 0;
}

.tab {
  position: relative;
  isolation: isolate;
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .4rem;
  min-height: 0;
  max-height: 9.5rem;
  margin-right: .55rem;
  padding: .5rem .35rem;
  color: var(--on-paint);
  font: 400 1rem/1 var(--display);
  text-decoration: none;
  white-space: nowrap;
  writing-mode: vertical-rl;
  transition: margin-right .12s ease;
}

/* The angled tab shape: the outer edge is shorter than the edge on the page */
.tab::before {
  content: "";
  position: absolute;
  inset: 0 -.7rem 0 0;
  z-index: -1;
  background: var(--tab);
  border: 1px solid rgb(0 0 0 / .3);
  border-left: 0;
  border-radius: 0 7px 7px 0;
  transform: perspective(70px) rotateY(20deg);
  transform-origin: left center;
}
.tab:hover { margin-right: .25rem; }
.tab:focus-visible { outline-offset: -3px; }
.tab[aria-current="page"] { margin-right: 0; text-decoration: underline 2px; text-underline-offset: 3px; }
.tab svg { flex: none; width: .85rem; height: .85rem; }

/* Header and footer */
.brand { flex: none; font: 400 1.05rem/1.1 var(--display); color: #d6166a; letter-spacing: .02em; text-decoration: none; text-transform: uppercase; }
.brand small { font: 400 .85rem var(--display); color: var(--text-soft); margin-left: 6px; }
.account { flex: none; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: .5rem; }
.account span { color: var(--text-soft); font: 400 .85rem var(--plain); }

.site-footer { padding: 28px 4vw 36px; color: var(--light); font-size: 1.1rem; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: 6px 22px; list-style: none; margin: 0 0 10px; padding: 0; }
.site-footer a, .site-footer .btn-text { color: var(--light); }
.site-footer p { margin: 0; }

/* Controls */
.btn {
  display: inline-block;
  border: 3px solid var(--text);
  border-radius: var(--rough);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: 400 1.12rem/1.2 var(--display);
  padding: .45rem 1.1rem;
  text-decoration: none;
}
.btn:hover { background: var(--surface-2); }
.btn-primary {
  background: var(--yellow);
  border-color: var(--on-paint);
  box-shadow: 4px 4px 0 var(--pink);
  color: var(--on-paint);
}
.btn-primary:hover { background: var(--cyan); }
.btn-dark { background: var(--pink); border-color: var(--on-paint); color: var(--on-paint); }
.btn-dark:hover { background: var(--violet); }
.btn-small { font-size: 1rem; padding: .2rem .7rem; }
.btn-text {
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn-danger { color: var(--danger); }

label.field { display: block; font: 400 1rem var(--display); margin-bottom: 14px; }
input[type="text"], input[type="email"], input[type="password"], input[type="date"], select {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 10px 12px;
  border: 3px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--on-paint);
  font: 400 1rem var(--plain);
}
input:focus, select:focus { border-color: var(--cyan); outline: none; }
input[type="file"] { font: 400 .95rem var(--plain); margin-top: 8px; max-width: 100%; }

.check { display: flex; gap: 10px; align-items: flex-start; font: 400 .88rem/1.4 var(--plain); margin-bottom: 12px; }
.check input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--pink); }

.form-error { color: var(--danger); font: 700 .92rem var(--plain); }

/* Home */
.hero {
  position: relative;
  margin: auto 0;
}
.hero h1 { font-size: 4.4rem; }
.hero .lede { font-size: 1.5rem; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.price-note { font-size: 1.1rem; color: var(--text-soft); }

.feature-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: auto 0; }
.feature {
  display: block;
  background: var(--tint, var(--surface-2));
  border-radius: 3px;
  box-shadow: 4px 4px 0 rgb(0 0 0 / .6);
  color: var(--on-paint);
  padding: 18px;
  text-decoration: none;
  transform: rotate(-1deg);
  transition: transform .12s ease;
}
.feature:nth-child(even) { transform: rotate(1.1deg); }
.feature p { margin: 0; font-size: 1.1rem; }
.feature:hover { transform: rotate(0) scale(1.03); }

/* Shared page pieces */
.page-title { margin: 0 0 .7rem; }
.page-title h1 { font-size: 2.9rem; margin-bottom: .3rem; }
.page-title p { color: var(--text-soft); margin: 0; max-width: 40em; }

.card { background: var(--surface-2); border: 2px solid var(--line); border-radius: var(--radius); padding: .9rem; margin-bottom: .8rem; }
.sample-note { display: inline-block; align-self: flex-start; background: var(--yellow); color: var(--on-paint); border-radius: 3px; font: 400 .85rem var(--display); padding: 2px 8px; margin-bottom: 14px; transform: rotate(-1.5deg); }

.unlock-banner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--pink);
  color: var(--on-paint);
  border-radius: var(--radius);
  padding: .7rem 1rem;
  margin-bottom: .9rem;
}
.unlock-banner p { margin: 0; font-size: 1.2rem; }
.unlock-banner .btn-primary { box-shadow: 4px 4px 0 var(--on-paint); }

.locked-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(11rem, 100%), 1fr)); gap: .8rem; }
.locked-item { position: relative; border: 2px solid var(--line); background: var(--surface-2); border-radius: var(--radius); padding: .9rem; min-height: 7rem; }
.locked-item .thumb { height: 3.6rem; border-radius: 4px; background: var(--line); margin-bottom: 12px; }
.bar { display: block; height: 11px; border-radius: 6px; background: var(--line); margin-bottom: 8px; }
.bar.short { width: 55%; }
.lock-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  background: var(--yellow);
  color: var(--on-paint);
  border-radius: 50%;
  padding: 7px;
}
.lock-badge svg { width: 15px; height: 15px; }

.locked-page { border: 2px solid var(--line); background: var(--surface-2); border-radius: var(--radius); padding: 1.8rem 1.2rem; text-align: center; }
.locked-page p { max-width: 32em; margin: 0 auto 18px; }

/* Calendar */
.cal-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .6rem; }
.cal-head h2 { margin: 0; }
.cal-nav { display: flex; gap: 8px; }
.cal-top { flex: none; display: flex; align-items: center; justify-content: space-between; gap: .5rem; height: 4.2rem; }
.cal-top h1 { margin: 0; font-size: 2.9rem; }
.cal-top.cal-head { flex-wrap: nowrap; margin: 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; background: var(--line); border: 2px solid var(--line); border-radius: var(--radius); overflow: hidden; flex: 1; min-height: 0; grid-template-rows: auto; grid-auto-rows: minmax(0, 1fr); }
.cal-dow { background: var(--on-paint); color: var(--yellow); font: 400 .9rem var(--display); text-align: center; padding: 7px 2px; }
.cal-day { background: var(--surface); min-height: 0; padding: 3px 4px; font-size: 1.05rem; min-width: 0; overflow: hidden; }
.cal-day.other { background: var(--surface-3); color: var(--text-soft); }
.cal-day.today .num { background: var(--pink); color: var(--on-paint); border-radius: 50%; display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; }
.cal-chip { display: block; border-radius: 3px; color: var(--on-paint); font: 500 .72rem/1.15 var(--plain); margin-top: 2px; padding: 1px 4px; overflow-wrap: anywhere; background: var(--violet); }
.cal-chip.send { background: var(--lime); }
.cal-grid.split { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cal-notes { grid-column: 4; background: var(--surface); padding: .4rem .5rem; overflow-y: auto; font-size: 1rem; line-height: 1.2; scrollbar-width: thin; }
.cal-notes h2 { font-size: 1.15rem; margin-bottom: .3rem; }
.cal-notes p { margin-bottom: .5rem; }
.cal-notes .btn { white-space: normal; }
.cal-notes .note-row { display: block; padding: .2rem 0; }
.cal-notes .note-row span { display: block; color: var(--text-soft); }
.cal-notes .legend { flex-direction: column; gap: .3rem; font-size: .95rem; }
.note-row { display: flex; justify-content: space-between; gap: 12px; padding: .35rem 0; }
.note-row strong { font-weight: 400; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 1rem; margin-top: 10px; }
.legend span::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--swatch); margin-right: 6px; vertical-align: -1px; }

/* Quiz */
fieldset { border: 0; padding: 0; margin: 0 0 .8rem; }
legend { font: 400 1.2rem/1.2 var(--display); padding: 0; margin-bottom: 10px; }
.choice { display: flex; gap: 10px; align-items: center; background: var(--surface); border: 3px solid var(--line); border-radius: var(--radius); padding: .3rem .8rem; margin-bottom: .35rem; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--on-paint); background: var(--yellow); color: var(--on-paint); }
.choice input { accent-color: var(--pink); }
.steps { padding-left: 1.3em; margin: 0 0 16px; }
.steps li { margin-bottom: 6px; }

/* Guide */
.guide-grid { display: flex; flex-direction: column; gap: .8rem; }
.guide-grid .card { display: grid; grid-template-columns: 45% minmax(0, 1fr); gap: .8rem; margin: 0; }
.guide-grid .card p { margin: 0; }
.video { aspect-ratio: 16 / 9; width: 100%; border: 0; border-radius: 4px; background: var(--on-paint); color: var(--light); display: grid; place-items: center; font-size: 1rem; }

/* Discounts */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 1.1rem; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 3px dashed var(--line); }
th { font: 400 .95rem var(--display); color: var(--teal); }
code { background: var(--yellow); color: var(--on-paint); border-radius: 3px; font: 400 .95rem var(--display); padding: 2px 8px; }

/* Discounts directory */
.title-aside { display: block; margin-top: 8px; color: var(--text); font: 400 1.5rem/1.2 var(--hand); letter-spacing: 0; text-shadow: none; text-transform: none; }

.sticky-note {
  background: #ffe873;
  border-bottom-right-radius: 60px 10px;
  box-shadow: -2px 12px 14px rgb(0 0 0 / .32);
  color: var(--on-paint);
  font-family: var(--hand);
  text-align: center;
}
.sticky-note p { margin: 0; }
.deals-top { flex: none; display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.8rem; }
.sticky-note.center {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 9;
  width: min(380px, calc(100vw - 90px));
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: clamp(12px, 3.5vh, 30px) clamp(14px, 5vw, 26px) clamp(10px, 2.5vh, 20px);
  font-size: clamp(1.1rem, min(7vw, 5.5vh), 1.7rem);
  line-height: 1.25;
  transform: translate(-50%, -50%) rotate(-11deg);
}
.sticky-note.pinned {
  flex: none;
  width: 14rem;
  padding: .8rem;
  font-size: 1.15rem;
  line-height: 1.2;
  transform: rotate(13deg) translate(-.4rem, .3rem);
  transform-origin: top left;
}
.eyes { display: block; background: none; border: 0; color: inherit; font-size: 2.3rem; line-height: 1.2; margin: 6px auto 0; padding: 0; }
button.eyes { cursor: pointer; }
.sticky-note .disclosure { font: italic 400 .72rem/1.3 var(--plain); margin-top: 4px; }
.peek-tip { position: fixed; z-index: 10; background: var(--on-paint); border-radius: 3px; color: var(--light); font-size: 1rem; padding: 2px 9px; pointer-events: none; }
.peek-tip[hidden] { display: none; }

.filter-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .35rem .6rem; }
.filter-col { display: contents; }
.filter-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .3rem;
  flex: 1 1 auto;
  white-space: nowrap;
  background: none;
  border: 0;
  border-bottom: 3px solid var(--line);
  color: var(--text);
  cursor: pointer;
  font: 400 1.2rem/1.2 var(--display);
  letter-spacing: .02em;
  padding: 6px 2px;
  text-transform: uppercase;
}
.filter-head:hover { border-bottom-color: var(--text); }
.filter-head[aria-pressed="true"] { border-bottom-color: var(--teal); color: var(--teal); }
.caret { flex: none; border: 6px solid transparent; border-top-color: currentColor; border-bottom: 0; }
[aria-expanded="true"] .caret { transform: rotate(180deg); }
.filter-chips { order: 1; flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 0 1rem; list-style: none; margin: .25rem 0 0; padding: 0; font-size: 1.05rem; }
.filter-chips li { display: inline-flex; align-items: center; gap: 2px; color: var(--text-soft); }
.filter-chips button { background: none; border: 0; color: var(--text); cursor: pointer; font-size: 1.25rem; line-height: 1; padding: 2px 4px; }
.filter-panel { order: 2; flex-basis: 100%; background: transparent; border: 2px solid var(--teal); margin-top: .35rem; padding: .35rem .7rem; }
.filter-option { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 1.1rem; line-height: 1.2; padding: 2px 0; }
.filter-option input { flex: none; width: 17px; height: 17px; margin: 0; accent-color: var(--pink); }
.filter-clear { display: block; font-size: 1rem; margin: 0 0 0 auto; }
.how-to { font-size: 1.15rem; }
.how-to strong { font-weight: 400; color: var(--teal); }
.deal-count { color: var(--text-soft); margin: 0 0 10px; }
.deal-list { background: var(--surface-2); display: flex; flex-direction: column; gap: .7rem; border: 3px solid var(--pink); padding: .8rem 1rem; }
.deal-list > p { margin: 0; }
.deal-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.deal-top h3 { margin: 0; }
.deal-terms { color: var(--text-soft); font-size: 1.05rem; margin: 4px 0 0; }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(9rem, 100%), 1fr)); gap: .7rem; }
.gallery figure { position: relative; margin: 0; }
.gallery img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; }
.gallery button { position: absolute; right: 7px; bottom: 7px; background: var(--surface); }

/* Reminders */
.reminder { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .3rem .6rem; padding: .45rem 0; border-bottom: 2px dashed var(--line); }
.reminder h3 { margin: 0 0 2px; }
.reminder p { margin: 0; font-size: 1.05rem; color: var(--text-soft); }
.reminder-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pill { background: var(--cyan); color: var(--on-paint); border-radius: 3px; font: 400 .74rem var(--display); margin-left: 8px; padding: 2px 8px; vertical-align: 2px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; align-items: end; }
.form-row .wide { grid-column: 1 / -1; }
.form-row label.field { margin: 0; }
.check-result { margin: 12px 0 0; font-size: 1.1rem; }

/* Legal text stays in a plain font so it is easy to read */
.legal { max-width: 44em; font: 400 1.02rem/1.6 var(--plain); }
.legal h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); line-height: 1.1; }
.legal h2 { font-size: 1.25rem; margin: .6rem 0 .25rem; }
.legal p { margin-bottom: .55rem; }
.legal .updated { color: var(--text-soft); font-style: italic; }
.contact-email { font: 400 1.25rem var(--display); color: var(--teal); }
.contact-email a { color: inherit; }
.legal blockquote { background: var(--surface-2); border-left: 6px solid var(--yellow); margin: 0 0 1em; padding: 14px 18px; }

/* Modal */
.modal {
  border: 3px solid var(--pink);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--surface);
  max-width: 480px;
  width: calc(100% - 32px);
  padding: clamp(16px, 4vw, 26px);
}
.modal::backdrop { background: rgb(0 0 0 / .75); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.modal-head h2 { margin-bottom: 4px; }
.modal-close { background: none; border: 0; cursor: pointer; font-size: 1.8rem; line-height: 1; color: var(--text); padding: 0 4px; }
.modal .sub { color: var(--text-soft); font-size: 1.1rem; }
.modal .btn { width: 100%; text-align: center; margin-top: 6px; }
.modal .alt { font-size: 1.05rem; text-align: center; margin: 14px 0 0; }
.email-preview { border-radius: var(--radius); background: #fff; color: var(--on-paint); padding: 16px; font: 400 .95rem/1.5 var(--plain); }
.email-preview h3 { font: 700 1.1rem var(--plain); }
.email-meta { border-bottom: 2px solid #ddd; font-size: .86rem; margin-bottom: 12px; padding-bottom: 10px; }
.email-meta div { overflow-wrap: anywhere; }
.email-foot { color: #555; font-size: .8rem; margin: 14px 0 0; }

/* Banners */
.cookie-banner {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 720px;
  margin: 0 auto;
  background: var(--on-paint);
  border: 3px solid var(--cyan);
  border-radius: var(--radius);
  color: var(--light);
  padding: 12px 18px;
  font-size: 1.05rem;
}
.cookie-banner[hidden], .demo-bar[hidden] { display: none; }
.cookie-banner p { margin: 0; flex: 1 1 280px; }
.cookie-banner .btn { border-color: var(--light); color: var(--light); }
.cookie-banner .btn:hover { background: #333; }
.cookie-banner .btn-primary { background: var(--yellow); box-shadow: none; border-color: var(--yellow); color: var(--on-paint); }
.cookie-banner .btn-primary:hover { background: var(--cyan); }
.cookie-actions { display: flex; gap: 8px; }

.demo-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 14px;
  background: var(--yellow);
  color: var(--on-paint);
  font: 400 .86rem var(--plain);
  padding: 7px 16px;
}
.demo-bar strong { margin-right: 4px; }

@media (prefers-reduced-motion: reduce) {
  .tab, .feature { transition: none; }
  .sheet-copy, .flip-layer { display: none; }
}

/* Phones and short screens: one page after the other */
@media (max-width: 820px), (max-height: 559px) {
  .screen { height: auto; }
  .binder { display: block; padding: 10px 0 0; }
  .tabs {
    flex-direction: row;
    gap: 2px;
    overflow-x: auto;
    padding: 8px 14px 0;
    scrollbar-width: none;
  }
  .tab, .tab:hover, .tab[aria-current="page"] {
    flex: none;
    margin: 0;
    max-height: none;
    padding: 9px 16px;
    writing-mode: horizontal-tb;
  }
  .tab::before {
    inset: -6px 0 0;
    border: 1px solid rgb(0 0 0 / .3);
    border-bottom: 0;
    border-radius: 7px 7px 0 0;
    transform: perspective(70px) rotateX(16deg);
    transform-origin: bottom center;
  }
  .page, .sheet { height: auto; }
  .page::before { inset: 8px auto 8px -6px; width: 30px; background-size: 30px 20px; }
  main { display: block; height: auto; }
  .leaf, .leaf.left, .leaf.right {
    --margin-x: 32px;
    --gutter: linear-gradient(transparent, transparent);
    overflow: visible;
    padding: 14px 14px 10px 40px;
    border-radius: 0;
  }
  .leaf-body { min-height: 0; }
  .account { justify-content: flex-start; }
  .sheet.closed .leaf.left { opacity: 1; pointer-events: auto; }
  .cover { left: 0; justify-content: flex-start; padding: 18vh 24px 40px 40px; border-radius: 0; backface-visibility: visible; }
  .cover.opening { animation-name: turn-away; }
  .cover-title { font-size: clamp(2.6rem, 12vw, 5rem); }
  h1, .hero h1 { font-size: 2.6rem; }
  .form-row { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .guide-grid .card { grid-template-columns: 1fr; }
  .filter-bar { column-gap: .3rem; }
  .filter-head { font-size: clamp(.56rem, 3.5vw, 1.2rem); letter-spacing: 0; }
  .deals-top { justify-content: flex-end; }
  .deals-top > div:first-child { margin-right: auto; }
  .sticky-note.pinned { width: min(13rem, calc(100% - 40px)); }
  .cal-grid { flex: none; grid-auto-rows: auto; }
  .cal-day { min-height: 62px; padding: 3px; }
  .cal-dow { font-size: .74rem; }
  .cal-chip { font-size: .64rem; padding: 1px 3px; }
}

/* Both pages keep matching top lines so the calendar's weeks line up across the spine */
@media (min-width: 821px) and (min-height: 560px) {
  .brand, .account { height: 2.2rem; }
  .brand { display: flex; align-items: flex-start; gap: 6px; }
  .brand small { margin-left: 0; }
  .account { flex-wrap: nowrap; }
  .account span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* The narrowest phones need every pixel to keep the categories on one line */
@media (max-width: 340px) {
  .caret { display: none; }
  .filter-bar { column-gap: .15rem; }
  .filter-head { padding-inline: 0; }
}
