/* 7d.at + 7d.at/giessplan. Tokens follow docs/DESIGN.md (ui/Theme.kt); Nunito is the app's font. */

/* Latin subsets of the app's Nunito, ~13 KB each (web/tools/build_assets.sh). The pages preload all three. */
@font-face {
  font-family: Nunito;
  src: url("fonts/nunito_regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Nunito;
  src: url("fonts/nunito_bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Nunito;
  src: url("fonts/nunito_extrabold.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* M3 roles (light) */
  --bg: #f6fbf4;
  --card: #f0f5ee;
  --card-2: #eaefe8;
  --text: #171d19;
  --muted: #404943;
  --primary: #0b5d3b;
  --on-primary: #ffffff;
  --primary-container: #b4efcb;
  --on-primary-container: #002112;
  --secondary-container: #d0e8d7;
  --on-secondary-container: #0b1f14;
  --tertiary: #7a5900;
  --line: #c0c9c0;
  --error: #ba1a1a;
  --error-tint: rgba(186, 26, 26, 0.08);
  /* brand and semantic roles */
  --sun: #fbb91c;
  --on-sun: #3a2800;
  --water: #00658f;
  --water-container: #cde8fa;
  --on-water-container: #001e2e;
  --hero: #0b5d3b;
  --on-hero: #ffffff;
  --on-hero-variant: #cdebd8;
  --hero-track: rgba(255, 255, 255, 0.22);
  --scene-blob: #e2f1da;
  /* plant avatar circles (ui/PlantAvatar.kt) */
  --av-herb: #c8ebc0;
  --av-vegetable: #ffd9cf;
  --av-fruit: #f8d8ec;
  --av-balcony-flower: #ffd8e4;
  --av-container: #fce3a9;
  --av-perennial-shrub: #dde6b5;
  --av-houseplant: #bfe9e3;
  --av-succulent: #ede0cf;
  --av-generic: #d0e8d7;
  --focus: var(--primary);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1511;
    --card: #171d19;
    --card-2: #1b211d;
    --text: #dfe4dd;
    --muted: #c0c9c1;
    --primary: #8dd8aa;
    --on-primary: #00391f;
    --primary-container: #0b5d3b;
    --on-primary-container: #b4efcb;
    --secondary-container: #364b3f;
    --on-secondary-container: #d0e8d7;
    --tertiary: #fbbf3a;
    --line: #404943;
    --error: #ffb4ab;
    --error-tint: rgba(255, 180, 171, 0.16);
    --water: #86cfff;
    --water-container: #004c6c;
    --on-water-container: #c8e6ff;
    --scene-blob: #1a2a20;
    --av-herb: #2c4f2b;
    --av-vegetable: #5e2a1c;
    --av-fruit: #55203f;
    --av-balcony-flower: #5c2238;
    --av-container: #4f3d10;
    --av-perennial-shrub: #3b4420;
    --av-houseplant: #1d4a46;
    --av-succulent: #4a3f33;
    --av-generic: #364b3f;
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

html {
  font-size: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Nunito, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

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

a {
  color: var(--primary);
  text-underline-offset: 0.15em;
}

a:focus-visible,
.card:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

/* ---------- layout ---------- */

.wrap {
  width: min(56rem, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 3rem;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 1.375rem;
  font-weight: 800;
  line-height: 1.27;
  color: var(--primary);
  text-decoration: none;
}

.brand img {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
}

.brand:hover {
  text-decoration: underline;
}

.site-nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.875rem;
  font-weight: 700;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--primary);
  text-decoration: underline;
}

section {
  margin: 3rem 0 0;
}

h1 {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.29;
  color: var(--primary);
  text-wrap: balance;
}

h2 {
  margin: 0 0 1rem;
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.27;
}

h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.00625em;
}

.lede {
  margin: 0 0 1rem;
  font-size: 1.125rem;
  line-height: 1.45;
  max-width: 34rem;
}

.note {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.00625em;
  color: var(--primary);
}

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 1.5rem 2rem;
  align-items: center;
}

.hero-art {
  margin: 0;
}

.hero-art img {
  width: 100%;
  height: auto;
}

@media (max-width: 40rem) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-art {
    order: -1;
    max-width: 22rem;
  }
}

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

.card {
  display: block;
  background: var(--card);
  border-radius: 1.5rem;
  padding: 1rem;
  text-decoration: none;
  color: inherit;
}

a.card:hover h2,
a.card:hover h3,
a.card:focus-visible h2 {
  text-decoration: underline;
}

.card p {
  margin: 0;
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

/* feature card: 24 px icon on a 44 px circle, text beside it */
.feature {
  display: grid;
  grid-template-columns: 2.75rem 1fr;
  gap: 0.75rem;
  align-items: start;
}

.feature .glyph {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
}

.feature .glyph img,
.feature .glyph svg {
  width: 1.5rem;
  height: 1.5rem;
}

.glyph-primary {
  background: var(--primary-container);
  color: var(--on-primary-container);
}

.glyph-water {
  background: var(--water-container);
  color: var(--on-water-container);
}

.glyph-tonal {
  background: var(--secondary-container);
  color: var(--on-secondary-container);
}

.feature h3 {
  color: var(--primary);
}

.feature p {
  font-size: 0.875rem;
  line-height: 1.43;
}

/* ---------- app card on the 7d page ---------- */

.app-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 15rem);
  gap: 1rem 1.5rem;
  align-items: center;
  padding: 1.25rem 1.25rem 1.25rem 1.5rem;
}

