/* ============================================================
   Aiery — clinical-editorial design system
   Paper / forest-ink / vital-green · Newsreader + Hanken + IBM Plex Mono
   ============================================================ */

:root {
  --paper:      #F4F2EC;
  --paper-2:    #EDEAE1;
  --white:      #FFFFFF;
  --ink:        #15201A;
  --ink-2:      #2C3831;
  --muted:      #5E655D;
  --line:       #DCD7CB;
  --line-2:     #E7E3D9;
  --vital:      #1C7A4B;
  --vital-deep: #115235;
  --vital-soft: #E2EDE5;
  --clay:       #B5543A;
  --shadow:     0 1px 2px rgba(21,32,26,.04), 0 18px 40px -24px rgba(21,32,26,.18);
  --shadow-sm:  0 1px 2px rgba(21,32,26,.05), 0 8px 20px -16px rgba(21,32,26,.16);
  --r:          14px;
  --r-sm:       10px;
  --maxw:       1140px;
  --serif:      "Newsreader", Georgia, serif;
  --sans:       "Hanken Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono:       "IBM Plex Mono", ui-monospace, "SF Mono", monospace;
}

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

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

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* grain + faint clinical grid backdrop */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(21,32,26,.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21,32,26,.022) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 78%);
}
body::after {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .4;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.035'/%3E%3C/svg%3E");
}

.wrap { position: relative; z-index: 1; max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

a { color: inherit; text-decoration: none; }

/* ---------- shared atoms ---------- */
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--vital);
  display: inline-flex; align-items: center; gap: 9px;
}
.eyebrow::before {
  content: ""; width: 22px; height: 1px; background: var(--vital); opacity: .55;
}

.tag {
  font-family: var(--mono);
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 4px 11px;
  background: var(--white);
}

h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.06; letter-spacing: -.01em; }
h1 { font-size: clamp(40px, 6.4vw, 74px); }
h2 { font-size: clamp(30px, 4.2vw, 46px); }
h3 { font-size: 21px; line-height: 1.2; }
.serif-italic { font-style: italic; }

.lead { font-size: clamp(17px, 1.6vw, 20px); color: var(--ink-2); line-height: 1.55; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--sans); font-weight: 600; font-size: 16px;
  padding: 14px 24px; border-radius: 100px; border: 1px solid transparent;
  cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--vital); color: #F4FBF6; box-shadow: var(--shadow-sm); }
.btn-primary:hover { transform: translateY(-2px); background: var(--vital-deep); box-shadow: var(--shadow); }
.btn-ghost { background: var(--white); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { transform: translateY(-2px); border-color: var(--ink); }
.btn svg { width: 17px; height: 17px; }

/* ============================================================
   NAV
   ============================================================ */
header.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--line-2);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand .mark {
  font-family: var(--serif); font-size: 24px; font-weight: 600; letter-spacing: -.02em;
  display: inline-flex; align-items: center; gap: 8px;
}
.brand .mark .leaf { color: var(--vital); }
.brand .sub { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a { font-size: 15px; color: var(--ink-2); transition: color .15s; }
.nav-links a:hover { color: var(--vital); }
.nav-phone {
  font-family: var(--mono); font-size: 14px; color: var(--ink);
  display: inline-flex; align-items: center; gap: 8px;
}
.nav-phone .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--vital); box-shadow: 0 0 0 0 rgba(28,122,75,.5); animation: pulse 2.4s infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(28,122,75,.45)} 70%{box-shadow:0 0 0 7px rgba(28,122,75,0)} 100%{box-shadow:0 0 0 0 rgba(28,122,75,0)} }
@media (max-width: 820px){ .nav-links a:not(.btn){ display:none; } .brand .sub{ display:none; } }

/* ============================================================
   HERO
   ============================================================ */
.hero { padding: clamp(54px, 8vw, 96px) 0 clamp(40px,6vw,72px); }
.hero-grid { display: grid; grid-template-columns: 1.08fr .92fr; gap: clamp(36px,5vw,72px); align-items: center; }
.hero h1 { margin: 22px 0 24px; }
.hero h1 em { font-style: italic; color: var(--vital-deep); }
.hero .lead { max-width: 42ch; }
.hero-cta { display: flex; align-items: center; gap: 16px; margin-top: 34px; flex-wrap: wrap; }
.hero-phone { margin-top: 30px; display: flex; align-items: center; gap: 14px; }
.hero-phone .num { font-family: var(--mono); font-size: clamp(20px,2.4vw,26px); letter-spacing: -.01em; }
.hero-phone .label { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.hero-trust { display: flex; gap: 22px; margin-top: 40px; flex-wrap: wrap; }
.hero-trust span { font-size: 13.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 7px; }
.hero-trust span::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--vital); }

