/* Remont AI, remontai.xyz
   The app's own language (docs/DESIGN.md): a white page, spruce-black ink, bottle-green brand,
   sage wells, Open Runde for headings and the phone's own font for reading. No action orange here:
   on the web the one main action is the official store badges.
   The paint roller from Roller.swift is the drag handle of every before/after. */

@font-face {
  font-family: "Open Runde";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/open-runde-600.woff2") format("woff2");
}
@font-face {
  font-family: "Open Runde";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/open-runde-700.woff2") format("woff2");
}

:root {
  --page: #fff;
  --well: #ebf1ed;
  --ink: #16211c;
  --ink-soft: #4a5952;
  --green: #1f4636;
  --green-deep: #132c22;
  --green-tint: #dfeae2;
  --on-green: #f3f7f2;
  --on-green-soft: #b9ccbf;

  --display: "Open Runde", ui-rounded, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --text: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --gutter: 20px;
  --wide: 1100px;
  --hero-max: var(--wide);
  --photo-radius: 22px;
  /* Roller.swift photoShadow: ink at 18 %, small and tight, one light from above. */
  --photo-shadow: 0 2px 6px rgb(22 33 28 / 0.18);
  /* Store badges: same visible height for both, inside both brands' size rules. */
  --badge-h: clamp(40px, calc((100vw - 56px) / 6.4), 54px);

  color-scheme: light;
}

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

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

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 400 18px/1.55 var(--text);
  overflow-x: clip;
}

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

a {
  color: var(--green);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

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

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

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

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  color: var(--ink);
  text-wrap: balance;
}

p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

p,
li,
dd {
  text-wrap: pretty;
}

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

.defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.skip {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 10;
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--page);
  font-weight: 600;
  text-decoration: none;
}

.skip:focus {
  top: 12px;
  color: var(--page);
}

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

.top {
  width: min(var(--hero-max), 100% - 2 * var(--gutter));
  margin-inline: auto;
  padding: 14px 0 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 24px;
}

/* Documents: the header shares the text column's edges. */
.doc-page .top {
  width: min(780px, 100% - 2 * var(--gutter));
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  color: var(--green);
  font: 700 22px/1 var(--display);
  letter-spacing: -0.005em;
  text-decoration: none;
}

.brand:hover {
  color: var(--green-deep);
}

.brand img {
  width: 40px;
  height: 40px;
}

/* ---------- store badges (official files, unmodified) ---------- */

