/* Super Intelligent Foo: a playful comic look. One light theme on purpose, so the page reads like paper in any setting.
   The palette is media-3's (superintelligentfoo#1) and lives in :root; change it there and nowhere else. */
:root {
  --ink: #1b1b2f;
  --paper: #fff8e7;
  --hero: #1e5bff;
  --pow: #ffc61a;
  --magenta: #f0432f; /* the comic red, for fills; the name is kept so the rules below stay put */
  --kicker: #d63a26; /* a darker red where white text sits on it (5:1) */
  --red-ink: #c8321f; /* heading colours that reach 4.5:1 on white and paper */
  --green-ink: #07785d;
  --gold-ink: #8a5d00;
  --mint: #22d3a6;
  --shadow: 6px 6px 0 var(--ink);
  --display: "Bangers", "Impact", "Arial Black", sans-serif;
  --body: "Comic Neue", "Comic Sans MS", "Chalkboard SE", system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--body); font-size: 1.15rem; line-height: 1.55;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.halftone {
  background-image: radial-gradient(rgba(27, 27, 47, 0.12) 1.2px, transparent 1.4px);
  background-size: 14px 14px; background-color: var(--paper);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--hero); font-weight: 700; text-underline-offset: 3px; }
a:focus-visible, summary:focus-visible { outline: 4px solid var(--magenta); outline-offset: 3px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--pow); padding: 8px 14px; border: 3px solid var(--ink); z-index: 10; }
.skip:focus { left: 8px; top: 8px; }

h1, h2, h3, .kicker, .btn, .bubble, summary { font-family: var(--display); letter-spacing: 0.03em; font-weight: 400; }
h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); line-height: 1.02; margin: 0 0 0.4em; text-wrap: balance; }
h2 { font-size: clamp(1.9rem, 4vw, 3rem); margin: 0 0 0.6em; text-wrap: balance; }
h3 { font-size: 1.6rem; margin: 0 0 0.3em; }
p { margin: 0 0 1em; max-width: 62ch; }

