/* Puretreon site. Vanilla CSS, no build step.
   Tokens are lifted from the extension's own styles.css so the site and the
   product don't look like two different things. */

/* Cross-document transitions between the site's four pages. One line, and
   browsers without it just swap instantly. */
@view-transition {
  navigation: auto;
}

:root {
  --accent: #635bff; /* the extension icon's indigo */
  --accent-ink: #fff;

  --bg: #fbfbfa;
  --surface: #fff;
  --surface-2: #f4f5f7;
  --ink: #0f1419;
  --ink-2: #39424d;
  --muted: #6b7684;
  --border: #e4e7ea;
  --border-2: #d3d8de;

  --shadow-sm: 0 1px 2px rgb(15 20 25 / 6%), 0 2px 8px rgb(15 20 25 / 5%);
  --shadow: 0 2px 6px rgb(15 20 25 / 7%), 0 12px 32px rgb(15 20 25 / 8%);
  --shadow-lg: 0 4px 12px rgb(15 20 25 / 8%), 0 32px 64px rgb(15 20 25 / 14%);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  /* Sampled from a real spring; the overshoot is what makes a press feel
     mechanical rather than animated. */
  --spring: linear(
    0, 0.009, 0.035 2.1%, 0.141, 0.281 6.7%, 0.723 12.9%, 0.938 16.7%, 1.017,
    1.077, 1.121, 1.149 24.3%, 1.159, 1.163, 1.161, 1.154 29.9%, 1.129 32.8%,
    1.051 39.6%, 1.017 43.1%, 0.991, 0.977 51%, 0.974 53.8%, 0.98 57.1%,
    1.018 69.2%, 1.006 81.4%, 1
  );

  --measure: 35rem;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --max: 74rem;

  /* One vertical rhythm for the whole site. --section is the gap between two
     sections; each section carries half of it, so every seam is the same
     height whatever sits on either side of it. --head-gap is the distance
     from a heading to the picture of what it claims. */
  --section: clamp(3.5rem, 6.5vw, 6.5rem);
  --head-gap: clamp(1.5rem, 3vw, 2.5rem);

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0d1013;
  --surface: #15181c;
  --surface-2: #1b1f24;
  --ink: #edf1f5;
  --ink-2: #c2cad3;
  --muted: #8e99a6;
  --border: #252a31;
  --border-2: #323942;

  --shadow-sm: 0 1px 2px rgb(0 0 0 / 40%);
  --shadow: 0 2px 8px rgb(0 0 0 / 45%), 0 16px 40px rgb(0 0 0 / 40%);
  --shadow-lg: 0 4px 16px rgb(0 0 0 / 50%), 0 40px 80px rgb(0 0 0 / 55%);

  color-scheme: dark;
}

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

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

body {
  /* A column so a short page still puts its footer on the floor rather than
     halfway up the screen. */
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

a {
  color: inherit;
}

figure {
  margin: 0;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 680;
  letter-spacing: -0.028em;
  line-height: 1.06;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.35rem, 1.2rem + 5.1vw, 4.25rem);
}

h2 {
  font-size: clamp(1.75rem, 1.15rem + 2.3vw, 2.6rem);
}

h3 {
  font-size: 1.0625rem;
  letter-spacing: -0.012em;
  line-height: 1.3;
}

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

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

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.narrow {
  max-width: 48rem;
}

main {
  flex: 1 0 auto;
}

section {
  padding-block: calc(var(--section) / 2);
}

/* The seam above the footer is a section boundary too. */
main > section:last-child {
  padding-bottom: var(--section);
}

.center {
  text-align: center;
}

.center .lede {
  margin-inline: auto;
}

.center .cta-row {
  justify-content: center;
}

.lede {
  max-width: var(--measure);
  color: var(--ink-2);
  font-size: clamp(1.0625rem, 1rem + 0.45vw, 1.25rem);
}

h1 + .lede,
h2 + .lede {
  margin-top: 1.15rem;
}

.lede + .sub {
  margin-top: 0.7rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  margin-bottom: 1.1rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 640;
  letter-spacing: 0.085em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 1.5rem;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.55;
}

/* A heading and the shot of what it claims, one gap apart. */
.shot {
  margin: var(--head-gap) 0 0;
}

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

.top {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  transition: border-color 0.2s, background 0.2s;
}

@supports (
  (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))
) {
  .top {
    -webkit-backdrop-filter: blur(14px) saturate(170%);
    backdrop-filter: blur(14px) saturate(170%);
  }
}

.top[data-stuck] {
  border-bottom-color: var(--border);
}

