/* AiGe'ez — aigeez.ai. Plain CSS, mobile first. Palette: ink, clay, cream (from the logo). */

:root {
  --ink: #1C1B18;
  --clay: #B4531F;
  --cream: #FAF7F1;
  --tray: #E4DCCD;

  --bg: var(--cream);
  --fg: var(--ink);
  --muted: #5A564E;
  --accent: var(--clay);       /* links, badges, highlights */
  --heading: var(--ink);
  --line: #DED6C8;
  --band: #F1ECE2;             /* alternate section background */
  --surface: #FFFDF9;          /* platform cards */
  --card-bg: #FFFDF9;          /* feature cards */
  --card-fg: var(--ink);
  --card-accent: var(--clay);
  --on-accent: var(--cream);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Ethiopic", "Kefa", "Nyala", sans-serif;
  --ethiopic: "Noto Sans Ethiopic", "Abyssinica SIL", "Kefa", "Nyala", var(--font);
  --measure: 38rem;
  --wide: 68rem;
  --gutter: 1rem;
  --radius: 16px;
  color-scheme: light dark;
}

/* Dark: warm brown rather than black, with cream cards and clay headings. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #3A322B;
    --fg: #FAF7F1;
    --muted: #DCD3C4;
    --accent: #F2A57A;
    --heading: #F2A57A;
    --line: #5A4F45;
    --band: #332C26;
    --surface: #463D35;
    --card-bg: #FAF7F1;
    --card-fg: var(--ink);
    --card-accent: var(--clay);
    --on-accent: #3A322B;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  border-top: 4px solid var(--clay);
}

img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; letter-spacing: -0.01em; color: var(--heading); overflow-wrap: break-word; }
h1 { font-size: clamp(2rem, 7vw, 3rem); }
h2 { font-size: clamp(1.5rem, 5vw, 2.1rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
.hl { color: var(--accent); }
strong.hl { font-weight: 700; }

.skip {
  position: absolute; left: var(--gutter); top: -3rem;
  background: var(--fg); color: var(--bg);
  padding: 0.5rem 0.75rem; border-radius: 6px; z-index: 10;
}
.skip:focus { top: 0.5rem; }

.wrap { width: 100%; max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: calc(var(--measure) + 2 * var(--gutter)); }

/* Header */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0 1rem; min-height: 4rem; flex-wrap: wrap;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  color: var(--fg); text-decoration: none; font-weight: 700; font-size: 1.15rem;
}
.brand img { width: 36px; height: 36px; }
.site-nav { margin-left: auto; }
.site-nav ul { display: flex; flex-wrap: wrap; gap: 0 1.25rem; list-style: none; margin: 0; padding: 0; }
.site-nav a { color: var(--fg); text-decoration: none; padding: 0.5rem 0; display: inline-block; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--accent); text-decoration: underline; }
.lang-switch { margin: 0; font-size: 0.95rem; color: var(--muted); }
.lang-switch a { color: var(--fg); padding: 0.5rem 0.25rem; }
.lang-switch a:hover { color: var(--accent); }
.lang-switch [aria-current] { font-weight: 600; color: var(--fg); }

/* Sections */
main { display: block; }
.section { padding: 3rem 0; }
.section + .section { border-top: 1px solid var(--line); }
.band { background: var(--band); }
.section.band, .band + .section { border-top: 0; }
.eyebrow {
  color: var(--accent); font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; font-size: 0.8rem; margin-bottom: 0.5rem;
}
.lead { font-size: 1.2rem; color: var(--muted); max-width: var(--measure); }

.button {
  display: inline-block; background: var(--accent); color: var(--on-accent);
  font-weight: 700; text-decoration: none; padding: 0.8rem 1.4rem;
  border-radius: 999px; margin-top: 0.5rem;
}
.button:hover { text-decoration: underline; }

/* Hero */
.hero { padding: 2.5rem 0 3rem; }
.hero-grid { display: grid; gap: 2rem; align-items: center; }
.hero-logo { width: 72px; height: 72px; margin-bottom: 1.25rem; }
.hero h1 {
  font-size: clamp(2.6rem, 10vw, 4.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--fg);
}
.hero h1 .hl { color: var(--accent); }

