/* ==========================================================================
   Habiton marketing site
   Values are transcribed from the design handoff. Do not adjust palette,
   type scale, spacing or motion timings without a matching handoff change.
   ========================================================================== */

/* --- Fonts -------------------------------------------------------------- */
/* Self-hosted Inter (SIL OFL), Latin subset, weights 400 and 600 only.
   Never load these from Google Fonts or any third-party CDN: that transmits
   every visitor's IP address to a US server without consent. */
@font-face {
  font-family: 'Inter';
  src: url('./fonts/inter-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('./fonts/inter-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* --- Tokens ------------------------------------------------------------- */
:root {
  --bg: #0B0B0C;
  --surface: #151517;
  --card: #1A1A1D;
  --card-raised: #212125;
  --line: #2A2A2F;
  --line-strong: #34343A;
  --border-muted: #42424A;
  --text: #F5F5F7;
  --text-sub: #9A9AA0;
  --text-muted: #7A7A82;
  --accent: #9EC5AE;
  --accent-wash: rgba(158, 197, 174, 0.1);
  --danger: #C98A8A;

  --font: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;

  --maxw: 1120px;
  --gutter: clamp(20px, 5vw, 40px);
  --section-y: clamp(80px, 10vw, 140px);
  --radius-card: 16px;
  --radius-sm: 12px;

  --device-shadow: 0 24px 64px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(245, 245, 247, 0.07);

  /* Device frame ratio, per the handoff. Set on .device__screen rather than
     on .device: the frame is 8px larger on every side, so a ratio set there
     leaves the screen a slightly different shape and object-fit: cover
     magnifies the screenshot inside it. */
  --device-ratio: 9 / 19.5;
}

/* --- Base --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  /* Dark only. Deliberately does not respond to prefers-color-scheme: light. */
  color-scheme: dark;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, figure, blockquote, ul, ol { margin: 0; }

img, svg { display: block; }

a { color: var(--text); text-decoration: none; }
a:hover { color: var(--accent); }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

::selection { background: var(--accent); color: var(--bg); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Shared centred column. */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* --- Typography roles --------------------------------------------------- */
.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.section-title {
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.lede {
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-sub);
}

/* --- Header ------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(11, 11, 12, 0.62);
  border-bottom: 1px solid transparent;
  transition: background 240ms ease-out, border-color 240ms ease-out;
}
.site-header.is-scrolled {
  background: var(--surface);
  border-bottom-color: var(--line);
}

/* Legal pages: static, solid, no blur. */
.site-header--static {
  position: static;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  transition: none;
}

.site-header__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand__mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.brand__name {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Apple's badge. Never restyle, recolour, crop or tint it. */
.badge { display: block; flex: 0 0 auto; }
.badge img { width: auto; }
.badge--sm img { height: 40px; }
.badge--lg img { height: 55px; }

/* --- Hero --------------------------------------------------------------- */
.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: clamp(72px, 10vw, 120px) 0 clamp(56px, 8vw, 96px);
}
.hero__grid {
  width: 100%;
  display: grid;
  /* min(100%, ...) keeps the 320px floor from forcing horizontal overflow
     at a 320px viewport, where the content box is only 280px. The design
     reference scrolls sideways here; the steps grid below already uses this
     idiom, so it is applied consistently rather than introduced. */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: clamp(48px, 7vw, 80px);
  align-items: center;
}
.hero .eyebrow { margin-bottom: 28px; }
.hero__title {
  font-size: clamp(2.1rem, 6.2vw, 4.5rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.03em;
  text-wrap: balance;
  margin-bottom: 28px;
}
.hero__sub { max-width: 30em; }
.hero__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  margin-top: 40px;
}
.hero__device { display: flex; justify-content: center; }

/* --- Device frames ------------------------------------------------------
   The app is near-black and the page is near-black. The 1px frame, the outer
   glow and the inset top highlight are what stop a screenshot dissolving into
   the page. Never fix separation with a lighter or coloured panel behind it.
   ------------------------------------------------------------------------ */
.device {
  border: 1px solid var(--line-strong);
  padding: 8px;
  background: var(--bg);
  box-shadow: var(--device-shadow);
}
.device__screen {
  aspect-ratio: var(--device-ratio);
  background: var(--surface);
  overflow: hidden;
}

.device--hero {
  width: min(300px, 82vw);
  border-radius: 36px;
  padding: 10px;
}
.device--hero .device__screen { border-radius: 27px; }

.device--step {
  width: 100%;
  max-width: 240px;
  border-radius: 29px;
}
.device--step .device__screen { border-radius: 22px; }

.device--rail {
  border-radius: 31px;
}
.device--rail .device__screen { border-radius: 24px; }

/* Screenshot images sit flush inside the screen, clipped to its radius. */
.device__screen picture,
.card__crop picture {
  display: block;
  width: 100%;
  height: 100%;
}
.device__screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Placeholder state, shown until a real screenshot is dropped in.
   Deliberately ugly so it cannot ship by accident. */
.device__screen--pending {
  display: grid;
  place-items: center;
  padding: 20px;
}
.device--step .device__screen--pending { padding: 14px; }
.device__screen .pending,
.card__crop .pending {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
  color: var(--danger);
  text-align: center;
  overflow-wrap: anywhere;
  hyphens: auto;
  max-width: 100%;
}
.device--step .device__screen .pending { font-size: 11px; line-height: 1.5; }

/* Hero alarm mock, used until screenshot 01 is supplied. */
.mock {
  height: 100%;
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
}
.mock__grabber {
  display: flex;
  justify-content: center;
  margin-bottom: 34px;
}
.mock__grabber span {
  width: 74px;
  height: 5px;
  border-radius: 3px;
  background: var(--line);
}
.mock__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.mock__time {
  font-size: 56px;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
  margin-top: 6px;
}
.mock__meta {
  font-size: 13px;
  color: var(--text-sub);
  font-variant-numeric: tabular-nums;
}
.mock__foot {
  margin-top: auto;
  display: grid;
  gap: 12px;
}
.mock__prompt {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-sub);
}
.mock__button {
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  padding: 13px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
}
.mock__snooze {
  text-align: center;
  font-size: 13px;
  color: var(--text-sub);
  padding-bottom: 4px;
}

/* --- The problem -------------------------------------------------------- */
/* Deliberately the slowest section on the page. */
.problem { padding: clamp(88px, 12vw, 168px) 0; }
.problem__grid {
  display: grid;
  gap: clamp(72px, 11vw, 136px);
}
.problem__block { max-width: 22em; }
.problem__block--center { justify-self: center; }
.problem__block--end { justify-self: end; max-width: 24em; }
.problem__block h2 {
  font-size: clamp(1.6rem, 3.6vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.problem__block p { margin-top: 16px; }

/* --- How it works ------------------------------------------------------- */
.section { padding: var(--section-y) 0; }
.section--ruled { border-top: 1px solid var(--line); }

.steps__title { margin-top: 18px; max-width: 20em; }
.steps {
  display: grid;
  /* The 200px floor matters: at 260px the three steps break into a 2 + 1
     orphan across common laptop widths and the one-row reading is lost. */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: clamp(48px, 5vw, 64px);
  margin-top: clamp(56px, 7vw, 88px);
  align-items: start;
}
.step .step__num {
  font-size: 40px;
  line-height: normal;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--line-strong);
  margin-top: 32px;
}
.step h3 {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-top: 12px;
}
.step p {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-sub);
  margin-top: 10px;
  max-width: 22em;
}

/* --- Features ----------------------------------------------------------- */
.features__title { max-width: 20em; }
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 288px), 1fr));
  gap: 20px;
  margin-top: clamp(44px, 6vw, 72px);
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  transition: background 200ms ease-out;
}
.card:hover { background: var(--card-raised); }
.card--text { padding: 32px; }
.card--shot { overflow: hidden; }
.card__body { padding: 32px; }
.card h3 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.card--text h3 { margin-top: 24px; }
.card p {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-sub);
  margin-top: 10px;
}
/* A tight crop of the real screen at close to 1:1, bleeding to the card
   edges. A whole iPhone shrunk into a card is illegible and reads as filler. */
