/* ============================================================
   GENUE LABS — design system "Engineering Notebook"
   Paper + ink. Mono annotations. Hairline rules. No hype.
   Fonts: Space Grotesk (display) · IBM Plex Sans (body) ·
          IBM Plex Mono (labels) — all on Google Fonts.
   ============================================================ */

:root {
  /* color */
  --paper:        #F7F5F0;
  --paper-raised: #FFFFFF;
  --ink:          #14283A;
  --ink-70:       rgba(20, 40, 58, 0.72);
  --ink-50:       rgba(20, 40, 58, 0.52);
  --ink-30:       rgba(20, 40, 58, 0.30);
  --line:         rgba(20, 40, 58, 0.16);
  --line-soft:    rgba(20, 40, 58, 0.09);

  /* product accents */
  --med:          #137F72;   /* MedAlert teal */
  --med-soft:     #E3F0EE;
  --med-red:      #C8232E;   /* MedAlert pill red */
  --mem:          #178F63;   /* Memoria green */
  --mem-soft:     #E4F1EA;
  --acc:          #2E6FDC;   /* AccessiScan blue */
  --acc-soft:     #E7EEFB;
  --ka:           #26356A;   /* KA Formula navy */
  --ka-soft:      #E6E2D2;
  --ka-cream:     #ECE7D8;   /* KA Formula egret */

  /* type */
  --f-display: 'Space Grotesk', sans-serif;
  --f-body:    'IBM Plex Sans', sans-serif;
  --f-mono:    'IBM Plex Mono', monospace;

  /* rhythm */
  --wrap: 1180px;
  --gut: 24px;
  --r: 4px;          /* base radius — deliberately sharp */
  --r-lg: 12px;

  --ease: cubic-bezier(.22,.61,.36,1);
}

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

html { scroll-behavior: smooth; }

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

::selection { background: var(--ink); color: var(--paper); }

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

a { color: inherit; }

/* ---------- layout ---------- */

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-left: var(--gut);
  padding-right: var(--gut);
}

@media (min-width: 768px) {
  .wrap { padding-left: 48px; padding-right: 48px; }
}

section { position: relative; }

.rule { border: 0; border-top: 1px solid var(--line); }

/* ---------- typography ---------- */

h1, h2, h3 { font-family: var(--f-display); letter-spacing: -0.02em; line-height: 1.05; text-wrap: balance; }

.display {
  font-size: clamp(44px, 7.2vw, 92px);
  font-weight: 700;
}

.h2 {
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 700;
}

.h3 { font-size: clamp(21px, 2.2vw, 26px); font-weight: 600; }

.lede {
  font-size: clamp(18px, 1.6vw, 21px);
  color: var(--ink-70);
  line-height: 1.55;
  max-width: 56ch;
  text-wrap: pretty;
}

.eyebrow {
  font-family: var(--f-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-50);
  display: flex;
  align-items: center;
  gap: 12px;
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--ink-30);
  flex: none;
}

.mono { font-family: var(--f-mono); }

/* ---------- nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247, 245, 240, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.nav-logo img { width: 30px; height: 30px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-link {
  font-family: var(--f-mono);
  font-size: 13.5px;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--ink-70);
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: color 160ms var(--ease), border-color 160ms var(--ease);
}

.nav-link:hover { color: var(--ink); border-bottom-color: var(--ink); }

.nav-link[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }

.nav-cta {
  font-family: var(--f-mono);
  font-size: 13.5px;
  text-decoration: none;
  color: var(--paper);
  background: var(--ink);
  padding: 9px 18px;
  border-radius: var(--r);
  transition: transform 160ms var(--ease), box-shadow 160ms var(--ease);
}

.nav-cta:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(20,40,58,0.25); }

.nav-burger {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--r);
  width: 40px;
  height: 40px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-direction: column;
}

.nav-burger span {
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 200ms var(--ease), opacity 200ms var(--ease);
}

@media (max-width: 860px) {
  .nav-links, .nav-cta { display: none; }
  .nav-burger { display: flex; }
  .nav.open .nav-links {
    display: flex;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 8px 24px 16px;
  }
  .nav.open .nav-links li { width: 100%; }
  .nav.open .nav-link {
    display: block;
    padding: 14px 0;
    font-size: 16px;
    border-bottom: 1px solid var(--line-soft);
  }
  .nav.open .nav-burger span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
  .nav.open .nav-burger span:nth-child(2) { opacity: 0; }
  .nav.open .nav-burger span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-mono);
  font-size: 14.5px;
  text-decoration: none;
  padding: 13px 24px;
  border-radius: var(--r);
  border: 1px solid var(--ink);
  transition: transform 160ms var(--ease), box-shadow 160ms var(--ease), background 160ms var(--ease), color 160ms var(--ease);
  cursor: pointer;
}

.btn-fill { background: var(--ink); color: var(--paper); }
.btn-fill:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(20,40,58,0.28); }

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

.store-badges { display: flex; gap: 12px; flex-wrap: wrap; }
.store-badges a { display: block; border-radius: 8px; transition: transform 160ms var(--ease), box-shadow 160ms var(--ease); }
.store-badges a:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(20,40,58,0.22); }
.store-badges img { height: 46px; width: auto; }

/* ---------- fact ledger ---------- */

.ledger {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.ledger > div {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 18px 20px 16px;
}

.ledger dt {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-50);
  margin-bottom: 6px;
}

