/* ==========================================================================
   Keep on Keeping On — base layer
   Design tokens, reset, typography, buttons, header, footer, shared blocks.
   ========================================================================== */

/* --- Tokens ------------------------------------------------------------- */
:root {
  /* brand */
  --cream:        #FAF6EE;
  --forest-900:   #143327;
  --forest-700:   #1F4D3A;
  --ink:          #22312B;
  --ink-soft:     #3B4A42;
  --ink-mute:     #6B7A72;

  --blue:         #1D5C82;
  --blue-hi:      #2A719D;
  --blue-deep:    #0F3A54;

  --green:        #2F6B3C;
  --green-hi:     #3B7F49;
  --green-deep:   #184020;

  --amber:        #F0A94E;
  --amber-hi:     #F7BB6B;
  --amber-ink:    #8A5A12;

  --on-dark:      #CFE0D4;
  --on-dark-mute: #9DBCA8;
  --on-dark-soft: #DCE8E0;
  --on-dark-warm: #EDE6D8;

  /* type */
  --font-display: Poppins, ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  --font-body: "Source Sans 3", ui-sans-serif, system-ui, "Segoe UI", sans-serif;

  /* layout */
  --shell: 1200px;
  --gutter: clamp(20px, 4vw, 40px);
  --r-sm: 14px;
  --r-md: 20px;
  --r-lg: 26px;
  --r-xl: 32px;

  /* motion */
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-bottom: 96px; /* clearance for the sticky action bar */
}

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

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

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

a { color: var(--forest-700); text-decoration: none; }
a:hover { color: var(--forest-900); }

button, input, textarea, select { font: inherit; color: inherit; }

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

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px; top: -60px;
  z-index: 200;
  background: var(--amber);
  color: var(--forest-900);
  font-family: var(--font-display);
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 999px;
  transition: top 160ms var(--ease);
}
.skip-link:focus { top: 12px; color: var(--forest-900); }

/* --- Layout helpers ----------------------------------------------------- */
.shell { max-width: var(--shell); margin-inline: auto; }

.section { padding: clamp(52px, 7vw, 100px) var(--gutter); }
.section--tight-top { padding-top: 0; }
.section--tight-bottom { padding-bottom: clamp(28px, 4vw, 44px); }

.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: clamp(28px, 4.5vw, 60px);
  align-items: center;
}
.split--top { align-items: start; }

.lede { font-size: 18.5px; line-height: 1.7; color: var(--ink-soft); max-width: 40em; }
.prose p { font-size: 19px; line-height: 1.75; color: var(--ink-soft); margin-bottom: 16px; }
.prose p:last-of-type { margin-bottom: 28px; }

.eyebrow {
  display: inline-block;
  background: rgba(240, 169, 78, 0.16);
  color: var(--amber);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 16px;
  border-radius: 999px;
}

/* --- Buttons ------------------------------------------------------------ */
.btn {
  --btn-bg: var(--amber);
  --btn-fg: var(--forest-900);
  --btn-bg-hi: var(--amber-hi);
  --btn-shadow: rgba(0, 0, 0, 0.28);

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 16px 28px;
  border: none;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 5px 0 var(--btn-shadow);
  transition: transform 150ms var(--ease), background-color 150ms var(--ease), box-shadow 150ms var(--ease);
}
.btn:hover { background: var(--btn-bg-hi); color: var(--btn-fg); transform: translateY(-2px); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--btn-shadow); }
.btn[disabled], .btn[aria-disabled="true"] { cursor: not-allowed; opacity: 0.75; transform: none; }

.btn--sm { min-height: 52px; padding: 14px 24px; font-size: 16.5px; box-shadow: 0 4px 0 var(--btn-shadow); }
.btn--lg { min-height: 60px; padding: 18px 30px; font-size: 18px; }

