/* hadianlabs.com — one stylesheet for every page (PUBLIC_SITE §8).
 *
 * Hadian Labs is the neutral parent: paper, ink and hairlines, headings in a book serif. Colour
 * belongs to the products — Curevise's teal appears only in its own panel, the same in both themes.
 * Light is the default; [data-theme="dark"] is set by theme.js when the visitor asks for it
 * (ADR-0092), never from the device's setting. The phone screenshots stay light in dark mode.
 *
 * Drawn on the design page (design-system/site/2026-10-30-hadianlabs/, round 3): its tokens, sizes
 * and forms, its container queries turned into media queries, and in-between widths added so the
 * panel's phones never cover its words.
 *
 * Same-origin only: the fonts and the images are served by this site and nothing else is fetched.
 * No @import, no escape sequence, and no off-origin reference in any position — check_site_egress
 * refuses them, and every page's policy refuses the request. */

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Literata";
  src: url("/fonts/literata.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  --paper: #f5f5f1;
  --sheet: #ffffff;
  --ink: #17191b;
  --ink-2: #5a5f64;
  --rule: #dcdcd5;
  --bezel: #1a1c1a;
  --phone-shadow: 0 40px 80px -30px rgba(3, 30, 36, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.08);

  /* Curevise's own panel: the same teal in both themes, as curevise.com's band. */
  --cv: #116576;
  --cv-ink: #062930;
  --on-cv: #ffffff;
  --on-cv-2: #cfe4e8;

  --display: "Literata", Georgia, "Times New Roman", serif;
  --body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;

  --wrap: 1200px;
  --gut: 56px;
  --header: 76px;
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --paper: #111213;
  --sheet: #1a1b1d;
  --ink: #ebebe7;
  --ink-2: #a0a4a8;
  --rule: #2c2e31;
  --bezel: #050505;
  --phone-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.14);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header) + 16px); }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  font-feature-settings: "kern", "calt";
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }

a { color: inherit; text-underline-offset: 0.22em; text-decoration-thickness: 1px; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }

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

p { margin: 0; }

h1, h2, h3 { margin: 0; text-wrap: balance; }

h1, h2 {
  font-family: var(--display);
  font-optical-sizing: auto;
  font-weight: 500;
  letter-spacing: -0.012em;
}

/* Buttons and links */

.button {
  display: inline-flex; align-items: center;
  height: 50px; padding: 0 24px;
  border-radius: 999px;
  background: var(--ink); color: var(--paper);
  font-weight: 600; font-size: 16px; text-decoration: none;
  transition: opacity 120ms ease;
}
.button:hover { opacity: 0.86; }

.text-link { font-weight: 600; font-size: 16px; text-decoration: underline; }

/* The mark: an ink tile with the H in paper, so it turns over with the theme. */

.tile { fill: var(--ink); }
.letter { fill: var(--paper); }

/* Header — stays on top as the page scrolls (SITE_PASS §5) */

.site-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  height: var(--header);
}

.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.brand svg { width: 30px; height: 30px; flex: none; }
.brand span {
  font-family: var(--display); font-optical-sizing: auto;
  font-size: 23px; font-weight: 600; letter-spacing: -0.01em; line-height: 1;
}

.header-end { display: flex; align-items: center; gap: 30px; }

.site-nav { display: flex; gap: 34px; font-size: 15px; font-weight: 500; }
.site-nav a { color: var(--ink-2); text-decoration: none; }
.site-nav a:hover { color: var(--ink); }

/* The light/dark switch and the phone menu share one round shape. */

.theme-toggle,
.menu summary {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px; padding: 0;
  border-radius: 999px; border: 1px solid var(--rule);
  background: transparent; color: var(--ink-2);
  cursor: pointer;
}
.theme-toggle:hover,
.menu summary:hover { color: var(--ink); border-color: var(--ink-2); }
.theme-toggle svg,
.menu summary svg {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
/* `hidden` until theme.js runs: an author `display` would otherwise beat it. */
.theme-toggle[hidden] { display: none; }
/* A moon in light (tap for dark), a sun in dark (tap for light). */
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }

/* The phone menu: a <details>, so it opens and closes with no script (ADR-0092 d4). Its links
 * drop below the header, never over the switch. Hidden on wider screens. */
