/* =========================================================================
   Time Horizon — styles
   Brand: ivory + ink + one green. Newsreader (serif) / IBM Plex Sans (labels)
   / IBM Plex Mono (data). The horizon motif is the through-line.
   ========================================================================= */

:root {
  /* Grounds */
  --ivory:        #fdfcf9;
  --ivory-warm:   #f3f0e8;
  --paper-line:   #e7e3da;
  --paper-line-2: #dcd7ca;

  /* Ink & text */
  --ink:      #1a1a17;
  --muted:    #5f5a4e;   /* secondary text — 6.6:1 on ivory */
  --muted-2:  #8a8578;   /* captions/decorative only — ~3.5:1 */
  --muted-3:  #a29a89;

  /* Green — brand green for graphics/large accents; green-strong for text-sized
     UI where AA 4.5:1 is required (kickers, links, button fills). Same hue. */
  --green:         #1a8a57;   /* motif, dots, tile, rules, large accents */
  --green-strong:  #16794a;   /* small text, links, buttons — AA on ivory & warm */
  --green-on-dark: #43c489;

  /* Data accents — only inside charts, never decoration */
  --up: #1a8a57;  --down: #cc4436;  --neutral: #c6952c;

  /* Dark surface */
  --dark: #141412;
  --dark-2: #1f1e1b;

  /* Type */
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans:  "IBM Plex Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --mono:  "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Fluid type scale (rem-anchored; vw only in the middle term) */
  --fs-hero:  clamp(2.75rem, 1.10rem + 7.2vw, 8rem);
  --fs-h1:    clamp(2rem, 1.20rem + 3.6vw, 3.5rem);
  --fs-h2:    clamp(1.5rem, 1.10rem + 1.9vw, 2.125rem);
  --fs-h3:    clamp(1.25rem, 1.05rem + 0.9vw, 1.375rem);
  --fs-body:  clamp(1.0625rem, 0.98rem + 0.4vw, 1.1875rem);
  --fs-small: clamp(0.875rem, 0.83rem + 0.2vw, 0.9375rem);
  --fs-label: clamp(0.6875rem, 0.66rem + 0.13vw, 0.75rem);

  /* Layout */
  --maxw: 1120px;
  --measure: 68ch;
  --gutter: clamp(20px, 5vw, 48px);
  --section-pad: clamp(72px, 10vw, 128px);
  --nav-h: 72px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--nav-h) + 12px);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  font-family: var(--serif);
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--ink);
  background: var(--ivory);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

/* ------------------------------ helpers --------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.hp {                       /* honeypot */
  position: absolute !important;
  left: -9999px; width: 1px; height: 1px; opacity: 0;
}

.skip-link {
  position: absolute;
  left: 12px; top: -60px;
  z-index: 100;
  background: var(--green-strong);
  color: #fff;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 16px;
  border-radius: 6px;
  transition: top .15s ease;
}
.skip-link:focus-visible { top: 12px; }

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

/* ------------------------------ kicker ---------------------------------- */
.kicker {
  font-family: var(--sans);
  font-weight: 600;
  font-size: var(--fs-label);
  text-transform: uppercase;
  letter-spacing: 0.26em;
  color: var(--green-strong);
  margin-bottom: 1.1rem;
}
.kicker--green { color: var(--green-strong); letter-spacing: 0.28em; }

/* section glyph (eyebrow mark) + spot diagrams */
.glyph { display: block; width: 40px; height: 40px; margin-bottom: 14px; }
.spot { margin-top: clamp(2.2rem, 5vw, 3.4rem); }
.spot img { display: block; width: 100%; max-width: 440px; height: auto; }