.app-card .scene {
  margin: 0;
  background: var(--scene-blob);
  border-radius: 1.25rem;
  padding: 0.5rem;
}

.app-card .scene img {
  width: 100%;
  height: auto;
}

.app-id {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-bottom: 0.75rem;
}

.app-id img {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.875rem;
}

.app-id h2 {
  margin: 0;
  color: var(--primary);
}

.app-id small {
  display: block;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--muted);
}

.app-card .cta {
  display: inline-flex;
  align-items: center;
  gap: 0.125rem;
  margin-top: 0.75rem;
  font-weight: 700;
  color: var(--primary);
}

.app-card .cta svg {
  width: 1.25rem;
  height: 1.25rem;
}

@media (max-width: 40rem) {
  .app-card {
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  .app-card .scene {
    order: -1;
  }
}

/* ---------- "Heute" sample list, after ui/PlantListScreen.kt ---------- */

.sample {
  display: grid;
  gap: 0.5rem;
  max-width: 26rem;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.43;
  letter-spacing: 0.00625em;
  color: var(--tertiary);
}

.badge {
  min-width: 1.25rem;
  padding: 0 0.375rem;
  border-radius: 999px;
  background: var(--sun);
  color: var(--on-sun);
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 700;
  text-align: center;
}

.hero-card {
  display: grid;
  grid-template-columns: 4rem 1fr;
  gap: 1rem;
  align-items: center;
  min-height: 6.5rem;
  padding: 1rem 1rem 1rem 1.25rem;
  border-radius: 1.5rem;
  background: var(--hero);
  color: var(--on-hero);
  position: relative;
  overflow: hidden;
}

.hero-card .ring {
  width: 4rem;
  height: 4rem;
  position: relative;
}

.hero-card .ring svg {
  width: 100%;
  height: 100%;
}

.hero-card .ring .track {
  stroke: var(--hero-track);
}

.hero-card .ring .arc {
  stroke: var(--sun);
}

.hero-card .ring b {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.hero-card .ring b span {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--on-hero-variant);
}

.hero-card .title {
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.27;
}

.hero-card .sub {
  margin: 0.125rem 0 0;
  font-size: 0.875rem;
  line-height: 1.43;
  color: var(--on-hero-variant);
}

.hero-card .leaves {
  position: absolute;
  right: 0.25rem;
  bottom: -0.5rem;
  width: 4rem;
  height: 3.5rem;
  color: #8dd8aa;
  opacity: 0.35;
}

.row {
  display: grid;
  grid-template-columns: 3rem 1fr 3rem;
  gap: 1rem 1rem;
  align-items: center;
  padding: 0.75rem 0.75rem 0.75rem 1rem;
  border-radius: 1.5rem;
  background: var(--card);
}

.row.overdue {
  background: linear-gradient(var(--error-tint), var(--error-tint)), var(--card);
}

.avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  flex: none;
}

.avatar img {
  width: 100%;
  height: 100%;
}

.row .name {
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.00625em;
}

.row .status {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.43;
  color: var(--muted);
}

.row .status .due {
  font-weight: 700;
  color: var(--primary);
}

