/*
 * The public page for madarcore.app.
 *
 * Plain CSS, no build step: this page changes rarely and has no application logic, so a
 * toolchain would be pure overhead. It reuses the product's own tokens (index.css in
 * merchant-web) rather than inventing a second palette — the site and the app a merchant
 * signs into must not look like two different companies.
 *
 * Written with logical properties throughout (CLAUDE.md §14.1): this page is Arabic and
 * RTL today, and an English LTR version must not require rewriting the layout.
 */

:root {
  --primary: #0f766e;
  --primary-hover: #0b5c56;
  --primary-soft: #e3f2ef;
  --amber: #d97706;
  --ink: #12211f;
  --ink-muted: #5a6b68;
  --surface: #ffffff;
  --ground: #f4faf8;
  --border: #d8e5e2;
  --radius: 12px;
  --measure: 68ch;
}

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: 'Segoe UI', Tahoma, system-ui, sans-serif;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

h1,
h2 {
  line-height: 1.3;
  text-wrap: balance;
  margin: 0;
}

p {
  margin: 0;
}

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

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 1.25rem clamp(1rem, 5vw, 4rem);
  background: var(--surface);
  border-block-end: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--primary);
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex: none;
}

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

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--ink-muted);
  text-decoration: none;
  font-weight: 500;
}

.site-nav a:hover {
  color: var(--primary);
}

.nav-cta {
  padding: 0.5rem 1.1rem;
  border: 1px solid var(--primary);
  border-radius: 999px;
  color: var(--primary) !important;
}

.nav-cta:hover {
  background: var(--primary-soft);
}

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

main {
  display: flex;
  flex-direction: column;
  gap: clamp(3rem, 8vw, 6rem);
  padding: clamp(3rem, 8vw, 6rem) clamp(1rem, 5vw, 4rem);
  max-width: 1180px;
  margin-inline: auto;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: 1.25rem;
  max-width: var(--measure);
}

.eyebrow {
  display: inline-block;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
}

.hero h1 {
  font-size: clamp(2rem, 5.5vw, 3.1rem);
  letter-spacing: -0.01em;
}

.lede {
  font-size: clamp(1.05rem, 2.2vw, 1.2rem);
  color: var(--ink-muted);
}

.hero-actions {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-block-start: 0.5rem;
}

.button {
  display: inline-flex;
  align-items: center;
  /* 2.75rem: the same minimum touch target the app uses, so a phone can hit it. */
  min-block-size: 2.75rem;
  padding: 0 1.5rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  transition: background-color 150ms ease;
}

.button-primary {
  background: var(--primary);
  color: #fff;
}

.button-primary:hover {
  background: var(--primary-hover);
}

.button-quiet {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
}

.button-quiet:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ---------------------------------------------------------------- features */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.feature h2 {
  font-size: 1.2rem;
  color: var(--primary);
}

.feature p {
  color: var(--ink-muted);
}

/* ---------------------------------------------------------------- offline */

.offline {
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  padding: clamp(2rem, 5vw, 3.5rem);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  /* The one place colour is spent, because this is the product's actual claim. */
}

.offline h2 {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  max-width: var(--measure);
}

.offline p {
  max-width: var(--measure);
  color: #dff1ee;
}

.offline-note {
  border-inline-start: 3px solid var(--amber);
  padding-inline-start: 1rem;
}

/* ---------------------------------------------------------------- pilot */

.pilot {
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: 1rem;
  max-width: var(--measure);
}

.pilot h2 {
  font-size: clamp(1.4rem, 3vw, 1.8rem);
}

.pilot p {
  color: var(--ink-muted);
}

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

.site-footer {
  padding: 2rem clamp(1rem, 5vw, 4rem);
  border-block-start: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.muted {
  color: var(--ink-muted);
}

/* Keyboard users must be able to see where they are. */
a:focus-visible,
.button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
