/* Free Gift Idea. Large, calm and friendly: many visitors are new to AI and to
   web apps in general. Colors are tokens with a dark-mode set; contrast meets WCAG 2.2 AA. */

:root {
  --bg: #fbf7f1;
  --surface: #ffffff;
  --surface-2: #f4ede4;
  --text: #1d2125;
  --muted: #555b62;
  --border: #ddd2c4;
  --border-strong: #b9ac9b;
  --accent: #0e6b63;
  --accent-hover: #0a564f;
  --accent-text: #ffffff;
  --accent-soft: #e0f0ed;
  --ribbon: #c4473a;
  --ribbon-soft: #fbe7e3;
  --focus: #1d4ed8;
  --notice-bg: #fff4dc;
  --notice-text: #5c3b00;
  --notice-border: #ecc98c;
  --ok-bg: #e0f0ed;
  --ok-text: #0a564f;
  --radius: 16px;
  --radius-small: 10px;
  --shadow: 0 1px 2px rgb(40 30 20 / 0.06), 0 10px 30px rgb(40 30 20 / 0.07);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121518;
    --surface: #1a1e22;
    --surface-2: #22282e;
    --text: #eef1f3;
    --muted: #a9b1b9;
    --border: #323a42;
    --border-strong: #4a545e;
    --accent: #4fc3b5;
    --accent-hover: #74d4c8;
    --accent-text: #08201d;
    --accent-soft: #163632;
    --ribbon: #ff8f80;
    --ribbon-soft: #3a2120;
    --focus: #93b4ff;
    --notice-bg: #33270f;
    --notice-text: #ffdc9e;
    --notice-border: #6b5222;
    --ok-bg: #163632;
    --ok-text: #8fe0d5;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 10px 30px rgb(0 0 0 / 0.35);
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.125rem;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  outline: none;
}

.wrap {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0 0 0.5rem;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2rem, 6vw, 2.75rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.5rem, 4.5vw, 1.9rem);
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.2rem;
}

h1:focus,
h2:focus,
section:focus {
  outline: none;
}

p {
  margin: 0 0 0.75rem;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  background: var(--surface);
  color: var(--text);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-small);
  z-index: 10;
}

.skip-link:focus {
  top: 12px;
}

/* ---------- header and footer ---------- */

.site-header {
  padding: 18px 0 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.25rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  font-weight: 600;
}

.site-nav a {
  color: var(--text);
  text-decoration: none;
  padding: 0.35rem 0.1rem;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  border-bottom-color: var(--accent);
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex: none;
}

.gift-box {
  fill: var(--accent);
}

.gift-lid {
  fill: var(--accent-hover);
}

.gift-ribbon,
.gift-bow {
  fill: var(--ribbon);
}

.site-footer {
  margin-top: 48px;
  padding: 24px 0 36px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer p {
  margin: 0 0 0.4rem;
}

.mode-banner {
  margin: 8px 0 16px;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-small);
  background: var(--accent-soft);
  color: var(--text);
  font-size: 0.98rem;
  border: 1px solid transparent;
}

.mode-banner-demo {
  background: var(--surface-2);
  border-color: var(--border);
}

.loading-text {
  color: var(--muted);
}

/* ---------- cards ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(20px, 5vw, 36px);
}

.eyebrow {
  color: var(--ribbon);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.lead {
  font-size: 1.2rem;
  color: var(--text);
}

.help,
.fine {
  color: var(--muted);
}

.fine {
  font-size: 0.95rem;
}

/* ---------- intro ---------- */

.intro {
  position: relative;
}

.intro-art {
  display: block;
  width: 76px;
  height: 76px;
  margin-bottom: 0.75rem;
}

.gift-knot {
  fill: var(--ribbon);
  stroke: var(--surface);
  stroke-width: 2;
}

@media (min-width: 640px) {
  .intro {
    padding-right: 180px;
  }

  .intro-art {
    position: absolute;
    top: 36px;
    right: 36px;
    width: 120px;
    height: 120px;
    margin: 0;
  }
}

.how {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 1.75rem;
  display: grid;
  gap: 0.75rem;
}