.top-in {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: 3.75rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 660;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand svg {
  width: 0.78rem;
  height: 1.02rem;
  fill: var(--accent);
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}

.nav a {
  padding: 0.4rem 0.6rem;
  border-radius: 7px;
  color: var(--ink-2);
  font-size: 0.9rem;
  font-weight: 550;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.nav a:hover {
  background: var(--surface-2);
  color: var(--ink);
}

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

@media (max-width: 30rem) {
  .nav a.opt {
    display: none;
  }
}

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

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem 1.25rem;
  margin-top: clamp(1.75rem, 3.5vw, 2.5rem);
}

.cta-note {
  color: var(--muted);
  font-size: 0.88rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 1.1rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-size: 0.96rem;
  font-weight: 620;
  text-decoration: none;
  cursor: pointer;
  transition: translate 0.25s var(--spring), filter 0.15s, box-shadow 0.2s;
}

.btn:hover {
  filter: brightness(1.07);
  box-shadow: 0 6px 20px color-mix(in oklab, var(--accent) 34%, transparent);
}

.btn:active {
  translate: 0 1px;
  scale: 0.99;
}

.btn svg {
  width: 1.05em;
  height: 1.05em;
}

.btn-ghost {
  background: transparent;
  border-color: var(--border-2);
  color: var(--ink);
}

.btn-ghost:hover {
  background: var(--surface-2);
  box-shadow: none;
  filter: none;
}

/* An inline link onward, sized like body text. */
.more {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 1.5rem;
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 620;
  text-decoration: none;
}

.more:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* --- hero ---------------------------------------------------------------- */

.hero {
  padding-block: clamp(2.5rem, 5vw, 4.25rem) calc(var(--section) / 2);
}

.hero h1 {
  max-width: 20ch;
}

/* --- product frame ------------------------------------------------------- */

/* A browser chrome wrapper. Puretreon lives inside a tab, and showing it
   framed is how you learn that without a sentence explaining it. */
.frame {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.frame-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.dot {
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 50%;
  background: var(--border-2);
}

.frame-url {
  flex: 1;
  overflow: hidden;
  margin-left: 0.5rem;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  background: var(--bg);
  color: var(--muted);
  font-size: 0.72rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.frame img,
.frame video {
  width: 100%;
  height: auto;
}

.shot-stage {
  margin-top: clamp(2.25rem, 4.5vw, 3.25rem);
}

/* --- feature grid -------------------------------------------------------- */

/* Card counts are known, so the columns are declared rather than fitted:
   auto-fit leaves a single card alone on the last row at the in-between
   widths, and that orphan is most of what "uneven" looks like. */
.grid {
  display: grid;
  gap: clamp(1rem, 2.5vw, 1.75rem);
  grid-template-columns: 1fr;
}

@media (min-width: 46rem) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 56rem) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 70rem) {
  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

.grid + .cap {
  margin-top: 1.3rem;
}

.card {
  padding: 1.4rem;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: translate 0.3s var(--spring), box-shadow 0.3s var(--ease),
    border-color 0.2s;
}

.card:hover {
  translate: 0 -3px;
  border-color: var(--border-2);
  box-shadow: var(--shadow);
}

.card p {
  margin-top: 0.5rem;
  color: var(--ink-2);
  font-size: 0.94rem;
}

.card-ico {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  margin-bottom: 0.9rem;
  border-radius: 8px;
  background: color-mix(in oklab, var(--accent) 13%, transparent);
  color: var(--accent);
}

.card-ico svg {
  width: 1.15rem;
  height: 1.15rem;
}

/* --- alternating feature rows -------------------------------------------- */

.row {
  display: grid;
  align-items: center;
  gap: clamp(1.75rem, 4.5vw, 3.5rem);
  grid-template-columns: 1fr;
}

@media (min-width: 56rem) {
  .row {
    grid-template-columns: 1fr 1.55fr;
  }

  /* Flipped, the picture takes the wider column too — otherwise every other
     screenshot lands smaller than the one above it. */
  .row.flip {
    grid-template-columns: 1.55fr 1fr;
  }

  .row.flip > :first-child {
    order: 2;
  }
}

.row h2 {
  font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.1rem);
}

.row p {
  margin-top: 0.9rem;
  color: var(--ink-2);
}

/* --- a claim on its own -------------------------------------------------- */

/* One line, full width, with the border doing the separating instead of
   another pile of whitespace. */
.band {
  padding-block: clamp(2.75rem, 5vw, 4.25rem);
  border-block: 1px solid var(--border);
  background: color-mix(in oklab, var(--accent) 4%, var(--bg));
}

.band p {
  max-width: 32ch;
  font-size: clamp(1.5rem, 1.1rem + 1.7vw, 2.25rem);
  font-weight: 680;
  letter-spacing: -0.028em;
  line-height: 1.1;
  text-wrap: balance;
}

.band .after {
  margin-top: 0.9rem;
  color: var(--ink-2);
  font-size: 1.0625rem;
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1.6;
}

/* --- plain list ---------------------------------------------------------- */

.ticks {
  margin: 1.35rem 0 0;
  padding: 0;
  list-style: none;
}

.ticks li {
  position: relative;
  padding-left: 1.6rem;
  color: var(--ink-2);
  font-size: 0.94rem;
}

.ticks li + li {
  margin-top: 0.6rem;
}

.ticks li::before {
  content: "";
  position: absolute;
  top: 0.55em;
  left: 0.35rem;
  width: 0.3rem;
  height: 0.3rem;
  border-radius: 50%;
  background: var(--accent);
}

/* --- theme control ------------------------------------------------------- */

.tools {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, scale 0.2s var(--spring);
}

.icon-btn:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.icon-btn:active {
  scale: 0.93;
}

.icon-btn svg {
  width: 1rem;
  height: 1rem;
}

/* --- quiet panel --------------------------------------------------------- */

.panel {
  padding: clamp(1.5rem, 4vw, 2.75rem);
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}

.panel-accent {
  border-color: color-mix(in oklab, var(--accent) 26%, var(--border));
  background: color-mix(in oklab, var(--accent) 5%, var(--surface));
}

.panel h2 {
  font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.9rem);
}

