/*
 * a2istudio.org — one shared stylesheet for every page.
 *
 * Forked from website/styles.css rather than shared with it. The two sites are
 * separate Cloudflare Pages projects that deploy independently, so a shared file
 * would mean a Halal Trace tweak silently reshaping the studio site with nothing
 * in the diff to say so. Structure is deliberately the same; the palette is not.
 *
 * The ground here is a neutral stone rather than Halal Trace's green-cast
 * off-white, and `--deep` is used sparingly, so the parent brand reads as a
 * parent rather than as a second Halal Trace page. `--deep` itself is the same
 * #3D605E the app uses for every filled brand surface, and like there it stays
 * theme-independent: a brand surface is an object sitting on the canvas, not
 * chrome that should invert with it.
 *
 * Every foreground/background pairing below clears WCAG AA (4.5:1) in both
 * themes — the tightest is --deep-muted on --deep at 4.52:1. Recompute rather
 * than eyeball if you change one; the app's own palette shipped four separate
 * contrast defects that all passed visual review.
 *
 * No webfonts, no CDN, no analytics: the site makes zero third-party requests,
 * which is what lets privacy.html say so plainly and the CSP stay at
 * `default-src 'none'`.
 */

:root {
  --bg: #f5f4f1;
  --surface: #ffffff;
  --selected: #e9ebe6;
  --text: #1b1d1a;
  --text-secondary: #63665f;
  --border: rgba(27, 29, 26, 0.12);
  --shadow: 0 1px 2px rgba(27, 29, 26, 0.05), 0 8px 24px rgba(27, 29, 26, 0.06);

  /* Theme-independent brand surfaces, shared with the app and halal-trace.com. */
  --deep: #3d605e;
  --deep-ink: #f1f6ef;
  --deep-muted: #c2d6c5;

  --radius: 18px;
  --radius-sm: 12px;
  --measure: 68ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --surface: #1e2125;
    --selected: #262a2e;
    --text: #e8eae6;
    --text-secondary: #9aa09a;
    --border: rgba(232, 234, 230, 0.14);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
    sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: currentColor;
}

img {
  max-width: 100%;
  height: auto;
}

.wrap {
  width: 100%;
  max-width: 940px;
  margin: 0 auto;
  padding: 0 20px;
}

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

.site-header {
  padding: 22px 0;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

.site-nav {
  display: flex;
  gap: 20px;
  font-size: 15px;
}

.site-nav a {
  color: var(--text-secondary);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current='page'] {
  color: var(--text);
}

/* ---------- hero ---------- */

.hero {
  padding: 48px 0 28px;
  max-width: 760px;
}

.hero h1 {
  font-size: clamp(2.1rem, 6vw, 3.1rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 18px;
}

.hero p.lede {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin: 0 0 28px;
  max-width: 54ch;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--deep);
  color: var(--deep-ink);
  border-radius: 999px;
  padding: 12px 22px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  border: 0;
}

.button:hover {
  opacity: 0.9;
}

.button.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.badge {
  display: inline-block;
  background: var(--selected);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ---------- sections ---------- */

section {
  padding: 44px 0;
}

section > .wrap > h2 {
  font-size: 1.55rem;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

.section-lede {
  color: var(--text-secondary);
  margin: 0 0 28px;
  max-width: var(--measure);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 15px;
}

/* ---------- the apps catalogue ----------
   One card per app. Adding an app is a copy of the block in index.html plus a
   new factsheet under /apps/ — see WEBSITE-A2ISTUDIO.md. The grid is sized so a
   single card doesn't stretch the full width and look like an accident. */

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.app-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
}

.app-card:hover {
  box-shadow: 0 1px 2px rgba(27, 29, 26, 0.05), 0 12px 32px rgba(27, 29, 26, 0.1);
}

.app-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-card-top img {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  flex: none;
}

.app-card h3 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.app-card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 15px;
}

.app-status {
  display: inline-block;
  align-self: flex-start;
  background: var(--selected);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.notice {
  background: var(--selected);
  border-radius: var(--radius);
  padding: 22px 24px;
}

.notice h2 {
  margin: 0 0 8px;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.notice p {
  margin: 0 0 10px;
  color: var(--text);
  max-width: var(--measure);
}

.notice p:last-child {
  margin-bottom: 0;
}

/* ---------- long-form document pages ---------- */

.doc {
  padding: 24px 0 8px;
}

.doc .wrap {
  max-width: 760px;
}

.doc h1 {
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  letter-spacing: -0.03em;
  margin: 0 0 6px;
}

.doc .updated {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 0 0 32px;
}

.doc h2 {
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  margin: 36px 0 10px;
  padding-top: 4px;
}

.doc h3 {
  font-size: 1rem;
  margin: 24px 0 8px;
}

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

.doc p {
  margin: 0 0 14px;
}

.doc ul {
  margin: 0 0 14px;
  padding-left: 22px;
}

.doc li {
  margin-bottom: 8px;
}

.doc .callout {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  margin: 0 0 20px;
}

.doc .callout p:last-child {
  margin-bottom: 0;
}

.table-scroll {
  overflow-x: auto;
  margin: 0 0 20px;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 420px;
  font-size: 15px;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 10px 14px 10px 0;
  border-bottom: 1px solid var(--border);
}

th {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  font-weight: 600;
}

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

.site-footer {
  margin-top: 40px;
  padding: 32px 0 48px;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 14px;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  justify-content: space-between;
}

.site-footer nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.site-footer a {
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--text);
  text-decoration: underline;
}

.site-footer p {
  margin: 0;
  max-width: 46ch;
}

/* `code` appears in privacy.html (an email domain). The site loads no webfont,
   so this is the platform monospace stack; the size step-down keeps it from
   towering over the 17px body text the way default monospace metrics do. */
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  font-size: 0.88em;
  background: var(--selected);
  border-radius: 5px;
  padding: 1px 5px;
}