.how li {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.how-num {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

/* ---------- buttons ---------- */

.btn {
  font: inherit;
  font-weight: 650;
  border-radius: 999px;
  padding: 0.75rem 1.4rem;
  min-height: 48px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-2);
}

.btn-quiet {
  background: transparent;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding-inline: 0.6rem;
}

.btn-quiet:hover {
  background: var(--accent-soft);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-big {
  font-size: 1.25rem;
  padding: 0.9rem 2.6rem;
  min-height: 56px;
  margin-bottom: 1rem;
}

/* ---------- step layout ---------- */

.progress-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.25rem;
}

.progress-text {
  color: var(--muted);
  font-size: 0.95rem;
  white-space: nowrap;
}

progress {
  flex: 1;
  height: 8px;
  border: 0;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
  appearance: none;
}

progress::-webkit-progress-bar {
  background: var(--surface-2);
  border-radius: 999px;
}

progress::-webkit-progress-value {
  background: var(--accent);
  border-radius: 999px;
}

progress::-moz-progress-bar {
  background: var(--accent);
  border-radius: 999px;
}

.step-body {
  margin: 1.25rem 0 0.5rem;
  display: grid;
  gap: 1rem;
}

.sub-heading {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0.25rem 0 0.5rem;
}

.nav-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.nav-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-left: auto;
}

/* ---------- chips (radio and checkbox buttons) ---------- */

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.chip {
  position: relative;
  display: inline-flex;
}

