/* PulseNote site.
   Palette is lifted from mobile/lib/theme/pulsenote_colors.dart so the web
   presence and the app read as one product:
     blue        #015DA3   (top-left blue)
     teal        #00D5C4   (bottom-right teal)
     brandAccent #00B7BC
     background  #F4FBFD   (very light teal/blue tint)
     dark bg     #121418   (dark blue-grey)
*/

:root {
  --blue: #015DA3;
  --teal: #00D5C4;
  --accent: #00807F;          /* brandAccent darkened for AA text on light */
  --ground: #F4FBFD;
  --surface: #FFFFFF;
  --ink: #10222B;
  --muted: #55707B;
  --rule: #D3E4EA;
  --rule-soft: #E4EFF3;
  /* Full-bleed band. Deliberately a step *away* from --ground rather than
     towards --surface: the cards inside a band are --surface, and a band that
     drifted towards white would swallow them. */
  --band: #E7F3F7;

  --sans: ui-sans-serif, -apple-system, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --blue: #4E9FD8;
    --teal: #00D5C4;
    --accent: #2FD3C4;
    --ground: #121418;
    --surface: #191D23;
    --ink: #E6EEF2;
    --muted: #91A7B1;
    --rule: #2A323A;
    --rule-soft: #222932;
    /* Darker than --ground here, for the same reason: the cards are the
       lighter surface and need to sit on something recessed. */
    --band: #0D1014;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }
a:focus-visible,
.wordmark:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

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

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  max-width: 1148px;
  margin: 0 auto;
  padding: 22px 24px;
  border-bottom: 1px solid var(--rule-soft);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 640;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}

/* No border-radius: the mark carries its own squircle in the alpha channel.
   The rounding here used to hide the opaque white corners the icons shipped
   with (see site/tools/make_icons.py) and now only clips the artwork. */
.mark {
  display: block;
  flex: none;
}

.beta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--rule);
  background: var(--surface);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}

.beta::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
  flex: none;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 600;
}

.lang-toggle a,
.lang-toggle .current {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.lang-toggle a { color: var(--muted); text-decoration: none; }
.lang-toggle a:hover { color: var(--accent); }
.lang-toggle a:hover .flag { opacity: 1; }
.lang-toggle a .flag { opacity: 0.55; }
.lang-toggle .current { color: var(--ink); }
.lang-toggle .sep { color: var(--rule); }
.lang-toggle .flag { display: block; border-radius: 2.5px; }

/* Privacy / Terms / Delete account live here rather than in the header. They
   are the conventional footer set, and on a phone the header was spending
   three stacked rows — brand, legal nav, language — before the page said
   anything about the product. */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px 40px;
  max-width: 1148px;
  margin: 0 auto;
  padding: 34px 24px 56px;
  border-top: 1px solid var(--rule-soft);
  color: var(--muted);
  font-size: 14px;
}

.site-footer p { margin: 3px 0; }
.footer-brand .wordmark { font-size: 15.5px; margin-bottom: 9px; }

/* A stacked column, so the legal links balance the brand block opposite rather
   than trailing off the end of it. */
.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 14.5px;
  text-align: right;
}

.footer-nav a { color: var(--muted); text-decoration: none; }
.footer-nav a:hover { color: var(--accent); }

/* ---------- prose pages ---------- */

main {
  max-width: 940px;
  margin: 0 auto;
  padding: 40px 24px 56px;
}

main.prose { max-width: 760px; }

.prose h1 {
  font-size: clamp(28px, 5vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.022em;
  font-weight: 660;
  margin: 0 0 6px;
  text-wrap: balance;
}

.prose h2 {
  font-size: 21px;
  line-height: 1.3;
  letter-spacing: -0.012em;
  font-weight: 640;
  margin: 44px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
  text-wrap: balance;
}

.prose h3 {
  font-size: 16.5px;
  font-weight: 640;
  margin: 28px 0 8px;
  text-wrap: balance;
}

.prose p, .prose li { max-width: 68ch; }
.prose p { margin: 0 0 16px; }

.prose ul { padding-left: 22px; margin: 0 0 16px; }
.prose li { margin-bottom: 8px; }
.prose li::marker { color: var(--muted); }

.prose strong { font-weight: 640; }

.prose code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.08em 0.34em;
}

