/* EnduRider site: shared styles. Brand kit v2: Trail Ink, Lift Yellow, Paper, Nunito. */

@font-face {
  font-family: "Nunito";
  src: url("fonts/Nunito.ttf") format("truetype");
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  --ink: #13202a;
  --ink-deep: #0c161d;
  --ink-raised: #1c2d3a;
  --yellow: #ffd400;
  --yellow-press: #e6bf00;
  --paper: #f6f5f0;
  --paper-line: #dcdacf;
  --text: #13202a;
  --text-soft: #46545e;      /* 7.4:1 on Paper */
  --on-ink: #f6f5f0;
  --on-ink-soft: #b7c3cb;    /* 9:1 on Ink */
  --ink-line: #2c3e4b;

  --display: "Nunito", "Noto Sans Hebrew", "Noto Sans Arabic", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;

  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --wrap: max(var(--gutter), calc((100% - 70rem) / 2));
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
  scrollbar-color: #5a6b77 var(--ink-deep);
}

body {
  margin: 0;
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

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

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

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0 0 1em; text-wrap: pretty; }

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 0.09em;
  text-underline-offset: 0.2em;
}

:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
  border-radius: 4px;
}
.on-paper :focus-visible { outline-color: var(--ink); }

.skip {
  position: absolute; left: 1rem; top: -4rem;
  background: var(--yellow); color: var(--ink);
  font-family: var(--display); font-weight: 800;
  padding: 0.75rem 1.25rem; border-radius: 999px; z-index: 100;
  text-decoration: none;
}
.skip:focus { top: 1rem; }

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

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--ink);
  color: var(--on-ink);
  border-bottom: 1px solid var(--ink-line);
}
.site-header .bar {
  display: flex; align-items: center; gap: clamp(1rem, 3vw, 2.5rem);
  min-height: 4.5rem;
  padding: 0 var(--gutter);
}
.brand { margin-right: auto; display: block; padding: 0.5rem 0; }
.brand img { height: 2rem; width: auto; }

.site-nav { display: flex; align-items: center; gap: clamp(1rem, 2.5vw, 2.25rem); }
.site-nav a:not(.btn) {
  font-family: var(--display); font-weight: 700; font-size: 1rem;
  text-decoration: none;
  padding: 0.75rem 0;
  background: linear-gradient(var(--yellow), var(--yellow)) left 85% / 0 2px no-repeat;
  transition: background-size 0.35s var(--ease-out);
}
.site-nav a:not(.btn):hover,
.site-nav a:not(.btn)[aria-current="page"] { background-size: 100% 2px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  min-height: 3.5rem; padding: 0 1.75rem;
  border-radius: 999px; border: 2px solid transparent;
  font-family: var(--display); font-weight: 800; font-size: 1.125rem; line-height: 1.1;
  text-decoration: none; white-space: nowrap;
  transition: background-color 0.2s, transform 0.2s var(--ease-out), border-color 0.2s;
}
.btn:active { transform: scale(0.98); }
.btn-yellow { background: var(--yellow); color: var(--ink); }
.btn-yellow:hover { background: #ffe14d; }
.btn-yellow:active { background: var(--yellow-press); }
.btn-ink { background: var(--ink); color: var(--on-ink); }
.btn-ink:hover { background: var(--ink-raised); }
.btn-small { min-height: 2.75rem; padding: 0 1.25rem; font-size: 1rem; }

/* "Coming soon" is a statement, not a control. */
.soon {
  display: inline-flex; align-items: center; gap: 0.6rem;
  min-height: 3.5rem; padding: 0 1.5rem;
  border-radius: 999px; border: 2px dashed currentColor;
  font-family: var(--display); font-weight: 700; font-size: 1.0625rem;
  color: var(--on-ink-soft);
}
.on-paper .soon { color: var(--text-soft); }
.soon svg { width: 1.25rem; height: 1.25rem; flex: none; }

@media (max-width: 760px) {
  .site-nav a:not(.btn) { display: none; }
  .brand img { height: 1.75rem; }
}

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

.site-footer {
  background: var(--ink-deep);
  color: var(--on-ink-soft);
  padding: clamp(3rem, 7vw, 5rem) var(--gutter) 2.5rem;
}
.site-footer .cols {
  display: grid; gap: 2.5rem;
  grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(0, 1fr));
  padding-bottom: 2.5rem; border-bottom: 1px solid var(--ink-line);
}
.site-footer img { height: 2.25rem; width: auto; margin-bottom: 1rem; }
.site-footer p { max-width: 34ch; }
.site-footer h2 {
  font-size: 1rem; letter-spacing: 0; color: var(--on-ink); margin-bottom: 0.9rem;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.15rem; }
.site-footer li a { display: inline-block; padding: 0.4rem 0; text-decoration: none; }
.site-footer li a:hover { color: var(--on-ink); text-decoration: underline; }
.site-footer .legal {
  display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; justify-content: space-between;
  padding-top: 1.5rem; font-size: 0.9375rem;
}
.site-footer .legal p { margin: 0; max-width: none; }
@media (max-width: 760px) {
  .site-footer .cols { grid-template-columns: 1fr 1fr; }
  .site-footer .cols > :first-child { grid-column: 1 / -1; }
}

/* ---------- Document pages (privacy, terms, support, delete account) ---------- */