/* ------------------------------ buttons --------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  padding: 0.62em 1.25em;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn--primary { background: var(--green-strong); color: #fff; }
.btn--primary:hover { background: #12633c; }
.btn--secondary { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn--secondary:hover { background: var(--ink); color: var(--ivory); }

/* -------------------------------- links --------------------------------- */
.link {
  color: var(--green-strong);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
  transition: color .15s ease;
}
.link:hover { color: #12633c; }

.prose a {                  /* inline body links: ink text, green underline */
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid var(--green);
}
.prose a:hover { border-bottom-color: var(--green-strong); }

/* ================================ NAV =================================== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(253, 252, 249, 0.82);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, background-color .2s ease;
}
.nav--stuck {
  border-bottom-color: var(--paper-line);
  background: rgba(253, 252, 249, 0.92);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--nav-h);
}

/* brand lockup */
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand__tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: 8px;               /* ~20% */
  background: var(--green);
  color: #fff;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 20px;
  letter-spacing: -0.02em;
  flex: none;
}
.brand__lockup { display: flex; flex-direction: column; line-height: 1.05; }
.brand__name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.32rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.brand__dot { color: var(--green); }
.brand__kick {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.58rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--green-strong);
  margin-top: 2px;
}

.nav__links { display: flex; align-items: center; gap: clamp(16px, 2.4vw, 32px); }
.nav__links > a:not(.btn) {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s ease;
}
.nav__links > a:not(.btn):hover { color: var(--ink); }
.nav__cta { font-size: 0.82rem; text-transform: none; letter-spacing: 0.01em; padding: 0.5em 1.1em; min-height: 40px; }

/* ================================ HERO ================================= */
.hero { padding-top: clamp(48px, 8vw, 96px); padding-bottom: clamp(40px, 6vw, 72px); }
.hero__inner { max-width: 940px; }
.hero__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: var(--fs-hero);
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: clamp(1.2rem, 3vw, 2rem);
  overflow-wrap: break-word;
}
.hero__lede {
  max-width: 40ch;
  font-size: clamp(1.15rem, 1.02rem + 0.7vw, 1.4rem);
  line-height: 1.5;
  color: var(--muted);
  margin-bottom: clamp(1.8rem, 4vw, 2.6rem);
}
.hero__cta { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.hero__cta-note { font-family: var(--mono); font-size: 0.85rem; color: var(--muted); max-width: 42ch; }

/* ------------------------------ signup ---------------------------------- */
.signup {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 12px;
  max-width: 500px;
  align-items: start;
}
.signup__field {
  grid-column: 1;
  min-height: 48px;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--paper-line-2);
  border-radius: 6px;
  padding: 0 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.signup__field::placeholder { color: var(--muted-2); }
.signup__field:focus-visible {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(26, 138, 87, 0.18);
}
.signup__btn { grid-column: 2; min-height: 48px; }
.signup__note {
  grid-column: 1 / -1;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 2px;
}
.signup__status {
  grid-column: 1 / -1;
  font-family: var(--mono);
  font-size: 0.85rem;
  min-height: 0;
  color: var(--muted);
}
.signup__status:empty { display: none; }
.signup__status[data-state="ok"]  { color: var(--green-strong); }
.signup__status[data-state="err"] { color: var(--down); }

/* ============================ HORIZON MOTIF ============================= */
.horizon { position: relative; width: 100%; }
.horizon svg { display: block; width: 100%; height: var(--h-height, 220px); }
.horizon__line  { stroke: var(--green); stroke-width: 1.4; opacity: 0.8; }
.horizon__curve { stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }

/* terminus dot — CSS element so it stays perfectly round under non-uniform
   scaling; positioned at the curve/horizon crossing (viewBox 1140,70). */
.horizon__dot {
  position: absolute;
  left: 95%;
  top: 29.17%;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--green);
  transform: translate(-50%, -50%);
}
.horizon__label {
  position: absolute;
  left: 0;
  top: calc(29.17% - 1.7em);
  font-family: var(--sans);
  font-weight: 600;
  font-size: var(--fs-label);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--green-strong);
}
.horizon__t {
  position: absolute;
  right: 0;
  bottom: 0;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted-2);
}