.menu { display: none; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu .close { display: none; }
.menu[open] .open { display: none; }
.menu[open] .close { display: block; }
.menu nav {
  position: absolute; left: 0; right: 0; top: 100%;
  padding: 0 var(--gut);
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.menu nav a {
  display: block; padding: 15px 0;
  font-size: 18px; font-weight: 500; text-decoration: none;
  border-top: 1px solid var(--rule);
}
.menu nav a:first-child { border-top: 0; }

/* Home: the statement */

.hero { padding: 128px 0 112px; }
.hero h1 { font-size: 84px; line-height: 1.02; max-width: 11.5em; }
.lead { margin-top: 32px; font-size: 21px; line-height: 1.55; color: var(--ink-2); max-width: 34em; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 30px; margin-top: 44px; }

/* Home: the products, Curevise in its own teal panel with its phones rising out of the bottom edge */

.products { padding: 0 0 120px; }
.section-title { font-size: 44px; line-height: 1.1; padding-top: 40px; border-top: 1px solid var(--rule); }

.product {
  --k: 0.74; --bz: 10px; --pw: calc(360px * var(--k) + var(--bz) * 2);
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px;
  margin-top: 40px; border-radius: 28px;
  background: var(--cv); color: var(--on-cv);
}
.product-copy { padding: 72px 0 72px 72px; min-width: 0; }
.product-name {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--body); font-size: 21px; font-weight: 650; letter-spacing: -0.02em;
}
.product-name svg { width: 44px; height: 44px; flex: none; }
.product-name .ct { fill: #ffffff; }
.product-name .cl { fill: var(--cv); }
.product-line {
  margin-top: 30px; max-width: 12em;
  font-size: 46px; line-height: 1.08; font-weight: 650; letter-spacing: -0.034em; text-wrap: balance;
}
.product-body { margin-top: 22px; font-size: 18px; line-height: 1.6; max-width: 26em; color: var(--on-cv-2); }
.product-platform { margin-top: 14px; font-size: 15px; color: var(--on-cv-2); }
.product-button {
  display: inline-flex; align-items: center;
  height: 50px; padding: 0 24px; margin-top: 36px;
  border-radius: 999px;
  background: #ffffff; color: var(--cv-ink);
  font-weight: 600; font-size: 16px; text-decoration: none;
}
.product-button:focus-visible { outline-color: #ffffff; }

.product-art { position: relative; min-width: 0; height: 600px; align-self: end; }
.phone {
  position: absolute; bottom: -150px;
  width: var(--pw); padding: var(--bz);
  border-radius: calc(var(--bz) + 36px * var(--k));
  background: var(--bezel);
  box-shadow: var(--phone-shadow);
}
.screen {
  overflow: hidden;
  width: calc(360px * var(--k)); height: calc(800px * var(--k));
  border-radius: calc(36px * var(--k));
  background: #ffffff;
}
.screen img { display: block; width: 100%; height: 100%; max-width: none; }
.phone-home { right: 56px; }
.phone-card { right: calc(56px + var(--pw) - 92px); bottom: -230px; }

/* Inner pages: the head, and rows of a heading beside its text */

.page-head { padding: 104px 0 64px; }
.page-head h1 { font-size: 64px; line-height: 1.05; }
.page-head .lead { margin-top: 22px; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 48px; }
.row .split { border-top: 1px solid var(--rule); padding: 40px 0 48px; }
.row:last-child .split { padding-bottom: 120px; }
.row h2 { font-size: 28px; line-height: 1.2; }
.copy { min-width: 0; }
.copy p { font-size: 18px; line-height: 1.65; max-width: 36em; }
.copy p + p { margin-top: 14px; }

/* Contact */

.sheets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; padding-bottom: 72px; }
.sheet { min-width: 0; padding: 32px 32px 34px; border: 1px solid var(--rule); border-radius: 20px; background: var(--sheet); }
.sheet h2 { font-family: var(--body); font-size: 18px; font-weight: 650; letter-spacing: -0.01em; }
.sheet p { margin-top: 6px; font-size: 16px; color: var(--ink-2); }
.sheet .address {
  margin-top: 26px;
  font-size: 22px; font-weight: 550; letter-spacing: -0.01em; color: var(--ink);
  overflow-wrap: anywhere;
}

.facts { margin: 0; display: grid; }
.facts div { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; padding: 14px 0; border-top: 1px solid var(--rule); }
.facts div:first-child { border-top: 0; padding-top: 4px; }
.facts dt { font-size: 15px; color: var(--ink-2); }
.facts dd { margin: 0; font-size: 17px; }

/* Legal pages: the contents beside the text */

.legal { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 72px; padding-top: 8px; padding-bottom: 128px; }
.contents { align-self: start; padding-top: 18px; border-top: 1px solid var(--rule); font-size: 15px; }
.contents h2 { margin-bottom: 10px; font-family: var(--body); font-size: 14px; font-weight: 600; letter-spacing: 0; }
.contents ol { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.contents a { color: var(--ink-2); text-decoration: none; }
.contents a:hover { color: var(--ink); text-decoration: underline; }
.doc { max-width: 42em; padding-top: 18px; border-top: 1px solid var(--rule); }
.doc .updated { font-size: 14px; color: var(--ink-2); }
.doc p { margin-top: 16px; font-size: 17px; line-height: 1.7; }
.doc .updated + p { margin-top: 20px; }
.doc h2 { margin-top: 44px; font-size: 25px; line-height: 1.25; }
.doc h2 + p { margin-top: 12px; }

/* Footer */

.site-footer { padding: 64px 0 44px; border-top: 1px solid var(--rule); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 32px; }
.footer-brand p { margin-top: 14px; max-width: 22em; font-size: 15px; color: var(--ink-2); }
.site-footer h2 { font-family: var(--body); font-size: 14px; font-weight: 600; letter-spacing: 0; color: var(--ink-2); }
.site-footer ul { display: grid; gap: 10px; margin: 14px 0 0; padding: 0; list-style: none; font-size: 15px; }
.site-footer ul a { text-decoration: none; }
.site-footer ul a:hover { text-decoration: underline; }
.footer-bottom { margin-top: 64px; padding-top: 22px; border-top: 1px solid var(--rule); font-size: 14px; color: var(--ink-2); }

/* A laptop narrower than the drawn 1440: smaller phones, so they stay clear of the panel's words. */

@media (max-width: 1199px) {
  :root { --gut: 40px; }
  .product { --k: 0.62; }
  .product-copy { padding: 64px 0 64px 56px; }
  .product-art { height: 520px; }
  .phone { bottom: -130px; }
  .phone-home { right: 32px; }
  .phone-card { right: calc(32px + var(--pw) - 90px); bottom: -200px; }
}

/* A tablet: one column, the panel's words above its phones. */

@media (max-width: 999px) {
  .hero { padding: 96px 0 88px; }
  .hero h1 { font-size: 64px; line-height: 1.04; }
  .section-title { font-size: 38px; }
  .page-head h1 { font-size: 54px; }
  .product { grid-template-columns: minmax(0, 1fr); gap: 0; --k: 0.66; }
  .product-copy { padding: 48px 48px 8px; }
  .product-line { font-size: 40px; }
  .product-art { height: 420px; }
  .phone { bottom: -190px; }
  .phone-home { right: 48px; }
  .phone-card { right: calc(48px + var(--pw) - 80px); bottom: -240px; }
  .legal { grid-template-columns: 200px minmax(0, 1fr); gap: 48px; }
}

/* A phone (the drawn 390): the links behind the menu, everything in one column. */

@media (max-width: 700px) {
  :root { --gut: 20px; --header: 60px; }
  body { font-size: 16px; }

  .brand span { font-size: 19px; }
  .brand svg { width: 26px; height: 26px; }
  .header-end { gap: 10px; }
  .site-nav { display: none; }
  .menu { display: block; }

  .hero { padding: 64px 0; }
  .hero h1 { font-size: 44px; line-height: 1.06; }
  .lead { margin-top: 20px; font-size: 18px; }
  .actions { gap: 14px 24px; margin-top: 30px; }

  .products { padding-bottom: 72px; }
  .section-title { font-size: 32px; padding-top: 28px; }
  .product { --k: 0.6; --bz: 8px; margin-top: 28px; border-radius: 22px; }
  .product-copy { padding: 30px 24px 8px; }
  .product-name svg { width: 38px; height: 38px; }
  .product-line { margin-top: 22px; font-size: 31px; }
  .product-body { margin-top: 14px; font-size: 16px; }
  .product-button { height: 48px; margin-top: 24px; }
  .product-art { height: 340px; }
  .phone { bottom: -170px; }
  .phone-home { right: 22px; }
  .phone-card { right: calc(22px + var(--pw) - 64px); bottom: -205px; }

  .page-head { padding: 56px 0 36px; }
  .page-head h1 { font-size: 40px; }
  .page-head .lead { margin-top: 14px; }
  .split { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .row .split { padding: 28px 0 32px; }
  .row:last-child .split { padding-bottom: 80px; }
  .row h2 { font-size: 24px; }
  .copy p { font-size: 17px; }

  .sheets { grid-template-columns: minmax(0, 1fr); gap: 14px; padding-bottom: 44px; }
  .sheet { padding: 24px; border-radius: 18px; }
  .sheet .address { margin-top: 18px; font-size: 19px; }
  .facts div { grid-template-columns: minmax(0, 1fr); gap: 2px; }

  .legal { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-bottom: 80px; }
  .doc h2 { margin-top: 36px; font-size: 22px; }
  .doc p { font-size: 16px; }

  .site-footer { padding: 44px 0 32px; }
  .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 16px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-bottom { margin-top: 40px; }
}
