/* The Yes No Wheel ------------------------------------------------------
   Light throughout. The wheel is the only saturated thing on the page;
   everything around it stays quiet so the answer is what you notice. */

@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo.woff2") format("woff2");
  font-weight: 400 800;
  font-stretch: 100% 125%;
  font-style: normal;
  font-display: swap;
}
/* Latin Extended-A (Turkish, Polish, œ). Declared second, so it wins for
   this range; browsers fetch it only on pages that use these letters. */
@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo-ext.woff2") format("woff2");
  font-weight: 400 800;
  font-stretch: 100% 125%;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-017F;
}

:root {
  color-scheme: light;

  --bg:      #F1F4F8;
  --card:    #FFFFFF;
  --ink:     #16202E;
  --muted:   #5B677A;
  --line:    #E1E7EF;
  --line-2:  #EDF1F6;

  --green:      #2A7A50;
  --green-dark: #1E5B3C;
  --green-soft: #E8F5EE;
  --yellow:     #F5C63C;
  --yellow-ink: #8C6208;
  --yellow-soft:#FDF4DC;
  --blue:       #2A6BB5;
  --blue-soft:  #E7F0FA;

  --focus: #16202E;

  --shadow-s: 0 1px 2px rgba(22, 32, 46, .06), 0 1px 3px rgba(22, 32, 46, .04);
  --shadow-m: 0 2px 6px rgba(22, 32, 46, .06), 0 8px 24px rgba(22, 32, 46, .07);

  --r-s: 10px;
  --r-m: 14px;
  --r-l: 20px;

  --sans: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
@media (min-width: 48em) { body { font-size: 18px; } }

h1, h2, h3 { margin: 0; line-height: 1.14; letter-spacing: -.015em; text-wrap: balance; }
p { margin: 0; }
a { color: var(--green-dark); text-underline-offset: 2px; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: -9999px; top: 0; z-index: 30; background: var(--card); padding: .7rem 1rem; font-weight: 600; }
.skip:focus { left: .5rem; top: .5rem; }

.wrap { max-width: 68rem; margin: 0 auto; padding: 0 1rem; }

/* ------------------------------------------------------------ site head */

.site { background: var(--card); border-bottom: 1px solid var(--line); }
.site-in { display: flex; align-items: center; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 700; font-size: .98rem; }
.brand-mark { width: 26px; height: 26px; display: block; }

/* ---------------------------------------------------------------- tool */

/* A soft pool of light under the wheel, so the disc sits in the page
   rather than floating on a flat field. */
.tool {
  padding: 1.4rem 0 2.4rem;
  background:
    radial-gradient(60% 55% at 50% 42%, #FFFFFF 0%, rgba(255,255,255,0) 70%),
    var(--bg);
}
@media (min-width: 64em) {
  .tool { background: radial-gradient(38% 70% at 33% 50%, #FFFFFF 0%, rgba(255,255,255,0) 72%), var(--bg); }
}
@media (min-width: 64em) { .tool { padding: 2.4rem 0 3.6rem; } }

.intro { text-align: center; margin-bottom: 1rem; }
.intro h1 { font-size: clamp(1.8rem, 6.2vw, 2.5rem); font-weight: 800; font-variation-settings: "wdth" 104; }
.tagline { margin-top: .35rem; color: var(--muted); font-size: 1rem; }

/* Optional. It reads as a line of help until someone types in it, so the
   people who only want to spin never feel they have to fill it in. */
.ask { display: block; max-width: 26rem; margin: .7rem auto 0; }
.ask input {
  width: 100%; min-height: 46px; padding: .6rem 1rem;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(255,255,255,.75); color: var(--ink);
  font: inherit; font-size: 1rem; font-weight: 600; text-align: center;
  transition: border-color .15s, background .15s;
}
.ask input::placeholder { color: var(--muted); font-weight: 400; opacity: 1; }
.ask input:hover { border-color: #CBD4E0; }
.ask input:focus { outline: none; border-color: var(--green); background: var(--card); box-shadow: 0 0 0 3px var(--green-soft); }

/* The wheel is the product. It gets the room; everything else defers to it. */
.board { display: grid; gap: 1.2rem; justify-items: center; }
.board > * { min-width: 0; }
@media (min-width: 64em) {
  .board {
    grid-template-columns: minmax(0, 1fr) 21.5rem;
    gap: 2rem; align-items: center; justify-items: stretch;
  }
}

.stage { width: 100%; display: flex; flex-direction: column; align-items: center; gap: .8rem; }

.wheel-box { position: relative; width: min(92vw, 27rem); aspect-ratio: 1 / 1; }
@media (min-width: 64em) { .wheel-box { width: 100%; max-width: 31rem; margin: 0 auto; } }

#wheel {
  width: 100%; height: 100%; display: block;
  filter: drop-shadow(0 10px 26px rgba(22, 32, 46, .16));
  touch-action: manipulation; cursor: pointer;
}

.hub {
  position: absolute; top: 50%; left: 50%; translate: -50% -50%;
  width: 26.5%; aspect-ratio: 1 / 1; border-radius: 50%;
  border: 0; background: transparent; color: #fff;
  font-family: inherit; font-size: clamp(.8rem, 3vw, 1.02rem); font-weight: 800;
  font-variation-settings: "wdth" 112; letter-spacing: .07em;
  cursor: pointer; z-index: 2; display: grid; place-items: center;
  transition: scale .13s ease-out;
}
.hub:hover { scale: 1.06; }
.hub:active { scale: .95; }
.hub[disabled] { cursor: default; }
.hub[disabled]:hover { scale: 1; }

.noscript {
  border: 1px solid var(--line); background: var(--card);
  border-radius: var(--r-s); padding: .7rem .9rem; color: var(--muted); font-size: .92rem;
}

/* side column */

.side { width: 100%; max-width: 27rem; display: grid; gap: .85rem; }
@media (min-width: 64em) { .side { max-width: none; } }

/* No card, no border, no empty box. Before the first spin this is one quiet
   line; after it, the answer is the loudest thing on the page. */
.result {
  min-height: 4.6rem;
  display: grid; place-items: center;
  text-align: center;
}
.result-wait { color: var(--muted); font-size: .98rem; }
.result-word {
  font-size: clamp(3rem, 15vw, 4.2rem);
  font-weight: 800; font-variation-settings: "wdth" 122;
  letter-spacing: -.03em; line-height: 1;
}
/* Idle it is one quiet line. Landed it becomes a tinted plate, so the answer
   arrives as an event rather than a text change. */
.result.is-yes, .result.is-no, .result.is-maybe {
  border-radius: var(--r-m);
  padding: .35rem 1.1rem;
}
.result.is-yes   { background: var(--green-soft); }
.result.is-no    { background: var(--yellow-soft); }
.result.is-maybe { background: var(--blue-soft); }
.result.is-yes   .result-word { color: var(--green-dark); }
.result.is-no    .result-word { color: var(--yellow-ink); }
.result.is-maybe .result-word { color: var(--blue); }

@media (prefers-reduced-motion: no-preference) {
  .result-word { animation: pop .42s cubic-bezier(.18, 1.6, .38, 1) both; }
}
@keyframes pop { from { scale: .6; opacity: 0; } to { scale: 1; opacity: 1; } }

.primary {
  appearance: none; border: 0; border-radius: var(--r-m);
  background: var(--green); color: #fff;
  font-family: inherit; font-size: 1.06rem; font-weight: 700;
  padding: .95rem 1rem; min-height: 56px; cursor: pointer;
  box-shadow: 0 1px 2px rgba(22,32,46,.16), 0 8px 20px rgba(42,122,80,.26);
  transition: background .15s, scale .1s, box-shadow .15s;
}
.primary:hover { background: #256E49; box-shadow: 0 1px 2px rgba(22,32,46,.18), 0 10px 26px rgba(42,122,80,.32); }
.primary:active { scale: .99; }
.primary[disabled] { background: #A6C4B4; box-shadow: none; cursor: default; }

.meta {
  display: flex; align-items: center; justify-content: space-between;
  gap: .6rem 1rem; flex-wrap: wrap;
}

.tallies {
  display: flex; flex-wrap: wrap; gap: .35rem .85rem;
  list-style: none; margin: 0; padding: 0; min-width: 0;
  font-size: .92rem; color: var(--muted);
}
.tallies li { display: flex; align-items: baseline; gap: .32rem; }
.tallies li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; align-self: center; }
.t-yes::before   { background: var(--green); }
.t-no::before    { background: var(--yellow); }
.t-maybe::before { background: var(--blue); }
.tallies b { font-size: 1.05rem; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.tallies .pct { font-size: .78rem; color: #5F6A7E; font-variant-numeric: tabular-nums; }

.tools { display: flex; gap: .4rem; flex: 0 0 auto; margin-left: auto; }

.icon-btn {
  width: 42px; height: 42px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--muted); cursor: pointer;
}
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn:hover { color: var(--ink); border-color: #CBD4E0; }
.icon-btn .mute, .icon-btn .i-done { display: none; }
.icon-btn.done .i-share { display: none; }
.icon-btn.done .i-done { display: block; }
.icon-btn.done { color: var(--green); border-color: #C2DFD1; background: var(--green-soft); }
.icon-btn[aria-pressed="false"] .wave { display: none; }
.icon-btn[aria-pressed="false"] .mute { display: block; }
.icon-btn[aria-pressed="true"] { color: var(--green); border-color: #C2DFD1; background: var(--green-soft); }

/* Settings sit in the open. They are two decisions, not a configuration
   screen, so hiding them costs more than it saves. */
.options {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-m); padding: 1rem 1rem .25rem;
}
.options-head {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  margin-bottom: 1rem;
}
.options-head h2 { font-size: .95rem; font-weight: 700; letter-spacing: 0; }
.badge {
  background: var(--bg); border: 1px solid var(--line); border-radius: 999px;
  padding: .16rem .58rem; font-size: .78rem; font-weight: 500; color: var(--muted);
  white-space: nowrap;
}
.badge b { color: var(--ink); font-variant-numeric: tabular-nums; }

.field + .field { margin-top: 1.05rem; }
.label { display: block; font-size: .84rem; font-weight: 600; color: var(--muted); margin-bottom: .45rem; }
.hint { margin-top: .5rem; font-size: .8rem; color: var(--muted); }

.segmented { display: flex; border: 1px solid var(--line); border-radius: var(--r-s); overflow: hidden; }
.segmented button {
  flex: 1; appearance: none; border: 0; background: var(--card); color: var(--muted);
  font-family: inherit; font-size: .92rem; font-weight: 600;
  padding: .6rem .4rem; min-height: 46px; cursor: pointer;
  transition: background .12s, color .12s;
}
.segmented button + button { border-left: 1px solid var(--line); }
.segmented button.on { background: var(--green); color: #fff; }
.segmented button:hover:not(.on) { background: var(--line-2); color: var(--ink); }

.pills { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .4rem; }
@media (min-width: 30em) { .pills { grid-template-columns: repeat(8, minmax(0, 1fr)); } }
.pills.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pills button {
  appearance: none; border: 1px solid var(--line); background: var(--card); color: var(--muted);
  font-family: inherit; font-size: .92rem; font-weight: 700; font-variant-numeric: tabular-nums;
  min-height: 44px; border-radius: var(--r-s); cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.pills button.on { background: var(--green); border-color: var(--green); color: #fff; }
.pills button:hover:not(.on) { background: var(--line-2); color: var(--ink); border-color: #CBD4E0; }

.ghost {
  appearance: none; width: 100%; margin: 1.05rem 0 1rem;
  border: 1px solid var(--line); border-radius: var(--r-s); background: var(--card);
  color: var(--muted); font-family: inherit; font-size: .92rem; font-weight: 600;
  padding: .6rem; min-height: 44px; cursor: pointer;
}
.ghost:hover:not([disabled]) { background: var(--line-2); color: var(--ink); }
.ghost[disabled] { opacity: .45; cursor: default; }

/* ---------------------------------------------------------------- paper */

.paper { background: var(--card); border-top: 1px solid var(--line); padding: 2.6rem 1rem .5rem; }
.col { max-width: 34rem; margin: 0 auto; }

.lede { font-size: 1.1rem; margin-bottom: 1.6rem; }
.paper h2 { font-size: clamp(1.3rem, 4.6vw, 1.55rem); font-weight: 700; margin: 2.6rem 0 .7rem; }
.paper h3 { font-size: 1.03rem; font-weight: 700; margin: 1.7rem 0 .35rem; }
.paper p { margin-bottom: 1rem; }
.paper code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .88em; background: var(--bg); padding: .1em .35em; border-radius: 3px;
}

/* A block an AI Overview or a hurried reader can lift whole. */
.summary {
  background: var(--green-soft);
  border: 1px solid #CFE6DA;
  border-radius: var(--r-m);
  padding: .9rem 1.1rem;
  margin: 0 0 1.4rem;
}
.summary ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.summary li { font-size: .95rem; line-height: 1.5; }
.summary b { color: var(--green-dark); font-weight: 700; margin-right: .35rem; }

.toc { margin: 0 0 2rem; }
.toc-title { font-size: .82rem; font-weight: 700; color: var(--muted); margin-bottom: .55rem; }
.toc ol {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: .4rem;
  counter-reset: toc;
}
.toc li { counter-increment: toc; }
.toc a {
  display: inline-block; text-decoration: none;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: .32rem .7rem; font-size: .85rem; color: var(--muted);
}
.toc a::before { content: counter(toc) ". "; color: #6B7688; }
.toc a:hover { color: var(--ink); border-color: #CBD4E0; background: var(--line-2); }

/* The one sentence a search result should quote. */
.definition {
  font-size: 1.06rem;
  border-left: 3px solid var(--green);
  padding-left: .9rem;
  margin-bottom: 1rem !important;
}

.aliases { margin: 0 0 1rem; padding-left: 1.1rem; list-style: none; }
.aliases li { margin-bottom: .3rem; position: relative; }
.aliases li::before {
  content: ""; position: absolute; left: -1.1rem; top: .62em;
  width: 5px; height: 5px; border-radius: 50%; background: #7F8B9D;
}

.tablewrap { overflow-x: auto; margin: 1rem 0 1.2rem; -webkit-overflow-scrolling: touch; }
.paper table {
  border-collapse: collapse; width: 100%; font-size: .92rem;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-s);
  overflow: hidden;
}
.paper caption {
  caption-side: top; text-align: left;
  font-size: .82rem; font-weight: 600; color: var(--muted); padding-bottom: .45rem;
}
.paper th, .paper td { padding: .6rem .7rem; text-align: left; border-bottom: 1px solid var(--line-2); }
@media (max-width: 26em) { .paper th, .paper td { padding: .55rem .5rem; font-size: .88rem; } }
.paper thead th {
  background: var(--bg); font-size: .78rem; font-weight: 700; color: var(--muted);
  white-space: nowrap;
}
.paper tbody th { font-weight: 600; color: var(--ink); background: #FAFBFD; white-space: nowrap; }
.paper tbody tr:last-child th, .paper tbody tr:last-child td { border-bottom: 0; }
.odds td { font-variant-numeric: tabular-nums; }
.odds td:last-child { font-weight: 700; color: var(--green-dark); }
.compare th[scope="col"]:first-child { width: 1%; }

.steps { margin: 0 0 1rem; padding-left: 1.3rem; }
.steps li { margin-bottom: .5rem; padding-left: .2rem; }
.steps li::marker { color: var(--green); font-weight: 700; }

.tips { margin: 0 0 1rem; padding-left: 1.3rem; }
.tips li { margin-bottom: .55rem; padding-left: .2rem; }
.tips li::marker { color: var(--green); }

.paper h3 + p { margin-top: 0; }

/* Ad slots reserve height only once a unit is actually placed. Uncomment
   at launch so the space is held and nothing shifts. */
.ad { margin: 2rem 0; }
/*
.ad[data-ad] { min-height: 280px; }
@media (min-width: 40em) { .ad[data-ad] { min-height: 250px; } }
*/

.foot { background: var(--card); padding: 1.6rem 1rem 2.6rem; color: var(--muted); font-size: .92rem; }
.foot .col { border-top: 1px solid var(--line); padding-top: 1.2rem; }
.langs { display: flex; flex-wrap: wrap; gap: 0 1.2rem; margin-bottom: .6rem; }
.langs a { color: var(--muted); font-weight: 600; text-decoration: none; padding: .45rem 0; }
.langs a:hover { color: var(--ink); text-decoration: underline; }
.langs a[aria-current="page"] { color: var(--ink); }

/* ----------------------------------------------------------- full screen */

.exit-full {
  position: fixed; top: max(.75rem, env(safe-area-inset-top)); right: .75rem; z-index: 20;
  display: none; appearance: none;
  border: 1px solid var(--line); border-radius: var(--r-s);
  background: var(--card); color: var(--ink); box-shadow: var(--shadow-m);
  font-family: inherit; font-size: .9rem; font-weight: 600;
  padding: .6rem .9rem; min-height: 44px; cursor: pointer;
}
body.is-full .exit-full { display: block; }

body.is-full { overflow: hidden; }
body.is-full .site,
body.is-full .paper,
body.is-full .foot,
body.is-full .intro,
body.is-full .side { display: none; }
body.is-full .tool { position: fixed; inset: 0; display: grid; place-items: center; padding: 0; background: var(--bg); }
body.is-full .board { grid-template-columns: 1fr; }
body.is-full .wheel-box { width: min(88vw, 80vh); max-width: none; }

/* A typed question stays on screen above the wheel, for a class or a stream. */
body.is-full.has-q .intro { display: block; margin-bottom: 1rem; }
body.is-full .intro h1 { display: none; }
body.is-full .ask { max-width: 90vw; }
body.is-full .ask input {
  border-color: transparent; background: transparent; box-shadow: none;
  font-size: clamp(1.4rem, 4.2vw, 2.6rem); font-weight: 800;
}
body.is-full.has-q .wheel-box { width: min(86vw, 70vh); }

@media (prefers-reduced-motion: reduce) {
  .hub, .primary { transition: none; }
}
