/* The home page: one screen, never scrolls. The words in the top part, Turt's garden from
   the app in the bottom part (drawn by hero/hero.v7.js into the canvas). The whole page is the
   garden's sky for the visitor's hour (the canvas fills the window, behind the words), with a
   soft veil behind the words so they read on it at every hour. The colours for the hour are set
   by SlowPage.apply (index.html): --sky-*, --veil and data-sky="bright" or "dark" on <html>.
   The other pages use site.css only; nothing here reaches them. */
@font-face {
  font-family: "SlowHand";
  src: url("/assets/SlowHand-Bold.otf") format("opentype");
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #24392b;
  --muted: #4d6555;
  --green: #2f6b3e;
  --green-deep: #1f4b2b;
  --terracotta: #c95a3f;
  --field: #ffffff;
  --field-line: #b9cdb9;
  --error: #b23a22;
  --gutter: clamp(16px, 4vw, 48px);
}

* { box-sizing: border-box; }

html, body.home {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}
/* The sky, as the garden draws it: its top at the top of the window, its middle half-way down
   to the hills, the horizon's colour from the hills down. (Day until SlowPage has the hour; the
   garden sets where the hills are, --sky-horizon, once it is laid out.) */
html {
  --sky-top: #8CC0E5;
  --sky-middle: #B5D6EE;
  --sky-horizon-colour: #E6EBDA;
  --sky-horizon: 62vh;
  --veil: rgba(255, 250, 232, .45);
  background: var(--sky-top) linear-gradient(var(--sky-top), var(--sky-middle) calc(var(--sky-horizon) / 2), var(--sky-horizon-colour) var(--sky-horizon)) no-repeat;
  background-size: 100% 100%;
  min-height: 100%;
}
body.home { background: transparent; }

body.home {
  color: var(--ink);
  font: 16px/1.45 ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}

.home-main > * { min-width: 0; }
.home-main {
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

/* The words. Sized off the window's height as well as its width, so they always fit above
   the garden, which keeps (about) the bottom half. */
.intro {
  position: relative;
  z-index: 1;
  padding: max(env(safe-area-inset-top), clamp(12px, 3.2vh, 40px)) max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left));
  max-width: 76rem;
}

.brand-row { display: flex; align-items: center; gap: clamp(8px, 1.4vh, 12px); }
.brand-icon {
  width: clamp(30px, 5vh, 44px);
  height: auto;
  aspect-ratio: 1;
  border-radius: 23%;
  box-shadow: 0 1px 3px rgba(31, 75, 43, .25);
}
.brand-name {
  font-family: SlowHand, ui-rounded, cursive;
  font-weight: 700;
  color: var(--green);
  font-size: clamp(20px, 3.6vh, 28px);
  line-height: 1;
}

/* Only the app's name is in the handwriting; the words are in the page's own type. */
.tagline {
  font-family: inherit;
  font-weight: 800;
  color: var(--green);
  font-size: min(clamp(22px, 6.1vw, 54px), 5.6vh);
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: clamp(8px, 2.2vh, 24px) 0 clamp(4px, 1.1vh, 12px);
}
.tagline em { font-style: normal; color: var(--terracotta); }
.tagline span { display: inline-block; max-width: 100%; text-wrap: balance; }

.lead {
  color: var(--muted);
  font-size: min(clamp(14px, 2.4vh, 19px), max(14px, 4.2vw));
  margin: 0;
  max-width: 38rem;
}

.soon {
  margin: clamp(6px, 1.8vh, 18px) 0 clamp(4px, 1vh, 10px);
  font-weight: 700;
  font-size: min(clamp(13px, 2.1vh, 16px), 16px);
  color: var(--green);
}

