/* Tokens. The page is the inside of a mid-century enamel recipe tin: a mint
   field, ruled index cards as the only surfaces, ballpoint ink for text. */
:root {
  --tin: #9ccfc0;
  --tin-deep: #3f7a6c;
  --card: #fffef9;
  --rule: #a9c4e4;
  --red-line: #d9473b;
  --ink: #1e2b4a;
  --ink-soft: #3d4a68;
  --brass: #e8c35a;
  --field-text: #14211f;
  /* Controls that sit on the tin rather than on a card. */
  --control: #1e2b4a;
  --control-hover: #3d4a68;
  --control-text: #fffef9;
  --card-shadow: 0 1px 0 rgba(30, 43, 74, 0.08), 0 14px 30px -18px rgba(20, 50, 44, 0.55);

  --line: 2.25rem;
  --serif: "Young Serif", Georgia, serif;
  --sans: "Atkinson Hyperlegible", system-ui, sans-serif;
  --hand: "Nanum Pen Script", "Comic Sans MS", cursive;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --tin: #17332d;
    --tin-deep: #9ccfc0;
    --card: #eeede6;
    --field-text: #e4efeb;
    --control: #eeede6;
    --control-hover: #ffffff;
    --control-text: #17332d;
    --card-shadow: 0 14px 34px -16px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --tin: #17332d;
  --tin-deep: #9ccfc0;
  --card: #eeede6;
  --field-text: #e4efeb;
  --control: #eeede6;
  --control-hover: #ffffff;
  --control-text: #17332d;
  --card-shadow: 0 14px 34px -16px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

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

body {
  margin: 0;
  background: var(--tin);
  color: var(--field-text);
  font-family: var(--sans);
  font-size: 1.125rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { display: block; }

:focus-visible {
  outline: 3px solid var(--control);
  outline-offset: 3px;
  border-radius: 4px;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.1;
  margin: 0;
  text-wrap: balance;
}

/* Layout */
.masthead, main > section, .footer {
  width: min(100% - 2rem, 72rem);
  margin-inline: auto;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1.25rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: inherit;
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.4rem;
}

.masthead-join {
  color: inherit;
  font-weight: 700;
  text-underline-offset: 0.2em;
}

main > section { padding-block: clamp(3rem, 8vw, 6rem); }

h2 { font-size: clamp(2rem, 4.5vw, 2.9rem); }

.section-lede {
  max-width: 38rem;
  margin: 1rem 0 0;
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
  padding-top: clamp(1.5rem, 5vw, 4rem);
}

@media (min-width: 900px) {
  .hero { grid-template-columns: 1.05fr 1fr; gap: 4rem; }
}

h1 {
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  letter-spacing: -0.01em;
}

.lede {
  max-width: 34rem;
  margin: 1.5rem 0 2rem;
  font-size: 1.2rem;
}

/* The index card: white stock, a red rule under the title line, blue rules
   below it, all on one rhythm so handwriting sits on the lines. */
.card {
  position: relative;
  --control: var(--ink);
  background-color: var(--card);
  background-image:
    linear-gradient(var(--red-line), var(--red-line)),
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent calc(var(--line) - 1px),
      var(--rule) calc(var(--line) - 1px),
      var(--rule) var(--line)
    );
  background-size: 100% 2px, 100% 100%;
  background-position: 0 calc(var(--line) * 1.5 - 1px), 0 calc(var(--line) * 0.5);
  background-repeat: no-repeat, repeat;
  color: var(--ink);
  border-radius: 3px;
  box-shadow: var(--card-shadow);
  padding: calc(var(--line) * 0.5) clamp(1.25rem, 4vw, 2rem) var(--line);
  line-height: var(--line);
}

.card-title {
  margin: 0;
  font-family: var(--hand);
  font-size: 2.1rem;
  line-height: var(--line);
}

.week-card {
  --line: 2.7rem;
  margin: 0;
  transform: rotate(-1.5deg);
  max-width: 34rem;
  justify-self: center;
  width: 100%;
}

.week {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--hand);
  font-size: 2.15rem;
}

.week li {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  min-height: var(--line);
  position: relative;
}

.week .day {
  width: 3.4rem;
  flex: none;
  color: var(--ink-soft);
}

.week .dish {
  position: relative;
  white-space: nowrap;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.week .dish.is-moving {
  opacity: 0;
  transform: translateY(-0.6rem);
}

/* The pen stroke through Tuesday. Drawn as a scaled line so it can be
   animated once, and simply present when motion is reduced. */
.week [data-row="tue"] .dish::after {
  content: "";
  position: absolute;
  left: -0.2rem;
  right: -0.2rem;
  top: 55%;
  height: 2px;
  background: var(--red-line);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s cubic-bezier(0.6, 0, 0.3, 1);
}

.week-card.is-struck [data-row="tue"] .dish::after { transform: scaleX(1); }

.week .note, .week .pin, .margin-note {
  font-family: var(--hand);
  color: var(--red-line);
}

.week .note {
  margin-left: auto;
  white-space: nowrap;
  transform: rotate(-4deg);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.week-card.is-struck .note { opacity: 1; }

.week .pin {
  margin-left: auto;
  color: var(--ink-soft);
  font-size: 1.4rem;
}

/* Waitlist form */
.waitlist label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.waitlist-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  max-width: 32rem;
}

.waitlist input[type="email"] {
  flex: 1 1 14rem;
  min-width: 0;
  font: inherit;
  padding: 0.8rem 1rem;
  border: 2px solid var(--control);
  border-radius: 6px;
  background: var(--card);
  color: var(--ink);
}

.waitlist button, .ask-options button {
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid var(--ink);
  border-radius: 6px;
}

.waitlist button {
  flex: 0 0 auto;
  padding: 0.8rem 1.3rem;
  border-color: var(--control);
  background: var(--control);
  color: var(--control-text);
}

.waitlist button:hover { background: var(--control-hover); }
.waitlist button[disabled] { opacity: 0.7; cursor: progress; }

.waitlist-note {
  margin: 0.6rem 0 0;
  font-size: 0.95rem;
}

.waitlist-note[data-state="error"] { font-weight: 700; }

.trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* One question a night */
.ask {
  margin-top: 2.5rem;
  max-width: 44rem;
}

.ask-question {
  margin: 0;
  font-family: var(--hand);
  font-size: 2.1rem;
}

.ask-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  min-height: calc(var(--line) * 2);
}

