/* IRCage website. Colours are the app's own (lib/core/theme/tokens.dart). */
:root {
  --bg: #ffffff;
  --raised: #f5f6fa;
  --overlay: #eceef5;
  --line: #e3e6ee;
  --text: #14161c;
  --muted: #5f6474;
  --accent: #5b5bf0;
  --on-accent: #ffffff;
  --accent-soft: #ececfd;
  --mention: #e0573e;
  --grad-top: #7474ff;
  --grad-bottom: #4141d8;
  --radius: 18px;
  --max: 1080px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1117;
    --raised: #171a23;
    --overlay: #232838;
    --line: #262b37;
    --text: #e8eaf2;
    --muted: #8e94a6;
    --accent: #8b8bff;
    --on-accent: #0f1117;
    --accent-soft: #23244a;
    --mention: #ff8a73;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

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

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

.skip {
  position: absolute; left: -999px; top: 8px;
  background: var(--accent); color: var(--on-accent);
  padding: 8px 14px; border-radius: 999px;
}
.skip:focus { left: 12px; }

/* Header and footer */
header.site {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
header.site .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 64px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 20px; color: var(--text); text-decoration: none;
}
.brand img { width: 32px; height: 32px; border-radius: 8px; }
nav.site ul { display: flex; gap: 20px; list-style: none; margin: 0; padding: 0; }
nav.site a { color: var(--muted); text-decoration: none; font-size: 15px; }
nav.site a:hover, nav.site a[aria-current="page"] { color: var(--text); }

footer.site {
  border-top: 1px solid var(--line);
  margin-top: 80px; padding: 32px 0 48px;
  color: var(--muted); font-size: 14px;
}
footer.site .wrap {
  display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between;
}
footer.site ul { display: flex; flex-wrap: wrap; gap: 8px 20px; list-style: none; margin: 0; padding: 0; }
footer.site a { color: var(--muted); }

/* Home */
.hero { padding: 72px 0 40px; }
.hero .wrap {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center;
}
.hero h1 {
  font-size: clamp(40px, 6vw, 64px); line-height: 1.05;
  letter-spacing: -0.03em; margin: 16px 0;
}
.hero .lead { font-size: 20px; color: var(--muted); max-width: 34rem; margin: 0 0 28px; }
.app-mark { width: 72px; height: 72px; border-radius: 18px; box-shadow: 0 10px 30px rgb(65 65 216 / 0.35); }

.badges { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 999px;
  background: var(--raised); border: 1px solid var(--line);
  color: var(--text); font-size: 15px; font-weight: 600;
}
.badge small { color: var(--muted); font-weight: 500; }
.note { color: var(--muted); font-size: 14px; margin-top: 12px; }

/* A chat drawn in HTML, like the app's chat screen */
.phone {
  justify-self: center;
  width: min(340px, 100%);
  border-radius: 40px; padding: 12px;
  background: linear-gradient(160deg, var(--grad-top), var(--grad-bottom));
  box-shadow: 0 30px 80px rgb(65 65 216 / 0.30);
}
.screen {
  background: var(--bg); border-radius: 30px; overflow: hidden;
  border: 1px solid var(--line);
}
.screen .bar {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 16px 12px; border-bottom: 1px solid var(--line);
}
.avatar {
  flex: none; width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
  background: var(--accent-soft); color: var(--accent);
}
.avatar.round { border-radius: 50%; }
.screen .bar b { display: block; font-size: 15px; }
.screen .bar span { color: var(--muted); font-size: 12px; }
.msgs { padding: 12px 14px 4px; display: grid; gap: 10px; }
.msg { display: flex; gap: 10px; align-items: flex-start; }
.msg p { margin: 0; font-size: 14px; line-height: 1.45; }
.msg .who { font-weight: 700; font-size: 13px; }
.msg .who time { color: var(--muted); font-weight: 400; margin-left: 6px; }
.c1 { color: #1e7f3c; } .c2 { color: #b54708; } .c3 { color: #7a3fd1; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .c1 { color: #5bd17e; }
  :root:not([data-theme="light"]) .c2 { color: #ffa45c; }
  :root:not([data-theme="light"]) .c3 { color: #c29bff; }
}
.mention { color: var(--mention); font-weight: 600; }
.mine { justify-content: flex-end; }
.mine p {
  background: var(--accent); color: var(--on-accent);
  padding: 8px 12px; border-radius: 16px 16px 4px 16px; max-width: 80%;
}
.typing { color: var(--muted); font-size: 12px; font-style: italic; padding: 4px 16px 0; }
.composer {
  margin: 8px 12px 14px; padding: 10px 14px; border-radius: 999px;
  background: var(--raised); border: 1px solid var(--line);
  color: var(--muted); font-size: 14px;
}

/* Feature grid */
section { padding: 48px 0; scroll-margin-top: 64px; }
h2 {
  font-size: clamp(28px, 4vw, 38px); letter-spacing: -0.02em;
  line-height: 1.15; margin: 0 0 12px;
}
.section-lead { color: var(--muted); font-size: 18px; max-width: 40rem; margin: 0 0 32px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card {
  background: var(--raised); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px;
}
.card h3 { margin: 12px 0 6px; font-size: 18px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.icon {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.icon svg { width: 22px; height: 22px; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.panel {
  border-radius: var(--radius); padding: 28px;
  background: linear-gradient(160deg, var(--grad-top), var(--grad-bottom));
  color: #fff;
}
.panel h3 { margin: 0 0 8px; font-size: 22px; }
.panel p, .panel li { color: rgb(255 255 255 / 0.88); }
.panel ul { margin: 0; padding-left: 20px; }
.panel.plain { background: var(--raised); color: var(--text); border: 1px solid var(--line); }
.panel.plain p, .panel.plain li { color: var(--muted); }

/* Long-form pages (privacy, terms, support) */
.doc { max-width: 46rem; padding-top: 48px; }
.doc h1 { font-size: clamp(32px, 5vw, 44px); letter-spacing: -0.02em; margin: 0 0 8px; }
.doc .updated { color: var(--muted); margin: 0 0 32px; }
.doc h2 { font-size: 24px; margin: 36px 0 8px; }
.doc h3 { font-size: 18px; margin: 24px 0 4px; }
.doc p, .doc li { color: var(--text); }
.doc li + li { margin-top: 6px; }
.callout {
  background: var(--accent-soft); border-radius: var(--radius);
  padding: 18px 20px; margin: 24px 0;
}
.callout p { margin: 0; }

@media (max-width: 860px) {
  .hero { padding-top: 40px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 40px; }
  .grid { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  nav.site ul { gap: 14px; }
  nav.site .optional { display: none; }
  .grid { grid-template-columns: 1fr; }
  .hero .lead { font-size: 18px; }
}
@media (prefers-reduced-motion: no-preference) {
  .phone { transition: transform 0.4s ease; }
  .phone:hover { transform: translateY(-4px) rotate(-0.5deg); }
}

/* Download buttons and cards */
.button {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 20px; border-radius: 999px;
  background: var(--accent); color: var(--on-accent);
  font-weight: 600; font-size: 15px; text-decoration: none;
}
.button:hover { filter: brightness(1.08); }
a.card.download { text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 6px; }
a.card.download h3 { margin: 0; color: var(--text); }
a.card.download .button { margin-top: 12px; align-self: flex-start; }
a.card.download:hover { border-color: var(--accent); }
details.howto {
  margin-top: 20px; background: var(--raised); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 20px;
}
details.howto summary { cursor: pointer; font-weight: 600; }
details.howto li + li { margin-top: 8px; }
code {
  font: 0.9em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--overlay); padding: 1px 6px; border-radius: 6px;
}
