/* Maarjv Safaris - Terms of Service
   Static page. Fonts are self-hosted. No third-party requests. */

@font-face {
  font-family: "DM Sans";
  src: url("../fonts/dm-sans-latin-variable.woff2") format("woff2");
  font-weight: 100 1000;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "DM Serif Display";
  src: url("../fonts/dm-serif-display-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --forest: #283F12;
  --forest-deep: #1B2C0A;
  --beige: #D8C5A3;
  --olive: #5B5B37;
  --orange: #D38125;
  --terra: #913A14;

  --cream: #FAF6EE;
  --tint: #F2EADB;
  --tint-soft: #F7F1E4;
  --line: #E3D8C2;
  --ink: #26301C;
  --muted: #5B5B37;

  --font-sans: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "DM Serif Display", Georgia, "Times New Roman", serif;

  --radius: 14px;
  --gutter: 1rem;
}

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

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

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  overflow-wrap: break-word;
}

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

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

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

.hero :focus-visible,
.contact-panel :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--beige);
}

main:focus { outline: none; }

.container {
  width: min(100% - (var(--gutter) * 2), 72rem);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  z-index: 100;
  padding: 0.75rem 1.1rem;
  background: var(--forest);
  color: var(--cream);
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
}
.skip-link:focus { top: 0.75rem; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Header */

.site-header {
  background: var(--cream);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.5rem;
  padding-block: 0.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  flex: 0 1 auto;
}
.brand img { display: block; width: 208px; height: auto; max-width: 100%; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.5rem 1rem;
  border: 1.5px solid var(--beige);
  border-radius: 999px;
  color: var(--forest);
  background: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  text-align: left;
  transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}
.back-link:hover { background: var(--tint); border-color: var(--olive); }
.back-link:active { transform: none; box-shadow: none; }

@media (max-width: 30em) {
  .brand img { width: 150px; }
  .back-link { padding: 0.4rem 0.75rem; font-size: 0.8125rem; max-width: 9.5rem; }
}

/* Hero */

.hero {
  position: relative;
  overflow: hidden;
  background: var(--forest);
  color: var(--cream);
  isolation: isolate;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: radial-gradient(60rem 28rem at 85% 0%, rgba(211, 129, 37, 0.18), transparent 70%);
}

/* Photo layer. Only active when terms-hero.webp exists (set at build time).
   Blur and scale apply to this layer only, never to the text. */
.hero.has-photo::before {
  inset: -12px;
  background:
    url("../img/terms-hero.webp") center 14% / cover no-repeat,
    var(--forest);
  filter: blur(1.5px);
  transform: scale(1.04);
}

/* Forest Green overlay that keeps the text crisp. */
.hero.has-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(27, 44, 10, 0.92) 0%, rgba(40, 63, 18, 0.80) 55%, rgba(40, 63, 18, 0.62) 100%),
    linear-gradient(180deg, rgba(40, 63, 18, 0.35) 0%, rgba(27, 44, 10, 0.55) 100%);
}

@media (max-width: 40em) {
  .hero.has-photo::before { background-position: 60% 12%; }
  .hero.has-photo::after {
    background: linear-gradient(180deg, rgba(27, 44, 10, 0.91) 0%, rgba(40, 63, 18, 0.85) 100%);
  }
}

.hero-inner {
  padding-block: 3.25rem 5.5rem;
  max-width: 72rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1rem;
  color: var(--beige);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1.2;
}
.eyebrow::before {
  content: "";
  width: 2rem;
  height: 3px;
  border-radius: 2px;
  background: var(--orange);
}

h1 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.5rem, 1.6rem + 4.4vw, 4.25rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: #fff;
}

.hero-lead {
  max-width: 36rem;
  margin: 0 0 1.75rem;
  color: var(--beige);
  font-size: clamp(1.0625rem, 1rem + 0.4vw, 1.25rem);
  line-height: 1.55;
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.quick-links > li { margin: 0; padding: 0; }
.quick-links > li::before { content: none; }
.quick-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.5rem 1.1rem;
  border: 1.5px solid rgba(216, 197, 163, 0.5);
  border-radius: 999px;
  background: rgba(250, 246, 238, 0.06);
  color: var(--cream);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.quick-links a:hover {
  background: rgba(250, 246, 238, 0.16);
  border-color: var(--beige);
}

/* Layout */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  padding-bottom: 4rem;
}

