/*
 * No Problemo pre-launch landing. Same brand as apps/site: cream, ink and night,
 * Inter Tight, olive for the italic word. The photo carries the page; text sits
 * on the bright sky with a soft cream gradient that keeps ink above 4.5:1.
 */
@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/inter-tight-latin-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/inter-tight-latin-ext-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter Tight";
  font-style: italic;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/inter-tight-latin-wght-italic.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter Tight";
  font-style: italic;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/inter-tight-latin-ext-wght-italic.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --cream: #f4f2ec;
  --ink: #1e1b18; /* 15.3:1 on cream */
  --muted: #4a463f; /* 8.6:1 on cream */
  --olive: #4b5a14; /* 6.8:1 on cream */
  --night: #161812;
  --line: #8c877c; /* 3.2:1 on cream: control borders */
  --focus: #b4500c;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "Inter Tight", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 400 1.125rem/1.6 var(--font);
}
a {
  color: inherit;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}
a:hover {
  text-decoration-thickness: 2px;
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
main:focus {
  outline: none;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  background: var(--night);
  color: var(--cream);
  font-weight: 600;
}
.skip-link:focus {
  top: 1rem;
}

/* Header and footer, shared by every page */
.top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem clamp(1.5rem, 5vw, 4rem);
}
.brand {
  display: inline-block;
  line-height: 44px;
  white-space: nowrap;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}
/* "AI" belongs to the name without carrying its weight: light italic, olive,
   a touch smaller and tucked against "Problemo". */
.brand-ai {
  margin-left: -0.06em;
  font-size: 0.78em;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--olive);
}
.lang {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  font-size: 0.95rem;
}
.foot {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 1.5rem;
  padding: 1rem clamp(1.5rem, 5vw, 4rem) 1.25rem;
  font-size: 0.9rem;
}
.legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.25rem;
}
.legal-nav a,
.credit a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.credit {
  margin: 0;
}

/* Landing: words on a clean cream column, the photo dissolving into it from
   the right with the horse in view. No veil over the photo. */
.landing {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
}
.photo-wrap {
  position: absolute;
  /* Starts at the edge of the text column; dither.js keeps the dots clear of
     the text itself. At most one screen tall, so
     the horse is in view on short laptops even when the page scrolls. */
  inset: 0 0 auto 30rem;
  z-index: 0;
  width: calc(100% - 30rem);
  height: min(100%, 100vh);
  height: min(100%, 100svh);
  overflow: hidden;
}
.photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 64% 80%;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, rgb(0 0 0 / 0.55) 22%, #000 46%);
  mask-image: linear-gradient(to right, transparent 0%, rgb(0 0 0 / 0.55) 22%, #000 46%);
}
/* Dithered version (dither.js): drawn at display size, one dot = whole device
   pixels, never smoothed. The plain photo stays until it is ready, or for good
   without JavaScript. */
.photo-dither {
  position: absolute;
  top: 0;
  left: 0;
  image-rendering: pixelated;
  opacity: 0;
  transition: opacity 400ms var(--ease);
}
.dither .photo {
  opacity: 0;
}
.dithered .photo-dither {
  opacity: 1;
}

/* On wide screens the header stays inside the cream column, so the language
   link never sits on the photo. */
.landing .top {
  width: min(100%, 44rem);
  justify-content: flex-start;
  gap: 2.5rem;
}
.intro,
.landing .foot {
  position: relative;
  z-index: 2;
  width: min(100%, 44rem);
}
.intro {
  padding: clamp(2rem, 10vh, 7rem) clamp(1.5rem, 5vw, 4rem) 3rem;
}
.landing .foot {
  flex-direction: column;
  align-items: flex-start;
  margin-top: auto;
  color: var(--muted);
}
.intro h1 {
  max-width: 11ch;
  margin: 0 0 1.25rem;
  font-size: clamp(2.6rem, 5.4vw, 4.75rem);
  font-weight: 300;
  line-height: 1.02;
  letter-spacing: -0.035em;
}
.intro h1 em {
  font-style: italic;
  font-weight: 300;
  color: var(--olive);
}
.lead {
  max-width: 31rem;
  margin: 0 0 2rem;
  font-size: 1.2rem;
  line-height: 1.55;
}