.card__crop {
  height: 208px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
}
.card__crop img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  padding: 0;
}
.card__crop:has(img) { padding: 0; }

/* --- Screenshot rail ---------------------------------------------------- */
.rail {
  margin-top: clamp(44px, 6vw, 72px);
  display: flex;
  gap: 28px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  /* Aligns the first device with the section heading below 1120px and lets
     the rail bleed to the viewport edge above it. A plain 20px floor here
     misaligns the rail against every other section. */
  padding: 8px max(var(--gutter), calc(50vw - 560px)) 8px;
  outline-offset: 4px;
}
.rail::-webkit-scrollbar { display: none; }
/* Do not fade the rail edges with a gradient mask. On this palette it reads
   as a rendering bug, not an affordance. */
.rail__item {
  flex: 0 0 clamp(228px, 62vw, 260px);
  scroll-snap-align: center;
  margin: 0;
}
.rail__item figcaption {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-sub);
  margin-top: 20px;
}

.rail__lede { margin-top: 16px; max-width: 42em; }

/* --- Testimonials ------------------------------------------------------- */
/* The section is emitted only when SHOW_TESTIMONIALS is on in the build, so
   there is no hide class here: when the flag is off the markup does not exist.
   See src/partials/testimonials.html before turning it on. */

.quotes__title { margin-top: 18px; }
.quotes__viewport {
  margin-top: clamp(40px, 5vw, 64px);
  overflow: hidden;
  outline: none;
}
.quotes__track {
  display: flex;
  gap: 20px;
  transition: transform 420ms cubic-bezier(0.2, 0.7, 0.3, 1);
  will-change: transform;
}
.quote {
  flex: 0 0 clamp(260px, 78vw, 360px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 32px;
}
.quote blockquote {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  line-height: 1.45;
  letter-spacing: -0.02em;
}
.quote figcaption {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  font-size: 15px;
  color: var(--text-sub);
}
.quote__monogram {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--card-raised);
  display: grid;
  place-items: center;
  font-size: 13px;
  color: var(--text-muted);
}
/* Placeholder quotes are styled wrong on purpose. */
.quote--placeholder { border: 1px dashed var(--danger); }
.quote--placeholder blockquote,
.quote--placeholder figcaption { color: var(--danger); }