.horizon--hero    { --h-height: clamp(150px, 24vw, 250px); margin-top: clamp(32px, 6vw, 64px); }
.horizon--divider { --h-height: clamp(90px, 13vw, 150px); margin-bottom: clamp(28px, 5vw, 48px); }
.horizon--footer  { --h-height: clamp(56px, 9vw, 96px); }

.horizon--on-dark .horizon__curve { stroke: var(--ivory-warm); }
.horizon--on-dark .horizon__line  { stroke: var(--green-on-dark); }
.horizon--on-dark .horizon__dot   { background: var(--green-on-dark); }

/* draw animation (JS adds .is-drawn once in view; gated by reduced-motion in JS) */
@media (prefers-reduced-motion: no-preference) {
  .horizon.js-draw .horizon__curve { transition: stroke-dashoffset 1.5s ease-out; }
  .horizon.js-draw .horizon__dot   { opacity: 0; transition: opacity .4s ease .9s; }
  .horizon.js-draw.is-drawn .horizon__dot { opacity: 1; }
}

/* ============================== SECTIONS =============================== */
.section { padding-block: var(--section-pad); }
.section--warm { background: var(--ivory-warm); }
.section__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: var(--fs-h2);
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--ink);
  max-width: 22ch;
  margin-bottom: clamp(1.3rem, 3vw, 2rem);
  overflow-wrap: break-word;
}
.prose { max-width: var(--measure); }
.prose p { font-size: var(--fs-body); color: var(--ink); }
.prose p + p { margin-top: 1.1em; }
.section--warm .prose p, .section .prose p { color: #24231e; }

/* anatomy cards */
.cards {
  list-style: none;
  padding: 0;
  margin-top: clamp(2.2rem, 5vw, 3.4rem);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(14px, 2vw, 20px);
}
.cards--2 { grid-template-columns: repeat(2, 1fr); }
.card {
  border: 1px solid var(--paper-line);
  background: var(--ivory);
  padding: clamp(20px, 2.4vw, 28px);
}
.card__label { color: var(--green-strong); margin-bottom: 0.7rem; }
.card__body {
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.45;
  color: var(--muted);
}

/* pull quote */
.pullquote { padding-block: clamp(64px, 9vw, 112px); }
.pullquote__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(28px, 5vw, 56px);
  align-items: center;
}
.pullquote .spot { margin-top: 0; }
.pullquote .spot img { max-width: 400px; }
@media (min-width: 760px) {
  .pullquote__inner { grid-template-columns: 1.35fr 1fr; }
}
.pullquote__text {
  max-width: 26ch;
  font-family: var(--serif);
  font-weight: 500;
  font-size: var(--fs-h1);
  line-height: 1.14;
  letter-spacing: -0.02em;
  color: var(--ink);
  padding-left: clamp(18px, 2.4vw, 28px);
  border-left: 3px solid var(--green);
  overflow-wrap: break-word;
}