.stores {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.store {
  display: block;
  height: var(--badge-h);
  border-radius: calc(var(--badge-h) * 0.2);
  line-height: 0;
}

.store img {
  width: auto;
  max-width: none;
  height: var(--badge-h);
}

/* Google's PNG carries transparent space above and below the badge (29 px of 250). */
.store .badge-google {
  height: calc(var(--badge-h) * 250 / 192);
  margin-top: calc(var(--badge-h) * -29 / 192);
}

/* ---------- before / after with the roller ---------- */

.ba {
  --split: 0.5;
  --hr: 0.75; /* height / width */
  --W: 600px; /* replaced by 100cqw below, or by the script where container units are missing */
  position: relative;
  aspect-ratio: 4 / 3;
  container-type: inline-size;
  overflow: hidden;
  border-radius: var(--photo-radius);
  background: var(--well);
  box-shadow: var(--photo-shadow);
  isolation: isolate;
  cursor: ew-resize;
  touch-action: pan-y pinch-zoom;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

@supports (width: 1cqw) {
  .ba > * {
    --W: 100cqw;
  }
}

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

.ba picture,
.ba img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.ba img {
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
}

.ba-after {
  clip-path: inset(0 0 0 calc(var(--split) * 100%));
}

/* The seam: a fine white line with a soft dark edge, visible on any photo (as in the app). */
.ba-seam {
  position: absolute;
  left: 0;
  top: 0;
  width: 2.5px;
  height: 100%;
  background: #fff;
  box-shadow: 0 0 2.4px rgb(0 0 0 / 0.28);
  transform: translateX(calc(var(--split) * var(--W) - 1.25px));
  pointer-events: none;
}

/* RollerGlyph: fleece height --fh, axle on the seam, fleece centred a little above the middle. */
.roller {
  --H: calc(var(--W) * var(--hr));
  --fh: clamp(56px, calc(var(--H) * 0.26), 150px);
  position: absolute;
  left: 0;
  top: 0;
  width: calc(var(--fh) * 0.56);
  height: calc(var(--fh) * 1.87);
  overflow: visible;
  transform: translate(
    calc(var(--split) * var(--W) - var(--fh) * 0.1744),
    calc((var(--H) - var(--fh) * 1.87) / 2 - var(--fh) * 0.08)
  );
  /* A tight shadow from one light above-left, so the roller sits on the photo. */
  filter: drop-shadow(calc(var(--fh) * 0.0163) calc(var(--fh) * 0.0233) calc(var(--fh) * 0.0256) rgb(11 20 16 / 0.32));
  pointer-events: none;
}

.ba-cap {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  gap: 12px;
  margin-top: 10px;
  padding-inline: 4px;
  font-size: 16px;
  line-height: 1.35;
  color: var(--ink-soft);
}

.ba-cap .hint {
  color: var(--ink);
  font-weight: 600;
}

.ba-cap span:last-child {
  text-align: right;
}

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

.hero {
  width: min(var(--hero-max), 100% - 2 * var(--gutter));
  margin-inline: auto;
  display: grid;
  grid-template-areas:
    "figure"
    "text";
  align-content: center;
  row-gap: 22px;
  min-height: calc(100vh - 72px);
  min-height: calc(100svh - 72px);
  padding: 14px 0 26px;
  container-type: inline-size;
}

.hero-figure {
  grid-area: figure;
}

.hero-text {
  grid-area: text;
}

.hero h1 {
  font-size: clamp(31px, 10.2vw, 46px);
  line-height: 1.06;
  letter-spacing: -0.01em;
}

.lede {
  margin-top: 12px;
  max-width: 36ch;
  font-size: 19px;
  line-height: 1.45;
  color: var(--ink-soft);
}

.hero .stores {
  margin-top: 22px;
}

/* Tall phones: a square crop gives the photo the room the screen has. */
@media (max-width: 719px) and (min-height: 760px) {
  .hero .ba {
    aspect-ratio: 1;
    --hr: 1;
  }
}

/* Short phones: keep the whole first screen in view. */
@media (max-width: 719px) and (max-height: 650px) {
  .hero {
    row-gap: 16px;
    padding-bottom: 24px;
  }
  .hero h1 {
    font-size: clamp(28px, 8.6vw, 34px);
  }
  .lede {
    margin-top: 8px;
    font-size: 17px;
  }
  .hero .stores {
    margin-top: 16px;
  }
}

/* ---------- sections ---------- */

.section {
  width: min(var(--wide), 100% - 2 * var(--gutter));
  margin: 88px auto 0;
  scroll-margin-top: 24px;
}

.section > h2,
.faq-head h2 {
  font-size: clamp(30px, 4.4vw, 46px);
  line-height: 1.1;
  letter-spacing: -0.005em;
}

.sec-intro {
  margin-top: 14px;
  max-width: 58ch;
  font-size: 19px;
  color: var(--ink-soft);
}

/* How it works: the real app screen in the middle, the steps around it. */
.how-grid {
  margin-top: 36px;
  display: grid;
  grid-template-areas:
    "shot"
    "s1"
    "s2"
    "s3"
    "s4";
  row-gap: 34px;
}

.how-shot {
  grid-area: shot;
  justify-self: center;
  width: min(300px, 80vw);
}

.how-shot img {
  width: 100%;
  border-radius: 26px;
  box-shadow: 0 0 0 1px rgb(22 33 28 / 0.1), var(--photo-shadow);
}

.how-shot figcaption {
  margin-top: 14px;
  text-wrap: balance;
  text-align: center;
  font-size: 15px;
  line-height: 1.4;
  color: var(--ink-soft);
}

.step-1 { grid-area: s1; }
.step-2 { grid-area: s2; }
.step-3 { grid-area: s3; }
.step-4 { grid-area: s4; }

.step h3 {
  display: flex;
  align-items: baseline;
  gap: 0.45em;
  font-size: 23px;
  line-height: 1.25;
}

.step .n {
  min-width: 0.7em;
  color: var(--green);
}

.step p {
  margin-top: 8px;
  max-width: 34ch;
  color: var(--ink-soft);
}

/* Examples */
.ex-grid {
  margin-top: 34px;
  display: grid;
  gap: 40px;
}

.ex figcaption {
  margin-top: 14px;
  padding-inline: 2px;
}

.ex-title {
  display: block;
  font: 600 21px/1.3 var(--display);
  color: var(--ink);
}

.ex-meta {
  display: block;
  margin-top: 2px;
  font-size: 17px;
  color: var(--ink-soft);
}

/* Questions */
.faq-help {
  margin-top: 12px;
  max-width: 30ch;
  color: var(--ink-soft);
}

.faq-list {
  margin-top: 30px;
  display: grid;
  gap: 12px;
  max-width: 820px;
}

.faq details {
  border-radius: 18px;
  background: var(--well);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 64px;
  padding: 16px 20px 16px 22px;
  border-radius: 18px;
  list-style: none;
  cursor: pointer;
  font: 600 20px/1.3 var(--display);
  color: var(--ink);
  transition: background-color 0.2s ease;
}

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

@media (hover: hover) {
  .faq summary:hover {
    background: var(--green-tint);
  }
}

.faq-mark {
  flex: none;
  width: 24px;
  height: 24px;
  color: var(--green);
}

.faq-mark path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
}

/* The vertical bar turns flat: plus becomes minus, caps stay round. */
.faq-mark .v {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.28s cubic-bezier(0.3, 0.7, 0.2, 1);
}

.faq details[open] .faq-mark .v {
  transform: rotate(90deg);
}

.faq-a {
  padding: 2px 22px 22px;
}

.faq-a p + p {
  margin-top: 10px;
}

@supports (interpolate-size: allow-keywords) {
  .faq {
    interpolate-size: allow-keywords;
  }
  .faq details::details-content {
    height: 0;
    overflow: clip;
    transition: height 0.3s ease, content-visibility 0.3s allow-discrete;
  }
  .faq details[open]::details-content {
    height: auto;
  }
  @media (prefers-reduced-motion: reduce) {
    .faq details::details-content {
      transition: none;
    }
  }
}

/* ---------- footer: the brand's own floor ---------- */

.foot {
  margin-top: 112px;
  background: var(--green);
  color: var(--on-green);
}

.foot-in {
  width: min(var(--wide), 100% - 2 * var(--gutter));
  margin-inline: auto;
  padding: 52px 0 40px;
  display: grid;
  gap: 40px;
}

.foot a {
  color: var(--on-green);
}

.foot a:hover {
  color: #fff;
}

.foot :focus-visible {
  outline-color: var(--on-green);
}

.foot .brand {
  color: var(--on-green);
}

.foot-line {
  margin-top: 10px;
  color: var(--on-green-soft);
}

.foot .stores {
  margin-top: 24px;
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 26px;
  padding: 0;
  list-style: none;
  font-size: 18px;
}

.foot-links a {
  display: inline-block;
  padding-block: 6px;
}

.foot-imprint {
  margin-top: 22px;
  font-style: normal;
  font-size: 15px;
  line-height: 1.6;
  color: var(--on-green-soft);
}

.foot-imprint p + p {
  margin-top: 6px;
}

.foot-imprint strong {
  font-weight: 600;
  color: var(--on-green);
}

.foot-copy {
  margin-top: 18px;
  font-size: 15px;
  color: var(--on-green-soft);
}

/* ---------- documents: terms, privacy, help ---------- */

.doc-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 22px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 17px;
}

