/*
 * Aamin AI home (HAFR workspace): footer, P29 with a brand-scale mark (§5.2). Builders: home-close, home-chapters.
 *   1440: brand line, Dubai, the address and "Book a call" in 5 columns; three link columns in 7;
 *         a hairline; the legal row (copyright, language, LinkedIn and Instagram, back to top); then the
 *         chosen lockup (the guardian shield with its amber eyes, and "Aamin AI"; «أمين» on ar.html) drawn as
 *         dots, whole, up to 1,200 px wide (the story column) (Home Reframe and polish, 2026-11-28).
 *   390:  one column; Services in two columns, then Countries and Company side by side; the mark about 110 px
 *         tall, the English "AI" running past the column's edge.
 * Ground: pearl with a faint sea-glass halo under the mark; never dark. Scoped under [data-section="footer"].
 */

/* NEW TOKENS (footer) */
[data-section="footer"] {
  --foot-line: clamp(1.5rem, 1.15rem + 1.2vw, 2.125rem);  /* 24 → 34 px brand line */
  --foot-head: 13px;
  --foot-link: 16px;
  /* the mark: the whole lockup (polish 2026-11-28: the shield keeps its tip). The box has the English
     lockup's proportions (776.15 x 195) in both languages, so both footers end at the same height; the
     canvas takes the file's own viewBox (section.js sets --foot-mark-full from it). */
  --foot-mark-box-r: 3.9803;     /* the box: 776.15 / 195 */
  --foot-mark-vbr: 3.9803;       /* the file's own width / height (section.js sets it from the viewBox) */
  --foot-mark-full: 776.15 / 195;
}

/* The frame: the story template's container (lib/story.css), so the footer lines up with every chapter */
[data-section="footer"] > .hf-wrap {
  max-inline-size: calc(var(--hf-story-max) + 2 * var(--hf-story-pad-x));
  padding-inline: var(--hf-story-pad-x);
}

/* Top: brand + site map -------------------------------------------------------------------------- */
[data-section="footer"] .foot-top { display: grid; gap: 56px; }
@media (min-width: 64rem) {
  [data-section="footer"] .foot-top { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: var(--hf-gutter); }
  [data-section="footer"] .foot-nav { padding-inline-start: calc(100% / 7); }
}
[data-section="footer"] .foot-brand { display: grid; align-content: start; justify-items: start; gap: 22px; }
[data-section="footer"] .foot-logo { display: inline-flex; min-block-size: 44px; align-items: center; border-radius: 6px; }
[data-section="footer"] .foot-logo .hf-wordmark--img { block-size: 40px; inline-size: auto; }
[data-section="footer"] .foot-line {
  max-inline-size: 15.5em;
  font-size: var(--foot-line); font-weight: 500; line-height: 1.18; letter-spacing: -0.03em;
  color: var(--hf-color-text-1);
  text-wrap: balance;
}
[data-section="footer"] .foot-line__tone { color: var(--hf-color-text-tone); }
[data-section="footer"] .foot-contact { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
[data-section="footer"] .foot-contact__item { display: inline-flex; align-items: center; gap: 8px; min-block-size: 40px; font-size: 16px; color: var(--hf-color-text-2); }
[data-section="footer"] .foot-contact__item .hf-icon { font-size: 20px; color: var(--hf-color-sea-600); }
[data-section="footer"] .foot-address a { min-block-size: 40px; }
[data-section="footer"] .foot-call { margin-block-start: -6px; }

[data-section="footer"] .foot-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 24px; }
[data-section="footer"] .foot-col--services { grid-column: 1 / -1; }
@media (min-width: 48rem) {
  [data-section="footer"] .foot-nav { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr); }
  [data-section="footer"] .foot-col--services { grid-column: auto; }
}
[data-section="footer"] .foot-col__head {
  font-size: var(--foot-head); font-weight: 500; letter-spacing: 0.01em; color: var(--hf-color-text-3);
  padding-block-end: 12px; margin-block-end: 6px;
  border-block-end: 1px solid rgb(11 13 16 / 0.08);
}
[data-section="footer"] .foot-col__list { display: grid; margin: 0; padding: 0; list-style: none; }
[data-section="footer"] .foot-col__list a {
  display: inline-flex; align-items: center; min-block-size: 40px;
  font-size: var(--foot-link); font-weight: 450; line-height: 1.3; letter-spacing: -0.005em;
  color: var(--hf-color-text-1); text-decoration: none;
  text-decoration-thickness: 1px; text-underline-offset: 4px;
  transition: color var(--hf-dur-2) var(--hf-ease-out);
}
[data-section="footer"] .foot-col__list a:hover { text-decoration-line: underline; }
@media (pointer: coarse) { [data-section="footer"] .foot-col__list a { min-block-size: 44px; } }

