/* ==========================================================================
   doddo.bio foundations
   One flat pastel ground, one deep green carrying every piece of type.
   Palette and letterforms follow maggie-app.com; the hero layout follows
   heylink.me, stripped back to copy plus the claim field.
   ========================================================================== */

:root {
  /* --- Brand palette (maggie-app.com) -------------------------------------
     One deep green carries every piece of type; the pastels are grounds. */
  --green: #03594d;
  --green-dark: #024a40; /* hover only */
  --green-deep: #04332b; /* the device screen in the hero */
  --mint: #82eda6;
  --cream: #f9f8f4;
  /* Unused today. The rest of the palette, kept for alternate grounds.
     Swap any of them into --hero-bg. */
  --cyan: #aefbff;
  --lilac: #f6bbfd;
  --yellow: #ffff94;
  --pink: #fccddc;

  /* --- Hero ground: one flat colour, no gradient -------------------------- */
  --hero-bg: var(--mint);

  /* --- Accents ----------------------------------------------------------- */
  --accent: var(--green); /* logo mark */
  --action: var(--green); /* every primary button */
  --action-hover: var(--green-dark);
  --action-ink: var(--cream); /* type on an --action fill */

  /* --- On white (the claim field) ---------------------------------------- */
  --white: #ffffff;
  --ink: var(--green);
  --ink-45: rgba(3, 89, 77, 0.45);
  --ink-25: rgba(3, 89, 77, 0.25);

  /* --- On the pastel ground, so type is the deep green -------------------- */
  --on-grad: var(--green);
  --on-grad-75: rgba(3, 89, 77, 0.75);

  /* A darkened relative of the palette's hot pink. Errors have to read as
     errors, and #fc5681 only reaches 2.1:1 on these light grounds. */
  --alert: #b01844;

  --r-sm: 8px;
  --r-md: 12px;
  --r-pill: 999px;

  /* --- Spacing: 8pt grid, per Apple HIG ----------------------------------
     Every margin, padding and gap on the page resolves to one of these.
     4px exists only for optical nudges inside a component. */
  --sp-4: 4px;
  --sp-8: 8px;
  --sp-12: 12px;
  --sp-16: 16px;
  --sp-24: 24px;
  --sp-32: 32px;
  --sp-40: 40px;
  --sp-48: 48px;
  --sp-64: 64px;
  --sp-96: 96px;

  /* HIG minimum comfortable hit area. Applies to controls; WCAG 2.5.8
     exempts links sitting inline in a sentence. */
  --hit: 44px;

  --gutter: clamp(16px, 4vw, 40px);
  --shell: 1200px;

  --sans: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui,
    sans-serif;

  /* Steps of roughly 1.25x, so nothing in the hero jumps more than it has
     to. Hero to sub is 3.2x; the old 4.6rem/1.2rem pairing was 3.8x and read
     as a hole in the middle of the hierarchy. */
  --t-hero: clamp(1.625rem, 4.2vw, 3rem); /* one line now, 48px at 1440 */
  --t-sub: clamp(1.0625rem, 1.35vw, 1.25rem); /* 20px at 1440 */
  --t-field: clamp(1rem, 1.15vw, 1.0625rem); /* 17px; never below 16, or
                                                iOS zooms the page on focus */
  --t-body: 1rem;
  --t-sm: 0.875rem;
  --t-xs: 0.78rem;
}

/* ==========================================================================
   Reset
   ========================================================================== */

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

* {
  margin: 0;
}

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

body {
  min-height: 100vh;
  /* matches --hero-bg so overscroll never shows a different colour */
  background: var(--hero-bg);
  color: var(--on-grad);
  font-family: var(--sans);
  font-size: var(--t-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

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

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

button {
  cursor: pointer;
  background: none;
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
  padding: 0;
}

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

::selection {
  background: var(--green);
  color: var(--mint);
}

/* text-transform is reflected in the computed accessible name, so keep
   screen-reader-only text in its literal case. */
.sr-only {
  text-transform: none;
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   Type
   ========================================================================== */

h1,
h2 {
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.022em;
}

.shell {
  width: min(100%, var(--shell));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-8);
  min-height: var(--sp-48);
  padding: 0 var(--sp-24);
  border-radius: var(--r-sm);
  background: var(--action);
  color: var(--action-ink);
  font-size: var(--t-body);
  font-weight: 600;
  letter-spacing: -0.005em;
  white-space: nowrap;
  transition: background-color 0.18s ease, transform 0.18s ease,
    box-shadow 0.18s ease;
}

.btn:hover {
  background: var(--action-hover);
}

.btn:active {
  transform: scale(0.985);
}

.btn:disabled {
  cursor: default;
  opacity: 0.8;
}

/* Secondary, for use on the pastel ground. An ink tint rather than a white
   one. White all but vanishes on the lighter pastels (cyan, yellow). */
/* Solid green with the page ground showing through as the label. Bound to
   --hero-bg rather than --mint, so swapping the ground carries the button
   with it. */
.btn--glass {
  background: var(--green);
  color: var(--hero-bg);
  border: 1px solid var(--green);
}

.btn--glass:hover {
  background: var(--green-dark);
  border-color: var(--green-dark);
}

.btn--sm {
  min-height: var(--hit);
  padding: 0 var(--sp-16);
  font-size: var(--t-sm);
}
