/* TheLads — design system from The Houseplant Register PDF */

:root {
  --ink: #10241A;
  --green: #1E7A46;
  --lime: #C9F04D;
  --paper: #F7F5EF;
  --muted: #5A6B60;
  --card: #FFFFFF;
  --radius: 18px;
  --pad: clamp(16px, 4vw, 28px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100dvh;
}

h1, h2, h3, .grotesk {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

button {
  font: inherit;
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

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

a { color: inherit; }

.kicker {
  display: inline-block;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--lime);
  color: var(--ink);
  padding: 4px 10px;
  border-radius: 999px;
}

/* ---------- token gate ---------- */

.gate {
  min-height: 100dvh;
  background: var(--ink);
  color: var(--paper);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: var(--pad);
  text-align: center;
}

.gate h1 { font-size: clamp(44px, 12vw, 72px); color: var(--lime); }

.gate p { color: #9DB0A4; max-width: 300px; font-size: 14px; }

.gate input {
  font: inherit;
  background: #1B342A;
  border: 2px solid #2C4A3B;
  color: var(--paper);
  border-radius: 12px;
  padding: 14px 16px;
  width: min(320px, 80vw);
  text-align: center;
  outline: none;
}

.gate input:focus { border-color: var(--lime); }

.gate .err { color: #F0A14D; font-size: 13px; min-height: 1.2em; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  border-radius: 999px;
  padding: 14px 26px;
  font-size: 16px;
  transition: transform 0.06s ease;
}

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

.btn-lime { background: var(--lime); color: var(--ink); }
.btn-ink { background: var(--ink); color: var(--lime); padding: 10px 18px; font-size: 14px; }
.btn-green { background: var(--green); color: #fff; }
.btn-ghost { background: transparent; color: var(--paper); border: 2px solid rgba(247,245,239,0.3); }
.btn-outline { background: transparent; color: var(--ink); border: 2px solid var(--ink); }
.btn-big { width: 100%; padding: 18px; font-size: 18px; }
.btn[disabled] { opacity: 0.5; cursor: default; }

/* ---------- home ---------- */

.home-head {
  background: var(--ink);
  color: var(--paper);
  padding: calc(env(safe-area-inset-top, 0px) + 28px) var(--pad) 30px;
  border-radius: 0 0 28px 28px;
}

.home-head .kicker { margin-bottom: 10px; }

.home-head h1 {
  font-size: clamp(40px, 11vw, 64px);
  color: var(--paper);
}

.home-head h1 .accent { color: var(--lime); }

.home-head .sub { color: #9DB0A4; font-size: 14px; margin-top: 8px; }

.due-strip {
  margin: 14px var(--pad) 0;
  background: var(--lime);
  color: var(--ink);
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  padding: var(--pad);
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(16,36,26,0.08);
  display: flex;
  flex-direction: column;
}

.card .thumb {
  aspect-ratio: 4 / 3.2;
  background: var(--ink);
  position: relative;
  overflow: hidden;
}

.card .thumb img { width: 100%; height: 100%; object-fit: cover; }

.card .thumb .leaf,
.hero .photo .leaf {
  position: absolute;
  inset: 0;
  margin: auto;
}

.card .badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(16,36,26,0.75);
  color: var(--paper);
  backdrop-filter: blur(4px);
}

.card .badge.due { background: var(--lime); color: var(--ink); }

.card .meta { padding: 12px 14px 14px; }

.card .meta h2 { font-size: 22px; }

.card .meta .species {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  margin: 2px 0 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.healthbar {
  height: 6px;
  background: #E4E1D6;
  border-radius: 999px;
  overflow: hidden;
}

.healthbar span {
  display: block;
  height: 100%;
  background: var(--green);
  border-radius: 999px;
}

/* ---------- plant page ---------- */

.hero {
  background: var(--ink);
  color: var(--paper);
  border-radius: 0 0 28px 28px;
  overflow: hidden;
  position: relative;
}

.hero .photo {
  height: clamp(220px, 45vw, 340px);
  position: relative;
}

.hero .photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* duotone-ish treatment: the plant is the artwork */
  filter: saturate(0.85) contrast(1.05);
}

.hero .photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(16,36,26,0.28) 0%, rgba(16,36,26,0) 35%, rgba(16,36,26,0.92) 92%);
}

.hero .top {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  z-index: 2;
}

.iconbtn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: rgba(16,36,26,0.65);
  color: var(--paper);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.hero .title {
  position: relative;
  margin-top: -74px;
  padding: 0 var(--pad) 22px;
  z-index: 1;
}

.hero .title h1 { font-size: clamp(42px, 13vw, 72px); color: var(--paper); }

.hero .species-line {
  display: inline-block;
  background: var(--lime);
  color: var(--ink);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 13px;
  font-style: italic;
  padding: 4px 10px;
  border-radius: 6px;
  margin-top: 8px;
}

.hero .cultivar {
  display: block;
  color: #9DB0A4;
  font-size: 12px;
  margin-top: 8px;
}

.section { padding: 0 var(--pad); margin-top: 18px; }

.panel {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 1px 3px rgba(16,36,26,0.08);
}

.panel h3 {
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.health-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}

.health-row .score { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 34px; }
.health-row .outof { color: var(--muted); font-size: 14px; }
.health-summary { margin-top: 10px; font-size: 15px; }

.water-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}

.water-stat {
  flex: 1;
  background: var(--paper);
  border-radius: 12px;
  padding: 12px;
}

.water-stat .num {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 24px;
}

.water-stat .lbl { font-size: 12px; color: var(--muted); }

.water-stat.due-now { background: var(--lime); }
.water-stat.due-now .lbl { color: var(--ink); opacity: 0.7; }

.history {
  margin-top: 14px;
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.history-lbl {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 4px;
}

.history .chip {
  font-size: 12px;
  font-weight: 600;
  background: var(--paper);
  border: 1px solid #E4E1D6;
  color: var(--muted);
  padding: 3px 9px;
  border-radius: 999px;
}

.history .chip:first-of-type {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.care-list { list-style: none; }

.care-list li {
  padding: 10px 0 10px 26px;
  position: relative;
  font-size: 15px;
  border-bottom: 1px solid #EEEBE0;
}

.care-list li:last-child { border-bottom: 0; }

.care-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 17px;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--green);
}

.facts .panel { margin-bottom: 12px; }

.facts .panel.ink {
  background: var(--ink);
  color: var(--paper);
}

.facts .panel.ink h3 { color: var(--lime); }

.facts p { font-size: 15px; }

.facts ul { list-style: none; }

.facts ul li {
  padding: 8px 0 8px 22px;
  position: relative;
  font-size: 15px;
}

.facts ul li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 700;
}

