/*
 * aiflower — the portal.
 *
 * The palette is the app's, verbatim from
 * `app/src/main/java/com/aiflower/app/ui/theme/Color.kt`: the page is the dark
 * of a specimen cabinet and the text is label-card bone. Green, honey and clay
 * are spent on meaning — fine, coming due, overdue — and never on decoration.
 *
 * The one light surface on the page is the herbarium sheet, because a sheet is
 * paper. Anything sitting on it needs the deepened variants below; the bright
 * care colours are tuned for the dark and go muddy on bone.
 */

:root {
  /* the cabinet */
  --ink:       #0D110F;
  --bark:      #151B17;
  --slate:     #232C26;
  --chalk:     #E9E7DD;
  --chalk-dim: #9AA298;

  /* care states, on the dark */
  --fern:  #8CC77C;
  --honey: #D8A64A;
  --clay:  #C97456;

  /* the sheet, and care states legible on it (all >= 5:1 on --paper) */
  --paper:      #E9E7DD;
  --paper-edge: #CFCABA;
  --paper-dim:  #6D6A5E;
  --fern-deep:  #3E6B33;
  --honey-deep: #7A5410;
  --clay-deep:  #8E402A;
  --specimen:   #4C6B47;   /* SpecimenTints[0] — pressed-foliage green */

  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body:    "Karla", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --label:   "Courier Prime", ui-monospace, "Courier New", monospace;

  --wonk: "SOFT" 24, "WONK" 1;

  --shell: 68rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --hair: 1px solid var(--slate);
}

/* ── base ─────────────────────────────────────────────────────────────── */

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

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--chalk);
  font: 400 1.0625rem/1.65 var(--body);
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

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

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

/* Read aloud, never drawn — the strikethrough carries "was" for everyone else. */
.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: var(--gutter);
  top: 0.75rem;
  z-index: 10;
  padding: 0.5rem 0.9rem;
  background: var(--fern);
  color: var(--ink);
  font: 700 0.8rem/1 var(--label);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* ── typographic roles ────────────────────────────────────────────────── */

.eyebrow {
  margin: 0 0 1.25rem;
  font: 400 0.72rem/1 var(--label);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--fern);
}

.section__title {
  margin: 0;
  max-width: 22ch;
  font-family: var(--display);
  font-variation-settings: var(--wonk);
  font-weight: 600;
  font-size: clamp(1.85rem, 3.6vw, 2.7rem);
  line-height: 1.08;
  letter-spacing: -0.018em;
  text-wrap: balance;
}

.section__lead {
  margin: 1.5rem 0 0;
  max-width: 58ch;
  color: var(--chalk-dim);
}

.lead {
  margin: 1.5rem 0 0;
  max-width: 46ch;
  font-size: clamp(1.05rem, 1.4vw, 1.22rem);
  color: var(--chalk-dim);
}

/* ── masthead ─────────────────────────────────────────────────────────── */