.row .status .late {
  font-weight: 700;
  color: var(--error);
}

.row .status .rain {
  font-weight: 700;
  color: var(--water);
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.375rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 1.375rem;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 700;
  letter-spacing: 0.025em;
}

.pill svg {
  width: 0.75rem;
  height: 0.75rem;
}

.pill-water {
  background: var(--water-container);
  color: var(--on-water-container);
}

.pill-tonal {
  background: var(--secondary-container);
  color: var(--on-secondary-container);
}

.can {
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  justify-self: end;
}

.can svg {
  width: 1.5rem;
  height: 1.5rem;
}

.can-due {
  background: var(--sun);
  color: var(--on-sun);
}

.can-later {
  background: var(--secondary-container);
  color: var(--on-secondary-container);
}

.rain-badge {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--water-container);
  color: var(--water);
  display: grid;
  place-items: center;
  justify-self: end;
  margin-right: 0.5rem;
}

.rain-badge svg {
  width: 1rem;
  height: 1rem;
}

/* ---------- screenshots ---------- */

.shots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1.5rem;
  max-width: 40rem;
}

.shot {
  margin: 0;
  text-align: center;
}

.phone {
  background: var(--card-2);
  border-radius: 2rem;
  padding: 0.5rem;
  margin: 0 auto 0.75rem;
  max-width: 18rem;
}

.phone img {
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 19.5;
  object-fit: cover;
  object-position: top;
  border-radius: 1.5rem;
}

.shot figcaption {
  font-size: 0.875rem;
  color: var(--muted);
}

/* ---------- plant categories ---------- */

.plants {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.plants li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  width: 5.25rem;
  font-size: 0.75rem;
  line-height: 1.33;
  font-weight: 700;
  text-align: center;
  color: var(--muted);
}

.plants .avatar {
  width: 3.5rem;
  height: 3.5rem;
}

/* ---------- impressum ---------- */

address {
  font-style: normal;
  background: var(--card);
  border-radius: 1.5rem;
  padding: 1.25rem;
  margin: 0 0 1rem;
  max-width: 26rem;
}

/* ---------- footer ---------- */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.4;
}

.site-footer a {
  color: var(--muted);
}

/* ---------- long text: privacy policy (giessplan/datenschutz, giessplan/privacy) ---------- */

.doc {
  max-width: 44rem;
}

.doc section {
  margin-top: 2.25rem;
  scroll-margin-top: 1rem;
}

.doc p,
.doc ul {
  margin: 0 0 0.75rem;
}

.doc ul {
  padding-left: 1.25rem;
}

.doc li + li {
  margin-top: 0.25rem;
}

.doc code {
  font-size: 0.875em;
  overflow-wrap: anywhere;
}

.doc-intro {
  margin: 1rem 0 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--card);
  border-radius: 1.5rem;
}

.doc-intro p:last-child {
  margin-bottom: 0;
}

.toc {
  margin: 0 0 1rem;
}

.toc h2 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  color: var(--primary);
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  columns: 2 16rem;
  column-gap: 2rem;
  font-size: 0.9375rem;
}

.toc li {
  break-inside: avoid;
  padding: 0.125rem 0;
}

.doc .table {
  margin: 0 0 1rem;
  overflow-x: auto;
  border-radius: 1rem;
  background: var(--card);
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.45;
}

.doc th,
.doc td {
  padding: 0.625rem 0.875rem;
  text-align: left;
  vertical-align: top;
}

.doc th {
  font-weight: 700;
  color: var(--primary);
  border-bottom: 1px solid var(--line);
}

.doc tbody tr + tr td {
  border-top: 1px solid var(--line);
}

.doc td:first-child {
  min-width: 7rem;
}

@media (max-width: 40rem) {
  .doc thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .doc tr,
  .doc td {
    display: block;
  }

  .doc tbody tr + tr td {
    border-top: 0;
  }

  .doc tbody tr + tr {
    border-top: 1px solid var(--line);
  }

  .doc td {
    padding: 0.125rem 0.875rem;
  }

  .doc td:first-child {
    padding-top: 0.75rem;
    font-weight: 700;
  }

  .doc td:last-child {
    padding-bottom: 0.75rem;
  }

  .doc td:not(:first-child)::before {
    content: attr(data-label) ": ";
    color: var(--muted);
    font-weight: 700;
  }
}
