/* Kifayat — site styles.
   Palette lifted from the app's app_palette.dart so the site and the app read
   as one product. Dark is the app's home theme; light follows the OS. */

:root {
  --bg: #070b16;
  --surface: #0f1526;
  --elevated: #161e36;
  --border: #1e2742;
  --text: #edf0fb;
  --muted: #8d97b8;
  --faint: #5b6685;
  --primary: #7c8aff;
  --primary-hover: #9aa5ff;
  --success: #3ddc97;
  --danger: #ff7e6b;
  --accent: #41c9dc;
  --warn: #f2b25c;
  --radius: 14px;
  --maxw: 46rem;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f3f4fa;
    --surface: #ffffff;
    --elevated: #ffffff;
    --border: #e4e7f2;
    --text: #161c33;
    --muted: #5c6584;
    --faint: #9aa2bc;
    --primary: #5a64f0;
    --primary-hover: #4650d8;
    --success: #0fa871;
    --danger: #d9503b;
    --accent: #1d8fa0;
    --warn: #b3781f;
  }
}

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

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

body {
  margin: 0;
  padding: 0 1.25rem 5rem;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.7 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
  overflow-wrap: break-word;
}

.wrap { max-width: var(--maxw); margin: 0 auto; }

/* ---- header ---- */

header {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: inherit;
}

.mark {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  border: 2.5px solid var(--primary);
  display: grid;
  place-items: center;
  flex: none;
}

.mark::after {
  content: "";
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--primary);
}

.brand-name {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(1.75rem, 5vw, 2.4rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 1.75rem 0 0.6rem;
}

.sub { color: var(--muted); margin: 0; font-size: 1.05rem; }

.dates {
  color: var(--faint);
  font-size: 0.875rem;
  margin-top: 1.25rem;
}

/* ---- body copy ---- */

h2 {
  font-size: 1.3rem;
  letter-spacing: -0.01em;
  margin: 3rem 0 0.75rem;
  padding-top: 0.5rem;
}

h3 { font-size: 1.05rem; margin: 2rem 0 0.5rem; }

p, li { color: var(--text); }

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

ul, ol { padding-left: 1.3rem; }
li { margin: 0.4rem 0; }

strong { font-weight: 650; }

code {
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.1rem 0.4rem;
  font-size: 0.9em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---- components ---- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.card h2, .card h3 { margin-top: 0; }

.card.primary { border-color: var(--primary); }
.card.danger { border-color: var(--danger); }

.tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 0.9rem;
}

.tag.best { background: color-mix(in srgb, var(--success) 18%, transparent); color: var(--success); }
.tag.alt  { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }

.btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-weight: 650;
  text-decoration: none;
  padding: 0.75rem 1.4rem;
  border-radius: 10px;
  margin-top: 0.5rem;
}
.btn:hover { background: var(--primary-hover); color: #fff; }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 1rem 0 0; }

.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 2.4rem;
  margin: 0.9rem 0;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.15rem;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--elevated);
  border: 1px solid var(--border);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.95rem;
}

.table-scroll { overflow-x: auto; }

th, td {
  text-align: left;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th { color: var(--muted); font-weight: 650; font-size: 0.85rem; }

/* ---- footer ---- */

footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  color: var(--faint);
  font-size: 0.9rem;
}

footer a { color: var(--muted); }
footer nav { margin-bottom: 0.75rem; display: flex; gap: 1.25rem; flex-wrap: wrap; }

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
  background: var(--surface);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--primary);
  z-index: 10;
}
