/*
 * GetWudd marketing site (W-05, W-06).
 *
 * Mobile first. Only logical properties (inline/block, start/end), never
 * left/right, so the Arabic pages mirror from `dir="rtl"` alone.
 * The palette comes from the app icon: champagne on warm dark.
 */

/*
 * Self-hosted fonts (SIL Open Font License; licences in /assets/fonts).
 * Each face declares its unicode-range, so a page downloads only the files
 * for the scripts it shows: English pages never fetch the Arabic fonts.
 * Served from 'self', so the CSP needs nothing more.
 */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/cormorant-garamond-latin-600-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Amiri';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/amiri-arabic-700-normal.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/ibm-plex-sans-arabic-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/ibm-plex-sans-arabic-latin-600-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #221c18;
  --ink-soft: #3a302a;
  --champagne: #e1d4c2;
  --champagne-soft: #f3ece2;
  --cream: #fbf8f3;
  --accent: #8a6a45; /* champagne darkened to pass contrast on cream */
  --text: #2a2420;
  --muted: #6b625a;
  --line: #e8e0d5;
  --danger: #a3261e;
  --success: #3d6b45;

  --serif: 'Cormorant Garamond', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --arabic: 'IBM Plex Sans Arabic', 'SF Arabic', 'Geeza Pro', 'Noto Naskh Arabic', 'Segoe UI', Tahoma, sans-serif;
  /* Latin words in Arabic headings (GetWudd, App Store) fall to Cormorant. */
  --arabic-display: 'Amiri', 'Cormorant Garamond', 'Geeza Pro', 'Noto Naskh Arabic', serif;

  --radius: 14px;
  --gutter: 1.25rem;
  --max: 68rem;
}

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

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

/* At least one screen tall, with the main content taking the spare room, so
   the footer sits at the bottom of the window on short pages (a thank-you
   message, a 404) instead of leaving a band of background below it. */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--cream);
  color: var(--text);
  font: 1.0625rem/1.65 var(--sans);
}

main {
  flex: 1 0 auto;
}

:lang(ar) body,
body:lang(ar) {
  font-family: var(--arabic);
  line-height: 1.8;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.15;
  margin-block: 0 0.6em;
  color: var(--ink);
}

:lang(ar) h1,
:lang(ar) h2,
:lang(ar) h3 {
  font-family: var(--arabic-display);
  font-weight: 700;
  line-height: 1.5;
}

/* Cormorant runs small, so the English sizes are a step up. */
h1 {
  font-size: clamp(2.3rem, 7vw, 3.75rem);
}

h2 {
  font-size: clamp(1.75rem, 4.5vw, 2.4rem);
}

h3 {
  font-size: 1.4rem;
}

:lang(ar) h1 {
  font-size: clamp(2rem, 6vw, 3.25rem);
}

:lang(ar) h2 {
  font-size: clamp(1.5rem, 4vw, 2.1rem);
}

:lang(ar) h3 {
  font-size: 1.2rem;
}

p {
  margin-block: 0 1em;
}

a {
  color: var(--accent);
}

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

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

.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.narrow {
  max-width: 44rem;
}

.center {
  text-align: center;
}

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

.lead {
  font-size: 1.2rem;
  max-width: 38rem;
}

.skip-link {
  position: absolute;
  inset-inline-start: 1rem;
  inset-block-start: -3rem;
  padding: 0.5rem 1rem;
  background: var(--champagne);
  color: var(--ink);
  border-radius: 0 0 var(--radius) var(--radius);
  z-index: 10;
}

.skip-link:focus {
  inset-block-start: 0;
}

/* Header */

.site-header {
  background: var(--ink);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-block: 0.75rem;
}

.site-logo img {
  display: block;
  width: 84px;
}

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

.site-nav a {
  color: var(--champagne);
  text-decoration: none;
  padding-block: 0.4rem;
}

.site-nav a:hover,
.site-nav a[aria-current='page'] {
  color: #fff;
  box-shadow: inset 0 -2px 0 var(--champagne);
}

.site-nav__lang {
  border: 1px solid var(--ink-soft);
  border-radius: 999px;
  padding-inline: 0.9rem;
}

.site-nav a.site-nav__lang:hover {
  box-shadow: none;
  border-color: var(--champagne);
}

/* Hero */

.hero {
  background: var(--ink);
  color: var(--champagne-soft);
  padding-block: 3.5rem 4.5rem;
}

.hero h1 {
  color: #fff;
  max-width: 16em;
}

.eyebrow {
  color: var(--champagne);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.85rem;
}

:lang(ar) .eyebrow {
  text-transform: none;
  letter-spacing: 0;
  font-size: 1rem;
}

/* Store links */

.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-block-start: 1.75rem;
}

.center .stores {
  justify-content: center;
}

