:root {
  --latte: #f6e9cf;
  --milk: #fffdf6;
  --foam: #fbf3df;
  --espresso: #2c1a0e;
  --roast: #6b4222;
  --roast-soft: #a4785a;
  --sun: #f5c842;
  --sun-deep: #e0a020;
  --leaf: #5d9e45;
  --leaf-deep: #3d7a2d;
  --red: #c8553d;
  --line: 3px solid var(--espresso);
  --radius-l: 28px;
  --radius-m: 18px;
  --radius-s: 12px;
  --display: "Fredoka", "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --measure: 62ch;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--latte);
  color: var(--espresso);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--roast); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--espresso); }
:focus-visible { outline: 3px solid var(--leaf-deep); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.05;
  margin: 0;
  letter-spacing: -0.01em;
}
h2 { font-size: clamp(30px, 4.2vw, 46px); }
h3 { font-size: 22px; }
p { margin: 0; }

.wrap {
  width: min(1120px, 100% - 32px);
  margin: 0 auto;
}

/* ---------- top bar ---------- */
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0 8px;
}
.bar-home {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 20px;
  color: var(--espresso);
  text-decoration: none;
}
.bar-home img { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--espresso); }
.bar-links { display: flex; gap: 6px 18px; flex-wrap: wrap; font-weight: 700; font-size: 15px; }
.bar-links a { text-decoration: none; }
.bar-links a:hover { text-decoration: underline; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 32px;
  align-items: center;
  padding: 36px 0 56px;
}
main { overflow-x: clip; }
.hero-copy { position: relative; z-index: 2; min-width: 0; }

.sun {
  position: absolute;
  z-index: 0;
  right: 4%;
  top: 0;
  width: clamp(280px, 38vw, 520px);
  height: clamp(280px, 38vw, 520px);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, #ffe27a 0%, var(--sun) 55%, rgba(245, 200, 66, 0) 72%);
  transform: translateY(40%) scale(0.85);
  opacity: 0;
  animation: sunrise 1.4s cubic-bezier(0.2, 0.7, 0.2, 1) 0.1s forwards;
  pointer-events: none;
}

.wordmark {
  font-size: clamp(84px, 15vw, 190px);
  font-weight: 700;
  line-height: 0.86;
  letter-spacing: -0.045em;
  color: var(--espresso);
  margin-left: -0.04em;
}
.wordmark .dot { color: var(--sun-deep); }

.tagline {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.2;
  margin-top: 22px;
  max-width: 24ch;
}
.lede {
  margin-top: 16px;
  max-width: var(--measure);
  font-size: 18px;
  color: var(--roast);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
  align-items: center;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 18px;
  padding: 13px 22px;
  border-radius: 999px;
  border: var(--line);
  text-decoration: none;
  color: var(--espresso);
  background: var(--milk);
  box-shadow: 0 4px 0 var(--espresso);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover { transform: translateY(2px); box-shadow: 0 2px 0 var(--espresso); color: var(--espresso); }
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--espresso); }
.btn-primary { background: var(--sun); }
.btn-leaf { background: var(--leaf); color: var(--milk); }
.btn-leaf:hover { color: var(--milk); }

.ca {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 14px;
  padding: 10px 14px;
  background: var(--foam);
  border: 2px solid var(--roast-soft);
  border-radius: 999px;
  color: var(--espresso);
  cursor: pointer;
  max-width: 100%;
  min-width: 0;
}
.ca:hover { border-color: var(--espresso); }
.ca .ca-label { font-family: var(--body); font-weight: 800; color: var(--roast); font-size: 13px; }
.ca .ca-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ca .ca-copied { font-family: var(--body); font-weight: 800; color: var(--leaf-deep); font-size: 13px; display: none; }
.ca.is-copied .ca-copied { display: inline; }
.ca.is-copied .ca-icon { display: none; }


.hero-art {
  position: relative;
  z-index: 1;
  justify-self: center;
  width: min(100%, 440px);
}
.hero-art img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-l);
  border: var(--line);
  box-shadow: 0 10px 0 var(--espresso);
  transform: rotate(-2deg);
}
.bubble {
  position: absolute;
  z-index: 3;
  top: -9%;
  left: -6%;
  background: var(--milk);
  border: var(--line);
  border-radius: 999px;
  padding: 12px 22px;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1;
  white-space: nowrap;
  transform: scale(0);
  animation: pop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) 1.1s forwards;
}
.bubble::after {
  content: "";
  position: absolute;
  bottom: -16px;
  left: 30px;
  width: 22px;
  height: 22px;
  background: var(--milk);
  border-right: var(--line);
  border-bottom: var(--line);
  transform: skewX(20deg) rotate(45deg);
  border-radius: 0 0 4px 0;
}
.bubble.is-swapping span { animation: swap 0.35s ease; display: inline-block; }

