/* FoxFinds farewell. Colors come from foxfinds-community-website/src/styles/tokens.css
   (FoxFinds) and thavala.app (Thavala section only). 8px spacing scale. */

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("/fonts/fraunces-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* FoxFinds */
  --ff-orange: #ff7400;      /* --color-brand-primary */
  --ff-orange-hover: #e66900;/* --color-brand-primary-hover */
  --ff-ember: #d54203;       /* logo base */
  --ff-wordmark: #333333;    /* logo "Finds" */
  --ff-amber: #ff9000;       /* --color-brand-gradient-1 */
  --ff-blush: #fff0e6;       /* --color-brand-gradient-4 */
  --ff-ink: #111928;         /* --color-text-hero */
  --ff-body: #3d4750;        /* --color-text-primary */
  --ff-muted: #686e7d;       /* --color-text-muted */
  --ff-rule: #eeeeee;        /* --color-border */
  --ff-paper: #ffffff;

  /* Thavala */
  --th-pond: #0f1817;
  --th-moss: #1b3a33;
  --th-text: #eef4f1;
  --th-text-2: #eef4f1a3;
  --th-green: #4cc47c;
  --th-green-hover: #6fd497;
  --th-rule: #c8f0dc24;

  /* spacing (8px scale) */
  --s1: 4px; --s2: 8px; --s3: 16px; --s4: 24px; --s5: 32px;
  --s6: 40px; --s7: 48px; --s8: 64px; --s9: 80px; --s10: 120px;

  --measure: 36rem;
  --wide: 68rem;
  --gutter: clamp(var(--s4), 5vw, var(--s8));
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ff-body);
  background: var(--ff-paper);
  font-feature-settings: "cv11", "ss01";
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--ff-orange); outline-offset: 3px; border-radius: 4px; }

.skip {
  position: absolute; left: var(--s3); top: -100px;
  background: var(--ff-ink); color: #fff; padding: var(--s2) var(--s3); border-radius: 4px; z-index: 10;
}
.skip:focus { top: var(--s3); }

.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Header ---------- */
.site-head { padding-block: var(--s5); }
.site-head img { width: 162px; height: 24px; }

