/* Tensio website. One stylesheet for the whole site:
   the landing pages (body.home) and the documents (privacy, impressum, support).
   Tokens follow the app's design system, see src/theme/tokens.js in the app repo.
   Body text is 18px, like the app: the people who keep a blood pressure diary are
   often the people who need the larger type. */

@font-face {
  font-family: "IBM Plex Sans";
  src: url("/fonts/ibm-plex-sans-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/fonts/ibm-plex-sans-500.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/fonts/ibm-plex-sans-600.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/fonts/ibm-plex-sans-700.woff2") format("woff2");
  font-weight: 700 800; font-style: normal; font-display: swap;
}

:root {
  --paper: #f7f6f3;
  --paper-glass: rgba(247, 246, 243, .82);
  --card: #fff;
  --sunken: #efede8;
  --ink: #1c1f1e;
  --body: #333936;
  --mute: #5c635f;
  --line: #dedbd4;
  --hair: #efede8;
  --accent: #0e6660;
  --accent-deep: #0a4f4a;
  --accent-soft: #e4efed;
  --on-accent: #fff;
  --ring: transparent;

  --shadow-sm: 0 1px 2px rgba(28, 31, 30, .04), 0 8px 20px -14px rgba(28, 31, 30, .18);
  --shadow-md: 0 28px 60px -22px rgba(28, 31, 30, .22), 0 8px 20px -12px rgba(28, 31, 30, .10);
  --shadow-lg: 0 48px 90px -30px rgba(28, 31, 30, .30), 0 14px 30px -14px rgba(28, 31, 30, .13);

  --wrap: 1120px;
  --gut: 32px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141716;
    --paper-glass: rgba(20, 23, 22, .78);
    --card: #1e2321;
    --sunken: #293030;
    --ink: #f1f3f2;
    --body: #d7dbd9;
    --mute: #a9b0ad;
    --line: #2f3735;
    --hair: #293030;
    --accent: #4db0a8;
    --accent-deep: #7ccbc4;
    --accent-soft: #173a38;
    --on-accent: #0b1514;
    /* screenshots stay light-mode UI; the ring keeps their edges readable on dark paper */
    --ring: rgba(255, 255, 255, .09);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5), 0 8px 20px -14px rgba(0, 0, 0, .6);
    --shadow-md: 0 28px 60px -22px rgba(0, 0, 0, .7), 0 8px 20px -12px rgba(0, 0, 0, .45);
    --shadow-lg: 0 48px 90px -30px rgba(0, 0, 0, .8), 0 14px 30px -14px rgba(0, 0, 0, .5);
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--body);
  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 18px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent-deep); text-underline-offset: 3px; }
a:hover { color: var(--ink); }

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

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

h1, h2, h3, strong { color: var(--ink); }

/* ---------------------------------------------------------------- brand mark */

.brand,
.wordmark {
  display: inline-flex;
  align-items: center;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--ink);
  text-decoration: none;
}

.brand::before,
.wordmark::before {
  content: "";
  width: 28px;
  height: 28px;
  flex: none;
  margin-right: .6rem;
  border-radius: 8px;
  background: url("/mark.png") center / cover no-repeat;
  box-shadow: var(--shadow-sm);
}

/* ================================================================= documents
   privacy, impressum and support. Everything here hangs off elements and a
   handful of classes. */

body:not(.home) {
  padding: 2.5rem 1.25rem 5rem;
}

body:not(.home) main {
  max-width: 44rem;
  margin: 0 auto;
}

body:not(.home) header { margin-bottom: 2.75rem; }

h1 {
  font-size: clamp(1.95rem, 4.5vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -.02em;
  font-weight: 600;
  margin: 1.75rem 0 .35rem;
  text-wrap: balance;
}

body:not(.home) h2 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.3;
  margin: 3rem 0 .85rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
}

h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin: 2rem 0 .5rem;
}

p { margin: 0 0 1.1rem; text-wrap: pretty; }

body:not(.home) .lede {
  font-size: 1.125rem;
  color: var(--mute);
}

.meta {
  font-size: 1rem;
  color: var(--mute);
  margin-top: .25rem;
}