/* Tell me when it's out. */
.notify { margin: 0; max-width: 30rem; }
.notify-row { display: flex; gap: 8px; }
.notify input[type="email"] {
  flex: 1 1 auto;
  min-width: 0;
  /* (16px: iOS does not zoom into the page when the field gets the focus.) */
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--field);
  border: 1.5px solid var(--field-line);
  border-radius: 999px;
  height: clamp(36px, 5.6vh, 44px);
  padding: 0 16px;
  outline: none;
}
.notify input[type="email"]::placeholder { color: var(--muted); opacity: .7; }
.notify input[type="email"]:focus-visible { border-color: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 25%, transparent); }
.notify input[aria-invalid="true"] { border-color: var(--error); }
.notify button {
  flex: 0 0 auto;
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  background: #2f6b3e;
  border: 0;
  border-radius: 999px;
  height: clamp(36px, 5.6vh, 44px);
  padding: 0 18px;
  cursor: pointer;
  box-shadow: 0 2px 0 #1f4b2b;
  white-space: nowrap;
}
.notify button:hover { background: #2a6038; }
.notify button:focus-visible { outline: 3px solid color-mix(in srgb, #2f6b3e 45%, transparent); outline-offset: 2px; }
.notify button[disabled] { opacity: .7; cursor: progress; }
.consent, .status {
  margin: clamp(4px, .9vh, 8px) 0 0 4px;
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--muted);
}
.consent a { color: var(--green); text-underline-offset: 2px; }
.status:empty { display: none; }
.status.error { color: var(--error); font-weight: 600; }
.status.ok { color: var(--green); font-weight: 700; }
.notify.has-status .consent { display: none; }
.notify.done .notify-row { display: none; }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Turt's garden: laid out in the scene's box, drawn over the whole window (its sky is the
   page's), behind the words. */
.scene { position: relative; min-height: 0; }
.scene canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }

/* The veil behind the words: the hour's dark (or, under a bright sky, a pale haze), full behind
   the paragraph and the form, thinning out to nothing to the right and below, no edge anywhere. */
.intro::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 auto -120px 0;
  width: 82rem;
  max-width: 100vw;
  background: var(--veil);
  /* (Solid past the paragraph's and the form's measure, then thinning out over the tagline's.) */
  --fade: #000 0, #000 44rem, rgba(0, 0, 0, .8) 50rem, rgba(0, 0, 0, .5) 58rem, rgba(0, 0, 0, .22) 66rem, rgba(0, 0, 0, .06) 72rem, transparent 78rem;
  -webkit-mask-image: linear-gradient(to right, var(--fade)), linear-gradient(to bottom, #000 0%, #000 76%, rgba(0, 0, 0, .75) 83%, rgba(0, 0, 0, .4) 90%, rgba(0, 0, 0, .12) 96%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, var(--fade)), linear-gradient(to bottom, #000 0%, #000 76%, rgba(0, 0, 0, .75) 83%, rgba(0, 0, 0, .4) 90%, rgba(0, 0, 0, .12) 96%, transparent 100%);
  mask-composite: intersect;
  pointer-events: none;
}

/* Narrow windows: the button goes under the field. */
@media (max-width: 420px) {
  .notify button { padding: 0 14px; font-size: 14px; }
}

/* Short windows on their side: the words on as few lines as they fit. */
@media (max-height: 560px) and (min-width: 600px) {
  .intro { padding-top: 10px; }
  .tagline { font-size: min(26px, 5.8vh); margin: 6px 0 4px; }
  .lead { font-size: 14px; line-height: 1.4; max-width: 44rem; }
  .soon { margin: 6px 0 4px; font-size: 13px; }
}

/* The words come in one after another as the garden starts. */
@media (prefers-reduced-motion: no-preference) {
  /* (The veil comes in with the words, so it is never an empty smudge.) */
  .anim .intro::before { animation: veil 2s ease-in-out .3s both; }
  .anim .brand-row { animation: rise .7s ease-out .15s both; }
  .anim .tag-a { animation: write 1s cubic-bezier(.3, .7, .3, 1) .7s both; }
  .anim .tag-b { animation: write 1s cubic-bezier(.3, .7, .3, 1) 1.5s both; }
  .anim .lead { animation: rise .8s ease-out 2.5s both; }
  .anim .soon, .anim .notify { animation: rise .8s ease-out 3s both; }
}
@keyframes veil { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes write {
  from { opacity: 0; clip-path: inset(-40% 100% -40% -5%); transform: translateY(3px); }
  to { opacity: 1; clip-path: inset(-40% -10% -40% -5%); transform: none; }
}

/* The app's onboarding and App Store lettering (GrassText in App/Sources/TurtIntro.swift):
   cream letters, a solid dark green edge all round, a soft shadow, and the accent word in
   terracotta. It reads on the sky at every hour. */
:root { --letter: #FFF8E4; --rim: #284E22; --accent: #D87A5A; }
.brand-name, .tagline {
  color: var(--letter);
  text-shadow: 0.060em 0.000em 0 var(--rim), 0.055em 0.023em 0 var(--rim), 0.042em 0.042em 0 var(--rim), 0.023em 0.055em 0 var(--rim), 0.000em 0.060em 0 var(--rim), -0.023em 0.055em 0 var(--rim), -0.042em 0.042em 0 var(--rim), -0.055em 0.023em 0 var(--rim), -0.060em 0.000em 0 var(--rim), -0.055em -0.023em 0 var(--rim), -0.042em -0.042em 0 var(--rim), -0.023em -0.055em 0 var(--rim), -0.000em -0.060em 0 var(--rim), 0.023em -0.055em 0 var(--rim), 0.042em -0.042em 0 var(--rim), 0.055em -0.023em 0 var(--rim), 0.030em 0.000em 0 var(--rim), 0.021em 0.021em 0 var(--rim), 0.000em 0.030em 0 var(--rim), -0.021em 0.021em 0 var(--rim), -0.030em 0.000em 0 var(--rim), -0.021em -0.021em 0 var(--rim), -0.000em -0.030em 0 var(--rim), 0.021em -0.021em 0 var(--rim), 0.02em 0.08em 0.1em rgba(24, 48, 20, .4);
}
.tagline em { color: var(--accent); }
.tagline { line-height: 1.2; }

/* The rest of the words in the same set: the lettering's dark green on the white page, the
   paragraph a softer green-grey, and on the dark page pale versions of the same. The one
   button is the cardboard house's yellow (sampled from decor_house_cardboard: #E9C45C), with
   the lettering's green on it and a darker yellow edge under it, like the app's buttons. */
:root {
  --ink: #284E22;
  --muted: #2F4A2B;
  --green: #284E22;
  --error: #9E2A14;
  --house: #E9C45C;
  --house-hi: #F1D27A;
  --house-edge: #A88228;
  --field: #FFF8E4;
  --field-line: rgba(40, 78, 34, .35);
}
/* Under a dark sky (dusk, night, before sunrise): the light words of the lettering. The field
   stays the lettering's cream, the button the house's yellow, at every hour. */
:root[data-sky="dark"] {
  --ink: #FFF8E4;
  --muted: #F1EBDA;
  --green: #E9C45C;
  --error: #FFB4A1;
  --field-line: rgba(255, 248, 228, .55);
}
.notify input[type="email"] { color: #284E22; box-shadow: 0 1px 2px rgba(14, 20, 44, .18); }
.notify input[type="email"]::placeholder { color: #5C6B55; opacity: 1; }
.soon { color: var(--green); }
.consent a { color: var(--green); font-weight: 600; }
.status.ok { color: var(--green); }
.notify input[type="email"]:focus-visible { border-color: var(--rim); box-shadow: 0 0 0 3px color-mix(in srgb, var(--house) 70%, transparent); }
.notify button {
  color: var(--rim);
  background: var(--house);
  box-shadow: 0 3px 0 var(--house-edge);
  transition: background-color .15s, transform .08s, box-shadow .08s;
}
.notify button:hover { background: var(--house-hi); }
.notify button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--house-edge); }
.notify button:focus-visible { outline: 3px solid var(--rim); outline-offset: 3px; }
:root[data-sky="dark"] .notify button:focus-visible { outline-color: var(--house-hi); }
