/* Public website at "/" (Pages/Index.cshtml + Shared/_HomeDemo.cshtml). Plain, neutral, one accent: the review page's green.
   Loaded after review.css, which styles the demo phone's screen. */

.home {
  --bg: #faf9f6; --ink: #18201c; --muted: #5b645f; --line: #e4e2dc; --soft: #f1efe9;
  --green: #1f5a43; --green-dark: #17463a;
  /* Stand insert (2:3) and framed phone (404:858) are always drawn at the same height. */
  --stand-ratio: .6667; --phone-ratio: .4709;
  min-height: 100dvh; background: var(--bg); color: var(--ink);
  font-size: 17px; line-height: 1.55;
}
body.bare { background: #faf9f6; }
body.bare::before { display: none; }

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

/* ---------- Header ---------- */
.hm-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 18px; padding-bottom: 18px; }
.hm-logo { text-decoration: none; }
.hm-logo .brand-name { font-size: 1.15rem; }
.hm-logo .brand-mark { color: var(--green); width: 28px; height: 28px; }
.hm-logo .brand-ai { color: var(--green); }

/* ---------- Buttons ---------- */
.hm-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px;
  border-radius: 10px; font-weight: 600; font-size: 15.5px; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s;
}
.hm-btn-solid { background: var(--green); color: #fff; }
.hm-btn-solid:hover { background: var(--green-dark); }
.hm-btn-line { border: 1px solid #cfccc4; color: var(--ink); background: #fff; }
.hm-btn-line:hover { border-color: var(--ink); }
.hm-btn-big { min-height: 52px; padding: 0 26px; font-size: 17px; }
.hm-link { color: var(--ink); font-weight: 600; font-size: 15.5px; text-underline-offset: 4px; }
.hm-btn:focus-visible, .hm-link:focus-visible, .hm-logo:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }

/* ---------- Hero ---------- */
.hm-hero { display: grid; gap: 40px; padding-top: 28px; padding-bottom: 56px; }
.hm-hero h1 { margin: 0; font-size: clamp(34px, 6.4vw, 54px); line-height: 1.08; letter-spacing: -.025em; font-weight: 750; max-width: 13ch; }
.hm-lead { margin: 18px 0 0; font-size: clamp(17px, 2.2vw, 19.5px); color: var(--muted); max-width: 30em; }
.hm-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 26px; }
.hm-note { margin: 18px 0 0; font-size: 14.5px; color: var(--muted); }

@media (min-width: 860px) {
  .hm-hero { grid-template-columns: 1fr 1fr; align-items: center; gap: 40px; padding-top: 36px; padding-bottom: 80px; }
}

/* ---------- Phone frame (same in the demo and around screenshots) ---------- */
.hm-phone { display: block; box-sizing: border-box; padding: 6px; background: #15191a; border-radius: 30px; box-shadow: 0 12px 30px rgb(0 0 0 / .16); }
.hm-phone img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 24px; }

/* ---------- Animated demo ---------- */
.hm-demo { --h: min(420px, calc((100vw - 56px) / 1.14)); }
@media (min-width: 860px) { .hm-demo { --h: min(430px, calc((50vw - 80px) / 1.14)); } }

.hm-demo-scene { display: flex; justify-content: center; align-items: flex-end; gap: 16px; }
.hm-demo-stand { position: relative; flex: none; height: var(--h); width: calc(var(--h) * var(--stand-ratio)); }
.hm-demo-stand img { display: block; width: 100%; height: 100%; border-radius: 6px; box-shadow: 0 1px 2px rgb(0 0 0 / .08), 0 10px 28px rgb(0 0 0 / .10); }