.btn--blue  { --btn-bg: var(--blue);  --btn-bg-hi: var(--blue-hi);  --btn-fg: #fff; --btn-shadow: rgba(15, 58, 84, 0.55); }
.btn--green { --btn-bg: var(--green); --btn-bg-hi: var(--green-hi); --btn-fg: #fff; --btn-shadow: rgba(24, 64, 32, 0.5); }
.btn--forest{ --btn-bg: var(--forest-900); --btn-bg-hi: var(--forest-700); --btn-fg: var(--cream); }
.btn--amber-on-light { --btn-shadow: rgba(138, 90, 18, 0.35); }

.btn--ghost {
  background: transparent;
  color: var(--on-dark-soft);
  border: 1.5px solid rgba(250, 246, 238, 0.35);
  box-shadow: none;
  min-height: 52px;
  padding: 14px 24px;
  font-size: 16px;
}
.btn--ghost:hover { background: rgba(250, 246, 238, 0.1); color: #fff; transform: none; }
.btn--ghost:active { transform: none; box-shadow: none; }

.btn--ghost-light {
  background: transparent;
  color: var(--blue);
  border: 1.5px solid rgba(29, 92, 130, 0.4);
  box-shadow: none;
  min-height: 52px;
  padding: 14px 24px;
  font-size: 16px;
}
.btn--ghost-light:hover { background: #EFF5FA; color: var(--blue); transform: none; }

/* --- Header ------------------------------------------------------------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--forest-900);
  color: var(--cream);
  border-bottom: 1px solid rgba(240, 169, 78, 0.25);
}
.masthead__inner {
  max-width: var(--shell);
  margin-inline: auto;
  padding: 14px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--cream); }
.brand:hover { color: #fff; }
.brand__mark {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--amber);
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  line-height: 1;
  color: var(--forest-900);
  flex: none;
}
.brand__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.mainnav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mainnav a {
  color: var(--on-dark-soft);
  font-size: 15px;
  padding: 10px 12px;
  border-radius: 999px;
  transition: background-color 140ms var(--ease), color 140ms var(--ease);
}
.mainnav a:hover { background: rgba(250, 246, 238, 0.1); color: var(--cream); }
.mainnav a[aria-current="page"] { color: #fff; }
.mainnav a.is-safe[aria-current="page"]  { background: var(--blue); }
.mainnav a.is-clean[aria-current="page"] { background: var(--green); }
.mainnav a.is-left[aria-current="page"]  { background: var(--amber); color: var(--forest-900); }

.mainnav .btn { margin-left: 6px; min-height: 44px; padding: 11px 20px; font-size: 15px; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.18); }
.mainnav .btn:active { box-shadow: 0 1px 0 rgba(0, 0, 0, 0.18); }

/* --- Figures / illustrations -------------------------------------------- */
.frame {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #E7E2D6;
}
.frame img { width: 100%; height: 100%; object-fit: cover; }
.frame--sm { border-radius: 18px; }
.frame--md { border-radius: 22px; }

/* A tidy, non-overlapping image cluster: one wide plate, two squares under it. */
.cluster { display: grid; gap: 14px; align-content: start; }
.cluster__wide { aspect-ratio: 4 / 3; }
.cluster__pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cluster__pair > * { aspect-ratio: 1 / 1; }

.callout-tag {
  position: absolute;
  bottom: -18px;
  left: -14px;
  background: var(--amber);
  color: var(--forest-900);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  padding: 12px 18px;
  border-radius: var(--r-sm);
  transform: rotate(-3deg);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.22);
}
.callout-tag--forest { background: var(--forest-900); color: var(--cream); }

.hero-figure { position: relative; }
.hero-figure > .frame { aspect-ratio: 4 / 3; border-radius: 28px; }

/* --- Numbered point cards ----------------------------------------------- */
.points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}
.point {
  background: #fff;
  border-radius: var(--r-md);
  padding: 24px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.point__n {
  width: 38px; height: 38px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  flex: none;
}
.point__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18.5px;
  line-height: 1.25;
  margin-bottom: 7px;
}
.point__body { font-size: 17px; line-height: 1.6; color: var(--ink-soft); }

/* --- Dark panel cards --------------------------------------------------- */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}
.tile {
  background: rgba(250, 246, 238, 0.07);
  border: 1px solid rgba(250, 246, 238, 0.16);
  border-radius: var(--r-md);
  padding: 24px;
}
.tile__n {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  color: var(--amber);
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.tile p:last-child { font-size: 17.5px; line-height: 1.6; color: var(--on-dark-warm); }

/* --- Next-habit cards --------------------------------------------------- */
.nextup {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}
.nextup__card {
  border-radius: 24px;
  padding: 30px;
  display: block;
  transition: transform 180ms var(--ease), background-color 180ms var(--ease);
}
.nextup__card:hover { transform: translateY(-3px); }
.nextup__card--blue  { background: var(--blue);  color: #fff; }
.nextup__card--blue:hover  { background: var(--blue-hi);  color: #fff; }
.nextup__card--green { background: var(--green); color: #fff; }
.nextup__card--green:hover { background: var(--green-hi); color: #fff; }
.nextup__card--amber { background: var(--amber); color: var(--forest-900); }
.nextup__card--amber:hover { background: var(--amber-hi); color: var(--forest-900); }
.nextup__kicker { font-size: 15px; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.85; margin-bottom: 8px; }
.nextup__title { font-family: var(--font-display); font-weight: 800; font-size: 26px; margin-bottom: 10px; }
.nextup__body { font-size: 17px; line-height: 1.6; opacity: 0.92; }

/* --- Forms -------------------------------------------------------------- */
.field { display: grid; gap: 8px; }
.field__label { font-size: 15px; font-weight: 600; }
.field__hint { font-size: 14.5px; font-weight: 400; color: var(--ink-mute); }

.field input,
.field textarea {
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 400;
  padding: 16px;
  border-radius: var(--r-sm);
  min-height: 56px;
  outline: none;
  width: 100%;
  transition: border-color 140ms var(--ease), box-shadow 140ms var(--ease);
}
.field textarea { resize: vertical; min-height: 120px; }

.field__error {
  font-size: 14.5px;
  font-weight: 600;
  min-height: 0;
  display: none;
}
.field.is-invalid .field__error { display: block; }

/* Spinner used by the submit buttons */
.spinner {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2.5px solid currentColor;
  border-top-color: transparent;
  animation: koko-spin 700ms linear infinite;
  flex: none;
}
@keyframes koko-spin { to { transform: rotate(360deg); } }

.form-alert {
  border-radius: var(--r-sm);
  padding: 14px 18px;
  font-size: 16px;
  line-height: 1.55;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.form-alert[hidden] { display: none; }
.form-alert__icon { font-weight: 800; flex: none; }

/* --- Footer ------------------------------------------------------------- */
.sitefoot {
  background: var(--forest-900);
  color: var(--on-dark);
  padding: clamp(44px, 6vw, 72px) var(--gutter) 32px;
}
.sitefoot__grid {
  max-width: var(--shell);
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 36px;
}
.sitefoot__brand { display: flex; align-items: center; gap: 11px; margin-bottom: 16px; }
.sitefoot h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0;
  color: var(--cream);
  margin-bottom: 14px;
}
.sitefoot__list { display: grid; gap: 10px; font-size: 16px; }
.sitefoot__list a { color: var(--on-dark); }
.sitefoot__list a:hover { color: var(--amber); }
.sitefoot__blurb { font-size: 16px; line-height: 1.6; color: var(--on-dark-mute); margin-bottom: 16px; max-width: 22em; }
/* The supplied logo is an opaque PNG with a white background baked in, so it
   gets a deliberate white plate here rather than floating as a bare rectangle
   on the dark footer. Intrinsic size is 222x148 — keep that ratio. */
.sitefoot__logo {
  width: 136px;
  height: auto;
  aspect-ratio: 222 / 148;
  object-fit: contain;
  background: #FFFFFF;
  padding: 9px 11px;
  border-radius: 12px;
}

/* Social entries are placeholders in this demo: focusable, announced, inert. */
.inert-link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 16px;
  color: var(--on-dark);
  text-align: left;
  cursor: default;
}
.inert-link:hover { color: var(--amber); }

.sitefoot__base {
  max-width: var(--shell);
  margin: 36px auto 0;
  padding-top: 22px;
  border-top: 1px solid rgba(250, 246, 238, 0.14);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  font-size: 14.5px;
  color: rgba(250, 246, 238, 0.6);
}

/* --- Sticky action bar -------------------------------------------------- */
.actionbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 70;
  background: rgba(20, 51, 39, 0.96);
  border-top: 2px solid var(--amber);
  backdrop-filter: blur(6px);
  animation: koko-bar-in 600ms var(--ease) both;
}
.actionbar__inner {
  max-width: var(--shell);
  margin-inline: auto;
  padding: 14px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.actionbar p {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16.5px;
  color: var(--cream);
}
.actionbar .btn { min-height: 52px; padding: 14px 26px; font-size: 16.5px; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3); }

/* --- Motion ------------------------------------------------------------- */
@keyframes koko-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes koko-bar-in { from { opacity: 0; transform: translateY(80px); } to { opacity: 1; transform: none; } }

.rise { animation: koko-rise 700ms var(--ease) both; }

/* Scroll-in reveal, driven by js/site.js.
   Scoped to .js so the page is fully readable with scripting off. */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 620ms var(--ease), transform 620ms var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

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

/* --- Small screens ------------------------------------------------------ */
@media (max-width: 720px) {
  .masthead__inner { flex-wrap: wrap; row-gap: 10px; }
  .mainnav { width: 100%; justify-content: flex-start; }
  .mainnav .btn { margin-left: auto; }
  .callout-tag { left: 0; bottom: -14px; font-size: 14px; padding: 10px 14px; }
  body { padding-bottom: 128px; }
}