.toc-desktop { display: none; }

.content { min-width: 0; }

/* Mobile "On this page" */

.toc-mobile {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 0 calc(var(--gutter) * -1);
  background: var(--cream);
  border-bottom: 1px solid var(--line);
}

.toc-mobile summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.5rem;
  padding: 0.5rem var(--gutter);
  color: var(--forest);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  list-style: none;
}
.toc-mobile summary::-webkit-details-marker { display: none; }
.toc-mobile summary:focus-visible { outline-offset: -3px; }

.toc-mobile .chev { transition: transform 0.2s ease; flex: none; }
.toc-mobile[open] .chev { transform: rotate(180deg); }

.toc-mobile nav {
  max-height: min(60vh, 28rem);
  overflow-y: auto;
  padding: 0 var(--gutter) 0.75rem;
  border-top: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 12px 24px rgba(38, 48, 28, 0.12);
}

.toc-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.toc-list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.4rem 0.25rem;
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.toc-list li:last-child a { border-bottom: 0; }
.toc-list a:hover { color: var(--terra); }

/* Terms sections */

.terms-section {
  padding-block: 2.5rem;
  border-top: 1px solid var(--line);
  scroll-margin-top: 4.5rem;
}
.terms-section:first-child { border-top: 0; padding-top: 2rem; }

h2 {
  position: relative;
  margin: 0 0 1rem;
  padding-top: 1.1rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.65rem, 1.35rem + 1.4vw, 2.25rem);
  line-height: 1.15;
  color: var(--forest);
}
h2::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 2.25rem;
  height: 3px;
  border-radius: 2px;
  background: var(--orange);
}

h3 {
  margin: 2rem 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--forest);
  scroll-margin-top: 4.5rem;
}

p { margin: 0 0 1rem; max-width: 44rem; }
p:last-child { margin-bottom: 0; }

ul {
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
  max-width: 44rem;
}
ul > li {
  position: relative;
  margin: 0 0 0.4rem;
  padding-left: 1.4rem;
}
ul > li::before {
  content: "";
  position: absolute;
  left: 0.2rem;
  top: 0.72em;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--orange);
}

@media (min-width: 40em) {
  .list-cols {
    columns: 2;
    column-gap: 2rem;
  }
  .list-cols > li { break-inside: avoid; }
}

.callout {
  max-width: 44rem;
  padding: 1.1rem 1.25rem;
  border-left: 4px solid var(--orange);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--tint);
  color: var(--forest);
  font-weight: 600;
  cursor: default;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
@media (hover: hover) {
  .callout:hover {
    transform: translateY(-2px);
    border-left-color: var(--terra);
    box-shadow: 0 10px 24px rgba(38, 48, 28, 0.10), 0 0 0 1px rgba(216, 197, 163, 0.85);
  }
}
.callout-alert {
  border-left-color: var(--terra);
  font-weight: 500;
  color: var(--ink);
}
.callout a { font-weight: 600; }

/* Tables */

.table-wrap { margin: 1.25rem 0 1.5rem; }

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.data-table th,
.data-table td {
  padding: 1rem 1.25rem;
  text-align: left;
  vertical-align: top;
}

