/*
  Elo Notarial — public site.
  Tokens follow the Elo Notas edition (docs/DESIGN-NOTAS.md): white and graphite surfaces,
  one discreet green for action, DM Sans for text and Manrope for titles. No scripts.
*/

@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/dm-sans-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/dm-sans-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/dm-sans-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/dm-sans-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/manrope-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/manrope-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("../fonts/manrope-latin-800-normal.woff2") format("woff2");
}

:root {
  color-scheme: light dark;

  --bg: #f6f7f7;
  --surface: #ffffff;
  --ink: #252b2b;
  --secondary: #586260;
  --line: #dfe5e2;
  --line-strong: #c3ccc8;
  --action: #256550;
  --action-hover: #1c5040;
  --on-action: #ffffff;
  --tint: #e9f1ed;
  --band: #1f2626;
  --band-ink: #edf0f0;
  --band-secondary: #b3bfbb;
  --band-line: #394342;
  --band-accent: #9ec8b5;
  --shadow: 0 12px 42px #23345412;

  --text: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --title: "Manrope", "DM Sans", system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;

  --radius-control: 8px;
  --radius-panel: 12px;
  --measure: 62ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171b1c;
    --surface: #202627;
    --ink: #edf0f0;
    --secondary: #a7b3af;
    --line: #333d3d;
    --line-strong: #47524f;
    --action: #9ec8b5;
    --action-hover: #b4d6c6;
    --on-action: #12211b;
    --tint: #22302b;
    --band: #111516;
    --band-ink: #edf0f0;
    --band-secondary: #a7b3af;
    --band-line: #2b3434;
    --band-accent: #9ec8b5;
    --shadow: 0 12px 42px #0003;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--title);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

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

ul,
ol {
  padding: 0;
  list-style: none;
}

p {
  text-wrap: pretty;
}

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

a {
  color: var(--action);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

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

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

.wrap {
  width: 100%;
  max-width: 70rem;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

.skip {
  position: absolute;
  left: var(--space-4);
  top: -4rem;
  z-index: 20;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-control);
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
}

.skip:focus {
  top: var(--space-4);
  color: var(--bg);
}

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 3rem;
  padding: 0 var(--space-5);
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  font-family: var(--text);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.button svg {
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
}

.button--primary {
  background: var(--action);
  color: var(--on-action);
}

.button--primary:hover {
  background: var(--action-hover);
  color: var(--on-action);
}

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

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

.button--small {
  min-height: 2.75rem;
  padding-inline: var(--space-4);
  font-size: 0.9375rem;
}

/* Header */

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
}

.top__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  min-height: 4.5rem;
}

.brand {
  display: inline-flex;
  flex: none;
  border-radius: 6px;
}

.brand img {
  width: 8.75rem;
  height: auto;
}

.top__nav {
  display: none;
}

.top__nav ul {
  display: flex;
  gap: var(--space-5);
}

.top__nav a {
  color: var(--secondary);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}

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

@media (min-width: 60rem) {
  .top__nav {
    display: block;
  }
}

/* Sections */

.section {
  padding-block: clamp(3.5rem, 8vw, 6rem);
}

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

