/* WaterWise home: one screen, one idea: an animated soil profile that drains and refills. */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: "Inter", system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; overflow: hidden; }
[hidden] { display: none !important; }

.top { position: fixed; inset: 0 0 auto 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: 22px clamp(20px, 4vw, 56px); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.brand svg { width: 30px; height: 30px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: 999px;
  font: inherit; font-size: 15px; font-weight: 700; text-decoration: none; cursor: pointer; border: 1px solid transparent; transition: transform .15s, filter .15s; }
.btn:hover { transform: translateY(-1px); }
.btn-lg { height: 54px; padding: 0 28px; font-size: 16.5px; }
.btn-solid { background: #2563eb; color: #fff; box-shadow: 0 10px 30px -8px rgb(37 99 235 / .6); }
.btn-solid:hover { filter: brightness(1.1); }
.btn-block { width: 100%; height: 48px; border-radius: 12px; }
.btn-quiet { background: none; color: var(--ink-2); }
.btn:disabled { opacity: .6; cursor: progress; }

.copy { position: relative; z-index: 10; height: 100%; display: flex; flex-direction: column; justify-content: center; padding: 0 clamp(20px, 6vw, 96px); max-width: 760px; }
h1 { margin: 0; font-size: clamp(52px, 8.6vw, 132px); line-height: .92; letter-spacing: -.055em; font-weight: 900; }
.lead { margin: 22px 0 32px; font-size: clamp(17px, 1.6vw, 21px); }
.cta { display: flex; gap: 12px; flex-wrap: wrap; }
.facts { list-style: none; padding: 0; margin: 48px 0 0; display: flex; gap: 36px; }
.facts li { display: flex; flex-direction: column; font-size: 13px; letter-spacing: .02em; }
.facts b { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.auth-error { margin: 12px 0 0; color: #f87171; font-size: 14px; }

.btn-glass { background: rgb(255 255 255 / .1); color: inherit; border-color: rgb(255 255 255 / .22); backdrop-filter: blur(10px); }
.btn-glass:hover { background: rgb(255 255 255 / .18); }

/* ── B: soil profile (light, minimal) ──────────────────────────────────── */
[data-variant="b"] body { background: radial-gradient(90% 80% at 80% 50%, #e8f0ff 0%, #f6f7f9 60%); color: #0b1220; }
[data-variant="b"] .stage { display: none; }
[data-variant="b"] .brand { color: #0b1220; }
[data-variant="b"] .btn-glass { background: #fff; border-color: #e4e4e7; color: #0b1220; backdrop-filter: none; }
[data-variant="b"] .lead, [data-variant="b"] .facts li { color: #52525b; }
.profile { position: fixed; right: clamp(20px, 7vw, 120px); top: 50%; transform: translateY(-50%); z-index: 5; width: min(40vw, 460px); }
.soil { width: 100%; height: auto; display: block; filter: drop-shadow(0 40px 60px rgb(15 23 42 / .25)); }
.water { transform-origin: 50% 100%; animation: level 8s ease-in-out infinite; }
.drop { animation: drop 8s ease-in infinite; }
.readout { position: absolute; left: -40px; bottom: -6px; display: flex; align-items: baseline; gap: 6px; padding: 14px 20px; border-radius: 18px; background: #fff;
  box-shadow: 0 20px 40px -18px rgb(15 23 42 / .35); font-weight: 700; color: #52525b; }
.readout b { font-size: 34px; font-weight: 900; letter-spacing: -.03em; color: #0b1220; font-variant-numeric: tabular-nums; min-width: 2.4ch; text-align: right; }
/* water drains to a third, the drop falls, the profile refills */
@keyframes level { 0% { transform: scaleY(.9); } 55% { transform: scaleY(.3); } 70% { transform: scaleY(.3); } 85%, 100% { transform: scaleY(.9); } }
@keyframes drop { 0%, 58% { transform: translateY(-40px); opacity: 0; } 60% { opacity: 1; } 70% { transform: translateY(80px); opacity: 1; } 72%, 100% { transform: translateY(80px); opacity: 0; } }

/* ── sign-in dialog ───────────────────────────────────────────────────── */
.auth { width: min(400px, calc(100vw - 32px)); padding: 26px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); color: var(--ink);
  box-shadow: 0 40px 80px -30px rgb(0 0 0 / .5); }
.auth::backdrop { background: rgb(5 7 10 / .55); backdrop-filter: blur(4px); }
.auth-close { position: absolute; top: 10px; right: 10px; margin: 0; }
.auth-close button { width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--ink-2); font-size: 22px; line-height: 1; cursor: pointer; }
.auth-tabs { display: flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin: 6px 0 16px; }
.auth-tabs button { flex: 1; height: 38px; border: 0; border-radius: 9px; background: none; font: inherit; font-size: 14.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.auth-tabs button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / .12); }
.auth-form { display: grid; gap: 10px; }
.auth-form input { height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); font: inherit; font-size: 15px; color: var(--ink); outline: none; }
.auth-form input:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgb(37 99 235 / .18); }
.auth .auth-error { color: var(--irr); margin: 0; }
.auth-hello { margin: 4px 0 14px; color: var(--ink-2); }
.auth-note { margin: 0 0 6px; font-size: 14px; color: var(--ink-2); }

@media (prefers-reduced-motion: reduce) {
  /* hold the drained frame, which matches the "Apply 4.6 in" the counter shows */
  .water, .drop { animation: none; }
  .water { transform: scaleY(.3); }
  .drop { display: none; }
}
@media (max-width: 900px) {
  body { overflow: auto; display: flow-root; }   /* flow-root: the profile's top margin must not push the whole page down */
  /* height:auto, or the copy block is a full screen tall and the headline and buttons start below the fold */
  .copy { justify-content: flex-end; padding-bottom: 48px; min-height: 100dvh; height: auto; }
  .facts { gap: 22px; margin-top: 32px; }
  .profile { position: relative; right: auto; top: auto; transform: none; width: min(56vw, 300px); margin: 84px auto 0; }
  [data-variant="b"] .copy { min-height: auto; padding-top: 24px; }
  .readout { left: -12px; }
}