.chip-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.chip-face {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 48px;
  padding: 0.55rem 1.1rem;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-weight: 550;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.chip:hover .chip-face {
  border-color: var(--border-strong);
}

/* Checked chips get a check mark as well as a color change, so color is never the only signal. */
.chip-input:checked + .chip-face {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.chip-input:checked + .chip-face::after {
  /* A corner badge, so checking a chip never changes its size or moves the buttons around. */
  content: "✓";
  position: absolute;
  top: -7px;
  right: -5px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1;
}

.chip-input:focus-visible + .chip-face {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.chip-small .chip-face {
  min-height: 40px;
  padding: 0.35rem 0.85rem;
  font-size: 0.98rem;
}

.chips-segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.chips-segmented .chip,
.chips-segmented .chip-face {
  width: 100%;
  justify-content: center;
}

.chips-segmented .chip-face {
  padding-inline: 0.5rem;
  white-space: nowrap;
}

/* ---------- sliders ---------- */

.slider-card {
  background: var(--surface-2);
  border-radius: var(--radius-small);
  padding: 1rem 1.1rem 0.9rem;
  display: grid;
  gap: 0.6rem;
  transition: opacity 0.15s ease;
}

.slider-card legend {
  float: left;
  width: 100%;
  font-weight: 700;
  padding: 0;
  margin-bottom: 0.4rem;
}

.slider-card.is-unsure .range,
.slider-card.is-unsure .big-value,
.slider-card.is-unsure .trait-scale {
  opacity: 0.6;
}

.big-value {
  font-size: 1.6rem;
  font-weight: 750;
  color: var(--accent);
}

.slider-card.is-unsure .big-value {
  font-size: 1.15rem;
  color: var(--muted);
}

.range {
  width: 100%;
  min-height: 44px;
  accent-color: var(--accent);
  cursor: pointer;
}

.scale-ends,
.trait-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.trait-scale {
  display: grid;
  grid-template-columns: minmax(70px, 1fr) minmax(120px, 2.2fr) minmax(70px, 1fr);
  align-items: center;
  gap: 0.75rem;
}

.scale-end {
  font-size: 0.98rem;
  color: var(--text);
  line-height: 1.25;
}

.scale-end-right {
  text-align: right;
}

.trait-readout {
  margin: 0;
  font-weight: 650;
  color: var(--text);
}

.not-sure {
  justify-self: start;
}

/* ---------- quick questions ---------- */

.quick-row {
  display: grid;
  grid-template-columns: 1fr minmax(300px, 340px);
  align-items: center;
  gap: 0.6rem 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.quick-row:last-child {
  border-bottom: 0;
}

.quick-question {
  margin: 0;
  font-weight: 600;
}

/* ---------- notes ---------- */

.notes textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-small);
  padding: 0.75rem 0.9rem;
  resize: vertical;
}

.notes textarea::placeholder {
  color: var(--muted);
}

.notes-foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-top: 0.4rem;
}

.counter {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- loading ---------- */

.loading {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 1rem;
  padding-block: 56px;
}

.spinner {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 5px solid var(--accent-soft);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- results ---------- */

.results-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.5rem;
}

.tag {
  font-size: 0.9rem;
  font-weight: 650;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
}

.notice {
  background: var(--notice-bg);
  color: var(--notice-text);
  border: 1px solid var(--notice-border);
  border-radius: var(--radius-small);
  padding: 0.75rem 1rem;
}

.picks {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0;
  display: grid;
  gap: 1rem;
}

.pick {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.25rem 1rem 4.25rem;
}

.pick-num {
  position: absolute;
  left: 1.1rem;
  top: 1.15rem;
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: var(--ribbon-soft);
  color: var(--ribbon);
  font-weight: 800;
}

.pick-name {
  font-size: 1.3rem;
  margin-bottom: 0.3rem;
}

.pick-blurb {
  color: var(--muted);
}

.pick-why {
  background: var(--accent-soft);
  border-radius: var(--radius-small);
  padding: 0.6rem 0.8rem;
}

.pick-price {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.pick-kind {
  margin: 0 0 0.15rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pick-features {
  margin: 0 0 0.85rem;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.3rem;
}

.source-link {
  font-size: 0.92rem;
  color: var(--muted);
  white-space: nowrap;
}

.source-link:hover {
  color: var(--accent);
}

.pick-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.btn-store {
  display: inline-flex;
  align-items: center;
  margin-top: 0.9rem;
  text-decoration: none;
}

.disclosure {
  margin-top: -0.25rem;
}

.badge {
  font-size: 0.85rem;
  font-weight: 650;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  border: 1px dashed var(--border-strong);
  color: var(--muted);
}

.badge-ok {
  border-style: solid;
  background: var(--ok-bg);
  color: var(--ok-text);
}

.results-actions {
  margin-top: 1.5rem;
}

.end-note {
  margin-top: 0.75rem;
}

.profile-card {
  margin-top: 2rem;
  padding: 1.25rem;
  border-radius: var(--radius);
  border: 1px dashed var(--border-strong);
  background: var(--surface-2);
}

.facts {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.facts li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  font-size: 0.98rem;
}

/* ---------- privacy and how-we-pick pages ---------- */

.prose h2 {
  font-size: 1.25rem;
  margin-top: 1.75rem;
}

.steps {
  padding-left: 1.4rem;
  display: grid;
  gap: 0.6rem;
}

/* ---------- gift guides ---------- */

.guide h1 {
  margin-bottom: 0.75rem;
}

.guide-intro {
  margin-bottom: 0.5rem;
}

.guide-section {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.guide-section h2 {
  font-size: 1.45rem;
  margin-bottom: 0.25rem;
}

.guide-product {
  margin-top: 1rem;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  background: var(--surface);
}

.recommended-by {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.cta {
  margin-top: 2.25rem;
  padding: 1.5rem;
  border-radius: var(--radius);
  background: var(--accent-soft);
  text-align: center;
}

.cta h2 {
  font-size: 1.35rem;
}

.cta .btn-big {
  display: inline-flex;
  text-decoration: none;
  margin: 0.5rem 0 0;
}

.guide-list {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0;
  display: grid;
  gap: 0.9rem;
}

.guide-card {
  padding: 1rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  background: var(--surface);
}

.guide-card p {
  margin: 0.25rem 0 0;
}

.guide-card-title {
  font-size: 1.2rem;
  font-weight: 700;
}

/* ---------- small screens ---------- */

@media (max-width: 560px) {
  body {
    font-size: 1.0625rem;
  }

  .quick-row {
    grid-template-columns: 1fr;
  }

  .trait-scale {
    grid-template-columns: 1fr 1fr;
  }

  .trait-scale .range {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .nav-row {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .nav-right {
    flex-direction: column-reverse;
    align-items: stretch;
    margin-left: 0;
  }

  .nav-row .btn {
    width: 100%;
  }

  .pick {
    padding: 1.1rem 1rem 1rem;
  }

  .pick-num {
    position: static;
    margin-bottom: 0.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }

  .spinner {
    border-top-color: var(--accent-soft);
    border-color: var(--accent);
  }
}
