/* CitedYet. Tokens first; everything below refers to them. */
:root {
  --bg: #dfdedb;
  --surface: #d3d2ce;
  --ink: #26251e;
  --muted: #5f5d55;
  --accent: #2456d6;
  --accent-strong: #1b45b3;
  --accent-ink: #ffffff;
  --panel: #f6f6f5;
  --panel-line: #d9d8d3;
  --tint: #e6ecfb;

  --font: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;

  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2rem, 1.3rem + 3.2vw, 4rem);
  --step-display: clamp(2.6rem, 1.2rem + 5.2vw, 5rem);

  --margin: clamp(1rem, 2.8vw, 2.5rem);
  --gutter: clamp(1rem, 2vw, 2rem);
  --section: clamp(6rem, 13vw, 13rem);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.76, 0, 0.24, 1);
  --ease-soft: cubic-bezier(0.33, 1, 0.68, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: var(--step-body); line-height: 1.5; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip; }
h1, h2, p, figure, ul { margin: 0; }
ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
:target { scroll-margin-top: 1.5rem; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
p { max-width: 62ch; text-wrap: pretty; }

.wrap { padding-inline: var(--margin); }
.muted { color: var(--muted); }
.display { font-size: var(--step-display); font-weight: 600; line-height: 0.92; letter-spacing: -0.04em; }
.display span { display: block; }
.head { font-size: var(--step-head); font-weight: 600; line-height: 0.96; letter-spacing: -0.04em; text-wrap: balance; }
.sub { font-size: var(--step-lead); font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; }
.lead { font-size: var(--step-lead); line-height: 1.32; max-width: 34ch; }
.statement { font-size: clamp(1.5rem, 1rem + 1.7vw, 2.25rem); line-height: 1.18; letter-spacing: -0.02em; font-weight: 500; max-width: 30ch; }

.link { text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 0.2em; text-decoration-thickness: 0.07em; transition: text-decoration-color 180ms ease; }
.link-plain { text-decoration: underline; text-underline-offset: 0.18em; text-decoration-thickness: 0.07em; }
.button { display: inline-flex; align-items: center; min-height: 3.1rem; padding: 0 1.5rem; background: var(--accent); color: var(--accent-ink); font-weight: 500; text-decoration: none; transition: transform 140ms var(--ease-out), background-color 180ms ease; }
.button:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .link:hover { text-decoration-color: currentColor; }
  .button:hover { background: var(--accent-strong); }
}

/* ---------- navigation ---------- */
.nav { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding-top: 1.6rem; }
.wordmark { font-weight: 600; font-size: var(--step-lead); letter-spacing: -0.03em; text-decoration: none; }
.nav nav { display: flex; gap: clamp(1rem, 2.4vw, 2.25rem); font-size: 0.9375rem; }
.nav nav a { padding-block: 0.4rem; }

/* ---------- hero ---------- */
.hero { padding-top: clamp(2.5rem, 7vh, 5rem); display: grid; grid-template-columns: 5fr 7fr; column-gap: var(--gutter); align-items: start; }
.hero-text { display: grid; gap: 1.5rem; justify-items: start; padding-top: clamp(1rem, 4vh, 3rem); }
.stage { background: var(--accent); }
.hero-stage { margin-top: 0; margin-right: calc(var(--margin) * -1); clip-path: polygon(0 3.5rem, 11rem 3.5rem, 11rem 0, 100% 0, 100% 100%, 0 100%); }
.stage-inner { padding: 6rem 3.5rem 3.5rem 3.5rem; }

