/* lollygagging.mom. Phone first, system fonts only. */
:root {
  --bg: #fff4e4;
  --ink: #1d1a17;
  --muted: #6c6158;
  --red: #e5372b;
  --red-dark: #b8231a;
  --card: #ffffff;
  --line: #ecd8bd;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  color-scheme: light;
}

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

[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.45 var(--font);
  overflow-wrap: anywhere;
}

h2 { font-size: clamp(26px, 7vw, 38px); line-height: 1.1; margin: 0 0 8px; letter-spacing: -0.01em; }
p { margin: 0; }

/* The big joke. */
.hero {
  min-height: 88vh;
  min-height: 88svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 28px 16px 40px;
  text-align: center;
  overflow-x: clip; /* the shake never makes the page scroll sideways */
  transition: background-color 0.6s, color 0.6s;
}
.brand { font-weight: 800; font-size: 15px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.who { font-size: clamp(30px, 10vw, 64px); font-weight: 900; line-height: 1; color: var(--red); }
.clock {
  font-size: min(28vw, 240px);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--red);
}
.clock[data-len="6"], .clock[data-len="7"] { font-size: min(20vw, 190px); }
.nag {
  max-width: 22ch;
  min-height: 3.6em;
  font-size: clamp(24px, 6.6vw, 44px);
  font-weight: 800;
  line-height: 1.2;
}
.cta {
  margin-top: 10px;
  display: inline-block;
  padding: 14px 22px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}
.cta:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }

/* Mom gets louder. */
.hero[data-tier="1"] .nag { color: var(--red-dark); }
.hero[data-tier="2"] .clock { animation: shake 0.5s ease-in-out infinite; }
.hero[data-tier="2"] .nag { color: var(--red-dark); text-transform: uppercase; }
.hero[data-tier="3"] { background: var(--red); color: #fff; }
.hero[data-tier="3"] .clock, .hero[data-tier="3"] .who { color: #fff; animation: shake 0.25s ease-in-out infinite; }
.hero[data-tier="3"] .nag { text-transform: uppercase; }
.hero[data-tier="3"] .brand { color: #ffd8d4; }
.hero[data-tier="3"] .cta { background: #fff; color: var(--red-dark); }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px) rotate(-0.6deg); }
  75% { transform: translateX(3px) rotate(0.6deg); }
}
@media (prefers-reduced-motion: reduce) {
  .hero .clock, .hero .who { animation: none !important; }
  html { scroll-behavior: auto; }
}

/* The maker. */
main { padding: 0 16px; }
.maker, .gallery { max-width: 560px; margin: 0 auto; padding: 40px 0; }
.lede { color: var(--muted); margin-bottom: 18px; }
label { display: block; font-weight: 700; margin-bottom: 6px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; }
input {
  flex: 1 1 170px;
  min-width: 0;
  font: inherit;
  font-size: 18px;
  padding: 13px 14px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
}
button {
  font: inherit;
  font-weight: 700;
  padding: 13px 18px;
  border-radius: 12px;
  border: 2px solid var(--ink);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}
#make, button.primary { background: var(--red); border-color: var(--red); color: #fff; }
#make { flex: 0 0 auto; }
button:active { transform: translateY(1px); }

.oops {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #ffe1dc;
  color: var(--red-dark);
  font-weight: 700;
}

.result { margin-top: 20px; }
#picture {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(60, 30, 10, 0.18);
  background: #fff;
}
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
@media (min-width: 520px) { .actions { grid-template-columns: repeat(4, 1fr); } }
.status { min-height: 1.5em; margin-top: 10px; color: var(--muted); font-weight: 600; }

/* The gallery. */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 720px) { .gallery { max-width: 900px; } .grid { grid-template-columns: repeat(3, 1fr); } }
figure { margin: 0; }
figure img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 12px;
  background: var(--line);
}

.footer {
  padding: 32px 16px 44px;
  text-align: center;
  border-top: 2px dashed var(--line);
  display: grid;
  gap: 6px;
}
.footer .small { font-size: 14px; color: var(--muted); }