/* privacy and support pages: EN and DE in one file, one shown at a time. The
   script in the head sets html[data-doc] from the hash or the browser language; without
   script both show, one after the other. The ids on the two headers keep old #de links
   working, and the scroll margin stops the browser jumping to them when they load. */
.docbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

html[data-doc="en"] [data-doc="de"],
html[data-doc="de"] [data-doc="en"],
html[data-doc] .doc-sep { display: none; }

html[data-doc] main header { scroll-margin-top: 100vh; }

.doc-sep { margin: 4rem 0 0; }

.box {
  background: var(--card);
  border-radius: 14px;
  box-shadow: 0 0 0 1px var(--line);
  padding: 1.35rem 1.5rem;
  margin: 1.75rem 0;
}

.box p:first-child { margin-top: 0; }
.box p:last-child { margin-bottom: 0; }

body:not(.home) ul { padding-left: 1.2rem; margin: 0 0 1.1rem; }
body:not(.home) li { margin-bottom: .45rem; }

strong { font-weight: 600; }

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

body:not(.home) footer {
  margin-top: 4.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
  font-size: 1rem;
  color: var(--mute);
  display: flex;
  flex-wrap: wrap;
  gap: .35rem 1.75rem;
}

body:not(.home) footer a {
  color: var(--mute);
  text-decoration: none;
  font-weight: 500;
}

body:not(.home) footer a:hover { color: var(--ink); }

/* support page questions: the same <details> as the landing page FAQ */
body:not(.home) .faq-list { margin-top: 1.25rem; }

/* ================================================================== landing */

.home h1, .home h2 {
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 1.08;
  margin: 0;
  border: 0;
  padding: 0;
  text-wrap: balance;
}

.home h3 { margin: 0; }
.home p { margin: 0; }

body.home { overflow-x: clip; }

.wrap, .topbar-in, .home .hero, .home .section, .home .feature, .home .faq, .home .closing {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gut);
}

/* top bar: sticky, frosted */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper-glass);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.topbar-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 20px;
}

.langswitch { position: relative; font-size: .9375rem; font-weight: 600; }

/* the language menu is a <details>: it opens without script, and the small script
   at the end of each page only closes it on an outside click or Escape */
.langmenu summary {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 44px;
  padding: .35rem .9rem .35rem .75rem;
  border-radius: 999px;
  background: var(--sunken);
  color: var(--body);
  cursor: pointer;
  list-style: none;
  letter-spacing: .02em;
}

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

.langmenu summary svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.langmenu summary:hover, .langmenu[open] summary { color: var(--ink); }

.langmenu ul {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
  min-width: 180px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--card);
  border-radius: 14px;
  box-shadow: 0 0 0 1px var(--line), var(--shadow-md);
}

.langmenu li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: .6rem .8rem;
  border-radius: 9px;
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
}

.langmenu li a:hover { background: var(--hair); }

.langmenu li a[aria-current] { font-weight: 600; }

.langmenu li a[aria-current]::after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
}

/* hero */

.hero { padding-top: 72px; text-align: center; position: relative; }

.hero h1 {
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  letter-spacing: -.035em;
}

.home .lede {
  margin: 28px auto 0;
  max-width: 50ch;
  font-size: 1.25rem;
  line-height: 1.55;
  color: var(--mute);
}

.fineprint {
  margin-top: 30px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--mute);
}

.closing .fineprint { margin: 28px auto 0; max-width: 48ch; line-height: 1.5; }

/* a soft teal wash so the hero screen sits in light rather than on flat paper */
.hero::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 42%;
  width: min(920px, 96vw);
  aspect-ratio: 1;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, var(--accent-soft), transparent 72%);
  opacity: .9;
  z-index: -1;
  pointer-events: none;
}

/* store buttons.
   is-soon = designed, not yet linkable. Remove the class and swap the href. */

.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 20px;
  justify-content: center;
  margin-top: 38px;
}

.store { display: flex; flex-direction: column; align-items: center; gap: 9px; }

.store-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 14px 28px 15px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 180ms cubic-bezier(.2, .6, .2, 1), box-shadow 180ms ease;
}

