/*
 * trinochat.org. Calma style: light by default, dark when the system asks.
 * Mobile first. No scripts, no inline styles, no external requests.
 */

/* Fonts: self-hosted latin subsets (SIL OFL 1.1, licences in fonts/). */
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/atkinson-hyperlegible-next-latin-400-normal.woff2") format("woff2");
  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: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/atkinson-hyperlegible-next-latin-700-normal.woff2") format("woff2");
  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: "Atkinson Hyperlegible Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/atkinson-hyperlegible-mono-latin-400-normal.woff2") format("woff2");
  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;
}

/*
 * Tokens. Every text pair is at least 4.5:1 in both modes; the tightest is
 * accent text on the tint (4.59 light). The app tokens come from trino-gui
 * (src/design/tokens.ts) so the illustrations match the real app.
 */
:root {
  color-scheme: light dark;

  --bg: #FFFFFF;
  --soft: #FAFBFA;
  --tint: #E3F2EA;
  --line: #DDE3E0;
  --ink: #111815;
  --muted: #56635C;
  --accent: #0F7B4A;
  --accent-hover: #0B5E38;
  --accent-ink: #FFFFFF;
  --accent-text: #0F7B4A;
  --focus: #111815;

  --app-surface: #FFFFFF;
  --app-raised: #EEF2F0;
  --bubble-in: #EEF2F0;
  --bubble-me: #DDF0E5;
  --bubble-me-ink: #111815;
  --bubble-me-muted: #3F5A4B;
  --avatar-bg: #DDF0E5;
  --avatar-fg: #0B5E38;
  --danger: #B3261E;
  --danger-ink: #FDECEA;
  --bezel: #111815;
  --shadow: 0 1px 2px rgba(17, 24, 21, 0.06), 0 8px 24px rgba(17, 24, 21, 0.06);

  --font: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Atkinson Hyperlegible Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --emoji: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F1311;
    --soft: #161B18;
    --tint: #183526;
    --line: #28302B;
    --ink: #E6ECE8;
    --muted: #9AA8A0;
    --accent: #3FD68A;
    --accent-hover: #6EE2A7;
    --accent-ink: #04170C;
    --accent-text: #3FD68A;
    --focus: #E6ECE8;

    --app-surface: #161B18;
    --app-raised: #1E2521;
    --bubble-in: #1E2521;
    --bubble-me: #1F3B2C;
    --bubble-me-ink: #E6F5EC;
    --bubble-me-muted: #A8C9B6;
    --avatar-bg: #1F3B2C;
    --avatar-fg: #BFF0D4;
    --danger: #FF8A8A;
    --danger-ink: #3A1E1E;
    --bezel: #050806;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

h1,
h2,
h3,
p,
ul {
  margin: 0;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

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

svg {
  display: block;
  flex: none;
}

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

a:hover {
  text-decoration-thickness: 2px;
}

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

.mono {
  font-family: var(--mono);
}

.wrap {
  width: 100%;
  max-width: 1152px;
  margin-inline: auto;
  padding-inline: 16px;
}

.skip-link {
  position: absolute;
  z-index: 10;
  top: 12px;
  left: 16px;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* Buttons. The transparent border shows up in forced-colours mode. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.btn:hover {
  background: var(--accent-hover);
}

.btn-header {
  grid-area: cta;
  min-height: 44px;
  padding: 0 18px;
  font-size: 0.9375rem;
}

.btn-large {
  min-height: 56px;
  padding: 0 32px;
  font-size: 1.125rem;
}

/* Header: brand and button on one row, the links below them on phones. */
.header-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "brand cta"
    "nav nav";
  align-items: center;
  column-gap: 16px;
  padding-block: 12px 4px;
}

.brand {
  grid-area: brand;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
}

.site-nav {
  grid-area: nav;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  column-gap: 24px;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
}

.site-nav a:hover {
  text-decoration: underline;
}

/* Two columns from tablet width: copy and illustration. */
.split {
  display: grid;
  gap: 40px;
  align-items: center;
}

/* Hero */
.hero {
  padding-block: 32px 64px;
}

.hero h1 {
  max-width: 12ch;
  font-size: clamp(2.625rem, 1.9rem + 3.4vw, 4.5rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.015em;
}

.lead {
  font-size: clamp(1.125rem, 1.02rem + 0.45vw, 1.375rem);
  line-height: 1.5;
}

.hero .lead {
  max-width: 32rem;
  margin-top: 20px;
}

.hero .btn {
  margin-top: 32px;
}

.platform {
  margin-top: 16px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.9375rem;
  text-wrap: balance;
}

/* Feature sections */
.feature {
  padding-block: 64px;
}

.feature-soft {
  background: var(--soft);
}

.feature h2,
.honest h2,
.beta h2 {
  font-size: clamp(1.875rem, 1.45rem + 1.9vw, 2.75rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.01em;
}

.feature-copy p {
  max-width: 30rem;
  margin-top: 16px;
  font-size: 1.125rem;
}

.feature-copy .note {
  color: var(--muted);
  font-size: 1rem;
}

/* Illustrations: pictures of the app, hidden from assistive technology. */
.art {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 32px 16px;
  border-radius: 28px;
  background: var(--tint);
  font-size: 15px;
  line-height: 1.4;
}

.avatar {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--avatar-bg);
  color: var(--avatar-fg);
  font-size: 14px;
  font-weight: 700;
}

.who {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.who-name {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}

.verified {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent-text);
  font-size: 13px;
  font-weight: 700;
}

/* Hero phone with a chat */
.phone {
  width: 100%;
  max-width: 300px;
  padding: 10px;
  border-radius: 46px;
  background: var(--bezel);
  box-shadow: var(--shadow);
}

.screen {
  display: flex;
  flex-direction: column;
  min-height: 540px;
  border-radius: 36px;
  background: var(--app-surface);
  color: var(--ink);
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 16px 12px;
  border-bottom: 1px solid var(--line);
}

.chat-log {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 12px;
}

.chat-day {
  align-self: center;
  margin-bottom: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--app-raised);
  color: var(--muted);
  font-size: 12px;
}

.bubble {
  display: flex;
  flex-direction: column;
  max-width: 82%;
  padding: 8px 12px 6px;
  border-radius: 16px;
}

.bubble-in {
  align-self: flex-start;
  background: var(--bubble-in);
  color: var(--ink);
}

.bubble-me {
  align-self: flex-end;
  background: var(--bubble-me);
  color: var(--bubble-me-ink);
}

.bubble-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 2px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

.bubble-me .bubble-meta {
  color: var(--bubble-me-muted);
}

.composer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 18px;
  border-top: 1px solid var(--line);
}

.composer-field {
  display: flex;
  flex: 1;
  align-items: center;
  min-width: 0;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.composer-send {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
}

/* Cards inside the feature illustrations */
.card {
  width: 100%;
  max-width: 360px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--app-surface);
  box-shadow: var(--shadow);
  color: var(--ink);
}

.id-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-block: 32px;
  text-align: center;
}