.ask-options button {
  padding: 0.35rem 1rem;
  line-height: 1.5;
  background: var(--card);
  color: var(--ink);
}

.ask-options button:hover { background: #eef4fb; }

.ask-options button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--card);
}

.ask-reply {
  margin: 0;
  font-family: var(--hand);
  font-size: 1.75rem;
  min-height: var(--line);
}

.secret {
  margin: 1.25rem 0 0;
  font-family: var(--hand);
  font-size: clamp(1.9rem, 3.4vw, 2.4rem);
  line-height: 1.1;
}

.secret + .lede { margin-top: 1rem; }

/* What's in the box: four cards laid out like a hand of recipe cards, each
   tipped a little differently so they read as objects, not a grid of tiles. */
.spread {
  display: grid;
  gap: 1.75rem;
  margin-top: 2.5rem;
}

@media (min-width: 820px) {
  .spread { grid-template-columns: 1fr 1fr; gap: 2.25rem 2.5rem; }
}

.feature:nth-child(1) { transform: rotate(-0.8deg); }
.feature:nth-child(2) { transform: rotate(0.6deg); }
.feature:nth-child(3) { transform: rotate(0.4deg); }
.feature:nth-child(4) { transform: rotate(-0.6deg); }

.feature h3 {
  font-size: 1.5rem;
  line-height: var(--line);
}

.feature p { margin: 0; }

.margin-note {
  margin-top: var(--line) !important;
  font-size: 1.8rem;
  transform: rotate(-2deg);
  transform-origin: left;
}

/* Getting your recipes in */
.start {
  display: grid;
  gap: 2.5rem 4rem;
  align-items: start;
}

@media (min-width: 900px) {
  .start { grid-template-columns: 1.2fr 1fr; }
  .start > h2, .start > .section-lede, .steps { grid-column: 1; }
  .heirloom { grid-column: 2; grid-row: 1 / span 3; align-self: center; }
}

.start > h2 + .section-lede { margin-top: -1.5rem; }

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.5rem;
}

.steps h3 { font-size: 1.35rem; }
.steps p { margin: 0.35rem 0 0; max-width: 34rem; }

.heirloom {
  margin: 0;
  transform: rotate(2deg);
  font-family: var(--hand);
  font-size: 1.7rem;
  max-width: 28rem;
  width: 100%;
  justify-self: center;
}

.heirloom p { margin: 0; }
.heirloom-margin { color: var(--red-line); transform: rotate(-3deg); transform-origin: left; margin-top: var(--line) !important; }

.stamp {
  position: absolute;
  right: 1.25rem;
  top: 0.9rem;
  margin: 0;
  padding: 0.1rem 0.7rem;
  border: 3px double var(--red-line);
  border-radius: 4px;
  color: var(--red-line);
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.6;
  transform: rotate(-8deg);
  opacity: 0.85;
}

/* Questions */
.faq details {
  max-width: 44rem;
  border-bottom: 2px solid color-mix(in srgb, var(--field-text) 25%, transparent);
}

.faq details:first-of-type { margin-top: 1.5rem; }

.faq summary {
  cursor: pointer;
  padding: 1rem 0;
  font-family: var(--serif);
  font-size: 1.25rem;
  list-style-position: outside;
}

.faq details p { margin: 0 0 1.25rem; max-width: 38rem; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Promises */
.promises ul {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: grid;
  gap: 1.25rem 3rem;
  max-width: 60rem;
}

@media (min-width: 760px) {
  .promises ul { grid-template-columns: 1fr 1fr; }
}

.promises li {
  padding-left: 2.2rem;
  position: relative;
  max-width: 28rem;
}

.promises li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: -0.25rem;
  font-family: var(--hand);
  font-size: 2rem;
  color: var(--tin-deep);
}

.promises strong {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.25rem;
  display: block;
}

/* Join */
.join .waitlist { margin-top: 2rem; }

.footer {
  padding-block: 2rem 3rem;
  font-size: 0.95rem;
}

.footer p { margin: 0; }

@media (max-width: 520px) {
  body { font-size: 1.0625rem; }
  .week-card { --line: 2.3rem; }
  .week { font-size: 1.45rem; }
  .week li { gap: 0.5rem; }
  .week .day { width: 2.4rem; }
  .week .pin { font-size: 1.2rem; }
  .heirloom { font-size: 1.45rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