.doc-nav a {
  display: inline-block;
  padding-block: 10px;
  color: var(--ink-soft);
  text-decoration: none;
}

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

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

.doc {
  width: min(780px, 100% - 2 * var(--gutter));
  margin: 36px auto 0;
}

.doc h1 {
  font-size: clamp(34px, 7vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.005em;
}

.doc .meta {
  margin-top: 12px;
  font-size: 16px;
  color: var(--ink-soft);
}

.doc h2 {
  margin-top: 48px;
  font-size: 25px;
  line-height: 1.25;
  scroll-margin-top: 24px;
}

.doc h3 {
  margin-top: 28px;
  font-size: 20px;
  line-height: 1.3;
}

.doc p,
.doc ul,
.doc ol {
  margin-top: 14px;
}

.doc ul,
.doc ol {
  padding-left: 1.3em;
}

.doc li + li {
  margin-top: 8px;
}

.doc li::marker {
  color: var(--ink-soft);
}

.box {
  margin-top: 16px;
  padding: 20px 22px;
  border-radius: 18px;
  background: var(--well);
}

.doc table {
  width: 100%;
  margin-top: 14px;
  border-collapse: separate;
  border-spacing: 0 8px;
  font-size: 16px;
  line-height: 1.5;
}

.doc th,
.doc td {
  padding: 14px 16px;
  text-align: left;
  vertical-align: top;
}

.doc th {
  padding-block: 4px 0;
  font: 600 15px/1.3 var(--display);
  color: var(--ink-soft);
}

.doc td {
  background: var(--well);
}

.doc td:first-child {
  border-radius: 14px 0 0 14px;
}

.doc td:last-child {
  border-radius: 0 14px 14px 0;
}

/* Help centre */
.doc .rows {
  display: grid;
  gap: 26px;
  margin-top: 26px;
}

.rows dt {
  font: 600 21px/1.3 var(--display);
}

.rows dd {
  margin-top: 6px;
  max-width: 62ch;
  color: var(--ink-soft);
}

.lost {
  min-height: 52vh;
}

/* ---------- wider screens ---------- */

@media (max-width: 719px) {
  /* Tables become one card per row, every value labelled. */
  .doc table,
  .doc tbody,
  .doc tr,
  .doc td {
    display: block;
  }
  .doc tr:first-child {
    display: none;
  }
  .doc tr {
    margin-top: 12px;
    padding: 6px 18px;
    border-radius: 16px;
    background: var(--well);
  }
  .doc td,
  .doc td:first-child,
  .doc td:last-child {
    padding: 10px 0;
    border-radius: 0;
    background: none;
  }
  .doc td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    font: 600 14px/1.3 var(--display);
    color: var(--ink-soft);
  }
}