.facts .panel.ink ul li::before { color: var(--lime); }

.pending-note { color: var(--muted); font-style: italic; font-size: 14px; }

.sources {
  margin-top: 12px;
  font-size: 12px;
  color: #9DB0A4;
}

.sources a { color: var(--lime); text-decoration: none; }

/* photo timeline */

.timeline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.timeline-grid .ph {
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: #E4E1D6;
  position: relative;
  cursor: pointer;
  border: 0;
  padding: 0;
}

.timeline-grid .ph img { width: 100%; height: 100%; object-fit: cover; }

.timeline-grid .ph .date {
  position: absolute;
  bottom: 6px;
  left: 6px;
  font-size: 10px;
  font-weight: 600;
  background: rgba(16,36,26,0.75);
  color: var(--paper);
  padding: 2px 6px;
  border-radius: 6px;
}

.empty-note { color: var(--muted); font-size: 14px; margin-top: 10px; }

/* lightbox */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(16,36,26,0.96);
  z-index: 50;
  display: flex;
  flex-direction: column;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 12px calc(env(safe-area-inset-bottom, 0px) + 12px);
}

.lightbox .lb-img {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.lightbox img { max-height: 100%; border-radius: 12px; }

.lightbox .lb-meta { color: var(--paper); text-align: center; padding: 10px 0 4px; font-size: 14px; }

.lightbox .lb-actions { display: flex; gap: 10px; justify-content: center; padding-top: 10px; }

/* ---------- settings ---------- */

.settings-list { list-style: none; }

.settings-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid #EEEBE0;
}