/* enquiries */
.enquiries__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: var(--fs-h3);
  line-height: 1.2;
  color: var(--ink);
  max-width: 22ch;
  margin-bottom: 1.1rem;
}
.enquiries__body {
  max-width: 56ch;
  color: #24231e;
  margin-bottom: 1.6rem;
}
.enquiries__contact a {
  font-family: var(--serif);
  font-size: clamp(1.35rem, 1.1rem + 1.2vw, 1.75rem);   /* large text → green passes at 3:1 */
  font-weight: 500;
  color: var(--green-strong);
  text-decoration: none;
  border-bottom: 2px solid var(--green);
  padding-bottom: 2px;
}
.enquiries__contact a:hover { color: #12633c; }
.enquiries__cta-line {
  max-width: 56ch;
  color: #24231e;
  margin-top: clamp(2rem, 4vw, 3rem);
  margin-bottom: 0.9rem;
}

/* ============================= SUBSCRIBE =============================== */
.subscribe { padding-block: var(--section-pad); }
.subscribe__title { max-width: 18ch; }
.subscribe__lede {
  max-width: 46ch;
  font-size: clamp(1.1rem, 1rem + 0.6vw, 1.3rem);
  color: var(--muted);
  margin-bottom: clamp(1.6rem, 3.5vw, 2.4rem);
}

/* ============================= ENQUIRE ================================ */
.enquire { padding-block: var(--section-pad); }
.enquire__title { max-width: 20ch; }
.enquire__lede {
  max-width: 54ch;
  font-size: clamp(1.05rem, 1rem + 0.5vw, 1.25rem);
  color: var(--muted);
  margin-bottom: clamp(1.8rem, 4vw, 2.6rem);
}
.enquiry {
  max-width: 640px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 20px;
}
.field { display: flex; flex-direction: column; gap: 7px; }
.field--full { grid-column: 1 / -1; }
.field label {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.field .opt { color: var(--muted-2); font-weight: 400; }
.enquiry input, .enquiry select, .enquiry textarea {
  width: 100%;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--paper-line-2);
  border-radius: 6px;
  padding: 11px 13px;
}
.enquiry textarea { resize: vertical; min-height: 118px; }
.enquiry input:focus-visible,
.enquiry select:focus-visible,
.enquiry textarea:focus-visible {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(26, 138, 87, 0.18);
}
.enquiry .cf-turnstile { grid-column: 1 / -1; }
.enquiry__actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
}
.enquiry__alt { font-family: var(--mono); font-size: 0.82rem; color: var(--muted); }
.enquiry .signup__status { grid-column: 1 / -1; }
@media (max-width: 599px) {
  .enquiry { grid-template-columns: 1fr; }
}

/* ============================== FOOTER ================================= */
.footer { background: var(--dark); color: var(--ivory-warm); }
.footer .horizon { margin-bottom: clamp(24px, 4vw, 40px); }
.footer__inner {
  display: grid;
  grid-template-columns: 1.2fr 2fr;
  gap: clamp(32px, 5vw, 64px);
  padding-bottom: clamp(40px, 6vw, 64px);
}
.brand--footer { gap: 12px; }
.brand__tile--footer { background: var(--ivory-warm); color: var(--ink); }
.brand__name--footer { color: var(--ivory-warm); }
.brand--footer .brand__dot { color: var(--green-on-dark); }
.footer__tag {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--muted-3);
  margin-top: 16px;
}
.footer__cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 3vw, 40px);
}
.footer__col { display: flex; flex-direction: column; gap: 10px; }
.footer__head { color: var(--green-on-dark); margin-bottom: 4px; }
.footer__col a {
  font-family: var(--sans);
  font-size: 0.92rem;
  color: var(--paper-line);
  text-decoration: none;
  width: max-content;
  transition: color .15s ease;
}
.footer__col a:hover { color: var(--green-on-dark); }
.footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
  padding-block: clamp(20px, 3vw, 28px);
  border-top: 1px solid var(--dark-2);
}
.footer__legal p {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--muted-3);
}

/* ============================ RESPONSIVE =============================== */

/* tablet and up: nothing extra needed until phone shrink; refine large screens */
@media (min-width: 1280px) {
  :root { --maxw: 1120px; }
}

/* tablet down */
@media (max-width: 899px) {
  .footer__inner { grid-template-columns: 1fr; gap: 32px; }
}

/* phone */
@media (max-width: 599px) {
  :root { --nav-h: 64px; }
  .brand__kick { display: none; }
  .nav__links > a:not(.btn) { display: none; }   /* short page → scroll; keep only CTA */
  .nav__cta { display: inline-flex; }

  .signup { grid-template-columns: 1fr; max-width: 100%; }
  .signup__field, .signup__btn { grid-column: 1; }

  .cards { grid-template-columns: 1fr; }

  .footer__cols { grid-template-columns: 1fr 1fr; gap: 24px; }
  .hero__title br { display: none; }
}

@media (max-width: 380px) {
  .footer__cols { grid-template-columns: 1fr; }
}
