/* SPDX-License-Identifier: Apache-2.0
   Copyright 2025, Alexander Willner
   CompressOffice product page. System fonts, one accent, no external requests. */

:root {
  color-scheme: light dark;
  --page: #f7f4ed;
  --surface: #fffdf8;
  --surface-2: #efeae0;
  --ink: #17161d;
  --muted: #5d5a66;
  --line: #ded9cc;
  --accent: #4b3fe4;
  --accent-ink: #fffdf8;
  --accent-soft: rgb(75 63 228 / 0.10);
  --positive: #1c7a4a;
  --max: 1240px;
  --pad: clamp(20px, 5vw, 64px);
  --radius: 20px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #0e0d13;
    --surface: #16151d;
    --surface-2: #1d1b26;
    --ink: #f3f1ea;
    --muted: #a9a5b3;
    --line: #2c2938;
    --accent: #a89fff;
    --accent-ink: #121118;
    --accent-soft: rgb(168 159 255 / 0.14);
    --positive: #6ddba0;
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
  font-synthesis: none;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

picture {
  display: block;
  max-width: 100%;
}

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

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

h1,
h2,
h3,
p,
dl,
dd,
figure {
  margin: 0;
}

h1,
h2,
h3 {
  font-weight: 620;
  line-height: 1.02;
  letter-spacing: -0.045em;
}

h1 {
  font-size: clamp(52px, 7.4vw, 104px);
}

h2 {
  font-size: clamp(32px, 4.4vw, 56px);
}

h3 {
  font-size: 21px;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

p {
  color: var(--muted);
}

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

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

.skip {
  position: fixed;
  top: -80px;
  left: 20px;
  z-index: 20;
  padding: 12px 18px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
}

.skip:focus {
  top: 14px;
}

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

/* Top bar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--page) 88%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.topbar .wrap {
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 66px;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 640;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}

.brand img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

.brand span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 450;
  letter-spacing: 0.02em;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-left: auto;
  font-size: 14px;
  min-width: 0;
}

.topnav a {
  color: var(--muted);
  text-decoration: none;
}

.topnav a:hover {
  color: var(--ink);
}

.lang {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 28px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.lang:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--positive);
}

/* Hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.06fr);
  gap: clamp(28px, 3.6vw, 56px);
  align-items: center;
  padding-block: clamp(40px, 5.5vw, 80px) clamp(44px, 5.5vw, 80px);
}

.hero > * {
  min-width: 0;
}

.kicker {
  margin-bottom: 22px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 620;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 span {
  color: var(--accent);
}

.lead {
  max-width: 36ch;
  margin-top: 26px;
  font-size: clamp(17px, 1.45vw, 20px);
  line-height: 1.55;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 22px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 11px 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.button:hover {
  color: var(--accent-ink);
  opacity: 0.9;
  transform: translateY(-1px);
}

.button.secondary {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.button.secondary:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.textlink {
  font-size: 15px;
  font-weight: 550;
  text-decoration: none;
}

.textlink::after {
  content: " →";
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 18px clamp(22px, 4vw, 46px);
  margin-top: 44px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.facts dt {
  font-size: 26px;
  font-weight: 620;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.facts dd {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.hero-shot {
  position: relative;
  margin-right: calc(var(--pad) * -1);
}

.hero-shot img {
  width: 100%;
  filter: drop-shadow(0 26px 48px rgb(20 18 32 / 0.20));
}

.hero-shot figcaption {
  margin-top: 16px;
  color: var(--muted);
  font-size: 12.5px;
}

/* Ruler demo */

.section {
  padding-block: clamp(48px, 6vw, 88px);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 18px 40px;
  margin-bottom: 34px;
}

.section-head p {
  max-width: 46ch;
  font-size: 16px;
}

.demo {
  padding: clamp(22px, 3.6vw, 38px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.demo-top {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 16px 32px;
}

.demo-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.demo-output {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: clamp(40px, 6vw, 70px);
  font-weight: 620;
  letter-spacing: -0.055em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.demo-output small {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
}

.scale {
  position: relative;
  margin-top: 28px;
  padding-top: 26px;
}

.scale::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 10px;
  background-image: repeating-linear-gradient(
    90deg,
    var(--line) 0 1px,
    transparent 1px calc(100% / 16)
  );
  background-size: 100% 10px;
  background-repeat: no-repeat;
}

.track {
  position: relative;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
}

.fill {
  position: relative;
  height: 100%;
  width: 23%;
  border-radius: 8px 4px 4px 8px;
  background: var(--accent);
  transition: width 0.55s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.fill-label {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.demo[data-preset="small"] .fill {
  width: 20%;
}

.demo[data-preset="tiny"] .fill {
  width: 13%;
}

.scale-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.segmented {
  display: inline-flex;
  gap: 2px;
  margin-top: 26px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
}

.segmented button {
  padding: 8px 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
}

.segmented button:hover {
  color: var(--ink);
}

.segmented button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgb(20 18 32 / 0.12);
}

.demo-note {
  margin-top: 22px;
  font-size: 12.5px;
}

/* Steps */

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 56px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps li {
  padding-top: 18px;
  border-top: 2px solid var(--ink);
}

.step-number {
  display: block;
  margin-bottom: 26px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
}

.steps p {
  margin-top: 10px;
  font-size: 15.5px;
}

/* Features */

.features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 clamp(32px, 5vw, 72px);
  margin: 0;
}

.features > div {
  display: grid;
  grid-template-columns: minmax(120px, 0.42fr) 1fr;
  gap: 18px;
  padding-block: 20px;
  border-top: 1px solid var(--line);
}

.features dt {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.features dd {
  color: var(--muted);
  font-size: 15px;
}

/* Limits band */

.band {
  border-block: 1px solid var(--line);
  background: var(--surface-2);
}

.band .wrap {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(28px, 5vw, 80px);
  padding-block: clamp(48px, 6vw, 84px);
}

.limits {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.limits li {
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 15px;
}

.limits strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
  font-weight: 600;
}

/* Pricing */

.plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.plan {
  padding: clamp(24px, 3.5vw, 40px) 0;
}

.plan + .plan {
  padding-left: clamp(24px, 4vw, 56px);
  border-left: 1px solid var(--line);
}

.plan h3 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.price {
  margin-top: 14px;
  color: var(--ink);
  font-size: clamp(34px, 4vw, 48px);
  font-weight: 620;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}

.price small {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
}

.plan ul {
  display: grid;
  gap: 8px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 15px;
}

.plan li {
  padding-left: 18px;
  position: relative;
}

.plan li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--accent);
}

.plan.pro li::before {
  background: var(--ink);
}

.status-note {
  max-width: 62ch;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}

/* FAQ */

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

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

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 0;
  cursor: pointer;
  font-size: 16px;
  font-weight: 550;
  list-style: none;
}

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

.faq summary::after {
  content: "+";
  color: var(--muted);
  font-size: 20px;
  font-weight: 400;
}

.faq details[open] summary::after {
  content: "−";
}

.faq details p {
  max-width: 72ch;
  padding-bottom: 22px;
  font-size: 15px;
}

/* Footer */

.footer {
  border-top: 1px solid var(--line);
  padding-block: 40px 48px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  justify-content: space-between;
  gap: 28px 56px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
}

.footer-brand img {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}

.footer p {
  margin-top: 8px;
  max-width: 38ch;
  font-size: 12.5px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 26px;
  max-width: 430px;
  font-size: 13px;
}

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

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

.legal {
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

/* Responsive */

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 44px;
  }

  .hero-shot {
    max-width: 760px;
    margin-right: 0;
  }

  .section-head {
    display: block;
  }

  .section-head p {
    margin-top: 14px;
  }

  .steps {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .features {
    grid-template-columns: 1fr;
  }

  .band .wrap {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  html {
    scroll-padding-top: 76px;
  }

  .topbar .wrap {
    min-height: 58px;
    gap: 12px;
  }

  .topnav {
    gap: 10px;
  }

  .brand span,
  .topnav a:not(.status):not(.lang) {
    display: none;
  }

  .facts {
    gap: 16px 28px;
  }

  .facts dt {
    font-size: 22px;
  }

  .plans {
    grid-template-columns: 1fr;
  }

  .plan + .plan {
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .footer-links {
    justify-content: flex-start;
  }

  .segmented {
    display: flex;
  }

  .segmented button {
    flex: 1;
    padding-inline: 8px;
  }

  .fill-label {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
