/* ==========================================================================
   Rooted — global stylesheet
   A warm, human feel: paper background, deep leaf green, terracotta accents.
   ========================================================================== */

:root {
  --paper: #f6f2ea;
  --card: #ffffff;
  --ink: #27231b;
  --ink-soft: #6e675a;
  --green: #3d6b4e;
  --green-dark: #2c4f39;
  --green-tint: #e9efe6;
  --clay: #bd7c3c;
  --clay-tint: #f4e9d9;
  --line: #e7dfcf;
  --danger: #b13a2c;
  --danger-tint: #f7e4e0;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(39, 35, 27, 0.06);
  --shadow-md: 0 6px 24px rgba(39, 35, 27, 0.08);
  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.15;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; }

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---- Header / navigation ---- */
.site-header {
  background: rgba(246, 242, 234, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 66px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }

.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-mark svg { width: 100%; height: 100%; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: 0.95rem;
}
.site-nav a { color: var(--ink-soft); font-weight: 500; }
.site-nav a:hover { color: var(--ink); text-decoration: none; }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-user {
  font-size: 0.85rem;
  color: var(--ink-soft);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.05s ease;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); }

.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--green); color: var(--green); }

.btn-clay { background: var(--clay); color: #fff; }
.btn-clay:hover { background: #a56830; }

.btn-block { width: 100%; }

/* ---- Forms ---- */
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ink);
}
.field input {
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(61, 107, 78, 0.14);
}
.field .hint { font-size: 0.82rem; color: var(--ink-soft); margin-top: 5px; }

/* ---- Flash messages ---- */
.flash-stack { padding-top: 24px; }
.flash {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  font-size: 0.95rem;
  border: 1px solid var(--line);
}
.flash-success { background: var(--green-tint); border-color: #cdddca; color: var(--green-dark); }
.flash-error { background: var(--danger-tint); border-color: #ecc4bc; color: var(--danger); }
.flash-info { background: #eef2f6; border-color: #d5dee6; color: #33414e; }

/* ---- Page sections ---- */
.section { padding: 72px 0; }
.section-tight { padding: 48px 0; }
.section-alt { background: var(--card); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.section-eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--clay);
  margin-bottom: 14px;
}

.lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 620px; }

/* ---- Hero ---- */
.hero { padding: 84px 0 64px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}
.hero-copy p { font-size: 1.15rem; color: var(--ink-soft); max-width: 520px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.hero-note { font-size: 0.85rem; color: var(--ink-soft); margin-top: 16px; }

.hero-art {
  background: linear-gradient(160deg, var(--green-tint), #f1ead8);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 40px 34px;
  display: grid;
  place-items: center;
  min-height: 320px;
}
.hero-art svg { width: min(100%, 300px); height: auto; }

/* ---- Feature cards ---- */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
  box-shadow: var(--shadow-sm);
}
.card h3 { margin-bottom: 8px; }
.card p { color: var(--ink-soft); margin: 0; }
.card-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  background: var(--green-tint);
  color: var(--green-dark);
}
.card-icon svg { width: 24px; height: 24px; }

/* ---- Steps (how it works) ---- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.step {
  position: relative;
  padding: 26px 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.step-num {
  font-family: var(--font-serif);
  font-size: 1.9rem;
  font-weight: 600;
  color: var(--clay);
  margin-bottom: 10px;
}
.step h3 { margin-bottom: 8px; }
.step p { color: var(--ink-soft); margin: 0; }

/* ---- Waitlist ---- */
.waitlist {
  background: var(--green);
  color: #fff;
  border-radius: 22px;
  padding: 48px 40px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 36px;
  align-items: center;
}
.waitlist h2 { color: #fff; margin-bottom: 10px; }
.waitlist p { color: rgba(255, 255, 255, 0.85); margin: 0; }
.waitlist-form { display: flex; gap: 10px; flex-wrap: wrap; }
.waitlist-form input {
  flex: 1 1 220px;
  padding: 13px 18px;
  font-size: 1rem;
  font-family: var(--font-sans);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.waitlist-form input::placeholder { color: rgba(255, 255, 255, 0.7); }
.waitlist-form input:focus { outline: none; border-color: #fff; background: rgba(255, 255, 255, 0.18); }
.waitlist-form .btn { background: #fff; color: var(--green-dark); }
.waitlist-form .btn:hover { background: var(--green-tint); }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px 0;
  margin-top: 72px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.site-footer .brand { font-size: 1.1rem; }
.footer-meta { font-size: 0.85rem; color: var(--ink-soft); }

/* ---- Auth (login / signup) ---- */
.auth-wrap { max-width: 440px; margin: 0 auto; padding: 72px 20px; }
.auth-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px 32px;
  box-shadow: var(--shadow-md);
}
.auth-card h1 { font-size: 1.9rem; }
.auth-sub { color: var(--ink-soft); font-size: 0.95rem; }
.auth-alt { text-align: center; font-size: 0.92rem; color: var(--ink-soft); margin-top: 18px; }

/* ---- Dashboard ---- */
.dash-wrap { padding-top: 40px; padding-bottom: 40px; }
.dash-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.dash-head h1 { margin: 0; }

.device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}
.device-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: inherit;
}
.device-card:hover { border-color: var(--green); box-shadow: var(--shadow-md); text-decoration: none; }
.device-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.device-name { font-family: var(--font-serif); font-size: 1.15rem; font-weight: 600; }
.device-id { font-size: 0.78rem; color: var(--ink-soft); letter-spacing: 0.02em; }

.meter { display: flex; align-items: baseline; gap: 8px; }
.meter-value { font-family: var(--font-serif); font-size: 2.4rem; font-weight: 600; color: var(--green-dark); line-height: 1; }
.meter-unit { font-size: 0.9rem; color: var(--ink-soft); }

.meter-track { height: 10px; border-radius: 999px; background: var(--green-tint); overflow: hidden; }
.meter-fill { height: 100%; border-radius: 999px; background: var(--green); transition: width 0.5s ease; }
.meter-fill.low { background: var(--clay); }
.meter-fill.dry { background: var(--danger); }

.device-meta { font-size: 0.82rem; color: var(--ink-soft); }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.status-pill.active { background: var(--green-tint); color: var(--green-dark); }
.status-pill.inactive { background: #efece4; color: var(--ink-soft); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.empty-state {
  text-align: center;
  padding: 64px 20px;
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--ink-soft);
}
.empty-state h3 { color: var(--ink); }

/* ---- Device detail / chart ---- */
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 0.9rem; margin-bottom: 20px; }
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
  box-shadow: var(--shadow-sm);
}
.panel h2 { font-size: 1.4rem; }
.chart-box { height: 320px; position: relative; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 26px 0; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; }
.stat-label { font-size: 0.8rem; color: var(--ink-soft); }
.stat-value { font-family: var(--font-serif); font-size: 1.6rem; font-weight: 600; color: var(--ink); }

/* ---- Responsive ---- */
@media (max-width: 860px) {
  .hero-grid, .waitlist, .grid-3, .steps { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr; }
  .site-nav { display: none; }
  .section { padding: 52px 0; }
  .hero { padding: 56px 0 44px; }
  .nav-user { display: none; }
  .waitlist { padding: 34px 24px; }
}


