/* ==========================================================================
   TANZAOLOGY TOURS & SAFARIS — base.css
   Tokens, reset, typography. Loaded first, on every page.
   ========================================================================== */

/* --------------------------------------------------------------------------
   FONTS  (self-hosted latin subsets — no third-party font requests)
   -------------------------------------------------------------------------- */
@font-face {
  font-family: 'Instrument Serif';
  src: url('../fonts/InstrumentSerif-Regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Instrument Serif';
  src: url('../fonts/InstrumentSerif-Italic.woff2') format('woff2');
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Josefin Sans';
  src: url('../fonts/JosefinSans-Variable.woff2') format('woff2-variations'),
       url('../fonts/JosefinSans-Variable.woff2') format('woff2');
  font-weight: 100 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../fonts/Inter-Variable.woff2') format('woff2-variations'),
       url('../fonts/Inter-Variable.woff2') format('woff2');
  font-weight: 300 700; font-style: normal; font-display: swap;
}

/* --------------------------------------------------------------------------
   TOKENS
   -------------------------------------------------------------------------- */
:root {
  /* Ground — warm, never grey. Tanzaology's brand is earth and gold. */
  --c-cream:     #faf6ee;
  --c-cream-alt: #f3ece0;
  --c-sand:      #e3d5bb;
  --c-sand-soft: #efe6d5;
  --c-white:     #ffffff;

  --c-dark:      #3a2614;
  --c-dark-deep: #241a12;

  --c-accent:      #a35f16;
  --c-accent-lift: #c47a2b;
  --c-accent-soft: #e8a84a;

  /* Ink is a deep warm brown, never true black — it keeps the cream ground
     from reading as grey. */
  --c-ink:       #241a12;
  --c-ink-soft:  #6b5c4c;
  --c-ink-faint: #9a8b78;
  --c-line:      #ded0b8;
  --c-line-soft: #ece3d4;

  --c-ok:   #4a7c4e;
  --c-err:  #a63a2a;

  /* "Script" is the role — the accent line over a serif title — not the
     letterform. It was Sacramento until the client asked for Josefin Sans. */
  --font-script: 'Josefin Sans', 'Century Gothic', 'Futura', 'Helvetica Neue', Arial, sans-serif;
  --font-serif:  'Instrument Serif', 'Times New Roman', Georgia, serif;
  --font-sans:   'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;

  --fs-xs:     0.75rem;
  --fs-sm:     0.875rem;
  --fs-base:   1rem;
  --fs-lg:     1.0625rem;
  --fs-h4:     clamp(1.25rem, 0.4vw + 1.1rem,  1.5rem);
  --fs-h3:     clamp(1.5rem,  1vw + 1.15rem,   2.05rem);
  --fs-h2:     clamp(1.9rem,  1.9vw + 1.3rem,  3.1rem);
  --fs-h1:     clamp(2.4rem,  3.4vw + 1.4rem,  4.6rem);

  /* A sans fills far more of its em than a script did, so these are roughly
     half the old Sacramento sizes. The hero line sits level with the serif
     title below it; the small one is a subtitle, well under the h2. */
  --fs-script:    clamp(1.85rem, 2.4vw + 1.05rem, 3.3rem);
  --fs-script-sm: clamp(1.15rem, .5vw + 1rem, 1.45rem);

  --lh-tight: 1.08;
  --lh-snug:  1.28;
  --lh-body:  1.7;

  --ls-nav:  0.09em;
  --ls-wide: 0.2em;

  --s-1: 0.25rem; --s-2: 0.5rem;  --s-3: 0.75rem; --s-4: 1rem;
  --s-5: 1.5rem;  --s-6: 2rem;    --s-7: 3rem;    --s-8: 4rem;
  --s-9: 6rem;    --s-10: 8rem;   --s-11: 11rem;

  --section-y: clamp(5rem, 8.5vw, 10.5rem);
  --gutter:    clamp(1.25rem, 4vw, 3.25rem);
  --measure:   62ch;

  --w-wide: 1560px;
  --w-page: 1240px;
  --w-text: 700px;

  /* Square is the luxury signal here. Only pills are round. */
  --r-none: 0;
  --r-pill: 40px;

  --shadow-sm: 0 1px 2px rgba(36, 26, 18, .05);
  --shadow-md: 0 6px 18px rgba(36, 26, 18, .07), 0 18px 44px rgba(36, 26, 18, .07);
  --shadow-lg: 0 12px 32px rgba(36, 26, 18, .10), 0 36px 80px rgba(36, 26, 18, .10);

  --ease: cubic-bezier(.22, .61, .36, 1);
  --dur:  .55s;

  /* The bar has to clear the logo with air left over — grow both together. */
  --header-h: 98px;
}

/* --------------------------------------------------------------------------
   RESET
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* keeps anchor targets clear of the fixed header */
  scroll-padding-top: calc(var(--header-h) + var(--s-5));
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  color: var(--c-ink);
  background: var(--c-cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, picture, video, canvas, svg { display: block; max-width: 100%; }
img { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
table { border-collapse: collapse; }

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

/* --------------------------------------------------------------------------
   TYPOGRAPHY
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: var(--lh-tight);
  letter-spacing: -0.005em;
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); line-height: var(--lh-snug); }
h4 { font-size: var(--fs-h4); line-height: var(--lh-snug); }

p { text-wrap: pretty; }
p + p { margin-top: var(--s-4); }

.script {
  font-family: var(--font-script);
  font-size: var(--fs-script);
  line-height: 1.15;
  font-weight: 300;
  letter-spacing: .02em;
}
.script-sm {
  font-family: var(--font-script);
  font-size: var(--fs-script-sm);
  line-height: 1.3;
  font-weight: 400;
  letter-spacing: .03em;
}

/* Small caps-ish label above a section title */
.eyebrow {
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--c-accent);
  font-weight: 500;
}

.lede {
  font-size: var(--fs-lg);
  color: var(--c-ink-soft);
  max-width: var(--measure);
}

.muted { color: var(--c-ink-soft); }

/* --------------------------------------------------------------------------
   LAYOUT PRIMITIVES
   -------------------------------------------------------------------------- */
.wrap      { width: min(100% - var(--gutter) * 2, var(--w-page)); margin-inline: auto; }
.wrap-wide { width: min(100% - var(--gutter) * 2, var(--w-wide)); margin-inline: auto; }
.wrap-text { width: min(100% - var(--gutter) * 2, var(--w-text)); margin-inline: auto; }

.section     { padding-block: var(--section-y); }
.section-sm  { padding-block: calc(var(--section-y) * .55); }
.section-alt { background: var(--c-cream-alt); }
.section-ink { background: var(--c-dark-deep); color: var(--c-cream); }

.stack > * + * { margin-top: var(--s-4); }
.center { text-align: center; }

.grid { display: grid; gap: var(--s-5); }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
  .g-3, .g-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .g-2, .g-3, .g-4 { grid-template-columns: 1fr; }
}

/* Section heading block: serif title over script subtitle */
.section-head { text-align: center; margin-bottom: var(--s-8); }
.section-head .eyebrow { display: block; margin-bottom: var(--s-3); }
.section-head h2 { margin-bottom: var(--s-2); }
.section-head .script-sm { color: var(--c-ink-faint); }
.section-head .lede { margin: var(--s-4) auto 0; }

/* --------------------------------------------------------------------------
   SCROLL REVEAL  (progressive enhancement — visible if JS never runs)
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal, .reveal.is-visible { opacity: 1; transform: none; }

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

/* --------------------------------------------------------------------------
   UTILITIES
   -------------------------------------------------------------------------- */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--s-4); top: -60px;
  z-index: 2000; background: var(--c-ink); color: var(--c-cream);
  padding: var(--s-3) var(--s-5); transition: top .2s;
}
.skip-link:focus { top: var(--s-4); }

[hidden] { display: none !important; }