.doc-head {
  background: var(--ink); color: var(--on-ink);
  padding: clamp(3rem, 8vw, 6.5rem) var(--wrap) clamp(2.5rem, 6vw, 4.5rem);
}
.doc-head h1 { font-size: clamp(2.75rem, 8vw, 5.5rem); letter-spacing: -0.035em; max-width: 14ch; }
.doc-head .lede {
  margin: 1.5rem 0 0; max-width: 56ch;
  font-size: clamp(1.125rem, 1.6vw, 1.3125rem); line-height: 1.5; color: var(--on-ink-soft);
}
.doc-head .lede strong { color: var(--on-ink); font-weight: 600; }
.doc-head .updated { margin: 1.5rem 0 0; font-size: 0.9375rem; color: var(--on-ink-soft); }

.doc {
  display: grid; gap: clamp(2rem, 6vw, 6rem);
  grid-template-columns: minmax(0, 15rem) minmax(0, 68ch);
  padding: clamp(2.5rem, 6vw, 5rem) var(--wrap) clamp(4rem, 9vw, 7rem);
  justify-content: space-between;
}
.toc { position: sticky; top: 6.5rem; align-self: start; font-size: 0.9375rem; }
.toc h2 { font-size: 1rem; letter-spacing: 0; margin-bottom: 0.75rem; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--paper-line); }
.toc a {
  display: block; padding: 0.4rem 0 0.4rem 1rem; margin-left: -2px;
  border-left: 2px solid transparent; color: var(--text-soft); text-decoration: none;
}
.toc a:hover { color: var(--text); border-left-color: var(--ink); }

.prose h2 { font-size: clamp(1.625rem, 3vw, 2.125rem); margin: 3.25rem 0 0.9rem; }
.prose > h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.25rem; letter-spacing: -0.01em; line-height: 1.2; margin: 2rem 0 0.5rem; }
.prose ul, .prose ol { margin: 0 0 1.1em; padding-left: 1.25rem; }
.prose li { margin-bottom: 0.45em; padding-left: 0.25rem; }
.prose li::marker { color: var(--text-soft); }
.prose strong { font-weight: 650; }
.prose a { font-weight: 600; }
.prose a:hover { text-decoration-thickness: 0.16em; }

/* The short version: an Ink panel, so yellow is allowed on it. */
.short {
  background: var(--ink); color: var(--on-ink);
  border-radius: 1.25rem; padding: clamp(1.5rem, 3vw, 2.25rem);
  margin: 0 0 3rem;
}
.short h2 { margin: 0 0 1rem; font-size: 1.5rem; color: var(--yellow); }
.short ul { margin: 0; padding-left: 1.25rem; }
.short li::marker { color: var(--yellow); }
.short li:last-child { margin-bottom: 0; }

.table-wrap { overflow-x: auto; margin: 0 0 1.25em; }
.prose table { border-collapse: collapse; width: 100%; min-width: 30rem; font-size: 1rem; }
.prose th, .prose td {
  text-align: left; vertical-align: top;
  padding: 0.75rem 1rem 0.75rem 0; border-bottom: 1px solid var(--paper-line);
}
.prose th { font-family: var(--display); font-weight: 800; border-bottom: 2px solid var(--ink); }
.prose td:first-child { font-weight: 600; width: 38%; }

.prose .steps { list-style: none; counter-reset: step; padding: 0; margin: 0 0 1.5rem; }
.prose .steps li {
  counter-increment: step; position: relative;
  padding: 0.9rem 0 0.9rem 3.5rem; margin: 0; border-bottom: 1px solid var(--paper-line);
}
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0.7rem;
  width: 2.25rem; height: 2.25rem; border-radius: 50%;
  background: var(--ink); color: var(--yellow);
  font-family: var(--display); font-weight: 800;
  display: grid; place-items: center;
}

.faq details { border-bottom: 1px solid var(--paper-line); }
.faq summary {
  cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1.1rem 0; min-height: 3.5rem;
  font-family: var(--display); font-weight: 800; font-size: 1.1875rem; line-height: 1.25;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 0.7rem; height: 0.7rem;
  border-right: 3px solid var(--ink); border-bottom: 3px solid var(--ink);
  transform: translateY(-0.2rem) rotate(45deg);
  transition: transform 0.3s var(--ease-out);
}
.faq details[open] summary::after { transform: translateY(0.15rem) rotate(-135deg); }
.faq details > :not(summary) { max-width: 62ch; }
.faq details > :last-child { margin-bottom: 1.4rem; }

.contact-card {
  background: var(--ink); color: var(--on-ink);
  border-radius: 1.25rem; padding: clamp(1.5rem, 3vw, 2.25rem);
  display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem 2rem;
  margin: 0 0 3rem;
}
.contact-card p { margin: 0; flex: 1 1 18rem; color: var(--on-ink-soft); }
.contact-card strong { display: block; font-family: var(--display); font-weight: 800; font-size: 1.5rem; color: var(--on-ink); line-height: 1.2; margin-bottom: 0.25rem; }

@media (max-width: 900px) {
  .doc { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; }
  .toc ol { display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; border-left: 0; }
  .toc a { margin: 0; padding: 0.55rem 0.9rem; border: 1px solid var(--paper-line); border-radius: 999px; }
  .toc a:hover { border-color: var(--ink); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
