/* ========================================================================
   ant-garden.css — Aunt Martha's Ant Garden, standalone.
   A night-garden storybook: the site's cosmic dark base with the app's
   leaf green as the one accent. Deliberately does NOT import the parent
   site's styles.css.

   Contrast contract (verified pairs):
   - ink #F3F0FA and ink2 #BDB7D3 on #0F0C1F / #123423 / card #1A1535: >= 9:1
   - green TEXT is #8CDC94 (>= 9:1 on every surface here). #4A9E50 is a
     FILL and ring colour only; button ink #0F0C1F on #4A9E50 is >= 5.5:1.
   Earth tones appear only inside the real captures.
   ======================================================================== */

:root {
  --bg: #0F0C1F;
  --bg-2: #171230;
  --card: #1A1535;
  --card-2: #211B44;
  --ink: #F3F0FA;
  --ink-2: #BDB7D3;
  --leaf: #4A9E50;
  --leaf-text: #8CDC94;
  --leaf-deep: #123423;
  --rule: rgba(140, 220, 148, 0.24);
  --fredoka: 'Fredoka', 'Inter Tight', system-ui, sans-serif;
  --sans: 'Inter Tight', system-ui, -apple-system, sans-serif;
  --motion-fast: 120ms;
  --motion-standard: 220ms;
  --motion-emphasis: 360ms;
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); }
html[data-motion="full"] { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: clip;
}

::selection { background: var(--leaf); color: var(--bg); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }
p { margin: 0; }

