/* AaMa Development website styles.
   Everything is served from this site: the Alexandria font files live in
   assets/fonts (SIL Open Font License, see assets/fonts/OFL.txt). */

@font-face {
  font-family: "Alexandria";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("fonts/alexandria-latin.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: "Alexandria";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("fonts/alexandria-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Alexandria";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("fonts/alexandria-arabic.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;
}

/* Tokens ----------------------------------------------------------------- */

:root {
  color-scheme: light dark;

  /* Brand colours: identical in light and dark mode. */
  --orange: #f26b21;
  --orange-hover: #ff8845;
  --forest: #13261e;
  --forest-hover: #24402f;
  --forest-raised: #24402f;
  --pale: #bfd6c8;
  --mint-light: #e6f2ea;
  --paper-light: #fbfcfa;
  --moss: #2c4539;
  --sage: #3f5a4e;
  --clay: #b8470a;

  /* Surfaces that follow the colour scheme. */
  --surface-paper: #fbfcfa;
  --surface-mint: #e6f2ea;
  --on-surface: #13261e;
  --on-surface-muted: #2c4539;
  --on-surface-label: #3f5a4e;
  --on-surface-link: #13261e;
  --on-surface-hover: #b8470a;
  --on-surface-rule: #13261e;
  --on-surface-focus: #13261e;
  --chip-on-mint: #fbfcfa;
  --chip-on-paper: #e6f2ea;
  --sticker: #fbfcfa;

  --todo-bg: #fff1b8;
  --todo-text: #5a3c00;
  --todo-line: #8a6400;

  --font: "Alexandria", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, "Noto Sans Arabic", sans-serif;
  --container: 72rem;
  --gutter: clamp(1.375rem, 4.5vw, 4rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface-paper: #0c1813;
    --surface-mint: #16302a;
    --on-surface: #e6f2ea;
    --on-surface-muted: #b4ccbe;
    --on-surface-label: #9db8a9;
    --on-surface-link: #ff8a4c;
    --on-surface-hover: #ffb08a;
    --on-surface-rule: #4a6b5d;
    --on-surface-focus: #ff8a4c;
    --chip-on-mint: #22443a;
    --chip-on-paper: #1a3129;
    --sticker: #e9f0eb;
  }
}

/* Each band sets its own foreground roles; components only use the roles. */
.tone-orange,
.tone-forest,
.tone-mint,
.tone-paper,
.sticker {
  background: var(--bg);
  color: var(--fg);
}

.tone-orange {
  --bg: var(--orange);
  --fg: var(--forest);
  --muted: var(--forest);
  --label: var(--forest);
  --link: var(--forest);
  --link-hover: var(--forest);
  --rule: var(--forest);
  --focus: var(--forest);
}

.tone-forest {
  --bg: var(--forest);
  --fg: var(--paper-light);
  --muted: var(--pale);
  --label: var(--pale);
  --link: var(--paper-light);
  --link-hover: var(--orange);
  --rule: #3c5a4c;
  --focus: var(--orange);
  --wordmark: var(--orange);
  --chip-bg: var(--forest-raised);
}

.tone-mint,
.tone-paper {
  --fg: var(--on-surface);
  --muted: var(--on-surface-muted);
  --label: var(--on-surface-label);
  --link: var(--on-surface-link);
  --link-hover: var(--on-surface-hover);
  --rule: var(--on-surface-rule);
  --focus: var(--on-surface-focus);
  /* Orange text fails contrast on the light bands, so the wordmark uses the ink colour there. */
  --wordmark: var(--on-surface);
}

.tone-mint {
  --bg: var(--surface-mint);
  --chip-bg: var(--chip-on-mint);
}

.tone-paper {
  --bg: var(--surface-paper);
  --chip-bg: var(--chip-on-paper);
}

/* Stickers stay light in both colour schemes. */
.sticker {
  --bg: var(--sticker);
  --fg: var(--forest);
  --muted: var(--moss);
  --label: var(--sage);
  --link: var(--forest);
  --link-hover: var(--clay);
  --rule: #d5e4da;
  --focus: var(--forest);
}

/* Base ------------------------------------------------------------------- */

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

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

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--surface-paper);
  color: var(--on-surface);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1;
}

main:focus {
  outline: none;
}

:where(h1, h2, h3, p, dl, dd, ul, ol, address) {
  margin: 0;
}

:where(h1, h2, h3) {
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

address {
  font-style: normal;
}

a {
  color: var(--link, currentColor);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

a:hover {
  color: var(--link-hover, currentColor);
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--focus, currentColor);
  outline-offset: 3px;
}

::selection {
  background: var(--forest);
  color: var(--paper-light);
}

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

.plain-list {
  padding: 0;
  list-style: none;
}

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

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 10;
  padding: 0.75rem 1.125rem;
  border-radius: 999px;
  background: var(--forest);
  color: var(--paper-light);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
  color: var(--paper-light);
}