@media (min-width: 720px) and (max-width: 979px) {
  .how-grid {
    grid-template-columns: 260px minmax(0, 1fr);
    grid-template-rows: 1fr auto auto auto auto 1fr;
    grid-template-areas:
      "shot ."
      "shot s1"
      "shot s2"
      "shot s3"
      "shot s4"
      "shot .";
    column-gap: 48px;
    row-gap: 30px;
  }
  .how-shot {
    width: 260px;
  }
}

@media (min-width: 720px) {
  .ex-grid {
    grid-template-columns: 1fr 1fr;
    gap: 56px 36px;
  }
}

@media (min-width: 900px) {
  :root {
    --gutter: 40px;
    /* The hero is as wide as the screen's height allows with the whole roller in view. */
    --hero-max: clamp(640px, calc((100svh - 400px) * 3), 1100px);
  }

  body {
    font-size: 19px;
  }

  .top {
    padding-top: 18px;
  }

  .hero {
    grid-template-areas:
      "text"
      "figure";
    align-content: start;
    row-gap: 30px;
    min-height: 0;
    padding: 14px 0 0;
  }

  .hero-text {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "h1 h1"
      "lede stores";
    align-items: center;
    column-gap: 40px;
    row-gap: 18px;
  }

  .hero h1 {
    grid-area: h1;
    font-size: clamp(40px, 6.45cqw, 72px);
    line-height: 1.04;
  }

  .lede {
    grid-area: lede;
    margin: 0;
    max-width: none;
    font-size: 20px;
    text-wrap: balance;
  }

  .hero .stores {
    grid-area: stores;
    margin: 0;
    flex-wrap: nowrap;
  }

  .hero .ba {
    aspect-ratio: 3 / 2;
    --hr: 0.6667;
  }

  .section {
    margin-top: 120px;
  }

  .faq {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    column-gap: 56px;
    align-items: start;
  }

  .faq-list {
    margin-top: 6px;
    max-width: none;
  }

  .foot {
    margin-top: 140px;
  }

  .foot-in {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    column-gap: 72px;
    padding-top: 72px;
  }
}

@media (min-width: 980px) {
  .how-grid {
    grid-template-columns: minmax(0, 1fr) 320px minmax(0, 1fr);
    grid-template-rows: 1fr auto 72px auto 1fr;
    grid-template-areas:
      ".  shot ."
      "s1 shot s3"
      ".  shot ."
      "s2 shot s4"
      ".  shot .";
    column-gap: 72px;
    row-gap: 0;
    margin-top: 48px;
  }

  .how-shot {
    width: 320px;
  }
}