a { color: var(--leaf-text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--leaf-text);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap { max-width: 1120px; margin-inline: auto; padding-inline: clamp(16px, 4vw, 40px); }

.skip-link {
  position: absolute; inset-inline-start: 12px; top: -64px; z-index: 100;
  background: var(--leaf); color: var(--bg);
  font-family: var(--fredoka); font-weight: 600; font-size: 0.9375rem;
  padding: 12px 20px; border-radius: 999px; text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ---------- Night sky (stars; static, painted once) ---------- */

.sky {
  position: absolute; inset: 0 0 auto 0; height: 880px; z-index: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='640' height='440' viewBox='0 0 640 440'%3E%3Cg fill='%23F3F0FA'%3E%3Ccircle cx='38' cy='52' r='1.4' opacity='.7'/%3E%3Ccircle cx='121' cy='164' r='1' opacity='.5'/%3E%3Ccircle cx='203' cy='38' r='1.6' opacity='.8'/%3E%3Ccircle cx='288' cy='121' r='1' opacity='.45'/%3E%3Ccircle cx='356' cy='62' r='1.3' opacity='.65'/%3E%3Ccircle cx='431' cy='198' r='1.1' opacity='.5'/%3E%3Ccircle cx='502' cy='84' r='1.7' opacity='.8'/%3E%3Ccircle cx='583' cy='147' r='1' opacity='.45'/%3E%3Ccircle cx='71' cy='286' r='1.1' opacity='.45'/%3E%3Ccircle cx='166' cy='344' r='1.5' opacity='.6'/%3E%3Ccircle cx='254' cy='262' r='1' opacity='.4'/%3E%3Ccircle cx='327' cy='381' r='1.2' opacity='.5'/%3E%3Ccircle cx='418' cy='312' r='1.5' opacity='.6'/%3E%3Ccircle cx='549' cy='271' r='1' opacity='.4'/%3E%3Ccircle cx='611' cy='398' r='1.3' opacity='.5'/%3E%3C/g%3E%3Cg fill='%238CDC94'%3E%3Ccircle cx='97' cy='108' r='1.2' opacity='.5'/%3E%3Ccircle cx='392' cy='24' r='1.2' opacity='.5'/%3E%3Ccircle cx='474' cy='356' r='1.2' opacity='.4'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 640px 440px;
  -webkit-mask-image: linear-gradient(#000 35%, transparent);
          mask-image: linear-gradient(#000 35%, transparent);
}
header, main, footer { position: relative; z-index: 1; }

/* ---------- Type ---------- */

h1, h2, h3 { font-family: var(--fredoka); font-weight: 600; letter-spacing: -0.01em; margin: 0; overflow-wrap: break-word; }
h1 { font-size: clamp(2.5rem, 7vw, 4.75rem); line-height: 1.02; }
h2 { font-size: clamp(1.85rem, 4vw, 2.75rem); line-height: 1.1; }
h3 { font-size: 1.1875rem; line-height: 1.25; }
h2 em { font-style: normal; color: var(--leaf-text); }

.lede { font-size: 1.1875rem; color: var(--ink-2); max-width: 36rem; }

.chip {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--fredoka); font-weight: 500; font-size: 0.875rem; line-height: 1.3;
  color: var(--leaf-text);
  background: rgba(74, 158, 80, 0.12);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 7px 16px;
}
.chip .dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--leaf-text); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 12px 26px;
  font-family: var(--fredoka); font-weight: 500; font-size: 1rem;
  text-decoration: none; border-radius: 999px;
  background: var(--leaf); color: var(--bg);
  border: 1.5px solid var(--leaf);
  box-shadow: 0 8px 24px -6px rgba(74, 158, 80, 0.5);
}
.btn:hover { background: var(--leaf-text); border-color: var(--leaf-text); color: var(--bg); }
.btn-ghost { background: transparent; color: var(--leaf-text); border-color: var(--rule); box-shadow: none; }
.btn-ghost:hover { background: rgba(140, 220, 148, 0.1); color: var(--ink); border-color: var(--leaf-text); }
html[data-motion="full"] .btn { transition: background-color var(--motion-standard) var(--ease-standard), border-color var(--motion-standard) var(--ease-standard), transform var(--motion-standard) var(--ease-standard); }
html[data-motion="full"] .btn:hover { transform: translateY(-2px); }
.btn:active { filter: brightness(0.9); }

/* ---------- Masthead ---------- */

.mast {
  display: flex; align-items: center; flex-wrap: wrap; gap: 14px;
  max-width: 1120px; margin-inline: auto;
  padding: 16px clamp(16px, 4vw, 40px);
}
.mark {
  display: inline-flex; align-items: center; gap: 12px; min-height: 44px;
  font-family: var(--fredoka); font-weight: 600; font-size: 1.125rem;
  color: var(--ink); text-decoration: none;
}
.mark img { width: 36px; height: 36px; border-radius: 9px; }
.mast-end { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 8px; }
.mast-link {
  display: inline-flex; align-items: center; min-height: 44px; padding-inline: 14px;
  font-family: var(--fredoka); font-weight: 500; font-size: 0.9375rem; text-decoration: none; color: var(--ink-2);
}
.mast-link:hover { color: var(--ink); }

.motion-toggle {
  flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px;
  font-family: var(--fredoka); font-weight: 500; font-size: 0.8125rem;
  color: var(--ink); background: transparent;
  border: 1.5px solid var(--rule); border-radius: 999px; cursor: pointer;
}
.motion-toggle:hover { border-color: var(--leaf-text); }
.motion-toggle[hidden] { display: none; }
.motion-toggle .ico { flex: none; fill: currentColor; }
.motion-toggle .ico-play, .motion-toggle[data-state="paused"] .ico-pause { display: none; }
.motion-toggle[data-state="paused"] .ico-play { display: block; }
@media (max-width: 560px) {
  .motion-toggle { width: 44px; padding: 0; }
  .motion-toggle .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* ---------- Hero ---------- */

.hero { position: relative; padding-block: clamp(16px, 4vw, 40px) clamp(28px, 5vw, 56px); }
.hero::before {
  content: ""; position: absolute; inset: -40px 0 0 0; pointer-events: none;
  background: radial-gradient(52% 62% at 70% 46%, rgba(74, 158, 80, 0.24), transparent 72%);
}
.hero-grid { position: relative; display: grid; gap: clamp(28px, 5vw, 48px); align-items: center; }
@media (min-width: 960px) {
  .hero-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
}
.hero-copy { display: grid; gap: 18px; justify-items: start; }
.hero-copy h1 { margin-top: 6px; }
.hero-copy .pre { display: block; font-size: 0.5em; line-height: 1.1; color: var(--ink-2); font-weight: 500; margin-bottom: 0.18em; }
.hero-copy .main { color: var(--leaf-text); }
.tagline { font-family: var(--fredoka); font-weight: 500; font-size: clamp(1.3rem, 2.6vw, 1.75rem); line-height: 1.25; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }

/* ---------- Captures: the green picture frame ---------- */

.shot { margin: 0; }
.shot figcaption { margin-top: 14px; font-size: 0.875rem; color: var(--ink-2); text-align: center; }
/* The app's own green frame is part of the capture; the page adds the glow and ring. */
.hero-frame img, .see-frame img {
  width: 100%; aspect-ratio: 1600 / 1226;
  border-radius: 5.2% / 6.8%;
  box-shadow: 0 0 0 2px rgba(74, 158, 80, 0.7), 0 28px 70px -18px rgba(74, 158, 80, 0.4), 0 18px 40px rgba(0, 0, 0, 0.5);
}
/* Captures with no frame of their own get one: the app's green case. */
.pframe {
  --pf: clamp(8px, 1.5vw, 14px);
  padding: var(--pf);
  border-radius: 26px;
  background: linear-gradient(155deg, #63BB68, #3F8E47 52%, #2C6E36);
  box-shadow: inset 0 0 0 2px rgba(15, 12, 31, 0.35), inset 0 0 0 5px rgba(255, 255, 255, 0.14), 0 28px 70px -18px rgba(74, 158, 80, 0.4), 0 18px 40px rgba(0, 0, 0, 0.5);
}
.pframe img {
  width: 100%; aspect-ratio: 1600 / 1206;
  border-radius: 14px; box-shadow: 0 0 0 3px #14502A;
}

/* ---------- Ant trail divider ---------- */

.trail { position: relative; height: 190px; overflow: hidden; margin-top: -2px; line-height: 0; }
.trail-inner { position: absolute; inset-block: 0; inset-inline-start: 50%; width: 2400px; transform: translateX(-50%); }
html[dir="rtl"] .trail-inner { inset-inline-start: auto; inset-inline-end: 50%; transform: translateX(50%); }
.trail .hills { position: absolute; inset: 0; display: block; max-width: none; }
.ant {
  position: absolute; left: 0; top: 0; width: 54px; height: 27px; display: block;
  offset-path: path("M0 104C160 74 330 66 500 90S820 134 1000 112S1360 62 1560 84S1960 128 2160 106S2330 86 2400 92");
  offset-anchor: 50% 50%;
  offset-rotate: auto;
  offset-distance: var(--at, 40%);
}
.ant svg { display: block; width: 100%; height: 100%; overflow: visible; }
.ant .body { fill: #A63A31; stroke: #E8957A; stroke-width: 0.5; }
.ant .legs { stroke: #C45A45; stroke-width: 0.8; stroke-linecap: round; fill: none; }
.ant .ant-feel { stroke: #C45A45; stroke-width: 0.7; stroke-linecap: round; fill: none; }
@media (max-width: 760px) { .ant { offset-distance: var(--at-n, var(--at, 50%)); } }
@supports not (offset-path: path("M0 0")) { .ant { display: none; } }

html[data-motion="full"] .ant { animation: ag-walk var(--dur, 100s) linear infinite; animation-delay: var(--delay, 0s); }
html[data-motion="full"] .ant .la { animation: ag-step 0.7s ease-in-out infinite alternate; }
html[data-motion="full"] .ant .lb { animation: ag-step 0.7s ease-in-out infinite alternate-reverse; }
@keyframes ag-walk { from { offset-distance: 0%; } to { offset-distance: 100%; } }
@keyframes ag-step { from { transform: translateX(-1.2px); } to { transform: translateX(1.2px); } }

/* ---------- Ground: the earth the ants walk on fades back to night ---------- */

.ground { position: relative; padding-block: clamp(32px, 5.5vw, 64px); }
.idea { background: linear-gradient(var(--leaf-deep), var(--bg) 460px); padding-top: clamp(32px, 5vw, 56px); }
.closing { background: linear-gradient(var(--leaf-deep), var(--bg) 520px); padding-top: clamp(40px, 6vw, 72px); }

.sec-head { display: grid; gap: 16px; justify-items: start; margin-bottom: clamp(28px, 5vw, 48px); }
.colony .sec-head, .see .sec-head { margin-bottom: 28px; }

/* ---------- Idea cards ---------- */

.cards { display: grid; gap: 16px; }
@media (min-width: 640px) { .cards-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .cards-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 22px;
  padding: 24px 22px 26px;
  display: grid; gap: 10px; align-content: start;
}
.card p { color: var(--ink-2); font-size: 1rem; }
.ico-card {
  width: 44px; height: 44px; padding: 10px; margin-bottom: 6px;
  border-radius: 14px; background: rgba(74, 158, 80, 0.16);
  fill: none; stroke: var(--leaf-text); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- Steps ---------- */

.steps { display: grid; gap: 16px; counter-reset: none; }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.step {
  position: relative;
  display: grid; gap: 10px; align-content: start;
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--rule);
  border-radius: 26px 26px 22px 22px;
  padding: 26px 22px 24px;
}
.step p { color: var(--ink-2); }
.num {
  display: inline-grid; place-items: center;
  width: 48px; height: 48px; border-radius: 50%;
  font-family: var(--fredoka); font-weight: 600; font-size: 1.5rem; line-height: 1;
  background: var(--leaf); color: var(--bg);
  box-shadow: 0 0 0 5px rgba(74, 158, 80, 0.2);
  margin-bottom: 6px;
}
.moods { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.moods li {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--fredoka); font-weight: 500; font-size: 0.8125rem;
  color: var(--leaf-text);
  border: 1px solid var(--rule); border-radius: 999px; padding: 4px 12px 4px 8px;
}
.moods svg { width: 14px; height: 14px; fill: var(--leaf-text); }

/* ---------- Colony + night ---------- */

.colony-grid, .see-grid { display: grid; gap: clamp(28px, 5vw, 56px); align-items: center; }
@media (min-width: 960px) {
  .colony-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .see-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
}
@media (max-width: 959px) { .see-copy { order: -1; } }
.notes { display: grid; gap: 14px; }
.notes li {
  color: var(--ink-2);
  padding-inline-start: 18px;
  border-inline-start: 3px solid var(--leaf);
}
.notes strong { color: var(--ink); font-family: var(--fredoka); font-weight: 600; }

/* ---------- Closing frame ---------- */

.closing-frame { max-width: 640px; margin-inline: auto; }
.closing-card {
  display: grid; justify-items: center; gap: 12px; text-align: center;
  padding: clamp(28px, 5vw, 48px) clamp(18px, 4vw, 40px);
  border-radius: 14px;
  background: radial-gradient(90% 80% at 50% 0%, #1F1946, var(--bg));
  box-shadow: 0 0 0 3px #14502A;
}
.closing-card img { width: 112px; height: 112px; border-radius: 26px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5); margin-bottom: 6px; }
.status { font-family: var(--fredoka); font-weight: 500; font-size: 1.1875rem; color: var(--leaf-text); }
.closing-card .quiet { color: var(--ink-2); }
.contact { margin-top: 8px; color: var(--ink-2); overflow-wrap: anywhere; }
.contact a { display: inline-block; padding-block: 10px; }

/* ---------- Footer ---------- */

.foot { background: var(--bg); border-top: 1px solid var(--rule); padding-block: 28px 40px; }
.foot-inner { display: grid; gap: 12px; }
@media (min-width: 860px) { .foot-inner { grid-template-columns: auto 1fr; align-items: center; } .foot-links { justify-content: flex-end; } }
.legal { color: var(--ink-2); font-size: 0.9375rem; }
.foot-links { display: flex; flex-wrap: wrap; gap: 0 6px; }
.foot-links a {
  display: inline-flex; align-items: center; min-height: 44px; padding-inline: 10px;
  font-size: 0.9375rem; color: var(--ink-2);
}
.foot-links a:hover { color: var(--ink); }

/* ---------- Scroll reveal: opt-in, armed by the script only under full motion ---------- */

html.ag-reveal[data-motion="full"] .rise:not(.in) { opacity: 0; transform: translateY(18px); }
html.ag-reveal[data-motion="full"] .rise {
  transition: opacity var(--motion-emphasis) var(--ease-standard), transform var(--motion-emphasis) var(--ease-standard);
}

/* ---------- Reduced motion (second guard; the first is data-motion) ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ant, .ant .la, .ant .lb { animation: none !important; }
  .rise { opacity: 1 !important; transform: none !important; }
  :root { --motion-fast: 0ms; --motion-standard: 0ms; --motion-emphasis: 0ms; }
}

/* ---------- Cross-document view transition (hero morph from the home page) ---------- */

@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  html:not(:active-view-transition-type(paw)) .hero-frame { view-transition-name: hero-work; }
  ::view-transition-old(hero-work),
  ::view-transition-new(hero-work) { animation-duration: var(--motion-emphasis); }
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) { animation: none !important; }
}

/* ---------- Forced colors ---------- */

@media (forced-colors: active) {
  .btn, .skip-link { border: 1px solid ButtonText; }
  .card, .step, .chip, .moods li { border-color: CanvasText; }
  .pframe { border: 3px solid CanvasText; }
}