.panel .grid {
  margin-top: clamp(1.6rem, 3vw, 2.1rem);
}

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

.faq {
  margin-top: clamp(1.6rem, 3vw, 2.25rem);
  border-top: 1px solid var(--border);
}

details {
  padding: 1.05rem 0;
  border-bottom: 1px solid var(--border);
}

summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

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

summary::after {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  flex: none;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  rotate: 45deg;
  transition: rotate 0.2s var(--ease);
}

details[open] summary::after {
  rotate: -135deg;
}

details .body {
  margin-top: 0.7rem;
  color: var(--ink-2);
  font-size: 0.94rem;
}

.cap {
  margin-top: 0.8rem;
  color: var(--muted);
  font-size: 0.82rem;
}

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

.foot {
  border-top: 1px solid var(--border);
  padding-block: clamp(2.25rem, 4vw, 3rem) clamp(2.5rem, 4vw, 3.25rem);
  color: var(--muted);
  font-size: 0.87rem;
}

.foot-in {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2.5rem;
  justify-content: space-between;
}

.foot a {
  color: var(--ink-2);
  text-decoration: none;
}

.foot a:hover {
  color: var(--accent);
}

.foot .brand {
  color: var(--ink);
  font-size: 0.95rem;
}

.foot .brand svg {
  width: 0.7rem;
  height: 0.92rem;
}

.foot-tag {
  margin-top: 0.5rem;
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.15rem;
}

.fine {
  max-width: 40rem;
  margin-top: clamp(1.75rem, 3vw, 2.25rem);
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  line-height: 1.55;
}

/* --- scroll-driven reveals ----------------------------------------------- */

/* Garnish only: animation-timeline still has not shipped in Firefox, so
   roughly a third of visitors never see these. Unsupported means the element
   simply sits in its final state, which is the correct outcome. */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .rise {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 4% entry 46%;
    }

    /* On a scroll timeline there is no elapsed time, so animation-delay does
       nothing. Staggering has to offset the range instead. */
    .stagger > * {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry calc(2% + var(--i, 0) * 7%) entry
        calc(48% + var(--i, 0) * 7%);
    }

    @supports (animation-range: entry calc(sibling-index() * 1%)) {
      .stagger > * {
        animation-range: entry calc(2% + (sibling-index() - 1) * 7%) entry
          calc(48% + (sibling-index() - 1) * 7%);
      }
    }

    .bar {
      transform-origin: 0 50%;
      animation: fill linear both;
      animation-timeline: scroll(root);
    }
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fill {
  from {
    scale: 0 1;
  }

  to {
    scale: 1 1;
  }
}

/* Page-progress strip, styled like a Puretreon card's progress bar. */
.bar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 60;
  height: 2px;
  background: var(--accent);
  scale: 0 1;
}

/* Below-fold sections can skip rendering until near the viewport. Kept off
   the hero, where a wrong size estimate would jump the scrollbar. */
.defer {
  content-visibility: auto;
  contain-intrinsic-size: auto 600px;
}

/* --- theme-swapped screenshot -------------------------------------------- */

/* Light and dark are a real Puretreon setting, so the header's toggle changes
   the screenshot too. Both frames share one grid cell; only opacity moves. */
.swap {
  display: grid;
}

.swap > img {
  grid-area: 1 / 1;
  transition: opacity 0.5s var(--ease);
}

.swap > img + img {
  opacity: 0;
}

:root[data-theme="dark"] .swap > img {
  opacity: 0;
}

:root[data-theme="dark"] .swap > img + img {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