.prose blockquote {
  margin: 0 0 20px;
  padding: 12px 18px;
  background: var(--surface);
  border-left: 3px solid var(--teal);
  border-radius: 0 4px 4px 0;
  color: var(--muted);
}

.prose blockquote p:last-child { margin-bottom: 0; }

/* Tables carry the data-handling detail; they must never widen the page. */
.table-scroll {
  overflow-x: auto;
  margin: 0 0 22px;
  border: 1px solid var(--rule);
  border-radius: 5px;
  background: var(--surface);
}

.prose table {
  border-collapse: collapse;
  width: 100%;
  min-width: 460px;
  font-size: 14.5px;
}

.prose th, .prose td {
  text-align: left;
  vertical-align: top;
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule-soft);
}

.prose th {
  font-weight: 640;
  font-size: 12.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}

.prose tr:last-child td { border-bottom: none; }

.effective-date {
  color: var(--muted);
  font-size: 14.5px;
  margin: 0 0 34px;
}

/* ---------- landing ---------- */

/* The width constraint lives on the sections, not on main, so that a section
   can paint edge to edge while its content stays in the column. The alternative
   — leaving it on main and pulling bands out with `margin-inline: calc(50% -
   50vw)` — is one line, but 100vw includes the scrollbar and overflows. */
main.landing {
  --gutter: 24px;
  max-width: none;
  padding-inline: 0;
  display: flex;
  flex-direction: column;
  gap: 92px;
  padding-top: 48px;
  padding-bottom: 32px;
}

main.landing > section {
  width: 100%;
  max-width: 1140px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Two of the ten sections are bands, so the page reads as movements rather than
   one long column: pitch, then how it works, then the product, then why it
   works, then the close. */
main.landing > section.band {
  max-width: none;
  padding-inline: 0;
  padding-block: 62px;
  background: var(--band);
  border-block: 1px solid var(--rule-soft);
}

.band-inner {
  max-width: 1140px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.landing h1 {
  font-size: clamp(34px, 6vw, 54px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 680;
  margin: 0 0 18px;
  max-width: 16ch;
  text-wrap: balance;
  background: linear-gradient(120deg, var(--blue), var(--teal));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.landing h2 {
  font-size: clamp(23px, 3.6vw, 31px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 660;
  margin: 0 0 24px;
  text-wrap: balance;
}

.landing h3 {
  font-size: 16.5px;
  font-weight: 640;
  margin: 0 0 6px;
}

/* :where() contributes no specificity, so this is (0,1,0) rather than (0,1,1).
   That matters: every `.some-class { margin: ... }` on a landing paragraph is
   also (0,1,0) and now wins on source order. Written as `.landing p` this rule
   silently beat four of them — .bucket-lead, .cta-note, .strip-caption and
   .science-note all declared spacing that never applied, which is why several
   of them looked cramped. Do not remove the :where(). */
.landing :where(p) { margin: 0; }

.landing .tagline {
  font-size: clamp(17px, 2.4vw, 20px);
  color: var(--muted);
  max-width: 46ch;
  margin: 0 0 14px;
  line-height: 1.5;
}

.landing .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 680;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 16px;
}

.landing .eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  flex: none;
}

.landing .hero-sub {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 28px;
  background: linear-gradient(120deg, var(--blue), var(--teal));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  width: fit-content;
}

.landing .science-lead {
  color: var(--muted);
  max-width: 68ch;
  margin: 0 0 26px;
}

/* Windows High Contrast and friends force `background-image: none`, which is
   exactly what the three gradient-text rules above rely on. Painting the text
   with a system colour and dropping the clip keeps them readable instead of
   betting on how each engine resolves `color: transparent` under forced
   colours. Cheap insurance — it costs nothing in normal rendering. */
@media (forced-colors: active) {
  .landing h1,
  .landing .hero-sub,
  .bucket-punch {
    background: none;
    -webkit-background-clip: border-box;
    background-clip: border-box;
    color: CanvasText;
  }
}

/* hero */

.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 44px;
  align-items: center;
  padding-top: 16px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 13px 22px;
  border-radius: 12px;
  font-weight: 640;
  font-size: 15.5px;
  text-decoration: none;
  line-height: 1.2;
}

.btn-primary {
  background: linear-gradient(120deg, var(--blue), var(--teal));
  color: #FFFFFF;
  box-shadow: 0 10px 26px -12px rgba(1, 93, 163, 0.55);
}

.btn-primary:hover { filter: brightness(1.06); }

.btn-secondary {
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--ink);
}

.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.cta-note {
  margin-top: 14px;
  font-size: 13.5px;
  color: var(--muted);
}

/* framed screenshots — the chassis is drawn in CSS: the screenshots already
   include the status bar and Dynamic Island, so a bezel + body + rim around
   them reads as a full iPhone without shipping frame artwork. */

.phone { margin: 0; }

.phone img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 42px;               /* body corners */
  border: 12px solid #10141B;        /* bezel + chassis */
  outline: 2px solid #3A424C;        /* metallic rim */
  background: #10141B;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 30px 70px -30px rgba(2, 45, 74, 0.45);
}