.avatar-lg {
  width: 72px;
  height: 72px;
  margin-bottom: 16px;
  font-size: 28px;
}

.id-handle {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
}

.id-address {
  margin-top: 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 15px;
  overflow-wrap: anywhere;
}

.verify-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
}

/* Same tiles as the app's call verification: outline icon over its word */
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.emoji-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
  font-size: 13px;
  font-weight: 600;
}

.sas-icon {
  flex: none;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.card-button {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding-inline: 18px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

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

.call-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.call-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.call-status {
  color: var(--muted);
  font-size: 13px;
}

.call-note {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
}

.call-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 12px 16px 28px;
  border-radius: 14px;
  background: var(--app-raised);
}

.key-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--app-surface);
  color: var(--accent-text);
  font-size: 13px;
  font-weight: 700;
}

.avatar-xl {
  width: 96px;
  height: 96px;
  font-size: 34px;
}

.call-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--app-surface);
  color: var(--ink);
}

.control-end {
  width: 60px;
  border-color: var(--danger);
  background: var(--danger);
  color: var(--danger-ink);
}

/* Abierto y honesto */
.honest {
  padding-block: 64px;
}

.honest-intro {
  max-width: 40rem;
  margin-inline: auto;
  text-align: center;
}

.honest-intro .lead {
  margin-top: 16px;
  text-wrap: balance;
}

.limits {
  max-width: 40rem;
  margin: 40px auto 0;
  padding: 24px 24px 8px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--soft);
}

.limits h3 {
  font-size: 1.125rem;
  font-weight: 700;
}

.limits-list {
  margin-top: 8px;
}

.limits-list li {
  padding-block: 14px;
  border-top: 1px solid var(--line);
}

/* Beta */
.beta {
  padding-block: 64px;
  background: var(--tint);
  text-align: center;
}

.beta-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.beta h2 {
  margin-top: 20px;
}

.beta .lead {
  max-width: 30rem;
  margin-top: 12px;
  text-wrap: balance;
}

/* Footer */
.site-footer {
  padding-block: 48px 32px;
  border-top: 1px solid var(--line);
  background: var(--soft);
}

.footer-cols {
  display: grid;
  gap: 24px;
}

.footer-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 1rem;
  font-weight: 700;
}

.footer-col li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 6px;
  min-height: 44px;
  color: var(--muted);
}

.footer-col a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
}

.footer-col .mono {
  font-size: 0.9375rem;
}

.made-in {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9375rem;
}

/* Wider screens */
@media (min-width: 640px) {
  .wrap {
    padding-inline: 24px;
  }

  .art {
    padding: 48px 32px;
  }

  .footer-cols {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
  }
}

@media (min-width: 768px) {
  .header-bar {
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "brand nav cta";
    column-gap: 32px;
    padding-block: 16px;
  }

  .site-nav ul {
    justify-content: flex-end;
    column-gap: 28px;
  }
}

@media (min-width: 960px) {
  .wrap {
    padding-inline: 32px;
  }

  .split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 64px;
  }

  .hero {
    padding-block: 56px 96px;
  }

  .feature,
  .honest,
  .beta {
    padding-block: 96px;
  }

  .feature-flip .art {
    order: -1;
  }
}

/* The page has no motion; this keeps it that way if some is added later. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