/* Missing facts: deliberately loud so they cannot be overlooked. */
mark.todo {
  padding: 0 0.3em;
  border: 1px dashed var(--todo-line);
  border-radius: 4px;
  background: var(--todo-bg);
  color: var(--todo-text);
  font-size: 0.95em;
  font-weight: 500;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* Shared pieces ---------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 3.25rem;
  padding: 0.875rem 1.75rem;
  border-radius: 999px;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.button svg {
  flex: none;
  width: 1rem;
  height: 1rem;
}

.button-dark,
.button-dark:hover {
  color: var(--paper-light);
}

.button-dark {
  background: var(--forest);
}

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

.button-orange,
.button-orange:hover {
  color: var(--forest);
}

.button-orange {
  background: var(--orange);
}

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

.text-link {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
}

.lead {
  max-width: 36rem;
  font-size: clamp(1.125rem, 1rem + 0.45vw, 1.25rem);
  line-height: 1.55;
  text-wrap: pretty;
}

.section {
  padding-block: clamp(5rem, 10vw, 8rem);
}

.section-title {
  font-size: clamp(2.375rem, 1.6rem + 2.4vw, 3.75rem);
}

.section-intro {
  max-width: 30rem;
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: 1.125rem;
}

/* A list of facts separated by heavy rules (contact, company information). */
.rule-list > div {
  padding-block: 1.5rem;
  border-bottom: 2px solid var(--rule);
}

.rule-list > div:first-child {
  padding-top: 0;
}

.rule-label,
.rule-list dt {
  color: var(--label);
  font-size: 1rem;
}

.rule-value,
.rule-list dd {
  margin-top: 0.375rem;
  font-size: clamp(1.1875rem, 1rem + 0.6vw, 1.625rem);
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

/* Header and footer ------------------------------------------------------ */

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-block: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--fg);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand:hover {
  color: var(--fg);
}

.brand-mark {
  flex: none;
  width: 1.875rem;
  height: 1.875rem;
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0 2rem;
  padding: 0;
  list-style: none;
  font-weight: 500;
}

.nav-list a {
  display: inline-block;
  padding-block: 0.375rem;
  text-decoration: none;
}

.nav-list a:hover,
.nav-list a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.4em;
}

.site-footer {
  padding-block: 2.5rem 3rem;
  font-size: 0.9375rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.25rem 3rem;
}

.legal-line,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  padding: 0;
  list-style: none;
}

.legal-line {
  gap: 0.375rem 1.75rem;
  font-weight: 500;
}

.footer-links {
  gap: 0.25rem 1.75rem;
  font-weight: 600;
}

.footer-links a {
  text-decoration-thickness: 2px;
}

/* Home: hero ------------------------------------------------------------- */

.hero {
  overflow: hidden;
}

.hero-body {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  align-items: end;
  gap: 1.5rem 4rem;
  padding-top: clamp(2.5rem, 6vw, 4.5rem);
}

.hero h1 {
  font-size: clamp(2.625rem, 1.3rem + 4.2vw, 4.125rem);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.875rem 1.5rem;
  margin-top: 2rem;
}

.giant {
  margin: clamp(2rem, 4vw, 2.5rem) 0 -0.2em -0.06em;
  font-size: clamp(9.25rem, 1rem + 29vw, 26.875rem);
  font-weight: 900;
  line-height: 0.8;
  letter-spacing: -0.06em;
  white-space: nowrap;
  user-select: none;
}

@media (prefers-reduced-motion: no-preference) {
  .giant {
    animation: giant-rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.1s both;
  }

  @keyframes giant-rise {
    from {
      transform: translateY(40%);
    }

    to {
      transform: none;
    }
  }
}

/* Home: about ------------------------------------------------------------ */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: 2.75rem 5rem;
}

.about-text > p {
  max-width: 34rem;
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
}

.about-text > h2 + p {
  margin-top: 2rem;
}

.sticker {
  padding: clamp(1.25rem, 3vw, 2.25rem) clamp(1.375rem, 3vw, 2.5rem);
  border-radius: 2.25rem;
  transform: rotate(-1.5deg);
}

.fact-list > div {
  display: grid;
  grid-template-columns: 10.5rem minmax(0, 1fr);
  gap: 0.125rem 1rem;
  padding-block: 1.125rem;
  border-bottom: 2px solid var(--rule);
}

.fact-list dt {
  color: var(--label);
}