@media (prefers-color-scheme: dark) {
  .phone img {
    outline-color: #4A525C;
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.05),
      0 30px 70px -30px rgba(0, 0, 0, 0.7);
  }
}

.phone-hero {
  max-width: 330px;
  justify-self: center;
  width: 100%;
}

.phone figcaption {
  margin-top: 12px;
  font-size: 13.5px;
  color: var(--muted);
  text-align: center;
}

/* problem strip (the leaky bucket) */

.bucket {
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}

.bucket-lead {
  font-size: clamp(17px, 2.4vw, 21px);
  line-height: 1.55;
  color: var(--muted);
  margin: 0 0 18px;
  text-wrap: balance;
}

.bucket-lead strong { color: var(--ink); font-weight: 660; }

.bucket-punch {
  font-size: clamp(18px, 2.6vw, 23px);
  font-weight: 660;
  letter-spacing: -0.014em;
  margin: 0;
  text-wrap: balance;
  background: linear-gradient(120deg, var(--blue), var(--teal));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* "not another notes app" strip */

.not-strip { text-align: center; }

.not-strip p {
  font-size: clamp(17px, 2.6vw, 23px);
  font-weight: 640;
  letter-spacing: -0.012em;
  margin: 0 auto;
  max-width: 26ch;
  text-wrap: balance;
  color: var(--muted);
}

.not-strip span { display: block; }

.not-strip strong {
  display: block;
  margin-top: 10px;
  color: var(--ink);
  font-weight: 680;
}

/* the loop */

.loop-steps {
  list-style: none;
  counter-reset: step;
  margin: 0 0 40px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.loop-steps li {
  counter-increment: step;
  background: var(--surface);
  border: 1px solid var(--rule-soft);
  border-radius: 14px;
  padding: 20px;
}

.loop-steps li::before {
  content: counter(step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  color: #FFFFFF;
  font-weight: 660;
  font-size: 14px;
  margin-bottom: 12px;
}

.loop-steps p { font-size: 14.5px; color: var(--muted); }

/* The five honest answers. This is the most distinctive thing on the page, so
   it is centred and sized as a focal band rather than a footnote to the steps
   above it. */
.rating-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* The hue rides on --pill rather than `color`, so the label can take --ink
   while the border, ring and wash stay in the rating colour. That is not
   cosmetic: on white, r2/r3/r4 measure 3.9/3.7/4.2:1, under the 4.5 AA needs
   for small text. As border and wash the hue is decoration and only has to
   clear 3:1, which all five do. */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 999px;
  padding: 9px 20px 9px 10px;
  font-size: 15px;
  font-weight: 620;
  color: var(--ink);
  border: 1.5px solid var(--pill);
  background: var(--surface);
  background: color-mix(in srgb, var(--pill) 10%, var(--surface));
}

.pill b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  border: 1.5px solid var(--pill);
  font-size: 13px;
  font-weight: 700;
}

.r1 { --pill: #C0453B; }
.r2 { --pill: #C46A1F; }
.r3 { --pill: #A08200; }
.r4 { --pill: #2E8C67; }
.r5 { --pill: #00857C; }

@media (prefers-color-scheme: dark) {
  .r1 { --pill: #E88379; }
  .r2 { --pill: #E8A25C; }
  .r3 { --pill: #D9C24A; }
  .r4 { --pill: #6FD0A5; }
  .r5 { --pill: #2FD3C4; }
}

.strip-caption {
  margin-top: 18px;
  font-size: 14.5px;
  color: var(--muted);
  text-align: center;
  text-wrap: balance;
}

/* the pulse engine */

.engine {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 48px;
  align-items: center;
}

/* This figure holds a full phone screenshot (it used to be a wide lock-screen
   card, which is why it had its own flat frame — .phone now draws the chassis).
   It has to be capped: at the grid column's natural width a 1:2.17 screenshot
   towers over the six bullets beside it. */
.engine-shot {
  max-width: 290px;
  margin-inline: auto;
}

.engine-copy > p { color: var(--muted); max-width: 52ch; }

.engine-copy ul {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.engine-copy li {
  position: relative;
  padding-left: 24px;
  font-size: 15px;
  color: var(--muted);
}

.engine-copy li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
}

.engine-copy li strong { color: var(--ink); font-weight: 640; }

/* feature + science grids */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.science-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px 40px;
  max-width: 880px;
}

.feature-grid article {
  background: var(--surface);
  border: 1px solid var(--rule-soft);
  border-radius: 14px;
  padding: 22px;
}

.feature-grid p { font-size: 14.5px; color: var(--muted); }

.science-grid article {
  border-left: 3px solid var(--teal);
  padding: 4px 0 4px 18px;
}

.science-grid p { font-size: 14.5px; color: var(--muted); }

.science-note {
  margin-top: 26px;
  font-size: 14.5px;
  color: var(--muted);
  max-width: 68ch;
}

/* gallery — a scroll-snap carousel; holds any number of phones */

.gallery-row {
  display: flex;
  gap: 22px;
  overflow-x: auto;
  padding: 4px 4px 18px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-color: var(--rule) transparent;
}

.gallery-row .phone {
  flex: 0 0 240px;
  scroll-snap-align: start;
}

.gallery-row::-webkit-scrollbar { height: 8px; }
.gallery-row::-webkit-scrollbar-track { background: transparent; }
.gallery-row::-webkit-scrollbar-thumb {
  background: var(--rule);
  border-radius: 999px;
}

.gallery-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 8px;
}

/* privacy strip */

.privacy-strip {
  background: var(--surface);
  border: 1px solid var(--rule-soft);
  border-radius: 16px;
  padding: 30px 32px;
}

.privacy-strip h2 { margin-bottom: 10px; }
.privacy-strip p { color: var(--muted); max-width: 78ch; }

/* closing */

.closing { text-align: center; padding: 8px 0 36px; }
.closing h2 { margin-bottom: 10px; }

/* drop-shadow follows the alpha, so it traces the squircle rather than boxing
   it — which only works now that the mark has real transparent corners. */
.closing-mark {
  display: block;
  width: 80px;
  height: 80px;
  margin: 0 auto 22px;
  filter: drop-shadow(0 12px 26px rgba(1, 93, 163, 0.28));
}

@media (prefers-color-scheme: dark) {
  .closing-mark { filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.6)); }
}
.landing .closing-sub {
  color: var(--muted);
  font-size: 15px;
  margin: 0 0 26px;
}
.closing .cta-row { justify-content: center; }

/* responsive */

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 36px; }
  .phone-hero { max-width: 270px; }
  .loop-steps { grid-template-columns: repeat(2, 1fr); }
  .engine { grid-template-columns: 1fr; gap: 28px; }
  .engine-shot { max-width: 260px; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  main.landing { gap: 72px; }
}

@media (max-width: 560px) {
  main { padding: 28px 20px 40px; }
  main.landing { --gutter: 20px; }
  main.landing > section.band { padding-block: 48px; }
  .site-header { padding: 18px 20px; }
  .site-footer { padding: 24px 20px 44px; }
  main.landing { padding-top: 32px; padding-bottom: 24px; gap: 56px; }
  .loop-steps, .feature-grid, .science-grid { grid-template-columns: 1fr; }
  .gallery-row { gap: 14px; }
  .gallery-row .phone { flex-basis: 64vw; }
  .btn { width: 100%; justify-content: center; }
  .privacy-strip { padding: 24px 20px; }
  /* One column of everything on a phone — a right-aligned link stack under a
     left-aligned brand block reads as two stray fragments. */
  .footer-nav { flex-direction: row; flex-wrap: wrap; gap: 10px 22px; text-align: left; }
}