.data-table thead th {
  background: var(--forest);
  color: var(--cream);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.data-table tbody th {
  font-weight: 600;
  color: var(--forest);
}

.data-table tbody tr + tr th,
.data-table tbody tr + tr td { border-top: 1px solid var(--line); }

.data-table tbody tr:nth-child(even) th,
.data-table tbody tr:nth-child(even) td { background: #FCFAF5; }

.pct {
  font-family: var(--font-display);
  font-size: 1.75rem;
  line-height: 1.1;
  color: var(--terra);
}
.pct-note { margin-left: 0.4rem; color: var(--ink); }

.meter {
  display: block;
  width: 100%;
  max-width: 14rem;
  height: 8px;
  margin-top: 0.6rem;
  border-radius: 999px;
  background: var(--tint);
  overflow: hidden;
}
.meter-fill {
  display: block;
  width: var(--w, 100%);
  height: 100%;
  border-radius: 999px;
  background: var(--orange);
  transition: width 0.6s cubic-bezier(0.22, 0.7, 0.2, 1);
}
.meter-fill.is-high { background: var(--terra); }
.w30 { --w: 30%; }
.w50 { --w: 50%; }
.w75 { --w: 75%; }
.w100 { --w: 100%; }

/* Added by script only for rows below the fold, then removed once the row is seen. */
.meter-fill.is-armed { width: 0; transition: none; }
.cancel-table tbody tr:nth-child(2) .meter-fill { transition-delay: 0.06s; }
.cancel-table tbody tr:nth-child(3) .meter-fill { transition-delay: 0.12s; }
.cancel-table tbody tr:nth-child(4) .meter-fill { transition-delay: 0.18s; }
.cancel-table tbody tr:nth-child(5) .meter-fill { transition-delay: 0.24s; }

/* Table row hover / focus-within */
.data-table tbody th,
.data-table tbody td { transition: background-color 0.25s ease; }

@media (hover: hover) and (min-width: 40.01em) {
  .data-table tbody tr:hover th,
  .data-table tbody tr:hover td { background: var(--tint-soft); }
}
@media (min-width: 40.01em) {
  .data-table tbody tr:focus-within th,
  .data-table tbody tr:focus-within td { background: var(--tint-soft); }
}

.cancel-table th[scope="row"] { width: 52%; }

@media (max-width: 40em) {
  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table th,
  .data-table td { display: block; width: auto; }

  .data-table { border: 0; background: transparent; border-radius: 0; overflow: visible; }

  .data-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .data-table tbody tr {
    margin-bottom: 0.75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    overflow: hidden;
  }
  .data-table tbody tr:last-child { margin-bottom: 0; }

  .data-table tbody tr + tr th,
  .data-table tbody tr + tr td { border-top: 0; }
  .data-table tbody tr:nth-child(even) th,
  .data-table tbody tr:nth-child(even) td { background: transparent; }

  .data-table tbody th {
    padding: 0.85rem 1rem;
    background: var(--tint);
    border-bottom: 1px solid var(--line);
  }

  .data-table td {
    display: grid;
    grid-template-columns: 6.5rem minmax(0, 1fr);
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    align-items: baseline;
  }
  .data-table td + td { border-top: 1px solid var(--line); }
  .data-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .data-table tbody tr:focus-within td { background: var(--tint-soft); }
  @media (hover: hover) {
    .data-table tbody tr:hover td { background: var(--tint-soft); }
  }

  .cancel-table th[scope="row"] { width: auto; }
  .cancel-table td { display: block; }
  .cancel-table td::before { display: block; margin-bottom: 0.25rem; }
  .pct-note { display: inline; margin-left: 0.35rem; }
}

/* Contact panel */

.contact-panel {
  margin-top: 2.5rem;
  padding: 2rem 1.5rem;
  border-radius: 20px;
  background: var(--forest);
  color: var(--cream);
  scroll-margin-top: 4.5rem;
}
.contact-panel h2 { color: #fff; }
.contact-panel p { color: var(--beige); }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.65rem 1.5rem;
  border: 2px solid transparent;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}
.btn-primary {
  background: var(--orange);
  color: var(--forest-deep);
}
.btn-primary:hover { background: #E0912F; }
.btn-ghost {
  border-color: var(--beige);
  color: var(--cream);
}
.btn-ghost:hover { background: rgba(250, 246, 238, 0.12); }
.btn:active { transform: none; box-shadow: none; }

@media (hover: hover) {
  .btn:hover,
  .back-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(27, 44, 10, 0.18);
  }
  .btn-primary:hover { box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28); }
  .btn:active,
  .back-link:active { transform: none; box-shadow: none; }
}

.contact-email {
  margin: 1.25rem 0 0;
  color: var(--beige);
  font-size: 0.9375rem;
  overflow-wrap: anywhere;
}
.contact-panel .contact-email a {
  color: var(--cream);
  font-weight: 600;
}

/* Footer */

.site-footer {
  background: var(--forest-deep);
  color: var(--beige);
}

.footer-inner {
  display: grid;
  gap: 1.75rem;
  padding-block: 2.75rem 2rem;
}

.footer-brand img { display: block; width: 208px; max-width: 100%; height: auto; }
.footer-brand a { display: inline-block; min-height: 44px; }

.tagline {
  margin: 0.5rem 0 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--beige);
}

