@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght,SOFT,WONK@9..144,400;9..144,600;9..144,700&family=Inter:wght@400;500;600&display=swap');

:root {
  --forest: #17251e;
  --forest-soft: #24382d;
  --paper: #eef1ea;
  --card: #ffffff;
  --brass: #b07d2b;
  --brass-lit: #d9a441;
  --moss: #55685c;
  --line: #d3dacd;
  --alert: #a33224;

  --display: 'Fraunces', Georgia, serif;
  --body: 'Inter', ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--forest);
  font: 400 16.5px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 62rem; margin: 0 auto; padding: 0 1.5rem; }
.narrow { max-width: 44rem; }

/* ---- the scent trail: the one repeating motif ---- */
.trail {
  height: 2px;
  background-image: linear-gradient(90deg, var(--brass) 0 10px, transparent 10px 22px);
  background-size: 22px 2px;
  opacity: 0.55;
  border: 0;
  margin: 0;
}

/* ---- header ---- */
header {
  background: var(--forest);
  color: var(--paper);
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.35rem;
  font-variation-settings: 'SOFT' 40, 'WONK' 1;
  color: var(--paper);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.logo svg { display: block; }
.logo .word { display: inline-block; }
.logo b { color: var(--brass-lit); font-weight: 700; }

/* Superscript sized off the wordmark rather than the root, so it scales with
   the smaller footer variant instead of staying fixed. */
/* Trademark mark.
   Position is deliberately NOT set with `vertical-align: super`. That property
   offsets by a fraction of the superscript's own font size, so size and
   position are coupled: enlarging the mark also throws it further from the
   wordmark. Anchoring to the baseline and lifting by a fixed amount means
   font-size can now be changed on its own without the mark drifting.
   line-height 1 keeps it from stretching the header and footer bars. */
.logo sup {
  font-family: var(--body);
  font-size: 0.6em;
  font-weight: 600;
  color: inherit;
  vertical-align: baseline;
  position: relative;
  top: -0.5em;
  line-height: 1;
  margin-left: 0.04em;
}

.logo.small { font-size: 1.1rem; }
.logo.small svg { width: 28px; height: 28px; }

.fbrand { display: flex; flex-direction: column; gap: 0.55rem; }
.fbrand span { color: #9fb0a4; }

.bar nav { display: flex; gap: 1.35rem; font-size: 0.92rem; }
.bar nav a { color: #c3cec5; text-decoration: none; }
.bar nav a:hover { color: var(--brass-lit); }

/* ---- hero ---- */
.hero { background: var(--forest); color: var(--paper); padding: 1rem 0 3.5rem; }

.hero h1 {
  font-family: var(--display);
  font-variation-settings: 'SOFT' 30, 'WONK' 1;
  font-weight: 600;
  font-size: clamp(2.1rem, 5.5vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin: 0 0 1rem;
  max-width: 17ch;
}

.hero p {
  color: #b9c6bc;
  max-width: 52ch;
  margin: 0 0 2rem;
  font-size: 1.05rem;
}

/* ---- form ---- */
.panel {
  background: var(--card);
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: 0 18px 40px -24px rgba(10, 30, 20, 0.55);
}

form { display: grid; gap: 0.9rem; grid-template-columns: 1fr 1fr; }
.full { grid-column: 1 / -1; }
@media (max-width: 38rem) { form { grid-template-columns: 1fr; } }

label {
  display: block;
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--moss);
  margin-bottom: 0.35rem;
}

input {
  width: 100%;
  padding: 0.68rem 0.8rem;
  font: 400 1rem var(--body);
  color: var(--forest);
  background: #fbfcfa;
  border: 1.5px solid var(--line);
  border-radius: 9px;
}

input::placeholder { color: #9aa89e; }
input:focus { border-color: var(--brass); outline: 2px solid rgba(176, 125, 43, 0.25); outline-offset: 1px; }

button {
  padding: 0.75rem 1.5rem;
  font: 600 1rem var(--body);
  color: #fff;
  background: var(--forest);
  border: 0;
  border-radius: 9px;
  cursor: pointer;
}

button:hover { background: var(--forest-soft); }
button:disabled { opacity: 0.55; cursor: default; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

.hint { font-size: 0.87rem; color: var(--moss); margin: 0.9rem 0 0; max-width: 66ch; }
.quota { font-size: 0.85rem; color: #b9c6bc; margin: 1rem 0 0; }

/* ---- results ---- */
main { padding: 3rem 0 4rem; }

.msg {
  padding: 0.9rem 1.05rem;
  border-radius: 10px;
  background: #fff;
  border-left: 3px solid var(--brass);
  margin-bottom: 1rem;
  font-size: 0.94rem;
}

.msg.bad { border-left-color: var(--alert); }

.funnel {
  font-size: 0.94rem;
  color: var(--moss);
  padding: 1.1rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.5rem;
}

.funnel strong {
  display: block;
  font-family: var(--display);
  font-variation-settings: 'SOFT' 30, 'WONK' 1;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--forest);
  margin-bottom: 0.3rem;
}

.bucket {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 2.25rem 0 0.5rem;
}

.bucket span { font-family: var(--body); font-size: 0.85rem; font-weight: 400; color: var(--moss); }

table { width: 100%; border-collapse: collapse; }

th {
  text-align: left;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--moss);
  padding: 0.5rem 0.6rem;
  border-bottom: 1.5px solid var(--line);
}

td { padding: 0.9rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
td.num { text-align: right; font-variant-numeric: tabular-nums; color: var(--moss); }
.site { font-weight: 600; }

.snippet { display: block; color: var(--moss); font-size: 0.88rem; margin-top: 0.25rem; max-width: 62ch; }
a { color: var(--brass); }
.none { color: var(--moss); }

/* ---- faq ---- */
.faq { padding: 3rem 0; border-top: 1px solid var(--line); }

.faq h2, .prose h1 {
  font-family: var(--display);
  font-variation-settings: 'SOFT' 30, 'WONK' 1;
  font-weight: 600;
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  letter-spacing: -0.02em;
  margin: 0 0 1.5rem;
}

details {
  border-bottom: 1px solid var(--line);
  padding: 1rem 0;
}

summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 1.02rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
}

summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; color: var(--brass); font-size: 1.3rem; line-height: 1; }
details[open] summary::after { content: '\2013'; }
details p { margin: 0.85rem 0 0; color: var(--moss); max-width: 70ch; }

/* ---- prose pages ---- */
.prose { padding: 3rem 0 4rem; }
.prose h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.3rem;
  margin: 2.25rem 0 0.6rem;
}
.prose p, .prose li { color: #33453a; max-width: 68ch; }
.prose li { margin-bottom: 0.4rem; }
.updated { color: var(--moss); font-size: 0.9rem; }

.note {
  background: #fff;
  border-left: 3px solid var(--alert);
  padding: 0.9rem 1.05rem;
  border-radius: 10px;
  font-size: 0.92rem;
}

/* ---- footer ---- */
footer {
  background: var(--forest);
  color: #9fb0a4;
  padding: 2.5rem 0;
  font-size: 0.88rem;
}

footer .cols { display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: space-between; align-items: center; }
footer a { color: #c3cec5; text-decoration: none; }
footer a:hover { color: var(--brass-lit); }
footer nav { display: flex; gap: 1.25rem; }

.credit { margin: 1.5rem 0 0; padding-top: 1.25rem; border-top: 1px solid #2c3f34; color: #8a9c8f; }
.credit b { color: var(--paper); font-weight: 600; }

/* ---- email gate ---- */
.preview {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  font-weight: 600;
}

.preview li { padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.preview .locked { font-weight: 400; color: var(--moss); font-style: italic; }

.gatebox h2 {
  font-family: var(--display);
  font-variation-settings: 'SOFT' 30, 'WONK' 1;
  font-weight: 600;
  font-size: 1.4rem;
  margin: 0 0 0.4rem;
}

.gatebox > p { color: var(--moss); margin: 0 0 1.2rem; font-size: 0.95rem; }

.gaterow { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.gaterow input { flex: 1 1 16rem; }

.check {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  margin: 0.9rem 0 0;
  font-size: 0.87rem;
  color: var(--moss);
  cursor: pointer;
}

.check input { width: auto; flex: 0 0 auto; margin-top: 0.2rem; }

.gatemsg { margin: 0.8rem 0 0; font-size: 0.9rem; color: var(--moss); }
.gatemsg.bad { color: var(--alert); font-weight: 500; }

/* Sandstorm credit link. Inherits the white already applied to the b element
   rather than taking the brass link colour, so the credit line keeps reading
   as one phrase instead of a link stuck in the middle of a sentence. The
   underline only appears on hover, which is what signals it is clickable. */
.credit a.sandstorm {
  color: inherit;
  text-decoration: none;
}

.credit a.sandstorm b { color: var(--paper); }

.credit a.sandstorm:hover b,
.credit a.sandstorm:focus-visible b {
  color: var(--brass-lit);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---- sent confirmation ---- */
.sentbox { margin-top: 1rem; }
.sentbox .tick { color: var(--brass); font-weight: 600; margin: 0 0 0.4rem; font-size: 0.9rem; }
.sentbox h2 {
  font-family: var(--display);
  font-variation-settings: 'SOFT' 30, 'WONK' 1;
  font-weight: 600;
  font-size: 1.45rem;
  margin: 0 0 0.7rem;
}
.sentbox p { color: var(--moss); margin: 0 0 0.7rem; }
.sentbox .fineprint { font-size: 0.87rem; margin: 0; }

/* ---- report page downloads ---- */
.tools { margin: 0 0 1.75rem; display: flex; gap: 0.6rem; flex-wrap: wrap; }
.dl {
  display: inline-block;
  background: var(--forest);
  color: #fff;
  text-decoration: none;
  padding: 0.6rem 1.15rem;
  border-radius: 9px;
  font-weight: 600;
  font-size: 0.92rem;
}
.dl:hover { background: var(--forest-soft); }

/* Logo on light backgrounds (report page, expired page), where the header's
   paper-on-forest colouring would be invisible. */
.pagemark { margin: 0 0 2rem; }
.logo.onlight { color: var(--forest); }
.logo.onlight b { color: var(--brass); }

/* Inline confirm buttons for the typo prompt. Sized down so they read as a
   question inside a sentence, not as a second call to action competing with
   the primary button. */
button.inline {
  padding: 0.3rem 0.7rem;
  font-size: 0.83rem;
  border-radius: 6px;
  margin-left: 0.35rem;
}
button.inline.plain { background: transparent; color: var(--moss); text-decoration: underline; }
button.inline.plain:hover { background: transparent; color: var(--forest); }

/* ---- inline explainers ---- */
.q {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.05rem;
  height: 1.05rem;
  padding: 0;
  margin-left: 0.3rem;
  font: 600 0.72rem/1 var(--body);
  color: var(--moss);
  background: transparent;
  border: 1.3px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  vertical-align: middle;
  flex: 0 0 auto;
}

.q:hover, .q[aria-expanded="true"] {
  color: #fff;
  background: var(--brass);
  border-color: var(--brass);
}

/* The trigger's parent needs a positioning context; set on the wrapper rather
   than the button so the popover is not clipped by the button's own box. */
.qwrap { position: relative; display: inline-block; }

.explainer {
  position: absolute;
  top: 1.6rem;
  left: 0;
  z-index: 40;
  width: min(22rem, calc(100vw - 2.5rem));
  padding: 1rem 1.1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 16px 40px -18px rgba(10, 30, 20, 0.5);
  text-align: left;
  white-space: normal;
  font-weight: 400;
  cursor: default;
}

.explainer strong {
  display: block;
  font-family: var(--display);
  font-variation-settings: 'SOFT' 30, 'WONK' 1;
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
  color: var(--forest);
}

.explainer p {
  margin: 0 0 0.85rem;
  font-size: 0.87rem;
  line-height: 1.6;
  color: var(--moss);
}

.explainer-close {
  padding: 0.35rem 0.8rem;
  font-size: 0.8rem;
  border-radius: 6px;
}

/* Header cells hold a trigger, so they must not clip the popover. */
th { position: relative; overflow: visible; }

/* Link safety notice on the report page. Alert-red rule rather than the brass
   used for informational messages, because this one is a caution and should
   not read as another tip. */
.caution {
  background: var(--card);
  border-left: 3px solid var(--alert);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
  margin: 1.5rem 0 2rem;
}
.caution strong { display: block; margin-bottom: 0.5rem; color: var(--forest); }
.caution p { font-size: 0.89rem; line-height: 1.65; margin: 0 0 0.6rem; }
.caution p:last-child { margin-bottom: 0; }

/* ---- mention footprint ---- */
.footprint {
  background: var(--card);
  border-radius: 12px;
  padding: 1.5rem 1.6rem;
  margin: 0 0 2rem;
  border-top: 3px solid var(--brass);
}

.footprint h2 {
  font-family: var(--display);
  font-variation-settings: 'SOFT' 30, 'WONK' 1;
  font-weight: 600;
  font-size: 1.4rem;
  margin: 0 0 0.5rem;
}

.fintro { color: var(--moss); font-size: 0.92rem; margin: 0 0 1.3rem; max-width: 64ch; }

.fstats { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.3rem; }

.fstat {
  background: var(--paper);
  border-radius: 9px;
  padding: 0.7rem 0.95rem;
  min-width: 8.5rem;
  flex: 1 1 8.5rem;
}

.fstat span { display: block; color: var(--moss); font-size: 0.76rem; margin-bottom: 0.2rem; }
.fstat strong { font-size: 1.2rem; font-variant-numeric: tabular-nums; }

.fmixlabel { font-size: 0.78rem; color: var(--moss); margin: 0 0 0.5rem; }
.fmix { list-style: none; padding: 0; margin: 0 0 1.3rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; font-size: 0.88rem; color: var(--moss); }
.fmix strong { color: var(--forest); font-variant-numeric: tabular-nums; }

.fnotes { border-left: 3px solid var(--line); padding-left: 1rem; margin-bottom: 1.2rem; }
.fnotes p { font-size: 0.88rem; color: var(--moss); margin: 0 0 0.7rem; max-width: 66ch; }
.fnotes p:last-child { margin-bottom: 0; }

/* The caveat is styled to be read, not skipped. Overclaiming to an audience
   that has read the same research costs more than it buys. */
.fcaveat {
  font-size: 0.83rem;
  color: var(--moss);
  background: var(--paper);
  border-radius: 8px;
  padding: 0.8rem 0.95rem;
  margin: 0;
  max-width: none;
}

/* ---- sortable columns ---- */
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { color: var(--forest); }
th.sortable::after {
  content: '\2195';
  margin-left: 0.3rem;
  opacity: 0.4;
  font-size: 0.9em;
}
th.sortable[aria-sort="descending"]::after { content: '\2193'; opacity: 1; color: var(--brass); }
th.sortable[aria-sort="ascending"]::after { content: '\2191'; opacity: 1; color: var(--brass); }
th.sortable:focus-visible { outline: 2px solid var(--brass); outline-offset: -2px; }