/* The legal row ------------------------------------------------------------------------------------ */
[data-section="footer"] .foot-legal {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px;
  margin-block-start: clamp(56px, 4vw + 1.5rem, 88px); padding-block-start: 18px;
  border-block-start: 1px solid rgb(11 13 16 / 0.1);
}
[data-section="footer"] .foot-copy { font-size: 14px; color: var(--hf-color-text-3); }
[data-section="footer"] .foot-lang { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; color: var(--hf-color-text-3); }
[data-section="footer"] .foot-lang .hf-icon { font-size: 18px; color: var(--hf-color-text-2); margin-inline-end: 2px; }
[data-section="footer"] .foot-lang a { display: inline-flex; align-items: center; min-block-size: 44px; padding-inline: 4px; font-weight: 500; color: var(--hf-color-text-2); text-decoration: none; border-radius: 6px; }
[data-section="footer"] .foot-lang a[aria-current="page"] { color: var(--hf-color-text-1); }
[data-section="footer"] .foot-lang a:not([aria-current]):hover { color: var(--hf-color-text-1); text-decoration: underline; text-underline-offset: 4px; }
[data-section="footer"] .foot-social { display: inline-flex; gap: 2px; margin-inline-start: auto; }
[data-section="footer"] .foot-up {
  display: inline-flex; align-items: center; gap: 10px; min-block-size: 44px; padding-inline: 14px 4px;
  border-radius: var(--hf-radius-pill); background: var(--hf-surface-card); box-shadow: 0 0 0 1px rgb(11 13 16 / 0.1);
  font-size: 14px; font-weight: 500; color: var(--hf-color-text-1); text-decoration: none;
}
[data-section="footer"] .foot-up:hover { box-shadow: 0 0 0 1px rgb(11 13 16 / 0.28); }
[data-section="footer"] .foot-up__orb { display: grid; place-items: center; inline-size: 34px; block-size: 34px; border-radius: 50%; background: var(--hf-surface-inset); }
[data-section="footer"] .foot-up__orb .hf-icon { font-size: 16px; transition: translate var(--hf-dur-2) var(--hf-ease-out); }
[data-section="footer"] .foot-up:is(:hover, :focus-visible) .foot-up__orb .hf-icon { translate: 0 -2px; }
@media (max-width: 47.99rem) {
  [data-section="footer"] .foot-legal { gap: 8px 16px; }
  [data-section="footer"] .foot-copy { inline-size: 100%; }
  [data-section="footer"] .foot-social { margin-inline-start: 0; }
  [data-section="footer"] .foot-up { margin-inline-start: auto; }
}

/* The brand-scale mark: the lockup file drawn as dots, cut by the bottom edge ------------------- */
[data-section="footer"] .foot-mark {
  position: relative; direction: ltr;
  inline-size: calc(100% - 2 * var(--hf-story-pad-x)); max-inline-size: var(--hf-story-max); margin-inline: auto;
  margin-block-start: clamp(48px, 3vw + 1.5rem, 80px);
  aspect-ratio: var(--foot-mark-box-r);
  overflow: hidden;
  background: radial-gradient(60% 90% at 50% 100% in oklab, rgb(191 230 225 / 0.5) 0%, rgb(210 230 230 / 0.2) 55%, rgb(210 230 230 / 0) 100%);
}
/* The canvas is the box's full height: its width is the file's proportion over the box's. */
[data-section="footer"] .foot-mark__canvas {
  position: absolute; left: 0; top: 0;
  inline-size: calc(100% * var(--foot-mark-vbr) / var(--foot-mark-box-r)); max-inline-size: none;
  block-size: auto; aspect-ratio: var(--foot-mark-full);
}
/* Arabic: the «أمين» lockup (taller for its width) on the inline start (the right, where the Arabic
   header's logo sits). The box is direction: ltr, so the sides are physical. */
[data-section="footer"]:lang(ar) { --foot-mark-vbr: 2.5852; --foot-mark-full: 504.11 / 195; }
[data-section="footer"]:lang(ar) .foot-mark__canvas { left: auto; right: 0; }
/* Phones: a taller mark (about 110 px at 390), drawn darker (section.js). In English the shield and
   "Aamin" fill the column (the lockup's first 620 of 776 units) and "AI" runs past its edge, the way
   the letters ran off the bottom in the 20:40 footer; the Arabic «أمين» lockup fits whole. */
@media (max-width: 47.99rem) {
  [data-section="footer"] { --foot-mark-box-r: 3.1795; } /* 620 / 195 */
}

/* Arabic */
[data-section="footer"]:lang(ar) .foot-line { line-height: 1.5; letter-spacing: 0; max-inline-size: 17em; font-size: clamp(1.375rem, 1.1rem + 1vw, 1.875rem); }
[data-section="footer"]:lang(ar) .foot-col__head,
[data-section="footer"]:lang(ar) .foot-col__list a { letter-spacing: 0; }

/* The mark ends the page: it sits on the bottom edge (the safe area below it on phones). */
[data-section="footer"].hf-sec--bottom-0 { padding-block-end: env(safe-area-inset-bottom, 0px); }
/* phones: the services list in two columns (a shorter footer) */
@media (max-width: 47.99rem) {
  [data-section="footer"] .foot-col--services { grid-column: 1 / -1; }
  [data-section="footer"] .foot-col--services .foot-col__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; }
}