.footer-email {
  margin: 0.15rem 0 0;
  max-width: none;
  overflow-wrap: anywhere;
}
.footer-email a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--beige);
  font-size: 0.9375rem;
  text-decoration: none;
  opacity: 0.9;
  transition: opacity 0.25s ease;
}
.footer-email a:hover { opacity: 1; text-decoration: underline; }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: none;
}
.footer-links > li { margin: 0; padding: 0; }
.footer-links > li::before { content: none; }
.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--cream);
  font-weight: 500;
  text-decoration: none;
}
.footer-links a:hover { text-decoration: underline; }
.footer-links a[aria-current="page"] { color: var(--beige); font-weight: 700; }

.footer-base {
  padding-block: 1.25rem 2rem;
  border-top: 1px solid rgba(216, 197, 163, 0.25);
  font-size: 0.875rem;
}
.footer-base p { margin: 0; max-width: none; }

/* Desktop */

@media (min-width: 62em) {
  :root { --gutter: 1.5rem; }

  .hero-inner { padding-block: 4.5rem 7rem; }

  .layout {
    grid-template-columns: 16.5rem minmax(0, 1fr);
    column-gap: 4rem;
    align-items: start;
    padding-bottom: 5rem;
  }

  .toc-mobile { display: none; }

  .toc-desktop {
    display: block;
    position: sticky;
    top: 1.5rem;
    max-height: calc(100vh - 3rem);
    margin-top: 2.5rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 0.5rem;
  }

  .toc-title {
    margin: 0 0 0.6rem;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }

  .toc-desktop .toc-list a {
    min-height: 2.25rem;
    padding: 0.2rem 0.75rem;
    border-bottom: 0;
    border-left: 2px solid var(--line);
    color: var(--muted);
    font-size: 0.875rem;
    transition: padding-left 0.2s ease, color 0.25s ease, border-color 0.25s ease, font-weight 0.25s ease;
  }
  @media (hover: hover) {
    .toc-desktop .toc-list a:hover { padding-left: calc(0.75rem + 3px); }
  }
  @media (pointer: coarse) {
    .toc-desktop .toc-list a { min-height: 44px; }
  }
  .toc-desktop .toc-list a:hover { color: var(--terra); border-left-color: var(--beige); }
  .toc-desktop .toc-list a.is-active {
    border-left-color: var(--orange);
    color: var(--forest);
    font-weight: 700;
  }

  .terms-section { scroll-margin-top: 1.5rem; padding-block: 3rem; }
  h3 { scroll-margin-top: 1.5rem; }
  .contact-panel { scroll-margin-top: 1.5rem; padding: 3rem; }

  .footer-inner {
    grid-template-columns: 1fr auto;
    align-items: start;
  }
}

/* Scroll reveal. The script adds .reveal only to sections below the fold, so
   without JavaScript everything is simply visible. */
.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Reduced motion: no reveal, no lifting, bars at final width, minimal transitions. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal,
  .reveal.is-visible { opacity: 1; transform: none; }
  .meter-fill.is-armed { width: var(--w, 100%); }
  .btn:hover,
  .back-link:hover,
  .callout:hover { transform: none; }
  .toc-desktop .toc-list a:hover { padding-left: 0.75rem; }
}

/* Print */

@media print {
  .site-header .back-link,
  .quick-links,
  .toc-mobile,
  .toc-desktop,
  .btn-row,
  .skip-link { display: none; }

  body { background: #fff; font-size: 11pt; }
  .hero { background: none; color: #000; }
  .hero::before,
  .hero::after { display: none; }
  h1, .hero-lead, .eyebrow { color: #000; }
  .layout { display: block; margin-top: 0; }
  .contact-panel { background: none; color: #000; border: 1px solid #999; }
  .contact-panel h2, .contact-panel p { color: #000; }
  .site-footer { background: none; color: #000; }
  .footer-links a { color: #000; }
  .terms-section { break-inside: avoid-page; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .meter-fill.is-armed { width: var(--w, 100%) !important; }
}
