/* Project Haystack LLC — findtheneedle.org
   One stylesheet. No imports, no web fonts, no third-party anything. */

/* ---------- Tokens ---------- */

:root {
  color-scheme: light dark;

  /* Light mode (default). Parchment ground, deep felt green, muted gold. */
  --bg:          #faf9f5;
  --bg-raised:   #ffffff;
  --bg-sunken:   #f1efe7;
  --text:        #1b2620;
  --text-muted:  #56635c;
  --rule:        #ddd9cc;
  --rule-strong: #c6c1b1;
  --accent:      #0f4a33;   /* felt green — headings, links */
  --accent-soft: #e3ece7;
  --gold:        #7d6310;   /* darkened for AA contrast on parchment */
  --gold-line:   #c9a227;   /* decorative strokes only, never text */
  --focus:       #0f4a33;

  --measure: 34rem;
  --page-max: 62rem;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:          #0d2019;
    --bg-raised:   #122c22;
    --bg-sunken:   #0a1a14;
    --text:        #e9ede9;
    --text-muted:  #a3b3aa;
    --rule:        #1f4132;
    --rule-strong: #2c5642;
    --accent:      #7fd6a8;
    --accent-soft: #16352a;
    --gold:        #dcc06a;
    --gold-line:   #c9a227;
    --focus:       #dcc06a;
  }
}

/* ---------- Reset-ish ---------- */

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

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

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

img, svg { max-width: 100%; }

h1, h2, h3 {
  line-height: 1.25;
  font-weight: 650;
  letter-spacing: -0.012em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 { font-size: clamp(1.75rem, 1.35rem + 1.7vw, 2.5rem); }
h2 { font-size: clamp(1.25rem, 1.1rem + 0.7vw, 1.5rem); margin-top: 2.25rem; }
h3 { font-size: 1.0625rem; margin-top: 1.5rem; }

p, ul, ol, dl { margin: 0 0 1rem; }

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}
a:hover { text-decoration-thickness: 2px; }

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

/* ---------- Skip link ---------- */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--bg-raised);
  color: var(--text);
  padding: 0.6rem 1rem;
  z-index: 10;
  border: 1px solid var(--rule-strong);
  border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

/* ---------- Layout ---------- */

.wrap {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

main { flex: 1 0 auto; }

.prose { max-width: var(--measure); }
.prose li { margin-bottom: 0.35rem; }

section { margin-block: 2.5rem; }
main > .wrap > section:first-child,
main > .wrap > *:first-child { margin-top: 0; }

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--bg-raised);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.5rem;
  padding-block: 0.9rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin-right: auto;
}
.brand:hover .brand-name { text-decoration: underline; text-underline-offset: 0.2em; }

.brand-mark { flex: none; width: 28px; height: 28px; }
.brand-name { font-size: 1.0625rem; white-space: nowrap; }
.brand-llc { color: var(--text-muted); font-weight: 500; }

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.1rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.9375rem;
}
.site-nav a { color: var(--text-muted); text-decoration: none; }
.site-nav a:hover { color: var(--accent); text-decoration: underline; }
.site-nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--gold-line);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.25em;
}

/* ---------- Hero ---------- */

.hero { padding-block: 2.75rem 0.5rem; }
.hero h1 { max-width: 22ch; }

.hero-lede {
  font-size: 1.1875rem;
  color: var(--text-muted);
  max-width: 46ch;
  margin-bottom: 1.25rem;
}

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

.pill {
  display: inline-block;
  font-size: 0.8125rem;
  line-height: 1.4;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  color: var(--text-muted);
  background: var(--bg-raised);
}

/* ---------- Suit divider (the restrained card motif) ---------- */