/* hero record card */
.record {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); overflow: hidden;
  transform: rotate(.4deg);
}
.record-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line-2); background: var(--paper-2);
}
.record-head .who { display: flex; align-items: center; gap: 11px; }
.record-head .avatar {
  width: 38px; height: 38px; border-radius: 50%; background: var(--vital-soft);
  display: grid; place-items: center; font-family: var(--serif); color: var(--vital-deep); font-size: 18px; font-weight: 600;
  border: 1px solid #cfe0d4;
}
.record-head .who b { font-size: 15px; font-weight: 600; }
.record-head .who small { display: block; font-family: var(--mono); font-size: 10.5px; color: var(--muted); letter-spacing: .05em; }
.record-head .live { font-family: var(--mono); font-size: 10.5px; color: var(--vital); display: inline-flex; align-items: center; gap: 6px; letter-spacing: .08em; }
.record-head .live .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--vital); animation: pulse 2.4s infinite; }
.record-body { padding: 18px 20px 22px; }
.rec-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 4px 0 12px; }
.rec-row {
  display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-top: 1px dashed var(--line-2);
}
.rec-row:first-of-type { border-top: none; }
.rec-row .ic { color: var(--vital); margin-top: 2px; flex-shrink: 0; }
.rec-row .ic svg { width: 16px; height: 16px; display: block; }
.rec-row p { font-size: 14.5px; line-height: 1.45; }
.rec-row p span { color: var(--muted); }
.rec-foot {
  margin-top: 16px; padding: 13px 15px; border-radius: var(--r-sm);
  background: var(--vital-soft); border: 1px solid #cfe0d4;
  font-size: 14px; color: var(--vital-deep); display: flex; gap: 10px; align-items: center;
}
.rec-foot .q { font-style: italic; font-family: var(--serif); font-size: 15.5px; }

/* ECG strip */
.ecg { display: block; width: 100%; height: 40px; color: var(--vital); opacity: .5; }
.ecg path { stroke-dasharray: 700; stroke-dashoffset: 700; animation: trace 4.5s linear infinite; }
@keyframes trace { to { stroke-dashoffset: -700; } }

@media (max-width: 880px){
  .hero-grid { grid-template-columns: 1fr; }
  .record { order: -1; transform: none; max-width: 460px; }
}

/* ============================================================
   SECTION SHELL
   ============================================================ */