.settings-list li:last-child { border-bottom: 0; }

.settings-list .nm { font-family: 'Space Grotesk', sans-serif; font-weight: 700; }

.settings-list .int-input {
  width: 64px;
  font: inherit;
  text-align: center;
  padding: 8px;
  border-radius: 10px;
  border: 2px solid #E4E1D6;
  background: var(--paper);
}

.settings-list .int-input:focus { border-color: var(--green); outline: none; }

.hint { font-size: 13px; color: var(--muted); margin-top: 10px; }

/* page chrome for sub-pages */

.page-head {
  background: var(--ink);
  color: var(--paper);
  padding: calc(env(safe-area-inset-top, 0px) + 16px) var(--pad) 22px;
  border-radius: 0 0 28px 28px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.page-head h1 { font-size: 30px; color: var(--paper); }

/* league table */

.league { list-style: none; }

.league li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid #EEEBE0;
  cursor: pointer;
}

.league li:last-child { border-bottom: 0; }

.league .pos {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 18px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.league li:first-child .pos { background: var(--lime); }

.league li:last-child .pos, .league li:nth-last-child(2) .pos { background: #F3D9C4; }

.league .who { flex: 1; display: flex; flex-direction: column; }

.league .nm { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 17px; }

.league .zone { font-size: 12px; color: var(--muted); }

.league .pts {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 22px;
}

/* compare slider */

.compare-stage {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
  border-radius: 12px;
}

.compare-stage > img { max-height: 62dvh; display: block; }

.compare-top {
  position: absolute;
  inset: 0 auto 0 0;
  overflow: hidden;
}

.compare-top img { height: 100%; max-width: none; }

.compare-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--lime);
  transform: translateX(-1.5px);
  pointer-events: none;
}

.compare-tag {
  position: absolute;
  bottom: 10px;
  font-size: 11px;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
  background: rgba(16,36,26,0.8);
  color: var(--paper);
  padding: 4px 9px;
  border-radius: 999px;
}

.compare-tag.then { left: 10px; }
.compare-tag.now { right: 10px; }

.compare-range {
  width: min(420px, 86vw);
  margin: 14px auto 0;
  accent-color: #C9F04D;
}

/* droplets */

.droplet {
  position: fixed;
  width: 10px;
  height: 14px;
  background: #7FC8F8;
  border-radius: 50% 50% 60% 60% / 40% 40% 70% 70%;
  z-index: 55;
  pointer-events: none;
  animation: drop-fall 1.1s ease-in forwards;
}

@keyframes drop-fall {
  0% { opacity: 0; transform: translateY(0) scale(0.7); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translateY(90px) scale(1); }
}

/* toast */

.toast {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--lime);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  padding: 12px 22px;
  border-radius: 999px;
  z-index: 60;
  box-shadow: 0 6px 20px rgba(16,36,26,0.35);
  animation: toast-in 0.2s ease;
  display: flex;
  gap: 12px;
  align-items: center;
  white-space: nowrap;
}

.toast-action {
  background: var(--lime);
  color: var(--ink);
  font: inherit;
  border-radius: 999px;
  padding: 4px 14px;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.spin {
  width: 34px;
  height: 34px;
  border: 4px solid #E4E1D6;
  border-top-color: var(--green);
  border-radius: 999px;
  margin: 60px auto;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

footer.appfoot {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 30px var(--pad) calc(env(safe-area-inset-bottom, 0px) + 30px);
}