.masthead {
  border-bottom: var(--hair);
  background: color-mix(in srgb, var(--ink) 88%, transparent);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.masthead__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 3.75rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.brand__mark { width: 1.6rem; height: 1.6rem; }

.brand__name {
  font: 400 0.82rem/1 var(--label);
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.masthead__nav {
  display: flex;
  gap: clamp(0.9rem, 2.5vw, 1.9rem);
  font: 400 0.72rem/1 var(--label);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.masthead__nav a {
  color: var(--chalk-dim);
  text-decoration: none;
  padding-block: 0.4rem;
  transition: color 0.15s ease;
}

.masthead__nav a:hover { color: var(--fern); }

/* Marked rather than counted by position: the document pages carry a
   different nav, and "hide the third link" quietly hid the one that deletes
   an account on a phone — which is the page most likely to be opened on one. */
@media (max-width: 40rem) {
  .masthead__nav a.is-optional { display: none; }
}

/* ── sections ─────────────────────────────────────────────────────────── */

.section { padding-block: clamp(4rem, 8.5vw, 7rem); }

.section--hero { padding-block: clamp(3.5rem, 7vw, 6rem) clamp(4rem, 8.5vw, 7rem); }

.section--ruled { border-top: var(--hair); }

.section--how {
  border-top: var(--hair);
  background:
    radial-gradient(120% 60% at 50% 0%, #12181400 0%, #0000 70%),
    var(--bark);
}

.section--close {
  border-top: var(--hair);
  text-align: center;
}

/* ── hero ─────────────────────────────────────────────────────────────── */

.hero {
  display: grid;
  gap: clamp(3rem, 6vw, 4.5rem);
  align-items: center;
}

@media (min-width: 60rem) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 24rem); }
}

.hero__title {
  margin: 0;
  font-family: var(--display);
  font-variation-settings: var(--wonk);
  font-weight: 600;
  font-size: clamp(2.5rem, 6.2vw, 4.15rem);
  line-height: 1.02;
  letter-spacing: -0.028em;
  text-wrap: balance;
}

/* ── the herbarium sheet ──────────────────────────────────────────────── */

.sheet {
  position: relative;
  /* A standard herbarium sheet is 29 × 42 cm. Capped and centred, because at
     full shell width that ratio makes a very tall rectangle. The explicit
     width matters: auto inline margins alone would turn off the grid item's
     stretch, and everything on the sheet is out of flow, so it would collapse
     to nothing. */
  width: 100%;
  max-width: 24rem;
  margin: 0 auto;
  aspect-ratio: 0.7;
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  box-shadow:
    0 1.5rem 3.5rem #00000066,
    0 0 0 0.5rem #ffffff05;
  padding: 1.1rem;
}

/* The inner rule a mounting sheet is printed with. */
.sheet::before {
  content: "";
  position: absolute;
  inset: 0.6rem;
  border: 1px solid color-mix(in srgb, var(--paper-edge) 70%, transparent);
  pointer-events: none;
}

.sheet__stamp {
  position: absolute;
  top: 1.6rem;
  left: 1.6rem;
  margin: 0;
  font: 700 0.62rem/1.5 var(--label);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: color-mix(in srgb, var(--specimen) 70%, transparent);
  border: 1px solid currentColor;
  padding: 0.35rem 0.5rem;
  rotate: -3deg;
}

.sheet__stamp span { font-weight: 400; letter-spacing: 0.14em; }

/* Mounted high on the sheet, clear of the determination label — the label
   corner is reserved, the way it is on a real sheet. */
.sheet__specimen {
  position: absolute;
  top: 40%;
  left: 50%;
  translate: -50% -50%;
  width: 52%;
  height: auto;
}

/* ── determination slips ──────────────────────────────────────────────── */

.slip {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--paper-edge);
  padding: 0.85rem 1rem 1rem;
}

.slip--pinned {
  position: absolute;
  right: 1.35rem;
  bottom: 1.35rem;
  width: min(15rem, 78%);
  box-shadow: 0 0.4rem 1rem #0000002e;
  rotate: 0.8deg;
}

.slip__head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
  align-items: baseline;
  padding-bottom: 0.5rem;
  margin-bottom: 0.7rem;
  border-bottom: 1px solid var(--paper-edge);
  font: 400 0.66rem/1.2 var(--label);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--paper-dim);
}

.slip__mark { font-weight: 700; color: var(--specimen); }
.slip__by { margin-left: auto; }

.slip__name {
  margin: 0;
  font-family: var(--display);
  font-variation-settings: var(--wonk);
  font-weight: 500;
  font-size: 1.22rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

/* Binomial nomenclature is set in italic — the one place the display face
   earns an italic on this page. */
.slip__name em { font-style: italic; }

.slip__none {
  margin: 0.35rem 0 0;
  font: 400 0.72rem/1.4 var(--label);
  color: var(--paper-dim);
}

.plan {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  font: 400 0.78rem/1.5 var(--label);
}

.plan li {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding-block: 0.2rem;
}

/* Leader dots: a printed care card, not a table. */
.plan__what { flex: 0 1 auto; }
.plan li::after {
  content: "";
  order: 1;
  flex: 1 1 auto;
  min-width: 1rem;
  height: 0;
  border-bottom: 1px dotted color-mix(in srgb, var(--paper-dim) 55%, transparent);
  translate: 0 -0.2rem;
}
.plan__when {
  order: 2;
  font-weight: 700;
  color: var(--fern-deep);
  white-space: nowrap;
}

.plan__when s {
  font-weight: 400;
  color: var(--paper-dim);
  margin-left: 0.35rem;
}

.plan__when.is-changed { color: var(--specimen); }
.plan__when.is-due     { color: var(--honey-deep); }
.plan__when.is-overdue { color: var(--clay-deep); }

/* ── the stack ────────────────────────────────────────────────────────── */

.stack {
  list-style: none;
  margin: clamp(2.5rem, 5vw, 3.75rem) 0 0;
  padding: 0;
  max-width: 46rem;
}

/* Later determinations sit on top of earlier ones, exactly as they do on a
   re-determined sheet. The overlap eats padding, never text. */
.stack .slip {
  position: relative;
  z-index: var(--i);
  padding: 1.1rem 1.35rem 1.5rem;
  rotate: var(--rot, 0deg);
  box-shadow: 0 0.75rem 1.75rem #00000047;
}

.stack .slip + .slip { margin-top: -0.9rem; }

.stack .slip:nth-child(odd)  { --rot: -0.45deg; }
.stack .slip:nth-child(even) { --rot: 0.5deg; }

.slip__body {
  display: grid;
  gap: 1rem 2rem;
}

@media (min-width: 46rem) {
  .slip__body { grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); }
  .slip__note {
    border-left: 1px solid var(--paper-edge);
    padding-left: 2rem;
  }
}