.store-btn svg { flex: none; width: 24px; height: 24px; fill: currentColor; }

.store-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
}

.store-label small {
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .7;
}

.store-label strong { font-size: 1.125rem; font-weight: 600; color: inherit; }

.store-btn.ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--line);
}

.store-caption { font-size: .9375rem; font-weight: 500; color: var(--mute); }

/* the button keeps its finished look, the caption underneath carries the state */
.store-btn.is-soon { pointer-events: none; }
.store-btn:not(.is-soon) + .store-caption { display: none; }

@media (hover: hover) {
  .store-btn:hover { color: var(--paper); transform: translateY(-2px); box-shadow: var(--shadow-md); }
  .store-btn.ghost:hover { color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--mute); }
}

/* screenshots.

   Every screen is generated at 2x and 3x of its CSS size from the 1290px
   screenshots (scripts/assets.py) and served through srcset, so nothing is ever
   upscaled. The hover lifts the frame and does not scale the image. */

.shot {
  margin: 0;
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--ring), 0 0 0 1px var(--line), var(--shadow-md);
  transition: transform 400ms cubic-bezier(.2, .6, .2, 1), box-shadow 400ms ease;
}

.shot img { border-radius: inherit; width: 100%; }

@media (hover: hover) {
  .shot:hover,
  .motion .shot.reveal.in:hover { transform: translateY(-6px); box-shadow: 0 0 0 1px var(--ring), 0 0 0 1px var(--line), var(--shadow-lg); }
  .motion .shot.reveal.in {
    transition: opacity 600ms ease, transform 400ms cubic-bezier(.2, .6, .2, 1), box-shadow 400ms ease;
  }
}

/* a screenshot that is cut mid-content fades out into its own paper colour.
   The screenshots are light-mode UI, so the fade stays light in both schemes. */
.shot-fade { position: relative; }
.shot-fade::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 90px;
  background: linear-gradient(to bottom, rgba(247, 246, 243, 0), #f7f6f3);
  pointer-events: none;
}

.hero-stage {
  position: relative;
  margin: 76px auto 0;
  max-width: 360px;
}

.shot-hero {
  border-radius: 30px;
  box-shadow: 0 0 0 1px var(--ring), 0 0 0 1px var(--line), var(--shadow-lg);
}

/* sections */

.home .section { padding-top: 156px; }

.section-head { text-align: center; }

.section-head h2, .feature h2 { font-size: clamp(2.05rem, 4.2vw, 3rem); }

.section-head .sub {
  margin: 20px auto 0;
  max-width: 52ch;
  font-size: 1.1875rem;
  line-height: 1.6;
  color: var(--mute);
}

.eyebrow {
  margin-bottom: 18px;
  font-size: .875rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
}

/* feature rows */

.feature {
  padding-top: 156px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
  align-items: center;
}

.feature .shot { justify-self: center; max-width: 340px; width: 100%; }

.feature h2 { max-width: 15ch; }

.feature-copy p:not(.eyebrow) {
  margin-top: 22px;
  max-width: 50ch;
  font-size: 1.1875rem;
  line-height: 1.6;
  color: var(--mute);
}

.feature-copy p.note { font-size: 1rem; }

/* the smaller things: a grid of short cards, no screenshots */

