/* ============================================================
   TFG Tech for Good — shared marks (2 Oct 2026). Layers on tokens.css +
   main.css and is loaded by every page except AI coaching: the Arunachala
   ridge, the contact section with the ridge and crescent, the minimal footer.
   The <symbol> defs (#arunachala-*, #moon) sit at the top of each page's body.
   ============================================================ */

/* ---------- Shared: the Arunachala horizon ----------
   The ridge lives in a <symbol>; fill and stroke are set on the <svg> and
   inherited into the <use> shadow tree, where selectors cannot reach. */
.horizon {
  display: block;
  width: 100%;
  /* Height is capped, not tied to width: on a 2000px screen the ridge stays a
     horizon instead of growing into the text above it. preserveAspectRatio is
     "none", so the ridge stretches gently sideways on very wide screens. */
  height: var(--ridge-h);
  overflow: visible;
  fill: none;
  stroke: var(--color-ink);
  stroke-width: 1.5;
  stroke-linejoin: round;
}
.horizon--fill { fill: var(--color-bg-alt); }
.horizon--narrow { display: none; }
@media (max-width: 640px) {
  .horizon--wide { display: none; }
  .horizon--narrow { display: block; }
}

/* ---------- The ridge: fill and line as two layers ----------
   --ridge-h mirrors home.css's heights so the sun and moon can be placed
   relative to the ridge band. */
.ridge-wrap { position: relative; --ridge-h: clamp(120px, 15vw, 240px); }
@media (max-width: 640px) { .ridge-wrap { --ridge-h: 112px; } }
.ridge-wrap--contact { --ridge-h: clamp(90px, 9vw, 130px); }
@media (min-width: 812px) and (max-height: 920px) { .ridge-wrap--hero { --ridge-h: clamp(100px, 11vw, 160px); } .ridge-wrap--contact { --ridge-h: clamp(80px, 8vw, 110px); } }

.ridge-fill { fill: var(--color-bg-alt); stroke: none; }
.ridge-wrap--contact .ridge-fill { fill: rgba(20, 18, 16, .08); }
.ridge-line { fill: none; stroke: var(--color-ink); stroke-width: 1.5; stroke-linejoin: round; }

/* Draw on arrival. Contact waits for .is-drawn, which marks.js adds when the
   section scrolls into view; without JS the ridge is simply visible. The dash
   is 4 path lengths, not 1: the ridge is stretched sideways with a non-scaling
   stroke and Chrome measures the dash short on wide screens. */
.will-draw .ridge-wrap--contact .ridge-line { stroke-dasharray: 4; stroke-dashoffset: 4; }
.will-draw .ridge-wrap--contact .ridge-fill { opacity: 0; }
.will-draw.is-drawn .ridge-wrap--contact .ridge-line { animation: ridgeDraw 2.8s cubic-bezier(.65, 0, .35, 1) forwards; }
.will-draw.is-drawn .ridge-wrap--contact .ridge-fill { animation: ridgeFill .8s ease-out 1.2s forwards; }
@keyframes ridgeDraw { to { stroke-dashoffset: 0; } }
@keyframes ridgeFill { to { opacity: 1; } }
@keyframes sunRise { to { opacity: 1; transform: none; } }

/* ---------- Contact: the moon over the ridge ---------- */
.moon--contact {
  position: absolute; left: 78%;
  bottom: calc(var(--ridge-h) * .23 + 24px);
  width: 22px; height: 22px;
  fill: none; stroke: var(--color-ink); stroke-width: 1.5; stroke-linejoin: round;
}
@media (max-width: 640px) { .moon--contact { left: 72%; bottom: calc(var(--ridge-h) * .48 + 16px); width: 18px; height: 18px; } }
.will-draw .moon--contact { opacity: 0; transform: translateY(10px); }
.will-draw.is-drawn .moon--contact { animation: sunRise 1.2s cubic-bezier(.2, .7, .3, 1) 1.3s forwards; }

/* ---------- Contact: the ridge closes the page ----------
   The copy fills the leftover height so the ridge and footer sit on the bottom edge. */
.contact--horizon .contact-inner { flex: 1 0 auto; justify-content: center; padding-top: clamp(48px, 6vw, 80px); padding-bottom: 0; }
.contact--horizon .contact-ctas { margin-bottom: clamp(36px, 5vw, 72px); }
@media (min-width: 812px) and (max-height: 920px) {
  .contact--horizon .contact-inner { padding-top: clamp(40px, 5vw, 60px); gap: clamp(16px, 2.2vw, 24px); }
  .contact--horizon .contact-ctas { margin-bottom: clamp(28px, 4vw, 48px); }
}
@media (min-width: 812px) and (max-height: 820px) { .contact h2 { font-size: clamp(34px, 5vw, 60px); } }

/* ---------- Footer: brand, one line, places ---------- */
.contact-foot {
  background: rgba(20, 18, 16, .08);
  padding-top: clamp(32px, 4vw, 48px);
  padding-bottom: clamp(32px, 4vw, 48px);
  color: var(--color-ink);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.foot-min { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.foot-brand { font-family: var(--font-sans); font-weight: 600; font-size: 22px; letter-spacing: -.01em; text-transform: none; margin-bottom: 2px; }
.foot-line { line-height: 1.7; }

/* 404: the links sit on the ink manifesto, so the filled one turns cream and the outlined ones take a cream outline */
.manifesto .contact-book { background: var(--color-dark-text); color: var(--color-ink); border-color: var(--color-dark-text); }
.manifesto .contact-mail { color: var(--color-dark-text); border-color: var(--border-contact-35); }

@media (prefers-reduced-motion: reduce) {
  .ridge-line, .ridge-fill, .moon--contact { animation: none !important; }
  .ridge-line { stroke-dashoffset: 0 !important; }
  .ridge-fill, .moon--contact { opacity: 1 !important; transform: none !important; }
}