.store-button {
  display: inline-block;
  padding: 0.8rem 1.4rem;
  border-radius: 999px;
  background: var(--champagne);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.store-button:hover {
  background: #fff;
}

.stores__soon {
  margin: 0;
  padding: 0.7rem 1.2rem;
  border: 1px dashed var(--champagne);
  border-radius: 999px;
  color: var(--champagne);
}

/* Sections */

.section {
  padding-block: 3.5rem;
}

.section--tint {
  background: var(--champagne-soft);
}

.section--dark {
  background: var(--ink);
  color: var(--champagne-soft);
}

.section--dark h2 {
  color: #fff;
}

.page-header {
  padding-block: 3rem 1rem;
}

.grid,
.steps {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.card p:last-child {
  margin-block-end: 0;
}

.steps {
  counter-reset: step;
}

.steps .card::before {
  counter-increment: step;
  content: counter(step);
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  margin-block-end: 0.75rem;
  border-radius: 50%;
  background: var(--ink);
  color: var(--champagne);
  font-family: var(--serif);
  font-weight: 600;
}

:lang(ar) .steps .card::before {
  content: counter(step, arabic-indic);
  font-family: var(--arabic);
}

/* Long-form text (about, privacy) */

.prose h2 {
  font-size: 1.4rem;
  margin-block-start: 2rem;
}

.prose h3 {
  font-size: 1.2rem;
  margin-block-start: 1.5rem;
}

.prose h4 {
  font-size: 1.05rem;
  margin-block: 1.25rem 0.5rem;
}

.prose ul,
.prose ol {
  padding-inline-start: 1.25rem;
}

.prose blockquote {
  margin: 1.25rem 0;
  padding-inline-start: 1rem;
  border-inline-start: 3px solid var(--champagne);
  color: var(--muted);
}

.prose hr {
  margin-block: 2rem;
  border: 0;
  border-block-start: 1px solid var(--line);
}

.prose li {
  margin-block-end: 0.4rem;
}

.notice {
  padding: 0.9rem 1.1rem;
  border-inline-start: 4px solid var(--accent);
  background: var(--champagne-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
}

[dir='rtl'] .notice {
  border-radius: var(--radius) 0 0 var(--radius);
}

/* Contact form (W-04) */

/* Two classes, so the wider screens' .section padding doesn't win. */
.section.section--flush {
  padding-block-start: 0;
}

.form {
  display: grid;
  gap: 1.25rem;
}

.field {
  display: grid;
  gap: 0.35rem;
}

.field label,
.field-group legend {
  font-weight: 600;
  color: var(--ink);
}

.field-group {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.field-group legend {
  padding-inline: 0.4rem;
}

.field-group .field__hint {
  margin: 0;
}

.field input,
.field textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid #cfc4b5;
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.field textarea {
  resize: vertical;
  min-height: 10rem;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  outline: 3px solid rgb(138 106 69 / 25%);
  outline-offset: 0;
}

.field [aria-invalid='true'] {
  border-color: var(--danger);
}

/* Numbers and emails stay left to right; align them with the Arabic labels. */
[dir='rtl'] .field input[dir='ltr'] {
  text-align: right;
}

.field__hint {
  color: var(--muted);
  font-size: 0.95rem;
}

.field__error {
  margin: 0;
  color: var(--danger);
  font-size: 0.95rem;
  font-weight: 600;
}

.button {
  justify-self: start;
  display: inline-block;
  padding: 0.85rem 1.6rem;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--champagne);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  background: var(--ink-soft);
  color: #fff;
}

.button--secondary {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.button--secondary:hover {
  background: var(--champagne-soft);
  color: var(--ink);
}

/* The mock gateway's test payment page (development and staging only). */
.payment-summary {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1.5rem;
  margin: 0 0 2rem;
}

.payment-summary dt {
  color: var(--muted);
}

.payment-summary dd {
  margin: 0;
  font-weight: 600;
}

.payment-summary + form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.notice--success {
  border-inline-start-color: var(--success);
}

.notice--success h2 {
  margin-block-start: 0;
  font-size: 1.5rem;
}

.notice--error {
  border-inline-start-color: var(--danger);
  color: var(--danger);
  font-weight: 600;
}

.visually-hidden,
.honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Error pages */

.page-header--error {
  padding-block: 4rem;
}

/* Footer */

.site-footer {
  background: var(--ink);
  color: var(--champagne);
  padding-block: 2rem;
  font-size: 0.95rem;
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

.site-footer a {
  color: var(--champagne);
}

.site-footer p {
  margin: 0;
  color: #b8ab99;
}

/* Tablet and up */

@media (min-width: 40rem) {
  :root {
    --gutter: 2rem;
  }

  .site-logo img {
    width: 96px;
  }

  .hero {
    padding-block: 5rem 6rem;
  }

  .section {
    padding-block: 4.5rem;
  }

  .grid,
  .steps {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }

  .site-footer__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

/* Desktop */

@media (min-width: 64rem) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .steps {
    grid-template-columns: repeat(4, 1fr);
  }
}