.divider {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-block: 2.5rem;
  color: var(--gold-line);
  border: 0;
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--rule-strong), transparent);
}
.divider span {
  font-size: 0.8125rem;
  letter-spacing: 0.15em;
  padding-left: 0.15em; /* balances the trailing letter-spacing */
}

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

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(24rem, 100%), 1fr));
  gap: 1rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.25rem;
  background: var(--bg-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

.card h3 { margin: 0; font-size: 1.125rem; }
.card p { margin: 0; color: var(--text-muted); font-size: 0.9375rem; }

.card-live { border-color: var(--rule-strong); }
.card-live::before {
  content: "";
  position: absolute;
  inset: -1px -1px auto;
  height: 3px;
  background: var(--gold-line);
  border-radius: var(--radius) var(--radius) 0 0;
}

/* Whole-card link target, keyboard accessible via the real <a>. */
.card-live a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.card-live a { text-decoration: none; color: inherit; }
.card-live:hover { border-color: var(--gold-line); }
.card-live h3 a { color: var(--accent); text-decoration: underline; text-underline-offset: 0.18em; }

.card-soon { background: var(--bg-sunken); border-style: dashed; }
.card-soon h3 { color: var(--text-muted); font-weight: 600; }

.card-tag {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--gold);
}
.card-soon .card-tag { color: var(--text-muted); }

/* ---------- Feature list ---------- */

.feature-list { list-style: none; padding: 0; max-width: var(--measure); }
.feature-list li {
  position: relative;
  padding-left: 1.6rem;
  margin-bottom: 0.7rem;
}
.feature-list li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.62em;
  width: 7px;
  height: 7px;
  transform: rotate(45deg);
  background: var(--gold-line);
  border-radius: 1px;
}

/* ---------- Data table (paytable returns) ---------- */

.table-scroll { overflow-x: auto; margin-bottom: 1rem; }

table {
  border-collapse: collapse;
  width: 100%;
  max-width: var(--measure);
  font-size: 0.9375rem;
}
caption {
  text-align: left;
  color: var(--text-muted);
  font-size: 0.875rem;
  padding-bottom: 0.5rem;
}
th, td {
  text-align: left;
  padding: 0.55rem 0.9rem 0.55rem 0;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}
th { font-weight: 650; }

/* ---------- Callout ---------- */

.note {
  background: var(--accent-soft);
  border-left: 3px solid var(--gold-line);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.15rem;
  max-width: var(--measure);
  margin-bottom: 1.25rem;
}
.note > :last-child { margin-bottom: 0; }
.note strong { color: var(--text); }

/* ---------- App Store placeholder ---------- */

.store-placeholder {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: flex-start;
  justify-content: center;
  width: 12.5rem;
  min-height: 3.5rem;
  padding: 0.75rem 1rem;
  border: 2px dashed var(--rule-strong);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.35;
  background: var(--bg-sunken);
}
.store-placeholder strong { color: var(--text); font-size: 0.875rem; }
.store-placeholder + p { margin-top: 1rem; max-width: var(--measure); }

/* ---------- FAQ ---------- */

.faq { max-width: var(--measure); }
.faq h3 { margin-top: 1.75rem; }
.faq h3:first-of-type { margin-top: 0.5rem; }
.faq p { color: var(--text); }

/* ---------- Contact ---------- */

.contact-list { list-style: none; padding: 0; }
.contact-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.5rem;
  margin-bottom: 0.4rem;
}
.contact-list .label {
  flex: none;
  min-width: 4.5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ---------- Footer ---------- */

.site-footer {
  flex: none;
  margin-top: 3.5rem;
  border-top: 1px solid var(--rule);
  background: var(--bg-sunken);
  color: var(--text-muted);
  font-size: 0.875rem;
}
.site-footer .wrap { padding-block: 1.5rem 2rem; }
.site-footer p { margin: 0 0 0.35rem; }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--accent); }
.site-footer .legal-name { color: var(--text); font-weight: 600; }

/* ---------- 404 ---------- */

.centered { text-align: center; padding-block: 4rem 2rem; }
.centered .prose { margin-inline: auto; }
.centered .divider { justify-content: center; }

/* ---------- Motion ---------- */

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