/* Subscribe form */
.subscribe {
  max-width: 30rem;
}
.subscribe label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
}
.field {
  display: flex;
  gap: 0.5rem;
  padding: 0.3rem;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: #fff;
}
.field:focus-within {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.field input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 0 0.9rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  outline: none;
}
.field input::placeholder {
  color: #6e695f; /* 5.2:1 on white */
}
.field button {
  flex: none;
  min-height: 44px;
  padding: 0 1.4rem;
  border: 0;
  border-radius: 999px;
  background: var(--night);
  color: var(--cream);
  font: 600 1rem/1 var(--font);
  cursor: pointer;
  transition: background-color 160ms var(--ease);
}
.field button:hover {
  background: #2c3022;
}
.field button:focus-visible {
  outline-offset: 2px;
}
.field button:disabled {
  cursor: progress;
  opacity: 0.7;
}
.status {
  min-height: 1.6em;
  margin: 0.75rem 0 0;
  font-weight: 600;
}
.status:empty {
  min-height: 0;
  margin: 0;
}
.status[data-kind="error"] {
  color: #8a2f0c; /* 6.9:1 on cream */
}
.note {
  margin: 0.75rem 0 0;
  font-size: 0.95rem;
  color: var(--muted);
}
.subscribe.is-done .field,
.subscribe.is-done label {
  display: none;
}
.subscribe.is-done .status {
  font-size: 1.25rem;
  animation: settle 300ms var(--ease) both;
}
@keyframes settle {
  from {
    opacity: 0;
  }
}

/* Legal pages and 404 */
.page .doc {
  max-width: 46rem;
  margin: 0 auto;
  padding: 2rem clamp(1.5rem, 5vw, 2rem) 4rem;
}
.page .foot {
  max-width: 46rem;
  margin: 0 auto;
  border-top: 1px solid #dcd8cf;
}
.kicker {
  margin: 0 0 1.5rem;
}
.kicker a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.doc h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.doc h2 {
  margin: 2.5rem 0 0.75rem;
  font-size: 1.4rem;
  font-weight: 400;
  letter-spacing: -0.01em;
}
.doc p,
.doc li {
  max-width: 40rem;
}
.doc li {
  margin-bottom: 0.6rem;
}
.doc a {
  color: var(--olive);
}
.doc code {
  font-size: 0.9em;
}
.updated {
  color: var(--muted);
}
.identity {
  margin: 1rem 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.identity div {
  display: grid;
  grid-template-columns: minmax(0, 12rem) minmax(0, 1fr);
  gap: 0.25rem 1.5rem;
  padding: 0.6rem 0;
}
.identity dt {
  font-weight: 600;
}
.identity dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.doc-en {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #dcd8cf;
}

/* Narrow desktops: nudge the crop so the horse stays out of the fade. */
@media (max-width: 75rem) {
  .photo {
    object-position: 46% 80%;
  }
}

/* Phones, tablets and small laptops: words first, then the photo fading in
   from the cream, then the footer on cream. */
@media (max-width: 68rem) {
  .landing .top {
    order: 0;
    width: 100%;
    justify-content: space-between;
  }
  .intro {
    order: 1;
    padding-top: 1rem;
    padding-bottom: 1.5rem;
  }
  .intro h1 {
    font-size: clamp(2.6rem, 8vw, 4.75rem);
  }
  .photo-wrap {
    order: 2;
    position: relative;
    inset: auto;
    width: 100%;
    max-height: none;
    height: clamp(20rem, 86vw, 36rem);
  }
  .photo {
    /* dither.js crops tighter on phones so the horse reads */
    --dither-zoom: 1.45;
    object-position: 47% 92%;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 30%, #000 82%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, #000 30%, #000 82%, transparent 100%);
  }
  .landing .foot {
    order: 3;
    margin-top: 0;
  }
}
@media (max-width: 44rem) {
  /* The headline's widest line ("Toma mejores") fills about 90% of the column. */
  .intro h1 {
    font-size: min(calc((100vw - 3rem) / 6.4), 3.5rem);
  }
  .lead {
    font-size: 1.1rem;
  }
  .field {
    flex-direction: column;
    gap: 0.4rem;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
  }
  .field:focus-within {
    outline: none;
  }
  .field input {
    min-height: 52px;
    border: 1.5px solid var(--line);
    background: #fff;
  }
  .field input:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
  }
  .field button {
    min-height: 52px;
  }
  .identity div {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