.also {
  margin: 64px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.also li {
  background: var(--card);
  border-radius: 14px;
  box-shadow: 0 0 0 1px var(--line);
  padding: 1.35rem 1.4rem 1.45rem;
}

.also h3 { font-size: 1.125rem; font-weight: 600; line-height: 1.3; }

.also p { margin-top: 8px; font-size: 1.0625rem; line-height: 1.55; color: var(--mute); }

/* privacy band. Fixed colours: this block is the same ink in both schemes. */

.privacy {
  margin-top: 164px;
  padding: 124px 0;
  background: #1c1f1e;
  color: #f1f3f2;
}

.privacy h2 { font-size: clamp(2rem, 4.5vw, 3.1rem); max-width: 18ch; color: #f1f3f2; }

.privacy-list {
  margin: 68px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 42px 40px;
}

.privacy-list li {
  font-size: 1.125rem;
  line-height: 1.55;
  font-weight: 500;
  color: #d7dbd9;
}

.privacy-list li::before {
  content: "";
  display: block;
  width: 26px;
  height: 3px;
  margin-bottom: 18px;
  border-radius: 999px;
  background: #8fc3be;
}

.privacy-link { margin-top: 60px; }

.privacy-link a {
  font-weight: 600;
  color: #8fc3be;
  text-decoration: none;
  border-bottom: 1px solid rgba(143, 195, 190, .4);
  padding-bottom: 3px;
}

.privacy-link a:hover { color: #f1f3f2; border-bottom-color: rgba(241, 243, 242, .5); }

/* faq. Native <details>, no script: the question is the summary, the answer the paragraph. */

.faq { padding-top: 132px; }

.faq-list {
  max-width: 700px;
  margin: 52px auto 0;
  border-top: 1px solid var(--line);
}

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

.faq-list summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 0;
  list-style: none;
  cursor: pointer;
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
}

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

/* a plus that turns into a minus: two hairlines, the vertical one goes when open */
.faq-list summary::after {
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  align-self: center;
  background:
    linear-gradient(var(--mute), var(--mute)) center / 14px 2px no-repeat,
    linear-gradient(var(--mute), var(--mute)) center / 2px 14px no-repeat;
  transition: transform 300ms cubic-bezier(.2, .6, .2, 1);
}

.faq-list details[open] summary::after {
  transform: rotate(180deg);
  background: linear-gradient(var(--mute), var(--mute)) center / 14px 2px no-repeat;
}

.faq-list summary:hover { color: var(--accent-deep); }

.faq-list details p {
  padding: 0 40px 24px 0;
  margin-top: -6px;
  max-width: 60ch;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--mute);
}

/* closing */

.closing { padding-block: 148px 140px; text-align: center; }
.closing h2 { font-size: clamp(2.25rem, 5.5vw, 3.6rem); letter-spacing: -.03em; }

/* footer */

.home footer { border-top: 1px solid var(--line); }

.footer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 32px;
  align-items: center;
  justify-content: space-between;
  padding-block: 34px 52px;
}

.home footer nav { display: flex; flex-wrap: wrap; gap: 14px 26px; }

.home footer nav a {
  font-size: 1rem;
  font-weight: 500;
  color: var(--mute);
  text-decoration: none;
}

.home footer nav a:hover { color: var(--ink); }

/* motion */

.motion .reveal { opacity: 0; transform: translateY(18px); }
.motion .reveal.in {
  opacity: 1;
  transform: none;
  transition: opacity 600ms ease, transform 600ms cubic-bezier(.2, .6, .2, 1);
}

.motion .reveal.d2.in { transition-delay: 90ms; }
.motion .reveal.d3.in { transition-delay: 180ms; }
.motion .reveal.d4.in { transition-delay: 270ms; }
.motion .reveal.d5.in { transition-delay: 360ms; }

@media (prefers-reduced-motion: reduce) {
  .motion .reveal, .reveal { opacity: 1 !important; transform: none !important; }
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* responsive */

@media (max-width: 900px) {
  :root { --gut: 24px; }
  .home .section { padding-top: 116px; }
  .feature {
    grid-template-columns: 1fr;
    gap: 48px;
    padding-top: 116px;
    text-align: center;
  }
  .feature h2, .feature-copy p:not(.eyebrow) { max-width: none; margin-inline: auto; }
  .feature-reverse .shot { order: 2; }
  .privacy { margin-top: 116px; padding-block: 92px; }
  .privacy h2 { max-width: none; }
  .privacy-list { margin-top: 52px; gap: 36px; }
  .faq { padding-top: 100px; }
  .faq-list { margin-top: 40px; }
  .closing { padding-block: 112px; }
}

@media (max-width: 560px) {
  .hero { padding-top: 46px; }
  .hero-stage { margin-top: 56px; }
  .store { width: 100%; }
  .store-btn { justify-content: center; }
  .footer-row { flex-direction: column; align-items: flex-start; gap: 20px; }
}