.quotes__dots {
  display: flex;
  gap: 10px;
  margin-top: 32px;
}
.quotes__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-strong);
  transition: background 200ms ease-out;
}
.quotes__dot[aria-current='true'] { background: var(--accent); }
.quotes__note {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
  margin-top: 24px;
  max-width: 46em;
}

/* --- FAQ ---------------------------------------------------------------- */
/* Native <details name="faq">: one open at a time, closed by default,
   keyboard accessible, zero JavaScript. */
.faq {
  display: grid;
  gap: 12px;
  margin-top: clamp(40px, 5vw, 64px);
  max-width: 800px;
}
.faq details {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 24px 28px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq p {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-sub);
  padding: 0 28px 26px;
  max-width: 60ch;
}

/* --- Closing CTA -------------------------------------------------------- */
/* No screenshot here. The band works because it is empty. */
.closing {
  background: var(--surface);
  padding: clamp(80px, 10vw, 132px) 0;
}
.closing__inner {
  display: grid;
  gap: 40px;
  justify-items: start;
}
.closing__line {
  font-size: clamp(1.9rem, 4.4vw, 3.2rem);
  font-weight: 600;
  letter-spacing: -0.028em;
  line-height: 1.08;
}

/* --- Footer ------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--line-strong);
  padding: clamp(48px, 6vw, 72px) 0 40px;
}
.site-footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 32px;
  align-items: start;
}
.site-footer__brand {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
.site-footer__made {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 8px;
}
/* The three legal links stay plain text on every page, never behind a
   dropdown or an icon: German law requires them findable under a
   recognisable name within two clicks. */
.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 14px;
  color: var(--text-muted);
}
.site-footer__legal a { color: var(--text-muted); text-decoration: none; }
.site-footer__legal a:hover { color: var(--accent); }
.site-footer__mail { font-size: 14px; color: var(--text-muted); }
.site-footer__mail a { color: var(--text-muted); text-decoration: none; }
.site-footer__mail a:hover { color: var(--accent); }
.site-footer__copy {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

/* --- Legal pages -------------------------------------------------------- */
.legal {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(56px, 8vw, 104px) var(--gutter) clamp(72px, 9vw, 112px);
}
.legal__title {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.1;
}
.legal__updated {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 16px;
  font-variant-numeric: tabular-nums;
}
.legal__body {
  display: grid;
  gap: 40px;
  margin-top: 48px;
}
.legal__body section > * + * { margin-top: 12px; }
.legal__body h2 {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.legal__lang {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-top: 8px;
}
.legal__body h3 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-top: 24px;
}
.legal__body p,
.legal__body li {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-sub);
  max-width: 65ch;
}
.legal__body ul,
.legal__body ol {
  padding-left: 1.2em;
  display: grid;
  gap: 8px;
}
.legal__body strong { color: var(--text); font-weight: 600; }
.legal__body hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 8px 0;
}
.legal__body table {
  border-collapse: collapse;
  font-size: 15px;
  color: var(--text-sub);
  width: 100%;
}
.legal__body th,
.legal__body td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}
.legal__body th { color: var(--text); font-weight: 600; }
/* Links on the legal pages are underlined, unlike the marketing page. */
.legal__body a,
.legal__updated a {
  color: var(--text-sub);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.legal__body a:hover { color: var(--accent); }

/* --- Motion ------------------------------------------------------------- */
[data-reveal].is-hidden {
  opacity: 0;
  transform: translateY(18px);
}
[data-reveal] {
  transition: opacity 400ms ease-out, transform 400ms ease-out;
}
/* Cards carry both: the reveal, and the 200ms hover the handoff specifies.
   Declaring only the reveal here would silently drop the hover transition. */
.card[data-reveal] {
  transition: background 200ms ease-out,
              opacity 400ms ease-out,
              transform 400ms ease-out;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
  [data-reveal].is-hidden { opacity: 1; transform: none; }
}