/* ---------- Farewell letter ---------- */
.farewell { padding-block: var(--s6) var(--s9); }
.farewell h1 {
  margin: 0;
  max-width: 14ch;
  color: var(--ff-ink);
  font-size: clamp(2.75rem, 7.5vw, 5.5rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-weight: 750;
}

/* The price-history line: FoxFinds' own chart, run to its last point. */
.history { margin: var(--s7) 0 var(--s8); }
.history-plot {
  position: relative;
  height: 200px;
  border-bottom: 1px solid var(--ff-rule);
  background-image: repeating-linear-gradient(to bottom, transparent 0 49px, var(--ff-rule) 49px 50px);
}
.history-plot svg {
  position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible;
  animation: draw 1.8s cubic-bezier(.45, 0, .2, 1) .2s both;
}
.history-line { fill: none; stroke: var(--ff-orange); stroke-width: 3; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.history-area { fill: url(#area); stroke: none; }
.point {
  position: absolute;
  left: var(--x); top: var(--y);
  width: 12px; height: 12px; margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: var(--ff-paper);
  border: 3px solid var(--ff-orange);
  animation: pop .3s ease-out both;
  animation-delay: calc(.2s + 1.8s * var(--t));
}
.point-label {
  position: absolute;
  left: var(--x); bottom: calc(100% - var(--y) + var(--s3));
  margin-left: -6px;
  font-size: .875rem; line-height: 1.3; font-weight: 600; color: var(--ff-ink);
  white-space: nowrap;
  animation: pop .3s ease-out both;
  animation-delay: calc(.2s + 1.8s * var(--t));
}
.point-label span { display: block; font-weight: 400; color: var(--ff-muted); }
.point--end { background: var(--ff-ember); border-color: var(--ff-ember); width: 14px; height: 14px; margin: -7px 0 0 -7px; }
.history-axis {
  display: flex; justify-content: space-between; gap: var(--s3);
  margin-top: var(--s2); font-size: .875rem; color: var(--ff-muted);
}
.history-axis span:last-child { color: var(--ff-ember); font-weight: 600; text-align: right; }

@keyframes draw { from { clip-path: inset(-20px 100% -20px -20px); } to { clip-path: inset(-20px -20px -20px -20px); } }
@keyframes pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }

.letter { max-width: var(--measure); }
.letter p { margin: 0 0 var(--s4); }
.letter .lede { font-size: 1.25rem; line-height: 1.55; color: var(--ff-ink); }
.letter h2 {
  margin: var(--s7) 0 var(--s3);
  font-size: 1.25rem; line-height: 1.3; letter-spacing: -0.01em; color: var(--ff-ink);
}
.letter ul { margin: 0 0 var(--s7); padding: 0; list-style: none; }
.letter li { position: relative; padding-left: var(--s5); margin-bottom: var(--s3); }
.letter li::before {
  content: ""; position: absolute; left: 0; top: .62em;
  width: 10px; height: 10px; border-radius: 2px; background: var(--ff-orange);
}
.signoff { color: var(--ff-ink); font-weight: 600; }
.contact {
  margin-top: var(--s6);
  padding-top: var(--s4);
  border-top: 1px solid var(--ff-rule);
}
.contact a, .footer-links a {
  color: var(--ff-ember);
  text-decoration-thickness: 1px; text-underline-offset: 3px;
}
.contact a:hover, .footer-links a:hover { color: var(--ff-ink); }
.contact a { font-weight: 600; }

/* ---------- Thavala ---------- */
.thavala {
  background:
    radial-gradient(120% 80% at 85% 0%, var(--th-moss) 0%, transparent 60%),
    var(--th-pond);
  color: var(--th-text);
  padding-block: var(--s10);
}
.thavala-from {
  display: flex; align-items: center; gap: var(--s3);
  margin: 0 0 var(--s6); color: var(--th-text-2); font-size: .9375rem;
}
.thavala-from img { width: 48px; height: 48px; border-radius: 12px; }
.thavala-from strong { display: block; color: var(--th-text); font-family: "Fraunces", Georgia, serif; font-size: 1.375rem; font-weight: 600; }
.thavala h2 {
  margin: 0 0 var(--s4);
  max-width: 13ch;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 500;
  font-size: clamp(2.75rem, 7vw, 5.25rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  font-variation-settings: "SOFT" 50, "WONK" 0;
}
.thavala-lede { max-width: 34rem; margin: 0 0 var(--s5); font-size: 1.1875rem; line-height: 1.6; color: var(--th-text); }
.thavala-meta { margin: 0 0 var(--s4); color: var(--th-text-2); font-size: .9375rem; }
.cta {
  display: inline-block;
  padding: var(--s3) var(--s5);
  border-radius: 999px;
  background: var(--th-green); color: var(--th-pond);
  font-weight: 650; font-size: 1.0625rem; text-decoration: none;
  transition: background-color .15s ease;
}
.cta:hover { background: var(--th-green-hover); }
.thavala :focus-visible { outline-color: var(--th-green); }
.cta-note { margin: var(--s3) 0 0; font-size: .875rem; color: var(--th-text-2); }
.promises {
  display: grid; gap: var(--s5);
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  margin: var(--s9) 0 0; padding: var(--s6) 0 0; list-style: none;
  border-top: 1px solid var(--th-rule);
}
.promises h3 { margin: 0 0 var(--s2); font-family: "Fraunces", Georgia, serif; font-weight: 600; font-size: 1.3125rem; color: var(--th-text); }
.promises p { margin: 0; color: var(--th-text-2); font-size: .9688rem; line-height: 1.6; }

/* ---------- More apps ---------- */
.apps { padding-block: var(--s9) var(--s8); }
.apps h2 {
  margin: 0 0 var(--s5); font-size: 1.5rem; letter-spacing: -0.015em; color: var(--ff-ink);
}
.app-list {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 28rem), 1fr));
  column-gap: var(--s7); margin: 0; padding: 0; list-style: none;
}
.app {
  display: grid; grid-template-columns: 64px 1fr; column-gap: var(--s4); row-gap: var(--s3);
  padding-block: var(--s5); border-top: 1px solid var(--ff-rule);
}
.app img.icon { width: 64px; height: 64px; border-radius: 14px; grid-row: span 2; }
.app h3 { margin: 0 0 var(--s1); font-size: 1.0625rem; line-height: 1.35; color: var(--ff-ink); }
.app p { margin: 0; color: var(--ff-body); font-size: .9688rem; line-height: 1.55; }
.badges { display: flex; flex-wrap: wrap; gap: var(--s2); }
.badges a { display: block; border-radius: 8px; }
.badges img { width: 135px; height: 40px; }

/* ---------- Footer ---------- */
.site-foot { border-top: 1px solid var(--ff-rule); padding-block: var(--s5) var(--s7); font-size: .875rem; color: var(--ff-muted); }
.site-foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s3); }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--s4); margin: 0; padding: 0; list-style: none; }
.site-foot p { margin: 0; }