@keyframes sunrise { to { transform: translateY(0) scale(1); opacity: 1; } }
@keyframes pop { to { transform: scale(1); } }
@keyframes swap {
  0% { transform: translateY(6px) scale(0.9); opacity: 0; }
  100% { transform: none; opacity: 1; }
}

/* ---------- sections ---------- */
section { padding: 56px 0; }
.section-head { max-width: var(--measure); margin-bottom: 28px; }
.section-head p { margin-top: 12px; font-size: 18px; color: var(--roast); }

.stripe {
  background: var(--espresso);
  color: var(--foam);
}
.stripe h2, .stripe h3 { color: var(--milk); }
.stripe .section-head p { color: #d9c3a5; }
.stripe a { color: var(--sun); }

/* ---------- the tek ---------- */
.tek {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  counter-reset: step;
}
.tek-step {
  counter-increment: step;
  background: var(--milk);
  border: var(--line);
  border-radius: var(--radius-m);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.tek-step img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-bottom: var(--line); background: var(--foam); }
.tek-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.tek-body h3::before {
  content: counter(step) ".";
  display: inline-block;
  min-width: 1.4em;
  color: var(--sun-deep);
}
.tek-body p { color: var(--roast); font-size: 16px; }
.tek-note {
  margin-top: 22px;
  padding: 16px 20px;
  border-left: 5px solid var(--leaf);
  background: var(--foam);
  border-radius: 0 var(--radius-s) var(--radius-s) 0;
  max-width: 78ch;
  color: var(--roast);
}
.tek-note strong { color: var(--espresso); }

/* ---------- the jar ---------- */
.jar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}
.stat {
  background: #3a2413;
  border: 2px solid #5a3a22;
  border-radius: var(--radius-m);
  padding: 20px 22px;
  min-height: 118px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
}
.stat-label { font-size: 14px; font-weight: 800; color: #d9c3a5; }
.stat-value {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(30px, 3.4vw, 40px);
  line-height: 1;
  color: var(--milk);
  font-variant-numeric: tabular-nums;
}
.stat-value.is-sun { color: var(--sun); }
.stat-sub { font-size: 14px; color: #bfa688; }
.stat-value.is-loading { opacity: 0.35; }
.jar-foot {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-size: 14px;
  color: #bfa688;
}

/* ---------- comics ---------- */
.comics { display: grid; gap: 34px; }
.strip { margin: 0; }
.strip img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-m);
  border: var(--line);
  background: var(--foam);
  box-shadow: 0 6px 0 var(--espresso);
}
.strip figcaption {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-weight: 700;
  color: var(--roast);
}
.strip figcaption a { font-weight: 800; text-decoration: none; }
.strip figcaption a:hover { text-decoration: underline; }

/* ---------- say it ---------- */
.sayit {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.say {
  background: var(--milk);
  border: var(--line);
  border-radius: var(--radius-m);
  padding: 18px 20px 20px;
}
.say dt {
  font-family: var(--display);
  font-weight: 700;
  font-size: 30px;
  line-height: 1;
  margin-bottom: 8px;
}
.say dd { margin: 0; color: var(--roast); font-size: 15px; }
.say-post { margin-top: 22px; }

/* ---------- faq ---------- */
.faq { max-width: 78ch; display: grid; gap: 8px; }
.faq details {
  background: var(--milk);
  border: 2px solid var(--roast-soft);
  border-radius: var(--radius-s);
  padding: 0 18px;
}
.faq details[open] { border-color: var(--espresso); }
.faq summary {
  cursor: pointer;
  font-family: var(--display);
  font-weight: 600;
  font-size: 19px;
  padding: 14px 0;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--sun-deep); font-weight: 700; }
.faq details[open] summary::after { content: "–"; }
.faq details p { padding: 0 0 16px; color: var(--roast); }
.faq code {
  font-size: 13px;
  word-break: break-all;
  background: var(--foam);
  padding: 2px 6px;
  border-radius: 6px;
}

/* ---------- footer ---------- */
footer {
  padding: 40px 0 60px;
  border-top: var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 18px 36px;
  justify-content: space-between;
  align-items: flex-start;
  color: var(--roast);
  font-size: 15px;
}
footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; font-weight: 800; }
footer nav a { text-decoration: none; }
footer nav a:hover { text-decoration: underline; }
.fine { max-width: 60ch; font-size: 13px; color: var(--roast-soft); }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); padding-top: 20px; }
  .hero-art { order: -1; width: min(100%, 320px); margin-top: 24px; }
  .sun { right: -10%; top: 0; }
  .tek { grid-template-columns: 1fr; }
  .tek-step img { aspect-ratio: 16 / 10; }
  .bar-links { display: none; }
}
@media (max-width: 480px) {
  body { font-size: 16px; }
  .wordmark { font-size: 27vw; }
  .btn { font-size: 16px; padding: 12px 18px; }
  .stat-value { font-size: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sun { animation: none; transform: none; opacity: 1; }
  .bubble { animation: none; transform: none; }
  .bubble.is-swapping span { animation: none; }
  .btn { transition: none; }
}
