/* Hutspot: the JustBee look (paper, ink, yellow; Fredoka and Nunito Sans, as on justbee.nl) with a
   Delft blue tile in Fraunces italic. */
:root {
  --paper: #faf7ee;
  --panel: #fffdf6;
  --ink: #1f1f1f;
  --muted: #6a665d;
  --line: #e8dfc9;
  --yellow: #ffc629;
  --yellow-soft: #fff0b7;
  --delft: #1d4f91;
  --delft-dark: #163d73;
  --delft-soft: #e6edf8;
  --glaze: #fbf8f1;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Nunito Sans', sans-serif;
  font-size: 17px;
  line-height: 1.55;
}

h1,
h2 {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1.05;
  margin: 0;
}

a {
  color: inherit;
  text-decoration-thickness: 2px;
  text-decoration-color: #d5a400;
  text-underline-offset: 4px;
}

button,
select {
  font: inherit;
  color: inherit;
}

[hidden] {
  display: none !important;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 11px;
  letter-spacing: .17em;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--delft);
}

.muted {
  color: var(--muted);
  margin: 6px 0 0;
}

/* ---------- JustBee return bar */

.justbee-return {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 8px max(24px, calc((100vw - 1100px) / 2));
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  font: 800 14px 'Nunito Sans', sans-serif;
}

.justbee-return a {
  color: var(--ink);
  text-decoration: none;
}

.justbee-return .brand {
  display: block;
  width: 156px;
  line-height: 0;
}

.justbee-return .brand img {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------- layout */

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 56px;
  display: grid;
  gap: 24px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 460px);
  gap: 48px;
  align-items: center;
  margin-bottom: 16px;
}

.hero h1 {
  font-size: clamp(48px, 8vw, 92px);
}

.intro {
  margin: 14px 0 0;
  font-size: 20px;
  color: var(--muted);
  max-width: 34ch;
}

.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.status {
  min-height: 1.5em;
  margin: 10px 0 0;
  font-weight: 700;
  color: var(--delft);
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 30px;
  min-width: 0;
}

.card h2 {
  font-size: clamp(24px, 3vw, 30px);
}

/* ---------- buttons */

.primary,
.secondary,
.ghost {
  min-height: 46px;
  padding: 10px 22px;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
  border: 2px solid transparent;
}

.primary {
  background: var(--delft);
  color: #fff;
}

.primary:hover,
.primary:focus-visible {
  background: var(--delft-dark);
}

.secondary {
  background: var(--yellow);
}

.secondary:hover,
.secondary:focus-visible {
  background: #f0b400;
}

.ghost {
  background: transparent;
  border-color: #d9cfb6;
}

.ghost:hover,
.ghost:focus-visible {
  border-color: var(--ink);
}

button.link {
  border: 0;
  background: none;
  padding: 0;
  font-weight: 800;
  color: var(--delft);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* ---------- the tile */

.tile-wrap {
  margin: 0;
}

.tile {
  position: relative;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 16%;
  background: var(--glaze);
  border: 10px solid var(--delft);
  outline: 2px solid var(--delft);
  outline-offset: -26px;
  border-radius: 6px;
  box-shadow: 0 20px 40px rgba(22, 61, 115, .18), inset 0 0 40px rgba(29, 79, 145, .08);
}

.tile.is-new {
  animation: wobble .45s cubic-bezier(.2, .9, .3, 1.4);
}

@keyframes wobble {
  0% { transform: rotate(-3deg) scale(.96); }
  100% { transform: none; }
}

.corner {
  position: absolute;
  width: 22%;
  aspect-ratio: 1;
  background:
    radial-gradient(circle at 0 0, var(--delft) 0 28%, transparent 29%),
    radial-gradient(circle at 0 0, var(--glaze) 0 52%, transparent 53%),
    radial-gradient(circle at 0 0, var(--delft) 0 70%, transparent 71%);
}

.corner--tl { top: 16px; left: 16px; }
.corner--tr { top: 16px; right: 16px; transform: scaleX(-1); }
.corner--bl { bottom: 16px; left: 16px; transform: scaleY(-1); }
.corner--br { bottom: 16px; right: 16px; transform: scale(-1); }

.tile-text {
  margin: 0;
  font: italic 600 clamp(24px, 3.4vw, 36px) 'Fraunces', Georgia, serif;
  line-height: 1.25;
  text-align: center;
  color: var(--delft-dark);
  text-wrap: balance;
}

.sources {
  margin-top: 16px;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}

.sources q {
  font-style: italic;
}

/* ---------- daily, cook, wall */

.daily {
  background: var(--delft-soft);
  border-color: #cad8ee;
}

.daily-text {
  margin: 0 0 10px;
  font: italic 600 clamp(22px, 3vw, 30px) 'Fraunces', Georgia, serif;
  color: var(--delft-dark);
}

.cook {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.field {
  display: grid;
  gap: 6px;
  font-weight: 700;
  font-size: 15px;
}

.field select {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid #d9cfb6;
  border-radius: 14px;
  background: #fff;
}

.field select:focus {
  outline: 3px solid var(--yellow);
  outline-offset: 1px;
}

.wall {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.wall-tile {
  position: relative;
}

.wall-open {
  width: 100%;
  aspect-ratio: 1;
  padding: 18%;
  border: 5px solid var(--delft);
  outline: 1px solid var(--delft);
  outline-offset: -11px;
  border-radius: 4px;
  background: var(--glaze);
  font: italic 600 16px 'Fraunces', Georgia, serif;
  line-height: 1.25;
  color: var(--delft-dark);
  cursor: pointer;
}

.wall-open:hover,
.wall-open:focus-visible {
  box-shadow: 0 8px 20px rgba(22, 61, 115, .2);
}

.wall-remove {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.small-print {
  font-size: 15px;
  color: var(--muted);
}

.small-print p:first-child {
  margin-top: 0;
}

.small-print p:last-child {
  margin-bottom: 0;
}

/* ---------- small screens */

@media (max-width: 820px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 0;
  }

  /* On a phone the tile comes right after the intro, with the buttons under it. */
  .hero-text {
    display: contents;
  }

  .hero .eyebrow,
  .hero h1,
  .intro {
    order: 1;
  }

  .tile-wrap {
    order: 2;
    max-width: 440px;
    width: 100%;
    margin: 24px auto 0;
  }

  .buttons,
  .status {
    order: 3;
  }

  .intro {
    font-size: 17px;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }

  .justbee-return {
    padding-inline: 16px;
  }

  .justbee-return .brand {
    width: 126px;
  }

  .justbee-return > a:last-child {
    font-size: 12px;
  }

  .page {
    padding-inline: 16px;
    padding-top: 28px;
  }

  .card {
    padding: 22px 18px;
  }

  .cook {
    grid-template-columns: 1fr;
  }

  .tile {
    border-width: 8px;
    outline-offset: -20px;
  }

  .corner--tl { top: 12px; left: 12px; }
  .corner--tr { top: 12px; right: 12px; }
  .corner--bl { bottom: 12px; left: 12px; }
  .corner--br { bottom: 12px; right: 12px; }

  .wall {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wall-open {
    font-size: 14px;
    padding: 16%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tile.is-new {
    animation: none;
  }

  * {
    scroll-behavior: auto !important;
  }
}
