/* Raisin website
   Paper UI in the Stoic manner: off-white page, white 24px cards, near-black type, no shadows,
   no accent color. Figtree with the system stack as fallback. There is no JavaScript on this site. */

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  color-scheme: light dark;

  --page: #F1F2F4;
  --surface: #FFFFFF;
  --surface-2: #E8E9EC;
  --ink: #161616;
  --ink-2: #5C5C60;          /* secondary text: 6.5:1 on white, 5.9:1 on the page */
  --ink-3: #919192;          /* decorative only (markers, separators) */
  --inverse: #161616;        /* black cards and pills */
  --on-inverse: #F1F2F4;
  --on-inverse-2: rgba(241, 242, 244, 0.72);
  --hairline: rgba(22, 22, 22, 0.08);
  --focus: #161616;

  --r-card: 24px;
  --r-card-sm: 16px;
  --r-pill: 999px;

  --gutter: clamp(16px, 4vw, 40px);
  --card-pad: clamp(20px, 4.5vw, 36px);
  --measure: 680px;

  --font: "Figtree", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;

  --dur: 180ms;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Stoic inverts to black at night; so do we. */
@media (prefers-color-scheme: dark) {
  :root {
    --page: #000000;
    --surface: #191919;
    --surface-2: #242424;
    --ink: #EDEDED;
    --ink-2: #A5A5A8;
    --ink-3: #6E6E73;
    --inverse: #F2F2F2;
    --on-inverse: #111111;
    --on-inverse-2: rgba(17, 17, 17, 0.7);
    --hairline: rgba(255, 255, 255, 0.1);
    --focus: #F2F2F2;
  }
}

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