.slip__note h3 {
  margin: 0 0 0.4rem;
  font-family: var(--display);
  font-variation-settings: var(--wonk);
  font-weight: 600;
  font-size: 1.02rem;
  line-height: 1.25;
}

.slip__note p {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.6;
  color: #3B3A33;
}

/* Settle onto the sheet on first sight. */
.js .stack .slip {
  opacity: 0;
  translate: 0 1.25rem;
  transition: opacity 0.5s ease, translate 0.5s cubic-bezier(0.2, 0.7, 0.3, 1);
  transition-delay: calc(var(--i) * 70ms);
}

.js .stack .slip.is-settled {
  opacity: 1;
  translate: 0 0;
}

/* ── what it does ─────────────────────────────────────────────────────── */

.does {
  display: grid;
  gap: 2.25rem;
  margin-top: clamp(2.25rem, 4.5vw, 3.25rem);
}

@media (min-width: 46rem) {
  .does { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem; }
}

.does__item { border-top: 1px solid var(--fern); padding-top: 1.1rem; }

.does__title {
  margin: 0 0 0.6rem;
  font-family: var(--display);
  font-variation-settings: var(--wonk);
  font-weight: 600;
  font-size: 1.15rem;
  line-height: 1.25;
}

.does__item p { margin: 0; color: var(--chalk-dim); font-size: 0.97rem; }

.state { font-weight: 700; }
.state--fine { color: var(--fern); }
.state--due  { color: var(--honey); }
.state--over { color: var(--clay); }

/* ── where it lives ───────────────────────────────────────────────────── */

.facts { margin: clamp(2.25rem, 4.5vw, 3.25rem) 0 0; }

.facts__row {
  display: grid;
  gap: 0.5rem 2.5rem;
  padding-block: 1.6rem;
  border-top: var(--hair);
}

.facts__row:last-child { border-bottom: var(--hair); }

@media (min-width: 52rem) {
  .facts__row { grid-template-columns: minmax(0, 17rem) minmax(0, 1fr); }
}

.facts dt {
  font-family: var(--display);
  font-variation-settings: var(--wonk);
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.3;
}

.facts dd { margin: 0; color: var(--chalk-dim); font-size: 0.97rem; }

/* ── call to action ───────────────────────────────────────────────────── */

.cta { margin-top: 2.5rem; }
.cta--centred { display: flex; flex-direction: column; align-items: center; }

.button {
  display: inline-block;
  background: var(--fern);
  color: var(--ink);
  text-decoration: none;
  padding: 0.9rem 1.6rem;
  font: 700 0.78rem/1 var(--label);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  border: 1px solid var(--fern);
  transition: background 0.15s ease, color 0.15s ease;
}

.button:hover {
  background: transparent;
  color: var(--fern);
}

.cta__note {
  margin: 0.9rem 0 0;
  font: 400 0.76rem/1.5 var(--label);
  color: var(--chalk-dim);
}

.close__title {
  margin: 0 auto;
  max-width: 18ch;
  font-family: var(--display);
  font-variation-settings: var(--wonk);
  font-weight: 600;
  font-size: clamp(1.85rem, 4.2vw, 2.85rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

/* ── footer ───────────────────────────────────────────────────────────── */

.footer {
  border-top: var(--hair);
  padding-block: 2.25rem 3rem;
}

.footer__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  justify-content: space-between;
  font: 400 0.72rem/1.6 var(--label);
  color: var(--chalk-dim);
}

.footer p { margin: 0; }
.footer__fine { color: color-mix(in srgb, var(--chalk-dim) 75%, var(--ink)); }

/* ── reduced motion ───────────────────────────────────────────────────── */

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

/* ── document pages ───────────────────────────────────────────────────── */
/*
 * Privacy, terms, and the two pages that do something: joining and leaving.
 *
 * One measure, one column, and the same cabinet the front page is lit in. A
 * privacy policy that looks like it came from somewhere else is a privacy
 * policy nobody believes belongs to the thing they just installed — and these
 * are the pages a Play Store listing points at, so they are read by people
 * deciding whether to trust the app at all.
 */

.doc { max-width: 44rem; }

.doc__meta {
  margin: 1rem 0 0;
  font: 400 0.72rem/1.6 var(--label);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--chalk-dim);
}