/* Faint fidel letters sit behind the demo phone only, never behind body text. */
.hero-art {
  background: url("/assets/img/fidel-pattern.svg") 0 0 / 220px repeat;
  border-radius: 28px;
  padding: 2rem 1rem;
}

/* Typing demo: CSS only. Without animation (or with reduced motion) it shows the last frame. */
.demo { display: flex; justify-content: center; }
.demo-phone {
  position: relative;
  width: min(272px, 100%);
  background: var(--ink);
  border-radius: 40px;
  padding: 11px;
  box-shadow: 8px 10px 0 rgb(15 14 12 / 0.28);
}
.demo-phone::before {               /* camera */
  content: ""; position: absolute; top: 19px; left: 50%;
  width: 8px; height: 8px; margin-left: -4px; border-radius: 50%;
  background: var(--ink); z-index: 1;
}
.demo-screen { background: #FBF8F2; border-radius: 30px; overflow: hidden; color: var(--ink); }
.demo-field {
  position: relative; height: 132px;
  margin: 0 16px; border-bottom: 2px solid #D9D1C2;
  font-family: var(--ethiopic); font-size: 1.75rem; line-height: 1;
}
.demo-field .t { position: absolute; left: 2px; bottom: 16px; white-space: pre; }
.demo-field .t::after {
  content: ""; display: inline-block; width: 2px; height: 1.05em;
  margin-left: 2px; vertical-align: -0.12em; background: var(--clay);
}
.demo-strip {
  position: relative; height: 2.6rem; margin-top: 14px;
  background: var(--tray); font-family: var(--ethiopic); font-size: 0.95rem;
}
.demo-strip .s {
  position: absolute; inset: 0; display: flex; align-items: center;
  list-style: none; margin: 0; padding: 0 4px;
}
.demo-strip li { flex: 1; text-align: center; padding: 0.3rem 0; border-left: 1px solid #C9BFAE; white-space: nowrap; line-height: 1.4; }
.demo-strip li:first-child { border-left: 0; }
.demo-strip .pick { background: var(--clay); color: var(--cream); border-radius: 8px; font-weight: 600; }
.demo-strip .pick + li { border-left-color: transparent; }
.demo-keys { width: 100%; background: var(--tray); }

.demo .t, .demo .s { opacity: 0; }
.demo .t6, .demo .s3 { opacity: 1; }

@media (prefers-reduced-motion: no-preference) {
  .demo .t0 { animation: d-t0 13s infinite; }
  .demo .t1 { animation: d-t1 13s infinite; }
  .demo .t2, .demo .s1 { animation: d-t2 13s infinite; }
  .demo .t3, .demo .s2 { animation: d-t3 13s infinite; }
  .demo .t4 { animation: d-t4 13s infinite; }
  .demo .t5 { animation: d-t5 13s infinite; }
  .demo .t6, .demo .s3 { animation: d-last 13s infinite; }
  .demo .pick { animation: d-pick 13s infinite; }
  .demo-field .t::after { animation: d-caret 1s steps(1) infinite; }
}
/* Timeline: empty, ሰ, ሰላ (suggestions), ሰላም picked, ሰላም_, ሰላም ነ, ሰላም ነው (new suggestions) */
@keyframes d-t0 { 0%, 5.9% { opacity: 1; } 6%, 100% { opacity: 0; } }
@keyframes d-t1 { 0%, 5.9% { opacity: 0; } 6%, 13.9% { opacity: 1; } 14%, 100% { opacity: 0; } }
@keyframes d-t2 { 0%, 13.9% { opacity: 0; } 14%, 25.9% { opacity: 1; } 26%, 100% { opacity: 0; } }
@keyframes d-t3 { 0%, 25.9% { opacity: 0; } 26%, 35.9% { opacity: 1; } 36%, 100% { opacity: 0; } }
@keyframes d-t4 { 0%, 35.9% { opacity: 0; } 36%, 45.9% { opacity: 1; } 46%, 100% { opacity: 0; } }
@keyframes d-t5 { 0%, 45.9% { opacity: 0; } 46%, 53.9% { opacity: 1; } 54%, 100% { opacity: 0; } }
@keyframes d-last { 0%, 53.9% { opacity: 0; } 54%, 94% { opacity: 1; } 99%, 100% { opacity: 0; } }
@keyframes d-pick { 0%, 30% { transform: scale(1); } 32% { transform: scale(0.9); } 34%, 100% { transform: scale(1); } }
@keyframes d-caret { 0% { opacity: 1; } 50% { opacity: 0; } }

/* Feature cards: cream in both themes */
.features { display: grid; gap: 1rem; list-style: none; padding: 0; margin: 1.5rem 0 0; }
.feature {
  background: var(--card-bg); color: var(--card-fg);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.4rem; box-shadow: 0 2px 0 rgb(28 27 24 / 0.06);
}
.feature h3 { color: var(--card-accent); font-size: 1.25rem; }
.feature p:last-child { margin-bottom: 0; }
.feature ul { margin: 0; padding-left: 1.2rem; }
.feature li::marker { color: var(--card-accent); }

/* Platform cards */
.cards { display: grid; gap: 1.25rem; list-style: none; padding: 0; margin: 1.5rem 0 0; }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 0.75rem 0.75rem 1.25rem;
}
.card img { width: 100%; aspect-ratio: 3 / 2; border-radius: 12px; margin-bottom: 1rem; }
.card h3, .card p, .card .status { margin-left: 0.5rem; margin-right: 0.5rem; }
.card h3 { margin-bottom: 0.35rem; color: var(--fg); }
.card p { margin-bottom: 0; }
.status {
  display: inline-block; font-size: 0.85rem; font-weight: 600; color: var(--accent);
  border: 1px solid currentColor; border-radius: 999px; padding: 0.1rem 0.6rem; margin-bottom: 0.6rem;
}

/* Prose pages */
.page-head { padding: 2.5rem 0 1rem; }
.page-head + .section { padding-top: 1.5rem; }
.prose { max-width: var(--measure); }
.prose h2 { margin-top: 2rem; }
.prose ol, .prose ul { padding-left: 1.3rem; }
.prose li { margin-bottom: 0.5rem; }
.policy { padding-left: 1.2rem; }
.policy li { margin-bottom: 1rem; }
.meta { display: grid; gap: 0.5rem; margin: 1rem 0 0; }
.meta div { display: flex; flex-wrap: wrap; gap: 0 0.5rem; }
.meta dt { font-weight: 600; }
.meta dt::after { content: ":"; }
.meta dd { margin: 0; }
.notice {
  border-left: 3px solid var(--accent); background: var(--band);
  padding: 0.75rem 1rem; border-radius: 0 8px 8px 0;
}
.shot { border-radius: var(--radius); border: 1px solid var(--line); background: #fff; }
.figure { margin: 1.5rem 0; }
.figure img { width: 100%; max-width: 270px; }
.figure figcaption { color: var(--muted); font-size: 0.9rem; margin-top: 0.5rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 2rem 0 2.5rem; color: var(--muted); font-size: 0.95rem; }
.site-footer p { margin-bottom: 0.5rem; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; list-style: none; padding: 0; margin: 1rem 0 0; }

/* Amharic: Ethiopic fonts first, more line height for the script */
:lang(am) body, body:lang(am) { font-family: var(--ethiopic); line-height: 1.75; }
:lang(am) .eyebrow { text-transform: none; letter-spacing: 0.02em; }
:lang(am) .meta dt::after { content: "፦"; }
.hero h1:lang(am) { font-size: clamp(2.1rem, 8.5vw, 3.6rem); line-height: 1.25; letter-spacing: 0; }
.lang-switch [lang="en"], .notice [lang="en"] { font-family: var(--font); }

@media (min-width: 40rem) {
  :root { --gutter: 1.5rem; }
  .features { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 48rem) {
  .cards { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 56rem) {
  .hero { padding: 4rem 0; }
  .hero-grid { grid-template-columns: 1.15fr 1fr; gap: 3rem; }
  .hero-art { padding: 3rem 2rem; }
}