.eyebrow {
  margin-bottom: var(--space-4);
  color: var(--action);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section__title {
  max-width: 24ch;
  font-size: clamp(1.75rem, 3.6vw, 2.5rem);
}

.section__lead {
  max-width: var(--measure);
  margin-top: var(--space-4);
  color: var(--secondary);
  font-size: 1.125rem;
}

/* Hero */

.hero {
  padding-block: clamp(3rem, 7vw, 5.5rem) clamp(3rem, 7vw, 5rem);
}

.hero__title {
  font-size: clamp(2.25rem, 6.4vw, 4.5rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.hero__title span {
  display: block;
}

.hero__title span + span {
  color: var(--action);
}

.hero__lead {
  max-width: 58ch;
  margin-top: var(--space-5);
  color: var(--secondary);
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  line-height: 1.6;
}

.hero__lead strong {
  color: var(--ink);
  font-weight: 600;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.hero__note {
  max-width: 58ch;
  margin-top: var(--space-4);
  color: var(--secondary);
  font-size: 0.9375rem;
}

.shot {
  margin-top: clamp(2.5rem, 6vw, 4rem);
}

.shot__frame {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.shot figcaption {
  margin-top: var(--space-3);
  color: var(--secondary);
  font-size: 0.875rem;
}

/* Steps */

.steps {
  display: grid;
  gap: var(--space-6) var(--space-6);
  margin-top: var(--space-7);
  counter-reset: step;
}

.steps li {
  padding-top: var(--space-4);
  border-top: 2px solid var(--ink);
  counter-increment: step;
}

.steps li::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  margin-bottom: var(--space-3);
  color: var(--action);
  font-family: var(--title);
  font-size: 0.9375rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.steps h3 {
  font-size: 1.1875rem;
  letter-spacing: -0.01em;
}

.steps p {
  margin-top: var(--space-3);
  color: var(--secondary);
  font-size: 1rem;
}

@media (min-width: 40rem) {
  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

/* Statement: what the product is, in one paragraph */

.statement {
  background: var(--tint);
}

.statement__grid {
  display: grid;
  gap: var(--space-5);
}

.statement h2 {
  font-size: clamp(1.625rem, 3.2vw, 2.25rem);
}

.statement p {
  max-width: var(--measure);
  font-size: 1.125rem;
}

@media (min-width: 60rem) {
  .statement__grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: var(--space-8);
    align-items: start;
  }
}

/* Features with a screen */

.feature {
  display: grid;
  gap: var(--space-6);
  align-items: center;
  margin-top: var(--space-8);
}

.feature h3 {
  font-size: clamp(1.375rem, 2.4vw, 1.75rem);
}

.feature p {
  max-width: 52ch;
  margin-top: var(--space-4);
  color: var(--secondary);
}

.feature .shot {
  margin-top: 0;
}

@media (min-width: 60rem) {
  .feature {
    grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
    gap: var(--space-8);
  }

  .feature--flip {
    grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  }

  .feature--flip .feature__text {
    order: 2;
  }
}

/* Smaller features: a ruled list, not a grid of cards */

.list {
  display: grid;
  gap: var(--space-6);
  margin-top: var(--space-8);
}

.list li {
  padding-top: var(--space-4);
  border-top: 1px solid var(--line-strong);
}

.list h3 {
  font-size: 1.125rem;
  letter-spacing: -0.01em;
}

.list p {
  margin-top: var(--space-2);
  color: var(--secondary);
  font-size: 1rem;
}

@media (min-width: 40rem) {
  .list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 64rem) {
  .list--four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .list--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Privacy band */

.band {
  background: var(--band);
  color: var(--band-ink);
}

.band .eyebrow {
  color: var(--band-accent);
}

.band .section__lead {
  color: var(--band-secondary);
}

.band .list li {
  border-top-color: var(--band-line);
}

.band .list p {
  color: var(--band-secondary);
}

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

.band :focus-visible {
  outline-color: var(--band-accent);
}

/* Pricing */

.plans {
  display: grid;
  gap: var(--space-4);
  margin-top: var(--space-7);
}

.plan {
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
}

.plan h3 {
  color: var(--secondary);
  font-family: var(--text);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0;
}

.plan__price {
  margin-top: var(--space-2);
  font-family: var(--title);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}

.plan__price small {
  color: var(--secondary);
  font-family: var(--text);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0;
}

.plan__note {
  margin-top: var(--space-2);
  color: var(--secondary);
  font-size: 0.9375rem;
}

@media (min-width: 40rem) {
  .plans {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.terms {
  display: grid;
  gap: var(--space-6);
  margin-top: var(--space-7);
}

.terms h3 {
  font-size: 1.0625rem;
  letter-spacing: -0.005em;
}

.terms ul {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.terms li {
  display: grid;
  grid-template-columns: 1.25rem minmax(0, 1fr);
  gap: var(--space-3);
  align-items: start;
  color: var(--secondary);
  font-size: 1rem;
}

.terms li svg {
  width: 1.125rem;
  height: 1.125rem;
  margin-top: 0.3rem;
  color: var(--action);
}

.terms .terms--apart li svg {
  color: var(--secondary);
}

@media (min-width: 60rem) {
  .terms {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-8);
  }
}

.buy {
  max-width: var(--measure);
  margin-top: var(--space-7);
  color: var(--secondary);
}

/* Questions */

.faq {
  max-width: 48rem;
  margin-top: var(--space-6);
  border-bottom: 1px solid var(--line-strong);
}

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

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-block: var(--space-4);
  font-family: var(--title);
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.005em;
  list-style: none;
  cursor: pointer;
}

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

.faq summary svg {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  color: var(--secondary);
  transition: transform 160ms ease;
}

.faq details[open] summary svg {
  transform: rotate(180deg);
}

.faq details p {
  max-width: var(--measure);
  padding-bottom: var(--space-5);
  color: var(--secondary);
}

/* Download */

.download {
  display: grid;
  gap: var(--space-6);
  padding: clamp(1.5rem, 4vw, 3rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
}

.download h2 {
  font-size: clamp(1.75rem, 3.6vw, 2.5rem);
}

.download__lead {
  max-width: 52ch;
  margin-top: var(--space-4);
  color: var(--secondary);
  font-size: 1.125rem;
}

.file {
  display: grid;
  gap: var(--space-4);
  align-content: start;
  padding-top: var(--space-5);
  border-top: 1px solid var(--line);
  font-size: 0.9375rem;
}

.file dt {
  color: var(--secondary);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.file dd {
  margin-top: var(--space-1);
}

.file code {
  font-family: var(--mono);
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
}

.file p {
  color: var(--secondary);
}

@media (min-width: 60rem) {
  .download {
    grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
    gap: var(--space-8);
  }

  .file {
    padding-top: 0;
    padding-left: var(--space-7);
    border-top: 0;
    border-left: 1px solid var(--line);
  }
}

/* Footer */

.foot {
  padding-block: var(--space-7);
  border-top: 1px solid var(--line);
  color: var(--secondary);
  font-size: 0.9375rem;
}

.foot__row {
  display: grid;
  gap: var(--space-5);
}

.foot img {
  width: 8.75rem;
}

.brand picture,
.foot picture {
  display: block;
}

.foot ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
}

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

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

@media (min-width: 60rem) {
  .foot__row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }
}

/*
  Motion. Everything below is CSS: a one-time entrance of the hero, and effects tied to the
  scroll position (scroll and view timelines) instead of timers, so nothing loops and nothing
  moves unless the visitor scrolls. Browsers without scroll timelines show the static page.
  Turned off entirely under prefers-reduced-motion.
*/

/* Decorative backdrops (generated art, no content). */

.hero {
  position: relative;
  isolation: isolate;
  overflow: clip;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0 0 -18%;
  z-index: -1;
  background: url("../img/hero-light.webp") right center / cover no-repeat;
  mask-image: linear-gradient(to bottom, #000 55%, transparent);
  pointer-events: none;
}

.band {
  position: relative;
  isolation: isolate;
  overflow: clip;
}

.band::before {
  content: "";
  position: absolute;
  inset: -12% 0;
  z-index: -1;
  background: url("../img/band-dark.webp") center / cover no-repeat;
  opacity: 0.8;
  pointer-events: none;
}

/* On a phone the text covers the whole width: keep the art faint behind it. */
@media (max-width: 40rem) {
  .hero::before {
    opacity: 0.4;
  }
}

@media (prefers-color-scheme: dark) {
  .hero::before {
    background-image: url("../img/hero-dark.webp");
  }

  /* The band is darker in this theme; darken the art to the same ground. */
  .band::before {
    filter: brightness(0.6);
  }
}

/* Reading progress, drawn on the bottom edge of the header. */

.top::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--action);
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}

@keyframes rise {
  from {
    opacity: 0;
    translate: 0 1rem;
  }
}

@keyframes reveal {
  from {
    opacity: 0;
    translate: 0 2rem;
  }
}

@keyframes settle {
  from {
    scale: 0.95;
    translate: 0 1.5rem;
  }
}

@keyframes drift {
  to {
    translate: 0 12%;
  }
}

@keyframes drift-band {
  from {
    translate: 0 -8%;
  }
  to {
    translate: 0 8%;
  }
}

@keyframes float {
  from {
    translate: 0 2.5rem;
  }
  to {
    translate: 0 -2.5rem;
  }
}

@keyframes progress {
  to {
    transform: scaleX(1);
  }
}

@keyframes lift {
  to {
    box-shadow: 0 6px 24px #0000000f;
  }
}

@media (prefers-reduced-motion: no-preference) {
  /* Hero entrance: once, on load, short. */
  .hero .eyebrow,
  .hero__title span,
  .hero__lead,
  .hero .actions,
  .hero__note {
    animation: rise 620ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .hero__title span:nth-child(1) {
    animation-delay: 60ms;
  }

  .hero__title span:nth-child(2) {
    animation-delay: 140ms;
  }

  .hero__lead {
    animation-delay: 220ms;
  }

  .hero .actions {
    animation-delay: 300ms;
  }

  .hero__note {
    animation-delay: 360ms;
  }

  @supports (animation-timeline: scroll()) {
    .top::after {
      animation: progress linear both;
      animation-timeline: scroll(root);
    }

    .top {
      animation: lift linear both;
      animation-timeline: scroll(root);
      animation-range: 0 6rem;
    }

    /* Parallax: the backdrops move slower than the page. */
    .hero::before {
      animation: drift linear both;
      animation-timeline: scroll(root);
      animation-range: 0 100vh;
    }

    .band {
      view-timeline: --band block;
    }

    .band::before {
      animation: drift-band linear both;
      animation-timeline: --band;
    }
  }

  @supports (animation-timeline: view()) {
    /* The hero screen settles into place as it comes up. */
    .hero .shot__frame {
      animation: settle linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 40%;
    }

    /* Feature screens drift against their text. */
    .feature .shot {
      animation: float linear both;
      animation-timeline: view();
      animation-range: cover;
    }

    /* Fade in as each block enters the viewport. */
    .section .eyebrow,
    .section__title,
    .section__lead,
    .statement__grid > *,
    .feature__text,
    .steps li,
    .list li,
    .plan,
    .terms > *,
    .buy,
    .faq,
    .download {
      animation: reveal linear both;
      animation-timeline: view();
      animation-range: entry 5% cover 28%;
    }

    /* Items in a row enter a little apart. */
    :is(.steps, .list, .plans) > :nth-child(2),
    .statement__grid > :nth-child(2),
    .terms > :nth-child(2) {
      animation-range: entry 15% cover 33%;
    }

    :is(.steps, .list) > :nth-child(3) {
      animation-range: entry 25% cover 38%;
    }

    :is(.steps, .list) > :nth-child(4) {
      animation-range: entry 35% cover 43%;
    }
  }
}

@media print {
  .hero::before,
  .band::before,
  .top::after {
    display: none;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
  }
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
  }

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