.fact-list dd {
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.sticker .text-link {
  display: inline-block;
  margin-top: 1.25rem;
}

/* Home: products --------------------------------------------------------- */

.product-grid {
  display: grid;
  /* auto-fill keeps a lone card at column width instead of stretching it. */
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
  gap: 1.25rem;
  margin-top: clamp(2.5rem, 6vw, 3.5rem);
  padding: 0;
  list-style: none;
}

.product-card {
  --fg: var(--forest);
  --muted: var(--moss);
  --link: var(--forest);
  --link-hover: var(--clay);
  --focus: var(--forest);

  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 16rem;
  padding: 2rem;
  border-radius: 2rem;
  color: var(--fg);
}

.product-card h3 {
  font-size: clamp(2rem, 1.5rem + 1.5vw, 2.75rem);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
}

.product-card p {
  color: var(--muted);
}

.product-card .text-link {
  align-self: flex-start;
  margin-top: auto;
  padding-top: 1.25rem;
}

.card-1 {
  background: var(--mint-light);
}

.card-2 {
  --muted: var(--forest);
  --link-hover: var(--forest);

  background: var(--orange);
}

.card-3 {
  background: var(--paper-light);
}

/* Products page ---------------------------------------------------------- */

.wordmark {
  margin-left: -0.05em;
  color: var(--wordmark, var(--orange));
  overflow-wrap: break-word;
  font-size: clamp(4.75rem, 0.5rem + 14vw, 12.5rem);
  font-weight: 900;
  line-height: 0.85;
  letter-spacing: -0.055em;
}

/* Keep a placeholder name readable instead of filling the band. */
.wordmark mark.todo {
  font-size: 0.3em;
  letter-spacing: 0;
}

.product-sub {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  align-items: end;
  gap: 1.5rem 4rem;
  margin-top: 2.5rem;
}

.product-desc {
  max-width: 40rem;
  color: var(--muted);
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
}

.languages {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.625rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  padding: 0;
  list-style: none;
}

.chips li {
  padding: 0.375rem 1rem;
  border-radius: 999px;
  background: var(--chip-bg, var(--forest-raised));
  font-size: 1rem;
  font-weight: 500;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: clamp(3rem, 7vw, 5rem);
  padding: 0;
  list-style: none;
}

.step {
  --fg: var(--forest);
  --muted: var(--moss);

  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 3.5rem;
  min-height: 17.5rem;
  padding: 2rem;
  border-radius: 2rem;
  color: var(--fg);
}

.step-1 {
  background: var(--mint-light);
}

.step-2 {
  --muted: var(--forest);

  background: var(--orange);
}

.step-3 {
  background: var(--paper-light);
}

/* Keep every step sticker distinct from a light band behind it. */
.tone-mint .step-1 {
  background: var(--paper-light);
}

.tone-paper .step-3 {
  background: var(--mint-light);
}

.step-number {
  font-size: 4.5rem;
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -0.04em;
}

.step h3 {
  font-size: 1.625rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.step p {
  margin-top: 0.5rem;
  color: var(--muted);
}

.product-cta {
  margin-top: 3.5rem;
}

/* Home: contact ---------------------------------------------------------- */

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: 2.5rem 5rem;
}

/* Inner pages ------------------------------------------------------------ */

.page-hero {
  padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(3.5rem, 8vw, 6rem);
}

.page-hero h1 {
  font-size: clamp(2.75rem, 1.5rem + 4vw, 4.5rem);
}

.page-hero .lead {
  margin-top: 1.5rem;
}

.page-hero .button {
  margin-top: 2.25rem;
}

.page-body {
  padding-block: clamp(3.5rem, 8vw, 6rem) clamp(5rem, 10vw, 8rem);
}

.details {
  max-width: 56rem;
}

.details > div {
  display: grid;
  grid-template-columns: minmax(0, 18rem) minmax(0, 1fr);
  gap: 0.25rem 2.5rem;
  align-items: baseline;
}

.details dd {
  margin-top: 0;
}

.note {
  max-width: 44rem;
  margin-top: clamp(3rem, 7vw, 4.5rem);
  transform: rotate(-1deg);
}

.note h2 {
  font-size: 1.5rem;
  letter-spacing: -0.015em;
}

.note p {
  margin-top: 0.75rem;
  color: var(--muted);
}

.prose {
  max-width: 44rem;
}

.prose h2 {
  margin: 3rem 0 1rem;
  font-size: 1.625rem;
  letter-spacing: -0.02em;
}

.prose p,
.prose ul {
  margin-bottom: 1rem;
  color: var(--muted);
}

.prose .intro {
  color: var(--fg);
  font-size: 1.25rem;
}

.prose ul {
  padding-left: 1.25rem;
}

.prose li {
  margin-bottom: 0.5rem;
}

.prose li::marker {
  color: var(--orange);
}

/* Responsive ------------------------------------------------------------- */

@media (max-width: 56rem) {
  .hero-body,
  .split,
  .product-sub,
  .contact-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .steps {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.875rem;
  }

  .step {
    gap: 1.25rem;
    min-height: 0;
    padding: 1.625rem;
    border-radius: 1.625rem;
  }

  .step-number {
    font-size: 3.25rem;
  }

  .step h3 {
    font-size: 1.375rem;
  }
}

@media (max-width: 40rem) {
  .nav-list {
    gap: 0 0.875rem;
    font-size: 0.9375rem;
  }

  .header-inner {
    padding-block: 1.25rem 0.25rem;
  }

  .sticker {
    border-radius: 1.75rem;
    transform: rotate(-1deg);
  }

  .fact-list > div,
  .details > div {
    grid-template-columns: minmax(0, 1fr);
  }

  .legal-line {
    flex-direction: column;
  }
}

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

@media print {
  .giant {
    display: none;
  }
}