/* ---------- the product's own interface (data-ui) ---------- */
.ui { background: var(--panel); color: var(--ink); border-radius: 12px; font-size: 0.9375rem; line-height: 1.45; }
.check { max-width: 40rem; display: grid; }
.check-form { padding: 1.5rem 1.5rem 1.25rem; display: grid; gap: 0.9rem; }
.ui-title { font-weight: 600; font-size: 1rem; letter-spacing: -0.01em; }
.ui-field { display: grid; gap: 0.3rem; min-width: 0; }
.ui-field > span { font-size: 0.8125rem; color: var(--muted); }
.ui-field input, .ui-filled { width: 100%; min-height: 2.75rem; padding: 0.55rem 0.75rem; background: #fff; border: 1px solid var(--panel-line); border-radius: 8px; font-size: 1rem; display: flex; align-items: center; }
.ui-field input::placeholder { color: #8b897f; }
.ui-field input:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.ui-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.ui-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.ui-button { display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; padding: 0 1.15rem; background: var(--accent); color: #fff; border-radius: 8px; font-weight: 500; font-size: 0.9375rem; transition: transform 140ms var(--ease-out), background-color 180ms ease; }
.ui-button:active { transform: scale(0.97); }
.ui-button[disabled] { background: var(--muted); cursor: progress; }
.ui-button.is-static { justify-self: start; }
.ui-note { font-size: 0.8125rem; color: var(--muted); max-width: none; }
.ui-note.is-error { color: #a12a1c; }
@media (hover: hover) and (pointer: fine) { .ui-button:not([disabled]):hover { background: var(--accent-strong); } }

.results { padding: 1.1rem 1.5rem 1.5rem; background: #ecebe8; border-radius: 0 0 12px 12px; display: grid; gap: 0.75rem; }
.results-head { font-size: 0.8125rem; color: var(--muted); max-width: none; }
.engine-list { display: grid; gap: 0.5rem; }
.engine { padding: 0.8rem 0.9rem; border: 1px solid var(--panel-line); /* taste-skill-ignore: inside the data-ui fragment */ border-radius: 10px; background: #fff; display: grid; gap: 0.25rem; }
.engine-top { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.engine-name { font-weight: 600; }
.verdict { font-size: 0.8125rem; font-weight: 600; padding: 0.15rem 0.6rem; border-radius: 999px; background: #ecebe6; color: var(--ink); white-space: nowrap; }
.is-cited .verdict { background: var(--accent); color: #fff; }
.is-off .verdict { background: transparent; color: var(--muted); padding-inline: 0; font-weight: 500; }
.engine-count { font-size: 0.8125rem; color: var(--muted); max-width: none; }
.engine-quote { font-size: 0.875rem; max-width: none; overflow-wrap: anywhere; }
.engine-quote mark { background: var(--tint); color: #123a9c; font-weight: 600; padding: 0.05em 0.2em; border-radius: 4px; }
.engine-sources { font-size: 0.8125rem; color: var(--muted); max-width: none; overflow-wrap: anywhere; }
.results.is-loading .engine { animation: wait 1.1s ease-in-out infinite alternate; }
.results.is-loading .engine:nth-child(2) { animation-delay: 160ms; }
.results.is-loading .engine:nth-child(3) { animation-delay: 320ms; }
@keyframes wait { from { opacity: 1; } to { opacity: 0.45; } }

/* ---------- intro: the world this is for ---------- */
.intro { padding-top: var(--section); display: grid; gap: clamp(2.5rem, 5vw, 4.5rem); }
.intro-pictures { display: grid; grid-template-columns: 7fr 5fr; gap: var(--gutter); align-items: end; }
.pic-frame { overflow: hidden; background: var(--surface); }
.pic img { width: 100%; object-fit: cover; filter: grayscale(1) contrast(1.05); }
.pic-wide img { aspect-ratio: 16 / 11; object-position: 50% 45%; }
.pic-narrow img { aspect-ratio: 4 / 5; object-position: 78% 60%; }
.pic figcaption { margin-top: 0.7rem; font-size: var(--step-small); color: var(--muted); max-width: 46ch; }

/* ---------- how it works: pinned fragment ---------- */
.how { padding-top: var(--section); display: grid; grid-template-columns: 5fr 7fr; column-gap: var(--gutter); align-items: start; }
.how-steps { grid-column: 1; grid-row: 1; }
.how-stage-col { grid-column: 2; grid-row: 1; position: sticky; top: 12vh; }
.how-stage { padding: clamp(1.5rem, 4vw, 3.5rem); min-height: min(34rem, 76vh); display: grid; align-items: center; margin-right: calc(var(--margin) * -1); }
.step { min-height: 72vh; display: grid; align-content: center; gap: 0.9rem; color: var(--muted); transition: color 300ms ease; }
.step-line { font-size: clamp(1.5rem, 1rem + 1.4vw, 2rem); font-weight: 600; line-height: 1.1; letter-spacing: -0.03em; max-width: 16ch; }
.step.is-active { color: var(--ink); }
.step p:not(.step-line) { color: var(--ink); }
.step:first-of-type { min-height: 56vh; }
.flow { padding: 1.5rem; max-width: 32rem; width: 100%; display: grid; }
.flow-panel { grid-area: 1 / 1; display: grid; gap: 0.9rem; align-content: start; opacity: 0; visibility: hidden; transform: translateY(10px); transition: opacity 320ms ease, transform 420ms var(--ease-out), visibility 0s linear 320ms; }
.flow[data-state="1"] [data-panel="1"], .flow[data-state="2"] [data-panel="2"], .flow[data-state="3"] [data-panel="3"] { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.ask-list { display: grid; gap: 0.5rem; }
.ask-list li { padding: 0.8rem 0.9rem; border: 1px solid var(--panel-line); /* taste-skill-ignore: inside the data-ui fragment */ border-radius: 10px; background: #fff; display: grid; gap: 0.2rem; }
.ask-list p { font-weight: 500; max-width: none; }
.ask-list span { font-size: 0.8125rem; color: var(--muted); }

/* ---------- comparison as text ---------- */
.compare { padding-top: var(--section); }
.table { margin-top: 4.5rem; }
.trow { display: grid; grid-template-columns: 5fr repeat(3, 2.33fr); min-height: 4.25rem; align-items: stretch; }
.trow > div { padding: 1.1rem 1.25rem; display: flex; align-items: center; }
.trow:nth-child(even) { background: var(--surface); }
.tname { font-size: var(--step-lead); font-weight: 500; letter-spacing: -0.015em; padding-left: 1rem !important; }
.thead { font-weight: 600; }
.feat { background: var(--accent); color: var(--accent-ink); }
.thead .feat { position: relative; }
.thead .feat::before { content: ""; position: absolute; inset: -1.5rem 0 100% 0; background: var(--accent); }

/* ---------- questions ---------- */
.faq { padding-top: var(--section); display: grid; grid-template-columns: 4fr 8fr; column-gap: var(--gutter); align-items: start; }
.faq-head { position: sticky; top: 6rem; }
.faq-list { display: grid; gap: 8px; }
.tile { background: var(--surface); transition: background-color 220ms ease, color 220ms ease; }
.tile summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 4.5rem; padding: 1rem 1.5rem; font-size: var(--step-lead); font-weight: 500; letter-spacing: -0.015em; line-height: 1.2; }
.tile summary::-webkit-details-marker { display: none; }
.tile i { flex: none; position: relative; width: 16px; height: 16px; }
.tile i::before, .tile i::after { content: ""; position: absolute; left: 0; top: 6.5px; width: 16px; height: 3px; background: currentColor; transition: transform 260ms var(--ease-out); }
.tile i::after { transform: rotate(90deg); }
.tile[open] i::after { transform: rotate(0deg); }
.tile[open] { background: var(--accent); color: var(--accent-ink); }
.tile > p { padding: 0 1.5rem 1.6rem; max-width: 56ch; }
.tile[open] ::selection { background: #fff; color: var(--accent); }
@media (hover: hover) and (pointer: fine) { .tile:not([open]):hover { background: #c9c8c3; } }

/* ---------- early list: a sentence with a blank ---------- */
.early { padding-top: var(--section); }
.blank { display: grid; gap: 1.25rem; }
.blank-line { max-width: 24em; line-height: 1.6; }
.blank-line input { display: inline-block; vertical-align: baseline; width: 11em; max-width: 100%; height: 1.5em; padding: 0 0.35em; background: var(--surface); border: 0; border-radius: 0; font-size: 1em; font-weight: 500; letter-spacing: inherit; }
.blank-line input::placeholder { color: var(--muted); }
.blank-line button { display: inline-block; height: 1.5em; padding: 0 0.4em; background: var(--accent); color: var(--accent-ink); font-weight: 500; letter-spacing: inherit; line-height: 1.5; transition: transform 140ms var(--ease-out), background-color 180ms ease; }
.blank-line button:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .blank-line button:hover { background: var(--accent-strong); } }
#early-note.is-error { color: #a12a1c; }
#early-note.is-done { color: var(--ink); font-weight: 500; }

/* ---------- footer: one quiet line ---------- */
.foot { margin-top: 34svh; padding-bottom: 30px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: baseline; gap: 1.5rem; font-size: 0.9375rem; }
.foot-links { display: flex; gap: 24px; }
.foot-right { justify-self: end; }
.foot p { max-width: none; }

/* ---------- motion (content stays visible without script) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js [data-rise] { opacity: 0; transform: translateY(22px); animation: rise 800ms var(--ease-out) forwards; animation-delay: calc(var(--i, 0) * 90ms + 100ms); }
  .js [data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity 700ms var(--ease-out), transform 900ms var(--ease-out); transition-delay: calc(var(--i, 0) * 80ms); }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
  .js .shutter[data-reveal] { opacity: 1; transform: none; transition: none; }
  .js .shutter[data-reveal] .stage-inner { clip-path: inset(0 0 100% 0); transition: clip-path 1100ms var(--ease-in-out) 250ms; }
  .js .shutter[data-reveal] .check { transform: scale(1.06); transform-origin: 0 0; transition: transform 1500ms var(--ease-soft) 250ms; }
  .js .shutter[data-reveal].is-in .stage-inner { clip-path: inset(0); }
  .js .shutter[data-reveal].is-in .check { transform: none; }
  .drift { animation: drift 22s ease-in-out infinite alternate; }
  .js .engine.is-new { animation: rise 520ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 110ms); }
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes drift { from { transform: scale(1.02); } to { transform: scale(1.1) translate(-1.2%, 1%); } }

/* ---------- tablet and phone ---------- */
@media (max-width: 60em) {
  .hero { grid-template-columns: 1fr; row-gap: 2.5rem; }
  .hero-stage { margin-left: 12%; }
  .stage-inner { padding: 6rem 2rem 3rem; }
  .faq { grid-template-columns: 1fr; row-gap: 2.5rem; }
  .faq-head { position: static; }
}
@media (max-width: 44em) {
  .nav nav a:nth-child(-n+2) { display: none; }
  .hero { padding-top: 2.5rem; }
  .display { font-size: 10vw; }
  .hero-stage { margin-left: calc(var(--margin) * -1); clip-path: polygon(0 2.5rem, 72px 2.5rem, 72px 0, 100% 0, 100% 100%, 0 100%); }
  .stage-inner { padding: 4.5rem 16px 2.5rem; }
  .check-form { padding: 1.1rem 1rem 1rem; }
  .results { padding: 1rem; }
  .ui-pair { grid-template-columns: 1fr; }
  .intro-pictures { grid-template-columns: 1fr; }
  .pic-narrow img { aspect-ratio: 4 / 3; }

  /* On a phone nothing is pinned: the three statements, then the three states one under another. */
  .how { display: flex; flex-direction: column; gap: 2.5rem; }
  .how-steps { order: 1; display: grid; gap: 2rem; }
  .how-stage-col { order: 2; position: static; margin-inline: calc(var(--margin) * -1); }
  .how-stage { min-height: 0; padding: 16px; margin-right: 0; }
  .flow { padding: 0; background: none; gap: 12px; max-width: none; }
  .flow-panel { grid-area: auto; opacity: 1; visibility: visible; transform: none; background: var(--panel); border-radius: 12px; padding: 1rem; }
  .step, .step:first-of-type { min-height: 0; color: var(--ink); }

  .table { margin-top: 2.5rem; }
  .trow { display: block; padding: 1.25rem 0 0; min-height: 0; }
  .trow.thead { display: none; }
  .trow:nth-child(even) { background: none; }
  .trow:nth-child(odd) { background: var(--surface); margin-inline: calc(var(--margin) * -1); padding-inline: 0; }
  .trow > div { display: block; padding: 0.3rem var(--margin); }
  .trow:nth-child(even) > div { padding-inline: 0; }
  .tname { font-weight: 600; padding-left: var(--margin) !important; padding-bottom: 0.6rem !important; }
  .trow:nth-child(even) .tname { padding-left: 0 !important; }
  .trow [data-col]::before { content: attr(data-col) ": "; color: var(--muted); }
  .trow .feat { margin-top: 0.7rem; padding-block: 0.8rem; font-weight: 500; }
  .trow:nth-child(even) .feat { margin-inline: calc(var(--margin) * -1); padding-inline: var(--margin); }
  .trow .feat::before { color: #d5defa !important; }

  .tile summary { min-height: 4rem; padding: 0.9rem 1.25rem; }
  .tile > p { padding: 0 1.25rem 1.25rem; font-size: 1rem; }
  .blank-line input { display: block; width: 100%; margin-block: 0.35em; }

  .foot { margin-top: 22svh; grid-template-columns: 1fr; gap: 8px; padding-bottom: 24px; font-size: 0.875rem; }
  .foot-links { flex-wrap: wrap; gap: 6px 20px; }
  .foot-right { justify-self: start; }
}