.doc h2 {
  margin: 3rem 0 0;
  font-family: var(--display);
  font-variation-settings: var(--wonk);
  font-weight: 600;
  font-size: 1.3rem;
  line-height: 1.2;
  letter-spacing: -0.012em;
}

.doc h3 {
  margin: 2rem 0 0;
  font-size: 1rem;
  font-weight: 700;
}

.doc p, .doc li { color: var(--chalk-dim); }
.doc p { margin: 1rem 0 0; }
.doc ul { margin: 1rem 0 0; padding-left: 1.2rem; }
.doc li { margin-top: 0.5rem; }
.doc li::marker { color: var(--fern); }
.doc a { color: var(--fern); }
.doc strong { color: var(--chalk); }

/* The one thing on these pages that must not be skimmed past. */
.doc__callout {
  margin: 2rem 0 0;
  padding: 1.25rem 1.4rem;
  border: 1px solid var(--slate);
  border-left: 3px solid var(--honey);
  background: var(--bark);
}
.doc__callout p:first-child { margin-top: 0; }

/* ── forms ────────────────────────────────────────────────────────────── */

.form { margin-top: 2.5rem; max-width: 30rem; }

.field { margin-top: 1.5rem; }

.field > label {
  display: block;
  font: 400 0.7rem/1.6 var(--label);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--chalk-dim);
}

.field__hint {
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
  color: color-mix(in srgb, var(--chalk-dim) 80%, var(--ink));
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="date"],
.field input[type="search"] {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.7rem 0.8rem;
  background: var(--bark);
  border: 1px solid var(--slate);
  color: var(--chalk);
  font: 400 1rem/1.4 var(--body);
}

.field input:focus-visible { outline: 2px solid var(--fern); outline-offset: 1px; }

/* A field the browser has decided is wrong only says so once it has been
   filled in and left — :invalid alone shouts at an empty form on load. */
.field input:user-invalid { border-color: var(--clay); }

.check {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  margin-top: 1.5rem;
  font-size: 0.92rem;
  color: var(--chalk-dim);
}
.check input { margin-top: 0.3rem; accent-color: var(--fern); }

.form button[type="submit"] {
  margin-top: 2rem;
  background: var(--fern);
  color: var(--ink);
  border: 1px solid var(--fern);
  padding: 0.9rem 1.6rem;
  font: 700 0.78rem/1 var(--label);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.form button[type="submit"]:hover:not(:disabled) { background: transparent; color: var(--fern); }
.form button[type="submit"]:disabled { opacity: 0.5; cursor: progress; }

.form--danger button[type="submit"] { background: var(--clay); border-color: var(--clay); }
.form--danger button[type="submit"]:hover:not(:disabled) { background: transparent; color: var(--clay); }

/* Where the API's answer lands. Announced, because on a form that deletes an
   account "did that work?" cannot be left to whether you happened to look. */
.form__result { margin-top: 1.5rem; font-size: 0.95rem; }
.form__result:empty { margin: 0; }
.form__result[data-state="error"] { color: var(--clay); }
.form__result[data-state="ok"] { color: var(--fern); }
.form__result[data-state="busy"] { color: var(--chalk-dim); }

/* ── the place picker ─────────────────────────────────────────────────── */
/*
 * Sign-up asks where you keep your plants, because a southern August is not a
 * northern one and the app is wrong all year without knowing which. Nobody is
 * asked to type a latitude — this searches, and you pick somewhere you
 * recognise.
 */
.places {
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--slate);
  border-top: none;
  max-height: 15rem;
  overflow-y: auto;
}
.places:empty { display: none; }

.places button {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--bark);
  border: none;
  border-top: 1px solid var(--slate);
  color: var(--chalk);
  padding: 0.6rem 0.8rem;
  font: 400 0.92rem/1.4 var(--body);
  cursor: pointer;
}
.places button:hover, .places button:focus-visible { background: var(--slate); color: var(--fern); }
.places .places__where { color: var(--chalk-dim); font-size: 0.82rem; }

.chosen {
  margin-top: 0.6rem;
  font: 400 0.78rem/1.5 var(--label);
  color: var(--fern);
}
.chosen:empty { display: none; }

/* ── a page that is only a heading and a paragraph ────────────────────── */

.masthead__nav a.is-cta { color: var(--fern); }