main {
  flex: 1 0 auto;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

h1,
h2,
h3 {
  font-weight: 700;
  text-wrap: balance;
}

p,
li,
dd,
dt {
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

strong {
  font-weight: 700;
}

svg {
  display: block;
}

::selection {
  background: var(--ink);
  color: var(--page);
}

:focus-visible {
  outline: 2.5px solid var(--focus);
  outline-offset: 3px;
}

[id] {
  scroll-margin-top: 24px;
}

.visually-hidden {
  position: absolute !important;
  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: 12px;
  z-index: 10;
  padding: 10px 18px;
  border-radius: var(--r-pill);
  background: var(--inverse);
  color: var(--on-inverse);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform var(--dur) var(--ease);
}

.skip-link:focus-visible {
  transform: none;
}

.wrap {
  width: min(100% - 2 * var(--gutter), 1080px);
  margin-inline: auto;
}

.wrap--doc {
  width: min(100% - 2 * var(--gutter), calc(var(--measure) + 2 * var(--card-pad)));
  margin-inline: auto;
}

/* ── Type roles ─────────────────────────────────────────────────────────── */
.eyebrow {
  font-size: 0.75rem;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.wordmark {
  font-weight: 800;
  font-size: 1.375rem;
  line-height: 1;
  letter-spacing: -0.04em;
  text-decoration: none;
  color: var(--ink);
  border-radius: 6px;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 22px;
}

.site-nav ul {
  display: flex;
  align-items: center;
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-nav li + li::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 3px;
  margin-inline: 12px;
  border-radius: 50%;
  background: var(--ink-3);
  vertical-align: middle;
}

.site-nav a {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
  border-radius: 6px;
  transition: color var(--dur) var(--ease);
}

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

/* ── Buttons and the store badge ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 26px;
  border: 0;
  border-radius: var(--r-pill);
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: opacity var(--dur) var(--ease), background-color var(--dur) var(--ease),
    transform var(--dur) var(--ease);
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: var(--inverse);
  color: var(--on-inverse);
}

.btn--primary:hover {
  opacity: 0.86;
}

.btn--secondary {
  min-height: 46px;
  padding: 0 22px;
  font-size: 1rem;
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--ink);
}

.btn--secondary:hover {
  background: var(--hairline);
}

.btn--light {
  min-height: 46px;
  padding: 0 20px;
  font-size: 1rem;
  background: var(--on-inverse);
  color: var(--inverse);
}

.btn--light:hover {
  opacity: 0.9;
}

/* App Store badge as plain type, no Apple artwork. Points at "#" until the listing is live. */
.store {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  min-height: 56px;
  padding: 8px 28px 9px;
  border-radius: var(--r-pill);
  background: var(--inverse);
  color: var(--on-inverse);
  text-decoration: none;
  line-height: 1.1;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.store:hover {
  opacity: 0.86;
}

.store:active {
  transform: scale(0.98);
}

.store__small {
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0.78;
}

.store__big {
  font-size: 1.1875rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

/* ── Landing ────────────────────────────────────────────────────────────── */
.hero {
  padding-block: clamp(20px, 5vw, 56px) clamp(40px, 7vw, 72px);
}

.hero__title {
  margin-top: 14px;
  max-width: 20ch;
  font-size: clamp(2.375rem, 1.35rem + 4.6vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.hero__lede {
  margin-top: 20px;
  max-width: 36rem;
  font-size: clamp(1.0625rem, 1rem + 0.45vw, 1.3125rem);
  line-height: 1.5;
  color: var(--ink-2);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 14px;
  margin-top: 28px;
}

.hero__note {
  margin-top: 16px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-2);
}

.section {
  padding-block: clamp(28px, 5vw, 48px) 0;
}

.section-head {
  margin-bottom: 20px;
}

.section-title {
  margin-top: 8px;
  max-width: 24ch;
  font-size: clamp(1.625rem, 1.2rem + 1.8vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.section-foot {
  margin-top: 16px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink-2);
}

.section-foot a {
  color: var(--ink);
}

.cards {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 12px;
}

@media (min-width: 760px) {
  .cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }
}

.cards .card h3 {
  font-size: 1.1875rem;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.cards .card p {
  margin-top: 10px;
  color: var(--ink-2);
  line-height: 1.55;
}

/* Numbers before reassurance */
.stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat__num {
  font-size: clamp(2rem, 1.5rem + 2vw, 2.75rem);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.stat__label {
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--ink-2);
}

.stat__source {
  margin-top: auto;
  padding-top: 10px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-2);
}

/* "What Raisin is not": a black card, the way Stoic does its category tiles */
.not h2 {
  margin-top: 8px;
  font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.125rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.not__list {
  margin-top: 20px;
  display: grid;
  gap: 18px;
}

@media (min-width: 760px) {
  .not__list {
    grid-template-columns: 1fr 1fr;
    gap: 22px 32px;
  }
}

.not__list dt {
  font-weight: 700;
  font-size: 1.0625rem;
}

.not__list dd {
  margin-top: 4px;
  color: var(--on-inverse-2);
  line-height: 1.55;
}

.not__list dd a {
  color: var(--on-inverse);
}

.footnote {
  padding-block: clamp(40px, 6vw, 64px) 0;
}

.footnote p {
  max-width: 44rem;
  font-size: 0.875rem;
  line-height: 1.6;
  font-weight: 500;
  color: var(--ink-2);
}

.footnote strong {
  color: var(--ink);
}

/* ── Inner pages ────────────────────────────────────────────────────────── */
.page-head {
  padding-block: clamp(24px, 6vw, 64px) clamp(24px, 5vw, 40px);
}

.page-title {
  margin-top: 10px;
  font-size: clamp(2.75rem, 1.6rem + 5.4vw, 4.75rem);
  line-height: 0.98;
  font-weight: 700;
  letter-spacing: -0.045em;
}

.lede {
  margin-top: 18px;
  max-width: 34rem;
  font-size: clamp(1.0625rem, 1rem + 0.4vw, 1.25rem);
  line-height: 1.5;
  color: var(--ink-2);
}

.meta {
  margin-top: 14px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-2);
}

.jump {
  margin-top: 20px;
}

.stack {
  display: grid;
  gap: 12px;
}

.stack > * {
  min-width: 0;
}

.card {
  padding: var(--card-pad);
  border-radius: var(--r-card);
  background: var(--surface);
}

.card--inverse {
  --focus: var(--on-inverse);
  background: var(--inverse);
  color: var(--on-inverse);
}

.card--inverse .eyebrow {
  color: var(--on-inverse-2);
}

.card--inverse a:not(.btn) {
  color: var(--on-inverse);
}

.card--inverse ::selection {
  background: var(--on-inverse);
  color: var(--inverse);
}

.group-title {
  margin: 36px 0 12px;
  padding-inline: 4px;
}

.group-title:first-child {
  margin-top: 0;
}

/* Long-form text */
.prose {
  font-size: 1rem;
  line-height: 1.65;
}

@media (min-width: 720px) {
  .prose {
    font-size: 1.0625rem;
  }
}

.prose h2 {
  font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.4375rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.prose h3 {
  margin-top: 26px;
  font-size: 1.0625rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.prose h2 + *,
.prose h3 + * {
  margin-top: 10px;
}

.prose p + p,
.prose p + ul,
.prose p + ol,
.prose ul + p,
.prose ol + p,
.prose p + dl,
.prose dl + p,
.prose ul + ul,
.prose ol + ul {
  margin-top: 14px;
}

.prose ul,
.prose ol {
  padding-left: 1.3em;
}

.prose li + li {
  margin-top: 8px;
}

.prose li::marker {
  color: var(--ink-3);
}

.prose ol li::marker {
  color: var(--ink-2);
  font-weight: 600;
}

.prose a {
  text-decoration-color: var(--ink-3);
  overflow-wrap: anywhere;
  border-radius: 3px;
  transition: text-decoration-color var(--dur) var(--ease);
}

.prose a:hover {
  text-decoration-color: currentColor;
}

.prose .muted {
  color: var(--ink-2);
}

.prose .conspicuous {
  font-weight: 600;
}

.path {
  font-weight: 600;
}

/* The short version */
.summary {
  list-style: none;
  padding: 0;
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.summary li {
  position: relative;
  padding-left: 22px;
  line-height: 1.55;
}

.summary li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.55;
}

.summary-note {
  margin-top: 18px;
  font-size: 0.875rem;
  color: var(--on-inverse-2);
}

/* Contents */
.toc h2 {
  margin-bottom: 12px;
}

.toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc li {
  break-inside: avoid;
}

@media (min-width: 640px) {
  .toc ol {
    columns: 2;
    column-gap: 24px;
  }
}

.toc a {
  display: block;
  padding: 6px 0;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink);
  border-radius: 6px;
}

.toc a:hover {
  text-decoration: underline;
  text-decoration-color: var(--ink-3);
}

/* Label / value rows */
.facts {
  margin-top: 16px;
  border-top: 1px solid var(--hairline);
}

.facts > div {
  padding-block: 14px;
  border-bottom: 1px solid var(--hairline);
}

.facts dt {
  font-weight: 700;
  line-height: 1.4;
}

.facts dd {
  margin-top: 4px;
  color: var(--ink-2);
}

.facts dd a {
  color: var(--ink);
}

@media (min-width: 640px) {
  .facts > div {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    gap: 20px;
  }

  .facts dd {
    margin-top: 0;
  }
}

/* ── FAQ ────────────────────────────────────────────────────────────────── */
.faq {
  padding: 0;
  overflow: hidden;
}

.faq details + details {
  border-top: 1px solid var(--hairline);
}

.faq summary {
  position: relative;
  display: block;
  padding: 18px 56px 18px var(--card-pad);
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  list-style: none;
  transition: background-color var(--dur) var(--ease);
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary:hover {
  background: var(--hairline);
}

.faq summary:focus-visible {
  outline-offset: -3px;
  border-radius: 12px;
}

.faq summary::after {
  content: "";
  position: absolute;
  right: calc(var(--card-pad) + 2px);
  top: 50%;
  width: 9px;
  height: 9px;
  margin-top: -7px;
  border-right: 2px solid var(--ink-2);
  border-bottom: 2px solid var(--ink-2);
  transform: rotate(45deg);
  transition: transform var(--dur) var(--ease), margin-top var(--dur) var(--ease);
}

.faq details[open] > summary::after {
  margin-top: -2px;
  transform: rotate(-135deg);
}

.faq__body {
  padding: 0 var(--card-pad) 22px;
}

/* ── Red flags and crisis ───────────────────────────────────────────────── */
.crisis h2 {
  font-size: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.crisis__intro {
  margin-top: 10px;
  color: var(--on-inverse-2);
}

.crisis__lines {
  list-style: none;
  padding: 0;
  margin-top: 20px;
  display: grid;
  gap: 10px;
}

@media (min-width: 560px) {
  .crisis__lines {
    grid-template-columns: 1fr 1fr;
  }
}

.crisis__lines .btn {
  width: 100%;
  flex-direction: column;
  gap: 1px;
  min-height: 58px;
  padding: 8px 18px;
}

.crisis__lines small {
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0.7;
}

.crisis__danger {
  margin-top: 18px;
  font-weight: 700;
}

.flags {
  list-style: none;
  padding: 0;
  margin-top: 16px;
  border-top: 1px solid var(--hairline);
}

.flags li {
  padding-block: 16px;
  border-bottom: 1px solid var(--hairline);
}

.flags li + li {
  margin-top: 0;
}

.flags .flag__what {
  font-weight: 700;
  line-height: 1.4;
}

.flags .flag__why {
  margin-top: 4px;
  color: var(--ink-2);
}

.flags .flag__do {
  margin-top: 6px;
  font-weight: 600;
}

/* ── Evidence list ──────────────────────────────────────────────────────── */
.refs {
  list-style: none;
  padding: 0;
  margin-top: 16px;
  border-top: 1px solid var(--hairline);
}

.refs li {
  padding-block: 18px;
  border-bottom: 1px solid var(--hairline);
}

.refs li + li {
  margin-top: 0;
}

.ref__key {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.ref__found {
  margin-top: 6px;
  font-weight: 600;
  line-height: 1.45;
}

.ref__use {
  margin-top: 6px;
  color: var(--ink-2);
}

.ref__cite {
  margin-top: 8px;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--ink-2);
}

.ref__cite a {
  color: var(--ink);
}

/* ── Contact ────────────────────────────────────────────────────────────── */
.contact h2 {
  font-size: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.contact__intro {
  margin-top: 8px;
  color: var(--ink-2);
}

.contact__email {
  margin-top: 20px;
}

.contact__email .btn {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.contact__fine {
  margin-top: 16px;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--ink-2);
}

/* ── Footer ─────────────────────────────────────────────────────────────── */
.site-footer {
  margin-top: clamp(64px, 10vw, 112px);
  border-top: 1px solid var(--hairline);
}

.site-footer__inner {
  display: grid;
  gap: 18px;
  padding-block: 32px 40px;
}

.wordmark--sm {
  font-size: 1.125rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links a {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
  border-radius: 6px;
  transition: color var(--dur) var(--ease);
}

.footer-links a:hover,
.footer-links a[aria-current="page"] {
  color: var(--ink);
}

.copyright {
  max-width: 44rem;
  font-size: 0.8125rem;
  line-height: 1.55;
  font-weight: 500;
  color: var(--ink-2);
}
