/* The Ibid Project — palette P5 "Pencil & Slate", Patrick Hand + Nunito Sans */
:root {
  --bg: #F4F1EA;
  --card: #FBFAF6;
  --ink: #1B2733;
  --blue: #2B5C8A;
  --red: #C8372D;
  --yellow: #F2C14E;
  --muted: #5F6B78;
  --rule: #D9D3C7;
  --hand: 'Patrick Hand', 'Segoe Print', 'Bradley Hand', cursive;
  --sans: 'Nunito Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}

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

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { display: block; max-width: 100%; height: auto; }

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding-inline: max(16px, 4vw);
}

h1, h2 { font-family: var(--hand); font-weight: 400; line-height: 1.05; margin: 0; text-wrap: balance; }
p { margin: 0; }

.lbl {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Header */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 24px;
}
.top-logo img { width: 200px; }
.chip {
  font-size: 14px;
  font-weight: 700;
  border: 1.5px solid var(--ink);
  border-radius: 20px;
  padding: 3px 12px;
  background: var(--card);
  white-space: nowrap;
}

main { flex: 1; }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: 48px;
  align-items: center;
  padding-block: 32px 48px;
}
.hero-text { display: grid; gap: 18px; }
.hero h1 { font-size: clamp(48px, 7vw, 84px); }
.lede { font-size: 21px; max-width: 34ch; }
.note {
  font-family: var(--hand);
  color: var(--red);
  font-size: 24px;
  line-height: 1.2;
  transform: rotate(-1.5deg);
  transform-origin: left;
}
.hero-art { display: grid; place-items: center; }
.hero-art img { width: min(100%, 400px); }

/* Signup */
.signup {
  margin-top: 8px;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 12px;
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  padding: 20px;
  max-width: 560px;
}
.field { display: grid; gap: 4px; font-size: 14px; font-weight: 700; }
.signup input, .signup select {
  font: inherit;
  font-size: 16px;
  font-weight: 400;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--rule);
  border-radius: 10px;
  padding: 10px 12px;
  width: 100%;
}
.signup button {
  grid-column: 1 / -1;
  font: inherit;
  font-weight: 800;
  font-size: 17px;
  color: #fff;
  background: var(--blue);
  border: 0;
  border-radius: 10px;
  padding: 12px 18px;
  cursor: pointer;
}
.signup button:hover { background: #234c73; }
.signup :focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.fine { grid-column: 1 / -1; font-size: 14px; color: var(--muted); }
.hp { position: absolute; left: -9999px; }

/* Ducklings on the dotted route */
.route {
  border-top: 3px dotted var(--rule);
  padding-block: 28px 40px;
  display: grid;
  gap: 18px;
}
.ducklings {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: start;
  gap: 16px;
}
.ducklings li { display: grid; justify-items: center; gap: 6px; text-align: center; font-size: 15px; font-weight: 700; }
.ducklings img { width: 72px; }

/* Footer */
.foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-block: 20px 32px;
  font-size: 14px;
  color: var(--muted);
  border-top: 1.5px solid var(--rule);
  width: calc(100% - 2 * max(16px, 4vw));
  max-width: calc(1120px - 2 * max(16px, 4vw));
  padding-inline: 0;
}
.foot img { width: 32px; }

/* Simple centered pages (thanks, 404) */
.simple {
  flex: 1;
  display: grid;
  place-items: center;
  text-align: center;
  padding-block: 48px;
}
.simple .inner { display: grid; gap: 16px; justify-items: center; max-width: 520px; }
.simple h1 { font-size: clamp(44px, 6vw, 64px); }
.simple img { width: 120px; }
.btn {
  display: inline-block;
  font-weight: 800;
  color: #fff;
  background: var(--blue);
  border-radius: 10px;
  padding: 10px 18px;
  text-decoration: none;
}
.btn:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 24px; padding-top: 8px; }
  .hero-art { order: -1; }
  .hero-art img { width: min(70%, 280px); }
  .ducklings { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 24px; }
}

@media (max-width: 520px) {
  .top-logo img { width: 150px; }
  .signup { grid-template-columns: 1fr; padding: 16px; }
  .ducklings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lede { font-size: 19px; }
}

@media (prefers-reduced-motion: no-preference) {
  .ducklings li { animation: waddle 3.2s ease-in-out infinite; }
  .ducklings li:nth-child(2) { animation-delay: .25s; }
  .ducklings li:nth-child(3) { animation-delay: .5s; }
  .ducklings li:nth-child(4) { animation-delay: .75s; }
  .ducklings li:nth-child(5) { animation-delay: 1s; }
  @keyframes waddle { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-4px) } }
}