.hm-demo-phone {
  position: relative; z-index: 2; flex: none; height: var(--h); width: calc(var(--h) * var(--phone-ratio));
  transition: transform .75s cubic-bezier(.3, 0, .2, 1);
}
.hm-screen-box { position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: 24px; background: #fff; }
.hm-screen { position: absolute; top: 0; left: 0; width: 390px; height: 844px; transform-origin: 0 0; }

/* Screens: one visible at a time (data-stage on #demo). */
.hm-scr { position: absolute; inset: 0; opacity: 0; transition: opacity .45s ease; }
.hm-demo[data-stage="lock"] .hm-scr-lock,
.hm-demo[data-stage="camera"] .hm-scr-camera,
.hm-demo[data-stage="review"] .hm-scr-review,
.hm-demo[data-stage="done"] .hm-scr-done { opacity: 1; }

.hm-scr-lock, .hm-scr-camera { background: #101614; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 120px 0 110px; }
.hm-clock { font-size: 78px; font-weight: 300; letter-spacing: -.02em; }
.hm-scr-hint { font-size: 19px; color: #a9b8b1; }
.hm-scr-camera { background: #222827; justify-content: center; gap: 40px; padding: 0; }
.hm-viewfinder {
  width: 230px; height: 230px;
  --c: rgb(255 255 255 / .9);
  background:
    linear-gradient(var(--c) 0 0) top left / 40px 5px, linear-gradient(var(--c) 0 0) top left / 5px 40px,
    linear-gradient(var(--c) 0 0) top right / 40px 5px, linear-gradient(var(--c) 0 0) top right / 5px 40px,
    linear-gradient(var(--c) 0 0) bottom left / 40px 5px, linear-gradient(var(--c) 0 0) bottom left / 5px 40px,
    linear-gradient(var(--c) 0 0) bottom right / 40px 5px, linear-gradient(var(--c) 0 0) bottom right / 5px 40px;
  background-repeat: no-repeat;
}

.hm-scr-review .rv { min-height: 0; height: 100%; }
.hm-scr-review .rv-text { min-height: calc(2 * 1.38em); }
.hm-scr-review .rv-send { position: relative; }

.hm-scr-done { background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--ink); }
.hm-done-check { display: grid; place-items: center; width: 120px; height: 120px; border-radius: 50%; background: var(--green); color: #fff; transform: scale(.6); transition: transform .5s cubic-bezier(.3, 1.6, .5, 1); }
.hm-done-stars { margin-top: 18px; font-size: 32px; letter-spacing: 4px; color: #e9a63a; }
.hm-done-title { font-size: 40px; font-weight: 750; letter-spacing: -.02em; }
.hm-done-sub { font-size: 19px; color: var(--muted); }
.hm-demo[data-stage="done"] .hm-done-check { transform: none; }

/* Tap: rings spread from the TAP circle printed on the insert. */
.hm-ripple { position: absolute; left: 70.7%; top: 69.7%; width: 30%; aspect-ratio: 1; translate: -50% -50%; z-index: 3; pointer-events: none; }
.hm-ripple::before, .hm-ripple::after { content: ""; position: absolute; inset: 0; border: 3px solid #fff; border-radius: 50%; box-shadow: 0 0 0 3px var(--green), inset 0 0 0 3px var(--green); opacity: 0; }
.hm-demo.is-tap.is-hit .hm-ripple::before { animation: hm-ripple 1s ease-out infinite; }
.hm-demo.is-tap.is-hit .hm-ripple::after { animation: hm-ripple 1s ease-out .4s infinite; }
@keyframes hm-ripple { from { transform: scale(.4); opacity: 1; } to { transform: scale(2.2); opacity: 0; } }

/* Scan: brackets lock onto the printed QR code and a line sweeps it. */
.hm-scanbox {
  position: absolute; left: 25%; top: 23%; width: 50%; height: 34.5%; opacity: 0; transition: opacity .25s;
  --c: var(--green);
  background:
    linear-gradient(var(--c) 0 0) top left / 22% 4px, linear-gradient(var(--c) 0 0) top left / 4px 22%,
    linear-gradient(var(--c) 0 0) top right / 22% 4px, linear-gradient(var(--c) 0 0) top right / 4px 22%,
    linear-gradient(var(--c) 0 0) bottom left / 22% 4px, linear-gradient(var(--c) 0 0) bottom left / 4px 22%,
    linear-gradient(var(--c) 0 0) bottom right / 22% 4px, linear-gradient(var(--c) 0 0) bottom right / 4px 22%;
  background-repeat: no-repeat;
}
.hm-scanbox::after { content: ""; position: absolute; left: 6%; right: 6%; top: 8%; height: 3px; border-radius: 3px; background: var(--green); box-shadow: 0 0 12px 2px rgb(31 90 67 / .45); opacity: 0; }
.hm-demo.is-scan.is-hit .hm-scanbox { opacity: 1; }
.hm-demo.is-scan.is-hit .hm-scanbox::after { animation: hm-sweep .7s ease-in-out 2 alternate; }
@keyframes hm-sweep { from { top: 8%; opacity: 1; } to { top: 90%; opacity: 1; } }

/* AI writing: label switches, sparkle pulses, a cursor follows the text. */
.hm-ai-busy { display: none; }
.hm-demo.is-writing .hm-ai-idle { display: none; }
.hm-demo.is-writing .hm-ai-busy { display: inline; color: var(--green); font-weight: 650; }
.hm-demo.is-writing .rv-ai { font-size: 15px; }
.hm-demo.is-writing .sparkle { width: 18px; height: 18px; }
/* Before the words appear: soft shimmer where the text will go. */
.hm-demo.is-thinking .rv-text {
  border-radius: 6px; background: linear-gradient(90deg, #eef2ef 25%, #d9e6de 50%, #eef2ef 75%) 0 0 / 200% 100%;
  animation: hm-shimmer 1s linear infinite;
}
@keyframes hm-shimmer { to { background-position: -200% 0; } }
.hm-demo.is-writing .sparkle { animation: hm-pulse .8s ease-in-out infinite; }
@keyframes hm-pulse { 50% { transform: scale(1.35) rotate(18deg); } }
.hm-scr-review .rv-text.is-typing::after { content: ""; display: inline-block; width: 2px; height: 1.05em; margin-left: 1px; vertical-align: -2px; background: var(--green); animation: hm-blink .7s steps(1) infinite; }
@keyframes hm-blink { 50% { opacity: 0; } }

/* Finger press on "Copy & proceed". */
.hm-finger { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%; background: rgb(20 30 25 / .22); border: 2px solid rgb(255 255 255 / .85); opacity: 0; transform: scale(1.5); transition: opacity .2s, transform .25s; pointer-events: none; }
.hm-demo.is-press .hm-finger { opacity: 1; transform: scale(1); }

.hm-demo-caption { margin: 18px 0 0; min-height: 1.6em; text-align: center; font-weight: 650; color: var(--green); font-size: 16px; }

@media (prefers-reduced-motion: reduce) {
  .hm-demo-phone, .hm-scr, .hm-done-check { transition: none; }
}

/* ---------- Sections ---------- */
.hm-section { padding-top: 56px; padding-bottom: 56px; border-top: 1px solid var(--line); }
.hm-section h2, .hm-contact h2 { margin: 0 0 28px; font-size: clamp(26px, 4vw, 34px); letter-spacing: -.02em; line-height: 1.15; }

/* How it works: every picture is drawn at the same height. */
.hm-steps { --sh: 400px; list-style: none; margin: 0; padding: 0; display: grid; gap: 44px; }
.hm-steps > li { max-width: 330px; margin: 0 auto; width: 100%; }
.hm-step-media { height: var(--sh); margin: 0 0 22px; display: flex; justify-content: center; align-items: flex-end; }
.hm-step-media > img { height: 100%; width: calc(var(--sh) * var(--stand-ratio)); border-radius: 6px; box-shadow: 0 10px 28px rgb(0 0 0 / .10); }
.hm-step-media .hm-phone { height: 100%; width: calc(var(--sh) * var(--phone-ratio)); }
.hm-steps h3 { display: flex; align-items: baseline; gap: 10px; margin: 0 0 6px; font-size: 19px; }
.hm-num { color: var(--green); font-variant-numeric: tabular-nums; }
.hm-num::after { content: "."; }
.hm-steps p { margin: 0; color: var(--muted); font-size: 16px; }

@media (min-width: 860px) {
  .hm-steps { --sh: 380px; grid-template-columns: repeat(3, 1fr); gap: 40px; }
  .hm-steps > li { max-width: none; }
}

/* Why */
.hm-why { margin: 0; display: grid; gap: 0 48px; }
.hm-why > div { padding: 18px 0; border-top: 1px solid var(--line); }
.hm-why dt { font-weight: 650; font-size: 17.5px; }
.hm-why dd { margin: 4px 0 0; color: var(--muted); font-size: 16px; }
@media (min-width: 760px) { .hm-why { grid-template-columns: 1fr 1fr; } }

/* Who it's for */
.hm-for { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.hm-for li { display: inline-flex; align-items: center; gap: 10px; padding: 12px 18px; background: #fff; border: 1px solid var(--line); border-radius: 10px; font-weight: 600; font-size: 16px; }
.hm-for svg { color: var(--green); flex: none; }

/* Contact */
.hm-contact { background: var(--soft); border-top: 1px solid var(--line); padding: 64px 0; text-align: center; }
.hm-contact h2 { margin-bottom: 10px; }
.hm-contact p { margin: 0 auto 26px; color: var(--muted); max-width: 30em; }
.hm-contact .hm-soon { margin: 0 auto; color: var(--ink); font-weight: 600; }

/* Footer */
.hm-foot { display: flex; justify-content: space-between; gap: 12px; padding-top: 22px; padding-bottom: calc(22px + env(safe-area-inset-bottom)); font-size: 14px; color: var(--muted); }
