/* Savewell guides: long-form help pages in the landing page's look
   (dark only, Geist, one indigo accent, no ornaments). */

@font-face { font-family: 'Geist'; src: url('/landing/fonts/Geist_400Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Geist'; src: url('/landing/fonts/Geist_500Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Geist'; src: url('/landing/fonts/Geist_600SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }

:root {
  --bg: #141416;
  --surface: #1b1b1e;
  --raised: #222226;
  --line: #2b2b30; /* only inside interface fragments (data-ui) and code */
  --ink: #dcddde;
  --muted: #a6a6ae;
  --faint: #8a8a93;
  --accent: #5b4fe8;
  --accent-ink: #ffffff;
  --accent-soft: #24213f;
  --accent-text: #9a92ff;
  --margin: clamp(20px, 3.4vw, 48px);
  --measure: 680px;
  --radius: 6px;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.65 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
a { color: var(--accent-text); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; border-radius: 2px; }

.top { display: flex; justify-content: space-between; align-items: center; padding: 32px var(--margin) 0; }
.top a { color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 500; }
.top a:hover { color: var(--accent-text); }
.brand { display: inline-flex; align-items: center; gap: 10px; }

/* The article: one reading column with a wide figure lane on desktop. */
.article { display: grid; grid-template-columns: minmax(0, var(--measure)) minmax(0, 1fr); gap: 0 clamp(40px, 6vw, 96px); padding: clamp(72px, 12vh, 120px) var(--margin) 0; }
.article > .body { grid-column: 1; grid-row: 1; }
.article > .aside { grid-column: 2; grid-row: 1; align-self: start; position: sticky; top: 32px; }
.crumb { font-size: 15px; color: var(--muted); }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--ink); }
.article h1 { margin-top: 0; font-size: clamp(34px, 4.4vw, 56px); font-weight: 500; line-height: 1.08; letter-spacing: -0.03em; }
.lede { margin-top: 24px; font-size: 20px; line-height: 1.5; color: var(--ink); }
.meta { margin-top: 16px; font-size: 15px; color: var(--faint); }
.article h2 { margin-top: 64px; font-size: clamp(24px, 2.2vw, 30px); font-weight: 500; line-height: 1.2; letter-spacing: -0.01em; }
.article h3 { margin-top: 32px; font-size: 19px; font-weight: 600; line-height: 1.3; }
.article p, .article ul, .article ol { margin-top: 16px; }
.article ul, .article ol { padding-left: 22px; }
.article li + li { margin-top: 8px; }
.article li::marker { color: var(--accent-text); }
.article strong { font-weight: 600; }
.note { margin-top: 24px; padding: 18px 20px; background: var(--surface); border-radius: var(--radius); color: var(--ink); }
.note p:first-child { margin-top: 0; }

code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 0.88em; background: var(--raised); padding: 2px 6px; border-radius: 4px; }
pre { margin: 16px 0 0; padding: 16px 18px; background: var(--surface); border-radius: var(--radius); overflow-x: auto; font-size: 14px; line-height: 1.55; }
pre code { background: none; padding: 0; font-size: inherit; }

table { margin-top: 20px; width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 12px 14px; vertical-align: top; }
th { color: var(--muted); font-weight: 500; background: var(--surface); }
tr:nth-child(even) td { background: var(--surface); }

/* The closing call to action: a full-width field of the accent's soft tone. */
.cta { margin-top: 96px; padding: clamp(48px, 7vw, 88px) var(--margin); background: var(--accent-soft); display: grid; grid-template-columns: minmax(0, var(--measure)) auto; gap: 24px clamp(40px, 6vw, 96px); align-items: end; }
.cta h2 { font-size: clamp(28px, 3vw, 40px); font-weight: 500; line-height: 1.15; letter-spacing: -0.02em; }
.cta p { margin-top: 14px; color: var(--ink); }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; background: var(--accent); color: var(--accent-ink); font: 500 17px/1 'Geist', system-ui, sans-serif; border-radius: var(--radius); text-decoration: none; transition: background-color 160ms var(--ease), transform 160ms var(--ease); white-space: nowrap; }
.button:hover { background: #6a5ff0; color: var(--accent-ink); }
.button:active { transform: scale(0.98); }

.more { padding: 64px var(--margin) 0; }
.more h2 { font-size: 20px; font-weight: 500; }
.more ul { list-style: none; padding: 0; margin-top: 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.more a { overflow: hidden; }
/* The guides index: the list sits in the reading column, beside the clip. */
.article > .guide-list { grid-column: 1; grid-row: 2; list-style: none; padding: 0; margin-top: 40px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.article > .guide-list ~ .aside, .article > .aside:has(~ .guide-list) { grid-row: 1 / span 2; }
.guide-list li + li { margin-top: 0 !important; }
.guide-list a { display: block; overflow: hidden; padding: 18px 20px; background: var(--surface); border-radius: var(--radius); color: var(--ink); text-decoration: none; font-weight: 500; line-height: 1.35; transition: background-color 160ms var(--ease); }
.guide-list a:hover { background: var(--raised); }
.guide-list a img { width: calc(100% + 40px); max-width: none; margin: -18px -20px 16px; aspect-ratio: 16 / 9; object-fit: cover; }
.guide-list a span { display: block; margin-top: 6px; color: var(--muted); font-weight: 400; font-size: 15px; }
@media (max-width: 1023px) { .article > .guide-list { grid-row: 3; } .article > .aside:has(~ .guide-list) { grid-row: 2; } }
@media (max-width: 767px) { .article > .guide-list { grid-template-columns: 1fr; } }
.more a { display: block; padding: 18px 20px; background: var(--surface); border-radius: var(--radius); color: var(--ink); text-decoration: none; font-weight: 500; line-height: 1.35; transition: background-color 160ms var(--ease); }
.more a:hover { background: var(--raised); }
.more a img { width: calc(100% + 40px); max-width: none; margin: -18px -20px 16px; aspect-ratio: 16 / 9; object-fit: cover; }
.more a span { display: block; margin-top: 6px; color: var(--muted); font-weight: 400; font-size: 15px; }

.foot { margin-top: 96px; padding: 0 var(--margin) 32px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; font-size: 15px; color: var(--muted); }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.foot a { color: var(--ink); text-decoration: none; }
.foot a:hover { color: var(--accent-text); }

/* Interface fragments: the app's own share card and item, as the page's pictures. */
[data-ui] { font-size: 15px; line-height: 1.45; }
.ui-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; overflow: hidden; }
.ui-status { display: flex; align-items: center; gap: 14px; }
.ui-status strong { display: block; font-weight: 600; font-size: 16px; }
.ui-status span { color: var(--muted); }
.ui-check { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); border: 1px solid rgba(91, 79, 232, 0.55); }
.ui-chip { display: inline-block; margin-top: 14px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--raised); color: var(--muted); font-size: 13px; }
.ui-item { padding: 0; margin-top: 12px; }
.ui-item img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.ui-item > :not(img) { margin-left: 18px; margin-right: 18px; }
.ui-meta { margin-top: 14px; color: var(--faint); font-size: 13px; }
.ui-title { margin-top: 4px; font-size: 17px; font-weight: 600; line-height: 1.3; }
.ui-label { margin-top: 14px; color: var(--faint); font-size: 13px; font-weight: 500; }
.ui-points { margin: 8px 0 18px; padding-left: 18px; display: grid; gap: 6px; }
.ui-points li::marker { color: var(--accent-text); }
.aside figcaption { margin-top: 12px; font-size: 14px; color: var(--faint); }

@media (max-width: 1023px) {
  .article { grid-template-columns: minmax(0, 1fr); }
  .article > .aside { grid-column: 1; grid-row: 2; position: static; margin-top: 48px; max-width: 480px; }
  .cta { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
  body { font-size: 16px; }
  .lede { font-size: 18px; }
  .article h2 { margin-top: 48px; }
  .cta .button { width: 100%; }
}

/* Header actions */
.top-nav { display: flex; align-items: center; gap: 24px; }
.button-small { min-height: 40px; padding: 0 16px; font-size: 15px; }
.top-nav .button-small { color: var(--accent-ink); }

/* Pictures inside the article */
.mess, .loop, .answer, .post { margin-top: 28px; }
.ui-post { display: grid; grid-template-columns: 40px 1fr; gap: 12px; background: #000; border: 1px solid #2f3336; border-radius: 12px; padding: 14px 16px; color: #e7e9ea; }
.ui-post p { margin: 0; }
.ui-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.ui-post-who span { color: #71767b; }
.ui-post-text { margin-top: 4px !important; }
.ui-post-actions { margin-top: 10px !important; display: flex; gap: 22px; color: #71767b; font-size: 13px; }
.ui-hot { color: #1d9bf0; font-weight: 600; }
.mess { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.mess img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.mess:not(.mess-all) img:not(:first-child) { opacity: 0.55; }
.mess figcaption, .loop figcaption, .answer figcaption, .post figcaption { grid-column: 1 / -1; margin-top: 10px; font-size: 14px; color: var(--faint); }
.loop video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); background: var(--surface); }
.answer .ui-card p { color: var(--ink); }
.answer b { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 4px; background: var(--accent-soft); color: var(--accent-text); font-size: 12px; font-weight: 600; vertical-align: 2px; }
.ui-sources { list-style: none; padding: 0; margin: 14px 0 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.ui-sources li { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--line); margin: 0; } /* taste-skill-ignore: rows inside an app fragment (data-ui) */
.ui-sources li:first-child { border-top: 0; }
.ui-sources img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; }
.ui-sources strong { display: block; font-weight: 500; font-size: 14px; }
.ui-sources em { font-style: normal; color: var(--faint); font-size: 13px; }

/* Motion: figures rise in as they arrive; nothing moves for people who ask for less. */
.reveal { opacity: 0; transform: translateY(20px); }
.reveal.in { opacity: 1; transform: none; transition: opacity 600ms var(--ease), transform 600ms var(--ease); }
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.in { opacity: 1; transform: none; transition: none; }
}
@media (max-width: 767px) {
  .top-nav { gap: 16px; }
  .top-nav a:not(.button) { display: none; }
  .brand { white-space: nowrap; }
}