/* ---------- Legal pages ---------- */
.legal { padding-block: var(--s6) var(--s9); }
.legal .notice {
  max-width: 44rem; margin: 0 0 var(--s6); padding: var(--s3) var(--s4);
  background: var(--ff-blush); border-left: 4px solid var(--ff-orange); border-radius: 4px;
  color: var(--ff-ink);
}
.legal .notice a { color: var(--ff-ember); font-weight: 600; }
.legal-body { max-width: 44rem; }
.legal-body h1 { margin: 0 0 var(--s2); font-size: clamp(2rem, 5vw, 2.75rem); line-height: 1.1; letter-spacing: -0.02em; color: var(--ff-ink); }
.legal-body h2 { margin: var(--s7) 0 var(--s3); font-size: 1.375rem; line-height: 1.3; color: var(--ff-ink); }
.legal-body h3 { margin: var(--s5) 0 var(--s2); font-size: 1.0625rem; color: var(--ff-ink); }
.legal-body p, .legal-body li { font-size: 1rem; }
.legal-body ul, .legal-body ol { padding-left: var(--s4); }
.legal-body a { color: var(--ff-ember); text-underline-offset: 3px; }
.legal-body table { width: 100%; border-collapse: collapse; margin: var(--s3) 0 var(--s4); font-size: .9375rem; display: block; overflow-x: auto; }
.legal-body th, .legal-body td { text-align: left; vertical-align: top; padding: var(--s2) var(--s3); border-bottom: 1px solid var(--ff-rule); }
.back { display: inline-block; margin-bottom: var(--s5); color: var(--ff-ember); font-weight: 600; text-underline-offset: 3px; }

@media (max-width: 560px) {
  .history-plot { height: 180px; }
  .point-label { font-size: .8125rem; }
  .thavala { padding-block: var(--s9); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Labels for points past the midpoint hang to the left so they never run off narrow screens. */
.point-label--left { left: auto; right: calc(100% - var(--x)); margin: 0 -6px 0 0; text-align: right; }

/* Point positions. x = days since Black Friday 2024 (Nov 29) / 734 days to Dec 3, 2026.
   Jun 3, 2025 = day 186 (25.34%); Apr 1, 2026 = day 488 (66.49%). */
.pt-ext  { --x: 0%;     --y: 78%; --t: 0; }
.pt-apps { --x: 25.34%; --y: 52%; --t: .2534; }
.pt-web  { --x: 66.49%; --y: 26%; --t: .6649; }
.pt-end  { --x: 100%;   --y: 26%; --t: 1; }

/* Labels wrap before they reach the next riser of the line. */
.point-label { white-space: normal; }
.point-label.pt-ext  { max-width: calc(25.34% - var(--s3)); }
.point-label.pt-apps { max-width: calc(41% - var(--s3)); }
.point-label.pt-web  { max-width: calc(66.49% - 25.34% - var(--s3)); }

/* ---------- Comeback vote (mailto) ---------- */
.comeback {
  margin: 0 0 var(--s7);
  padding: var(--s5);
  background: var(--ff-blush);
  border-radius: 12px;
}
.comeback h2 { margin-top: 0; }
.comeback p { margin-bottom: var(--s4); }
.comeback-btn {
  display: inline-block;
  padding: var(--s3) var(--s5);
  border-radius: 999px;
  background: var(--ff-ember); color: var(--ff-paper);
  font-weight: 650; text-decoration: none;
  transition: background-color .15s ease;
}
.comeback-btn:hover { background: var(--ff-ink); }
.comeback .comeback-note { margin: var(--s3) 0 0; font-size: .875rem; color: var(--ff-muted); }
.comeback-note strong { color: var(--ff-ink); font-weight: 600; user-select: all; }

/* "FoxFinds" in the headline uses the logo's wordmark colors. */
.wordmark { color: var(--ff-wordmark); white-space: nowrap; }
.wordmark-fox { color: var(--ff-orange); }