main, .top, .foot { max-width: 1120px; margin: 0 auto; }
section { padding-block: clamp(28px, 5vw, 56px); }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 14px; }
.brand { display: inline-flex; align-items: flex-end; gap: 12px; text-decoration: none; color: var(--ink); }
.brand img { width: 56px; height: 56px; margin-bottom: 4px; } /* the mark at FOO's cap height, level with FOO's baseline, left of the wordmark (STYLE.md) */
.brand .wordmark { width: 160px; height: auto; } /* 160 px wide is the wordmark's minimum (STYLE.md) */
.top nav { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.top nav a:not(.btn) { color: var(--ink); display: inline-flex; align-items: center; min-height: 44px; }

/* buttons */
.btn { white-space: nowrap;
  display: inline-block; background: var(--pow); color: var(--ink); text-decoration: none; font-size: 1.35rem;
  padding: 0.5em 1.1em; border: 4px solid var(--ink); border-radius: 12px; box-shadow: 4px 4px 0 var(--ink);
  transition: transform 0.08s, box-shadow 0.08s;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn.ghost { background: #fff; }
.btn.small { font-size: 1.1rem; padding: 0.3em 0.8em; }
.row { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 1.4em; }

/* hero */
.hero { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(20px, 4vw, 48px); align-items: center; }
.kicker { display: inline-block; background: var(--kicker); color: #fff; padding: 0.15em 0.7em; border: 3px solid var(--ink); transform: rotate(-2deg); font-size: 1.3rem; margin-bottom: 1em; }
.lead { font-size: 1.3rem; }
.hero-art { position: relative; }
.hero-art img { margin-inline: auto; display: block; border: 4px solid var(--ink); border-radius: 14px; box-shadow: var(--shadow); } /* Foo's portrait has its own dark halftone background, so it is framed like a comic panel, not cut out */
.bubble {
  position: absolute; top: -4%; right: -2%; max-width: 7.6em; margin: 0; background: #fff; border: 4px solid var(--ink); border-radius: 22px;
  padding: 0.5em 0.9em; font-size: 1.5rem; line-height: 1.1; box-shadow: var(--shadow); transform: rotate(3deg); z-index: 1;
}
.bubble::after {
  content: ""; position: absolute; left: 22%; bottom: -22px; width: 26px; height: 26px; background: #fff;
  border-right: 4px solid var(--ink); border-bottom: 4px solid var(--ink); transform: skewX(-20deg) rotate(45deg);
}

.plain p, .plain li { overflow-wrap: anywhere; } /* the long MCP and API addresses wrap instead of scrolling a 320 px phone sideways */

/* the /check page */
.check-hero .hero-art { max-width: 380px; margin-inline: auto; }
.check-form label { display: block; font-weight: 700; margin-bottom: 6px; }
.check-row { display: flex; gap: 12px; flex-wrap: wrap; }
.check-row input { flex: 1 1 14em; min-width: 0; min-height: 52px; padding: 0 14px; font: inherit; font-size: 1.15rem; color: var(--ink); background: #fff; border: 4px solid var(--ink); border-radius: 12px; box-shadow: var(--shadow); }
.check-row input:focus-visible { outline: 4px solid var(--hero); outline-offset: 3px; }
.check-row .btn { cursor: pointer; }
.check-row .btn:disabled { opacity: 0.6; cursor: progress; }
.hint, .status, .problem { margin: 10px 0 0; }
.hint { font-size: 1rem; }
.status { min-height: 1.6em; font-weight: 700; }
.problem { border-left: 6px solid var(--kicker); padding: 4px 12px; background: #fff; }
.result:empty { display: none; }
.report { background: #fff; border: 5px solid var(--ink); box-shadow: var(--shadow); padding: clamp(14px, 3vw, 28px); }
.report .score { font-family: var(--display); font-weight: 400; font-size: clamp(2.2rem, 7vw, 3.4rem); margin: 0; outline: none; }
.report .meta { margin: 4px 0 18px; overflow-wrap: anywhere; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.check { border: 3px solid var(--ink); border-left-width: 12px; padding: 10px 14px; }
.check.pass { border-left-color: #1f9d63; }
.check.fail { border-left-color: var(--kicker); }
.check p { margin: 4px 0; overflow-wrap: anywhere; }
.badge { display: inline-block; padding: 0.05em 0.6em; border: 2px solid var(--ink); font-family: var(--display); font-weight: 400; letter-spacing: 0.03em; background: var(--paper); }
.check.pass .badge { background: #bff0d6; }
.check.fail .badge { background: #ffd3cc; }
.check-fix { background: var(--paper); border: 3px solid var(--ink); border-left: 10px solid #FFC61A; padding: 6px 10px; }
.check-fix strong { font-family: var(--display); font-weight: 400; letter-spacing: 0.03em; }

/* the three panels */
.panels { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.panel { background: #fff; border: 5px solid var(--ink); box-shadow: var(--shadow); display: flex; flex-direction: column; }
.panel:nth-child(2) { transform: translateY(14px) rotate(0.6deg); }
.panel img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-bottom: 5px solid var(--ink); background: var(--pow); }
.beat {
  aspect-ratio: 16 / 5; border-bottom: 5px solid var(--ink); display: grid; place-items: center; overflow: hidden;
  background-color: var(--pow); background-image: radial-gradient(rgba(27, 27, 47, 0.18) 2px, transparent 2.4px); background-size: 16px 16px;
}
.panel:nth-child(2) .beat { background-color: var(--hero); background-image: radial-gradient(rgba(255, 248, 231, 0.3) 2px, transparent 2.4px); }
.panel:nth-child(3) .beat { background-color: var(--magenta); background-image: radial-gradient(rgba(255, 248, 231, 0.3) 2px, transparent 2.4px); }
.beat-n {
  font-family: var(--display); font-size: clamp(2.6rem, 6vw, 3.6rem); line-height: 1; color: var(--paper); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill;
  text-shadow: 4px 4px 0 var(--ink); transform: rotate(-6deg);
}
.panel:first-child .beat-n { color: #fff; }
.caption { padding: 14px 16px 6px; }
.caption h3 { display: inline-block; background: var(--pow); border: 3px solid var(--ink); padding: 0 0.5em; transform: rotate(-1.5deg); }
.caption p { font-size: 1.05rem; }

/* powers */
.power-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; } /* four cards: 4, then 2 + 2, then 1: never 3 + 1 */
.power { position: relative; background: #fff; border: 4px solid var(--ink); border-radius: 16px; padding: 26px 18px 18px; box-shadow: 4px 4px 0 var(--ink); }
.power::before { content: ""; position: absolute; top: -4px; left: 16px; width: 54px; height: 14px; background: var(--pow); border: 4px solid var(--ink); border-top: 0; border-radius: 0 0 8px 8px; }
.power:nth-child(4n + 1)::before { background: var(--hero); }
.power:nth-child(4n + 2)::before { background: var(--magenta); }
.power:nth-child(4n + 3)::before { background: var(--mint); }
.power:nth-child(4n + 1) h3 { color: var(--hero); }
.power:nth-child(4n + 2) h3 { color: var(--red-ink); }
.power:nth-child(4n + 3) h3 { color: var(--green-ink); }
.power:nth-child(4n) h3 { color: var(--gold-ink); }

/* faq */
.faq details { background: #fff; border: 4px solid var(--ink); border-radius: 14px; margin-bottom: 14px; box-shadow: 4px 4px 0 var(--ink); }
.faq summary { cursor: pointer; padding: 14px 18px; font-size: 1.4rem; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--magenta); font-size: 1.8rem; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { padding: 0 18px; margin: 0 0 1em; }

/* closing call to action */
.cta { text-align: center; }
.burst-box {
  background: var(--pow); border: 5px solid var(--ink); box-shadow: 8px 8px 0 var(--ink); padding: clamp(24px, 5vw, 48px);
  clip-path: polygon(0 4%, 3% 0, 8% 5%, 14% 0, 20% 4%, 27% 0, 34% 5%, 41% 0, 48% 4%, 55% 0, 62% 5%, 69% 0, 76% 4%, 83% 0, 90% 5%, 97% 0, 100% 4%, 100% 96%, 96% 100%, 90% 95%, 83% 100%, 76% 96%, 69% 100%, 62% 95%, 55% 100%, 48% 96%, 41% 100%, 34% 95%, 27% 100%, 20% 96%, 14% 100%, 8% 95%, 3% 100%, 0 96%);
}
.burst-box p { margin-inline: auto; }

/* plain pages */
.plain { max-width: 70ch; }

/* footer */
.foot { padding-block: 28px 40px; font-size: 1rem; border-top: 4px solid var(--ink); margin-top: 20px; }
.foot p { max-width: none; margin-bottom: 0.4em; }
.foot a { display: inline-flex; align-items: center; min-height: 44px; }

@media (max-width: 1000px) { .power-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .power-grid { grid-template-columns: 1fr; } }
@media (min-width: 561px) and (max-width: 860px) {
  /* the panels stack one per row here; art beside its caption keeps the strip from running to two thousand pixels */
  .panel { flex-direction: row; }
  .panel img { width: 50%; align-self: stretch; border-bottom: 0; border-right: 5px solid var(--ink); }
  .caption { flex: 1; align-self: center; padding: 14px 16px; }
}
@media (min-width: 561px) and (max-width: 700px) {
  .caption h3 { font-size: 1.4rem; } /* "It already knows" stays on one line in the narrow caption cell */
}
@media (min-width: 701px) and (max-width: 860px) {
  .caption p { font-size: 1.2rem; } /* a wide caption cell is not a small caption in a big white box */
}
@media (min-width: 861px) and (max-width: 1100px) {
  .hero-art { padding-top: 84px; } /* the portrait is narrow here: the bubble gets its own room above the frame instead of covering his face */
  .bubble { top: 0; right: 2%; font-size: 1.3rem; max-width: 8em; }
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .hero-art { max-width: 420px; margin-inline: auto; padding-top: 96px; }
  .check-hero .hero-art { display: none; } /* he points at the form from the side; stacked, he would point at nothing and push the report down */ /* the words come first; room above Foo for the bubble */
  .bubble { top: 0; right: 2%; font-size: 1.3rem; max-width: 8em; }
  .panels { grid-template-columns: 1fr; }
  .panel:nth-child(2) { transform: none; }
  .brand img { width: 48px; height: 48px; }
}
@media (min-width: 375px) and (max-width: 520px) {
  .top { flex-wrap: nowrap; } /* one row: the lockup and the button; "How it's built" stays in the footer */
  .top nav a:not(.btn) { display: none; }
  .brand img { width: 44px; height: 44px; }
}
@media (max-width: 374px) { .top nav a:not(.btn) { display: none; } } /* below 375 px the button wraps under the lockup rather than over it */
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