section { position: relative; z-index: 1; }
.band { padding: clamp(60px, 9vw, 110px) 0; }
.band--paper2 { background: var(--paper-2); border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.band--ink { background: var(--ink); color: #E9EDE9; }
.band--ink h2, .band--ink h3 { color: #FBFCFB; }
.band--ink .lead { color: #B7C0B9; }
.sec-head { max-width: 60ch; margin-bottom: 48px; }
.sec-head h2 { margin: 16px 0 14px; }

/* ---------- memory / record chart section ---------- */
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.chart-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r);
  padding: 26px 26px 24px; box-shadow: var(--shadow-sm);
}
.chart-card .kind { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--vital); margin-bottom: 18px; display: flex; align-items: center; gap: 8px; }
.entry { display: flex; gap: 13px; padding: 13px 0; border-top: 1px solid var(--line-2); }
.entry:first-of-type { border-top: none; padding-top: 4px; }
.entry .stamp { font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap; min-width: 58px; padding-top: 2px; }
.entry p { font-size: 15px; line-height: 1.45; }
.entry p b { font-weight: 600; }
@media (max-width: 760px){ .chart-grid { grid-template-columns: 1fr; } }

/* ---------- steps ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; counter-reset: step; }
.step { position: relative; padding-top: 26px; border-top: 2px solid var(--ink); }
.step .n { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; color: var(--vital); margin-bottom: 14px; }
.step h3 { margin-bottom: 9px; }
.step p { font-size: 15px; color: var(--muted); }
@media (max-width: 760px){ .steps { grid-template-columns: 1fr; } }

/* ---------- pricing ---------- */
.price-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.price {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r);
  padding: 26px 22px; display: flex; flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease;
}
.price:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.price.feat { background: var(--ink); color: #EAEEEA; border-color: var(--ink); position: relative; }
.price.feat .name, .price.feat .amt { color: #fff; }
.price.feat .per, .price.feat li { color: #B7C0B9; }
.price .badge {
  position: absolute; top: -11px; left: 22px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  background: var(--vital); color: #fff; padding: 4px 10px; border-radius: 100px;
}
.price .name { font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.price .amt { font-family: var(--serif); font-size: 38px; margin: 14px 0 2px; }
.price .per { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.price ul { list-style: none; display: flex; flex-direction: column; gap: 9px; margin-bottom: 22px; flex: 1; }
.price li { font-size: 14px; color: var(--ink-2); display: flex; gap: 9px; align-items: flex-start; }
.price li::before { content: "+"; color: var(--vital); font-weight: 700; }
.price.feat li::before { color: #6FD49E; }
.price .btn { width: 100%; justify-content: center; }
@media (max-width: 900px){ .price-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px){ .price-grid { grid-template-columns: 1fr; } }

/* ---------- safety strip ---------- */
.safety-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; margin-top: 8px; }
.safety .it { padding: 22px; border: 1px solid rgba(255,255,255,.12); border-radius: var(--r); background: rgba(255,255,255,.02); }
.safety .it .ic { color: #6FD49E; margin-bottom: 14px; }
.safety .it .ic svg { width: 24px; height: 24px; }
.safety .it h3 { font-size: 18px; margin-bottom: 8px; }
.safety .it p { font-size: 14.5px; color: #AEB7B0; }
@media (max-width: 760px){ .safety-grid { grid-template-columns: 1fr; } }

/* ============================================================
   SIGNUP
   ============================================================ */
.signup-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(34px,5vw,64px); align-items: start; }
.signup-aside .num-big { font-family: var(--mono); font-size: clamp(24px,3vw,32px); margin: 18px 0 6px; }
.signup-aside .lead { max-width: 38ch; }
.signup-aside .checklist { list-style: none; margin-top: 30px; display: flex; flex-direction: column; gap: 14px; }
.signup-aside .checklist li { display: flex; gap: 12px; font-size: 15px; color: var(--ink-2); }
.signup-aside .checklist .ic { color: var(--vital); flex-shrink: 0; }
.signup-aside .checklist .ic svg { width: 19px; height: 19px; }

.form-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r);
  padding: clamp(26px, 3.4vw, 40px); box-shadow: var(--shadow);
}
.form-card .corner { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; margin-bottom: 24px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 7px; letter-spacing: .01em; }
.field label .req { color: var(--clay); }
.field input, .field select {
  width: 100%; font-family: var(--sans); font-size: 16px; color: var(--ink);
  padding: 13px 15px; border: 1.5px solid var(--line); border-radius: var(--r-sm);
  background: var(--paper); transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder { color: #9AA09A; }
.field input:focus, .field select:focus { outline: none; border-color: var(--vital); box-shadow: 0 0 0 3px var(--vital-soft); background: var(--white); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 480px){ .field-row { grid-template-columns: 1fr; } }

.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  position: relative; cursor: pointer;
  font-size: 14px; padding: 9px 15px; border: 1.5px solid var(--line); border-radius: 100px;
  background: var(--paper); transition: all .15s; user-select: none;
}
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip:has(input:checked) { border-color: var(--vital); background: var(--vital-soft); color: var(--vital-deep); font-weight: 600; }

.consent {
  margin: 22px 0 20px; padding: 16px; border: 1.5px solid var(--line-2); border-radius: var(--r-sm);
  background: var(--paper); display: flex; gap: 12px; align-items: flex-start;
}
.consent input { width: 19px; height: 19px; margin-top: 2px; accent-color: var(--vital); flex-shrink: 0; cursor: pointer; }
.consent label { font-size: 12.5px; line-height: 1.5; color: var(--muted); cursor: pointer; }
.consent label a { color: var(--vital-deep); text-decoration: underline; text-underline-offset: 2px; }
.consent label b { color: var(--ink-2); font-weight: 600; }

.form-card .btn-primary { width: 100%; justify-content: center; font-size: 17px; padding: 16px; }
.form-card .btn-primary:disabled { opacity: .55; cursor: progress; transform: none; }
.form-note { text-align: center; font-size: 12.5px; color: var(--muted); margin-top: 14px; }

.form-success { display: none; text-align: center; padding: 24px 8px; }
.form-success.on { display: block; animation: rise .5s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.form-success .ck {
  width: 64px; height: 64px; border-radius: 50%; background: var(--vital-soft); border: 1px solid #cfe0d4;
  display: grid; place-items: center; margin: 0 auto 22px; color: var(--vital);
}
.form-success .ck svg { width: 30px; height: 30px; }
.form-success h3 { font-size: 28px; margin-bottom: 12px; }
.form-success p { color: var(--muted); max-width: 34ch; margin: 0 auto 8px; }
.form-success .call-num { font-family: var(--mono); font-size: 22px; color: var(--vital-deep); margin: 18px 0 6px; display: block; }
.form-err { display: none; margin-top: 14px; padding: 12px 14px; border-radius: var(--r-sm); background: #FBEAE5; border: 1px solid #EBC7BC; color: #8C3A24; font-size: 14px; }
.form-err.on { display: block; }

/* ============================================================
   FOOTER
   ============================================================ */
footer.foot { background: var(--ink); color: #AEB7B0; padding: 56px 0 40px; position: relative; z-index: 1; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding-bottom: 36px; border-bottom: 1px solid rgba(255,255,255,.1); }
.foot .mark { font-family: var(--serif); font-size: 26px; color: #fff; margin-bottom: 12px; display: inline-flex; gap: 8px; align-items: center; }
.foot .mark .leaf { color: #6FD49E; }
.foot p { font-size: 14px; max-width: 34ch; }
.foot .num { font-family: var(--mono); color: #DCE3DD; margin-top: 16px; display: inline-block; }
.foot h4 { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #79847C; margin-bottom: 16px; }
.foot ul { list-style: none; display: flex; flex-direction: column; gap: 11px; }
.foot ul a { font-size: 14px; color: #C2CAC3; transition: color .15s; }
.foot ul a:hover { color: #6FD49E; }
.foot-base { display: flex; justify-content: space-between; align-items: center; padding-top: 26px; flex-wrap: wrap; gap: 12px; }
.foot-base small { font-size: 12.5px; color: #79847C; font-family: var(--mono); letter-spacing: .03em; }
@media (max-width: 760px){ .foot-grid { grid-template-columns: 1fr; gap: 30px; } }

/* ============================================================
   LEGAL PAGES
   ============================================================ */
.legal { padding: clamp(48px,7vw,86px) 0 80px; max-width: 760px; }
.legal .eyebrow { margin-bottom: 18px; }
.legal h1 { font-size: clamp(36px,5vw,54px); margin-bottom: 10px; }
.legal .updated { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: .06em; margin-bottom: 44px; }
.legal h2 { font-size: 24px; margin: 42px 0 14px; }
.legal h3 { font-size: 18px; margin: 26px 0 10px; }
.legal p, .legal li { font-size: 16px; color: var(--ink-2); line-height: 1.68; margin-bottom: 14px; }
.legal ul, .legal ol { padding-left: 22px; margin-bottom: 16px; }
.legal li { margin-bottom: 8px; }
.legal a { color: var(--vital-deep); text-decoration: underline; text-underline-offset: 2px; }
.legal strong { color: var(--ink); }
.legal .callout {
  border-left: 3px solid var(--vital); background: var(--vital-soft);
  padding: 16px 20px; border-radius: 0 var(--r-sm) var(--r-sm) 0; margin: 22px 0;
}
.legal .callout p { margin: 0; color: var(--vital-deep); }
.back-home { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); margin-bottom: 30px; }
.back-home:hover { color: var(--vital); }

/* reveal on load */
.reveal { opacity: 0; transform: translateY(16px); }
.reveal.in { opacity: 1; transform: none; transition: opacity .7s ease, transform .7s ease; }
@media (prefers-reduced-motion: reduce){ .reveal { opacity: 1; transform: none; } .ecg path, .nav-phone .dot, .record-head .live .dot { animation: none; } }