.ledger dd {
  font-family: var(--f-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ---------- product panels (home) ---------- */

.product {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 6vw, 88px);
  align-items: center;
  padding: clamp(56px, 8vw, 110px) 0;
}

.product + .product { border-top: 1px solid var(--line); }

@media (max-width: 860px) {
  .product { grid-template-columns: 1fr; gap: 40px; }
  .product .phone-stage { order: -1; }
}

.product-id {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.product-id img { width: 52px; height: 52px; border-radius: 12px; border: 1px solid var(--line); background: #fff; }

.product-id .name { font-family: var(--f-display); font-size: 26px; font-weight: 700; line-height: 1.1; }
.product-id .tag { font-family: var(--f-mono); font-size: 13px; color: var(--ink-50); }

.feature-rows { list-style: none; margin: 26px 0 30px; border-top: 1px solid var(--line); }

.feature-rows li {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 11px 2px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 16px;
  color: var(--ink-70);
}

.feature-rows .idx {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--ink-30);
  flex: none;
  width: 22px;
}

.product-links { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }

.text-link {
  font-family: var(--f-mono);
  font-size: 14.5px;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ink-30);
  padding-bottom: 2px;
  transition: border-color 160ms var(--ease);
}

.text-link:hover { border-bottom-color: var(--ink); }

/* ---------- phone mock ---------- */

.phone-stage {
  display: flex;
  justify-content: center;
  padding: clamp(20px, 3vw, 36px);
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 28px 28px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}

.phone {
  width: 296px;
  border: 1.5px solid var(--ink);
  border-radius: 38px;
  background: #fff;
  padding: 10px;
  box-shadow: 10px 12px 0 rgba(20,40,58,0.10);
  flex: none;
}

.phone-screen {
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  background: #FBFBF9;
  display: flex;
  flex-direction: column;
  height: 588px;
}

.phone-status {
  display: flex;
  justify-content: space-between;
  font-family: var(--f-mono);
  font-size: 11px;
  padding: 10px 18px 6px;
  color: var(--ink-50);
}

/* ---------- principles ---------- */

.principles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

@media (max-width: 860px) { .principles { grid-template-columns: 1fr; } }

.principle {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: clamp(26px, 3.4vw, 44px);
}

.principle .num {
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--ink-30);
  display: block;
  margin-bottom: 16px;
}

.principle h3 { margin-bottom: 12px; }

.principle p { color: var(--ink-70); font-size: 16px; max-width: 44ch; text-wrap: pretty; }

/* ---------- footer ---------- */

.footer { border-top: 1px solid var(--line); margin-top: clamp(56px, 8vw, 110px); }

.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  padding: clamp(40px, 6vw, 72px) 0 28px;
}

@media (max-width: 860px) { .footer-inner { grid-template-columns: 1fr; gap: 28px; } }

.footer h4 {
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-50);
  margin-bottom: 14px;
}

.footer ul { list-style: none; }
.footer li { margin-bottom: 9px; }

.footer a { color: var(--ink-70); text-decoration: none; font-size: 15px; transition: color 140ms var(--ease); }
.footer a:hover { color: var(--ink); text-decoration: underline; }

.footer-brand p { color: var(--ink-70); font-size: 15px; max-width: 34ch; margin-top: 10px; text-wrap: pretty; }

.footer-base {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line-soft);
  padding: 18px 0 26px;
  font-family: var(--f-mono);
  font-size: 12.5px;
  color: var(--ink-50);
}

/* ---------- doc / legal layout ---------- */

.page-head { padding: clamp(48px, 7vw, 96px) 0 clamp(28px, 4vw, 48px); border-bottom: 1px solid var(--line); }

.page-head .display { font-size: clamp(36px, 5vw, 64px); }

.doc { max-width: 760px; padding: clamp(36px, 5vw, 64px) 0; counter-reset: docsec; }

.doc section { margin-bottom: 44px; }

.doc h2 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 14px;
  counter-increment: docsec;
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.doc h2::before {
  content: counter(docsec, decimal-leading-zero);
  font-family: var(--f-mono);
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-30);
}

.doc p { color: var(--ink-70); margin-bottom: 12px; font-size: 16.5px; text-wrap: pretty; }

.doc ul { margin: 12px 0 12px 4px; list-style: none; }

.doc li {
  color: var(--ink-70);
  padding: 6px 0 6px 26px;
  position: relative;
  font-size: 16.5px;
}

.doc li::before {
  content: "—";
  position: absolute;
  left: 0;
  font-family: var(--f-mono);
  color: var(--ink-30);
}

.doc a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--ink-30); text-underline-offset: 3px; }
.doc a:hover { text-decoration-color: var(--ink); }

.doc strong { color: var(--ink); }

.doc .highlight-box, .doc .contact-box, .doc .warning-box {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px 26px;
  margin: 22px 0;
  background: var(--paper-raised);
}

.doc .warning-box { border-color: rgba(200,35,46,0.4); }

.doc .contact-box h3, .doc .highlight-box h3 { font-size: 18px; margin-bottom: 8px; }

/* ---------- FAQ ---------- */

.faq details { border-bottom: 1px solid var(--line); }

.faq summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 20px 2px;
  font-family: var(--f-display);
  font-size: 18px;
  font-weight: 600;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "+";
  font-family: var(--f-mono);
  font-size: 20px;
  font-weight: 400;
  color: var(--ink-50);
  transition: transform 200ms var(--ease);
  flex: none;
}

.faq details[open] summary::after { transform: rotate(45deg); }

.faq details p { color: var(--ink-70); padding: 0 2px 22px; max-width: 64ch; }

/* ---------- reveal animation ---------- */

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 600ms var(--ease), transform 600ms var(--ease);
  }
  .reveal.in { opacity: 1; transform: none; }
}

/* ---------- utility ---------- */

.section-pad { padding: clamp(56px, 8vw, 110px) 0; }
.stack-8  { display: grid; gap: 8px; }
.stack-16 { display: grid; gap: 16px; }
.stack-24 { display: grid; gap: 24px; }
