@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@400;500;700&display=swap');

:root {
  --ground: #EEF1EC;
  --paper: #FFFFFF;
  --ink: #1C2421;
  --muted: #55625C;
  --pine: #22413A;
  --bubble-out: #D4E6DC;
  --marigold: #F2B33D;
  --line: #CCD5CF;
  --radius-bubble: 14px;
  --measure: 62ch;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: 'Rubik', system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}

a { color: var(--pine); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--marigold);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
  gap: 16px;
}
.brand { font-weight: 700; font-size: 1.15rem; color: var(--ink); text-decoration: none; }
.brand small { display: block; font-weight: 400; font-size: .85rem; color: var(--muted); }
.site-nav { display: flex; gap: 18px; flex-wrap: wrap; font-size: .95rem; }
.site-nav a { text-decoration: none; color: var(--muted); }
.site-nav a:hover { color: var(--ink); }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 48px;
  align-items: center;
  padding: 40px 0 72px;
}
.hero h1 {
  font-size: clamp(2.1rem, 4.6vw, 3.4rem);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 20px;
  max-width: 16ch;
}
.hero p { font-size: 1.15rem; color: var(--muted); max-width: 44ch; margin: 0 0 28px; }

.btn {
  display: inline-block;
  background: var(--pine);
  color: #fff;
  text-decoration: none;
  padding: 13px 22px;
  border-radius: 999px;
  font-weight: 500;
}
.btn:hover { background: var(--ink); color: #fff; }
.btn-quiet { background: transparent; color: var(--pine); padding-inline: 8px; }
.btn-quiet:hover { background: transparent; color: var(--ink); }

/* Chat thread: the one memorable element */
.thread {
  background: var(--paper);
  border-radius: 22px;
  padding: 22px 18px;
  box-shadow: 0 18px 40px -24px rgba(34, 65, 58, .45);
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 420px;
  justify-self: end;
  width: 100%;
}
.thread-head {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 12px; margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
  font-size: .95rem;
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--pine); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: .85rem;
}
.thread-head span { color: var(--muted); font-size: .8rem; display: block; }
.msg {
  max-width: 82%;
  padding: 9px 13px;
  border-radius: var(--radius-bubble);
  font-size: .95rem;
  line-height: 1.45;
}
.msg.in { background: var(--ground); align-self: flex-start; border-end-start-radius: 4px; }
.msg.out { background: var(--bubble-out); align-self: flex-end; border-end-end-radius: 4px; }
.msg .time { display: block; font-size: .7rem; color: var(--muted); margin-top: 3px; text-align: end; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-self: flex-end; }
.chips span {
  border: 1px solid var(--pine); color: var(--pine);
  border-radius: 999px; padding: 4px 11px; font-size: .82rem;
}

@media (prefers-reduced-motion: no-preference) {
  .thread .msg, .thread .chips { opacity: 0; transform: translateY(6px); animation: pop .35s ease forwards; }
  .thread > :nth-child(2) { animation-delay: .2s; }
  .thread > :nth-child(3) { animation-delay: .9s; }
  .thread > :nth-child(4) { animation-delay: 1.6s; }
  .thread > :nth-child(5) { animation-delay: 2.3s; }
  .thread > :nth-child(6) { animation-delay: 3.0s; }
  @keyframes pop { to { opacity: 1; transform: none; } }
}

/* Sections */
section.block { padding: 64px 0; border-top: 1px solid var(--line); }
section.block h2 {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  line-height: 1.2;
  margin: 0 0 12px;
  font-weight: 700;
}
.lede { color: var(--muted); max-width: var(--measure); margin: 0 0 36px; }

.uses {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 48px;
  margin: 0; padding: 0; list-style: none;
}
.uses h3 { font-size: 1.1rem; margin: 0 0 4px; font-weight: 500; }
.uses p { margin: 0; color: var(--muted); max-width: 46ch; }

.steps { counter-reset: s; list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; max-width: var(--measure); }
.steps li { counter-increment: s; display: grid; grid-template-columns: 40px 1fr; gap: 14px; }
.steps li::before {
  content: counter(s);
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--marigold); color: var(--ink);
  display: grid; place-items: center; font-weight: 700; font-size: .9rem;
}
.steps strong { display: block; font-weight: 500; }
.steps span { color: var(--muted); }

.about { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.about p { max-width: var(--measure); margin: 0 0 14px; }

.contact-card {
  background: var(--pine);
  color: #EAF1ED;
  border-radius: 22px;
  padding: 36px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
.contact-card h2 { color: #fff; }
.contact-card a { color: #fff; }
.contact-card dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; }
.contact-card dt { color: #A9C2B8; }
.contact-card dd { margin: 0; }
.contact-card .btn { background: var(--marigold); color: var(--ink); }
.contact-card .btn:hover { background: #fff; }

/* Footer */
.site-footer { padding: 40px 0 48px; font-size: .9rem; color: var(--muted); }
.site-footer .cols { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.site-footer address { font-style: normal; line-height: 1.7; }
.site-footer nav { display: flex; flex-direction: column; gap: 6px; }
.site-footer .fine { margin-top: 24px; font-size: .8rem; max-width: 80ch; }

/* Legal pages */
.legal { background: var(--paper); border-radius: 22px; padding: 40px clamp(20px, 5vw, 56px); margin: 8px 0 40px; }
.legal h1 { font-size: clamp(1.8rem, 3.4vw, 2.4rem); line-height: 1.15; margin: 0 0 6px; }
.legal .updated { color: var(--muted); margin: 0 0 28px; }
.legal h2 { font-size: 1.2rem; margin: 32px 0 8px; }
.legal p, .legal li { max-width: var(--measure); }
.legal ul { padding-inline-start: 1.2em; }

/* RTL */
[dir="rtl"] body, body[dir="rtl"] { font-size: 1.08rem; }
[dir="rtl"] .thread { justify-self: start; }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; gap: 36px; padding-top: 16px; }
  .thread { justify-self: stretch; max-width: none; }
  [dir="rtl"] .thread { justify-self: stretch; }
  .uses, .about, .contact-card { grid-template-columns: 1fr; }
  .contact-card { padding: 26px 20px; }
  .site-header { flex-direction: column; align-items: flex-start; }
}
