/* Ship 52. One page, no build step. Design spec: AGENTS.md > Design spec. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/assets/fonts/bricolage-grotesque-800.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #FFFBF2;
  --ink: #141414;
  --accent: #FF5C39;
  --accent-soft: #FFE8D6;
  --muted: #6B6560;
  --border: 3px solid var(--ink);
  --shadow: 5px 5px 0 var(--ink);
  --shadow-pressed: 3px 3px 0 var(--ink);
  --head: "Bricolage Grotesque", "Arial Black", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem; /* 17px */
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page {
  flex: 1;
  width: 100%;
  max-width: 44rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 2rem;
}

/* ---------- The mark: 13 x 4 = 52 weeks ---------- */

.mark { margin: 0 0 2.75rem; }

.grid {
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  gap: 4px;
  max-width: 30rem;
  transform: rotate(-1.5deg);
}

.grid span {
  aspect-ratio: 1;
  border: 2px solid var(--ink);
  border-radius: 3px;
  background: #fff;
  animation: pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* A shipped week. Add class="on" to a square to fill it. */
.grid span.on { background: var(--accent); }

/* Week 1 is next up: it breathes while it waits. */
.grid span:first-child:not(.on) {
  animation: pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both, next 1.6s ease-in-out 1.2s infinite;
}

/* Stagger the pop-in by column, left to right. */
.grid span:nth-child(13n+2)  { animation-delay: 0.04s; }
.grid span:nth-child(13n+3)  { animation-delay: 0.08s; }
.grid span:nth-child(13n+4)  { animation-delay: 0.12s; }
.grid span:nth-child(13n+5)  { animation-delay: 0.16s; }
.grid span:nth-child(13n+6)  { animation-delay: 0.20s; }
.grid span:nth-child(13n+7)  { animation-delay: 0.24s; }
.grid span:nth-child(13n+8)  { animation-delay: 0.28s; }
.grid span:nth-child(13n+9)  { animation-delay: 0.32s; }
.grid span:nth-child(13n+10) { animation-delay: 0.36s; }
.grid span:nth-child(13n+11) { animation-delay: 0.40s; }
.grid span:nth-child(13n+12) { animation-delay: 0.44s; }
.grid span:nth-child(13n)    { animation-delay: 0.48s; }

@keyframes pop {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}
@keyframes next {
  0%, 100% { background: #fff; }
  50%      { background: var(--accent-soft); }
}

.wordmark {
  display: inline-block;
  margin: 1.1rem 0 0;
  padding: 0.2rem 0.7rem 0.25rem;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--head);
  font-weight: 800;
  font-size: 1.125rem;
  letter-spacing: 0.06em;
  line-height: 1.2;
  transform: rotate(1.5deg);
}

/* ---------- Headline ---------- */

h1 {
  margin: 0 0 1.25rem;
  font-family: var(--head);
  font-weight: 800;
  font-size: clamp(2.6rem, 11vw, 4.75rem);
  line-height: 1;
  letter-spacing: -0.035em;
}

h1 mark {
  position: relative;
  z-index: 0;
  background: none;
  color: inherit;
  white-space: nowrap;
}
h1 mark::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: -0.1em;
  right: -0.12em;
  top: 0.5em;
  bottom: 0.02em;
  background: var(--accent-soft);
  transform: rotate(-1.5deg) scaleX(1);
  transform-origin: left center;
  animation: swipe 0.5s 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes swipe {
  from { transform: rotate(-1.5deg) scaleX(0); }
  to   { transform: rotate(-1.5deg) scaleX(1); }
}

.sub {
  margin: 0 0 2.5rem;
  max-width: 34rem;
  font-size: 1.125rem;
}

/* ---------- Signup card ---------- */

.card {
  background: var(--accent-soft);
  border: var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 1.25rem;
  transform: rotate(0.75deg);
  margin-right: 5px; /* room for the shadow at 375px */
}

.signup label {
  display: block;
  margin: 0 0 0.75rem;
  font-weight: 600;
  font-size: 1.0625rem;
  line-height: 1.35;
}

.row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

input[type="email"] {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0.8rem 0.9rem;
  border: var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 1.125rem; /* 16px+ stops iOS zoom on focus */
}
input[type="email"]::placeholder { color: var(--muted); opacity: 1; }

button {
  margin: 0;
  padding: 0.8rem 1.4rem;
  border: var(--border);
  border-radius: 8px;
  background: var(--accent);
  color: var(--ink);
  font-family: var(--head);
  font-weight: 800;
  font-size: 1.1875rem;
  letter-spacing: -0.01em;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.08s ease-out, box-shadow 0.08s ease-out;
}
button:hover,
button:active {
  transform: translate(2px, 2px);
  box-shadow: var(--shadow-pressed);
}
button[disabled] { cursor: progress; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
input[type="email"]:focus-visible { outline-offset: 2px; }

.micro {
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 0.9375rem;
}

.msg { margin: 0; }
.msg[hidden] { display: none; }

.msg-error {
  margin-top: 0.85rem;
  font-weight: 600;
}
.msg-error::before {
  content: "";
  display: inline-block;
  width: 0.7em;
  height: 0.7em;
  margin-right: 0.45em;
  border: 2px solid var(--ink);
  background: var(--accent);
  vertical-align: -0.02em;
}

.msg-success {
  font-family: var(--head);
  font-weight: 800;
  font-size: clamp(1.6rem, 7vw, 2.25rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  outline: none;
}

/* Honeypot. Off-screen, not display:none, so dumb bots still fill it. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Footer ---------- */

.foot {
  width: 100%;
  max-width: 44rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2.5rem;
  color: var(--muted);
  font-size: 0.9375rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  align-items: baseline;
}
.foot p { margin: 0; }
.foot .links { display: flex; gap: 1rem; }

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 3px;
  text-underline-offset: 3px;
}
a:hover { background: var(--accent-soft); }

/* ---------- No-JS result page (subscribe.php) ---------- */

.result .card { margin-top: 0.5rem; }
.result .back { margin: 1.5rem 0 0; }

/* ---------- Bigger screens ---------- */

@media (min-width: 560px) {
  .page { padding-top: 4rem; }
  .grid { gap: 5px; }
  .grid span { border-width: 3px; }
  .card { padding: 1.75rem; }
  .row { flex-direction: row; }
  .row input[type="email"] { flex: 1; }
}

@media (min-width: 960px) {
  .page { padding-top: 6rem; }
  .mark { margin-bottom: 3.5rem; }
}

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