/* ===========================================================================
   Kyan Althiqah - main stylesheet

    1  reset and base
    2  layout primitives
    3  typography
    4  buttons and links
    5  header, nav, mobile menu
    6  section furniture
    7  hero
    8  about
    9  vision and mission
   10  services
   11  contact and form
   12  footer
   13  reveal states
   14  print

   Two standing rules run through the whole file:

   - Nothing changes size on hover or on tap. Not a row, not a card, not
     an icon. Reveals are fades, colour changes and clips. Where a card
     appears to lift, it is a shadow and a border changing, never a
     transform that alters its box.
   - Modifiers are written after the rule they modify, because at equal
     specificity source order decides, and a modifier placed above the
     base rule silently loses.
   ========================================================================= */


/* == 1  reset and base =================================================== */

*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--hdr-h) + 1rem);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: var(--t-body);
  font-weight: var(--w-reg);
  line-height: var(--lh-body-ar);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'kern' 1, 'liga' 1;
  overflow-x: hidden;
}

[lang='en'] body,
[dir='ltr'] body { line-height: var(--lh-body-en); }

img, svg { display: block; max-width: 100%; }

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

a { color: inherit; }

ul, ol { list-style: none; padding: 0; }

/* The generated artwork reads these. Kept here rather than in tokens.css
   because they are one direction's rendering of the artwork, not part of
   the brand: a different direction retunes them without touching the SVGs. */
body {
  --art-bg:   #F1ECE3;
  --art-lit:  #FFFFFF;
  --art-dim:  #E0D6C4;
  --art-deep: #D3C6AE;
  --art-line: var(--brand);
  --art-fill: var(--brand);
}


:focus-visible {
  outline: 2px solid var(--brand-deep);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection {
  background: var(--brand-wash);
  color: var(--ink);
}

.skip {
  position: absolute;
  inset-inline-start: var(--s-4);
  top: var(--s-4);
  z-index: 200;
  padding: var(--s-3) var(--s-5);
  background: var(--ink-surface);
  color: var(--paper);
  border-radius: var(--r-md);
  font-size: var(--t-small);
  font-weight: var(--w-med);
  transform: translateY(-160%);
  transition: transform var(--d-fast) var(--e-out);
}

.skip:focus-visible { transform: translateY(0); }


/* == 2  layout primitives ================================================ */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.main { display: block; }

.sec {
  position: relative;
  padding-block: var(--sec-y);
}

/* No rule between chapters. There was a hairline here, and together with
   the hard bottom edge of the hero wash it made the page read as a stack
   of separate panels rather than one continuous document. The section
   padding is the separation now; where a chapter needs more than that it
   changes ground colour instead of drawing a line. */


/* == 3  typography =======================================================
   Arabic display leading is set from measured ink, not taste.

   In IBM Plex Sans Arabic the hamza and the madda ride above the cap
   line while the tails of ق, ي, ج and ن drop well below the baseline.
   `tools/measure-leading.py` reads the true ink extents with
   `canvas.measureText(...).actualBoundingBoxAscent / Descent` for the
   exact strings this site sets. The numbers and the reasoning live on
   the --lh-* tokens; the short version is that the h2 needs 1.375em and
   the hero needs 1.190em, so they are set at 1.44 and 1.26.

   Re-run that tool after any heading copy change. Do not adjust these
   by eye: the failure mode is two lines touching on one screen width
   and looking fine on every other one.

   Latin has no such problem and runs at 1.08, which is what the English
   page needs to hold the same visual weight as the Arabic. */

.h1, .h2, .h3 {
  font-weight: var(--w-semi);
  letter-spacing: var(--track-tight);
  text-wrap: balance;
}

.h1 {
  font-size: var(--t-hero);
  line-height: var(--lh-hero-ar);
}

.h2 {
  font-size: var(--t-h2);
  line-height: var(--lh-h2-ar);
}

.h3 {
  font-size: var(--t-h3);
  line-height: 1.4;
  font-weight: var(--w-semi);
}

[dir='ltr'] .h1 { line-height: var(--lh-hero-en); }
[dir='ltr'] .h2 { line-height: var(--lh-h2-en); }
[dir='ltr'] .h3 { line-height: 1.24; }

.lead {
  font-size: var(--t-lead);
  color: var(--ink-mute);
  max-width: var(--wrap-text);
}

/* Arabic never gets a synthetic italic or a synthetic bold: both are
   drawn by the browser and both wreck the joins. Weights come from real
   faces only, which is why 300/400/500/600/700 are all downloaded. */
b, strong { font-weight: var(--w-semi); }

bdi { unicode-bidi: isolate; }

/* Latin numerals inside Arabic copy stay upright and in sequence. */
.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}


/* == 4  buttons and links ================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 0.9rem 1.5rem;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-size: var(--t-small);
  font-weight: var(--w-semi);
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background-color var(--d-fast) var(--e-out),
    border-color     var(--d-fast) var(--e-out),
    color            var(--d-fast) var(--e-out);
}

.btn--solid {
  background: var(--brand-deep);
  color: var(--paper);
  border-color: var(--brand-deep);
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule-strong);
}

.btn--sm {
  padding: 0.6rem 1.15rem;
  font-size: var(--t-micro);
}

@media (hover: hover) {
  .btn--solid:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
  .btn--ghost:hover { background: var(--ink-surface); color: var(--paper); border-color: var(--ink-surface); }
}

/* A link underline that sits below the Arabic descenders instead of
   cutting through them. text-underline-offset does the work; the
   browser's default position slices ق and ي in half. */
.link {
  color: var(--brand-deep);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.28em;
  transition: color var(--d-fast) var(--e-out);
}

@media (hover: hover) {
  .link:hover { color: var(--ink); }
}


/* == 5  header, nav, mobile menu ========================================= */

.hdr {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 100;
  /* Clear over the hero, so the star lines run behind the bar as in the
     approved design; it gains its paper and blur once the page moves. */
  background: transparent;
  border-bottom: 1px solid transparent;
  transition:
    background-color var(--d-mid) var(--e-out),
    border-color     var(--d-mid) var(--e-out);
}

/* set by motion.js once the page has left the hero */
.hdr[data-lifted='true'] {
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom-color: var(--rule);
}

.hdr__in {
  display: flex;
  align-items: center;
  gap: var(--s-5);
  height: var(--hdr-h);
}

.hdr__brand {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  text-decoration: none;
  flex: none;
}

/* On phones the mark sits a little under the menu button's height, so
   the two read as one row. */
.hdr__mark {
  display: block;
  width: 2.3rem;
  flex: none;
}

.hdr__mark svg,
.hdr__word svg { display: block; width: 100%; height: auto; }

/* The traced company name, set beside the mark at roughly the mark's
   cap height. */
.hdr__word {
  display: block;
  width: 8.6rem;
  flex: none;
}

.nav { display: none; }

.nav__list {
  display: flex;
  align-items: center;
  gap: clamp(var(--s-5), 2.2vw, 1.9rem);
}

.nav__link {
  position: relative;
  display: block;
  padding-block: var(--s-2);
  /* The header floats clear over the hero, so the browser draws its text
     on a transparent layer, where it can only use greyscale smoothing;
     at medium weight in a mid ink the links read soft. A step heavier,
     a touch larger and in the full-strength ink they hold a crisp edge. */
  font-size: 0.97rem;
  font-weight: var(--w-semi);
  color: var(--ink-surface);
  -webkit-font-smoothing: auto;
  text-rendering: optimizeLegibility;
  text-decoration: none;
  transition: color var(--d-fast) var(--e-out);
}

/* The active rule is a scaleX on a pseudo element, so the link's own box
   never changes width and the row never reflows. */
.nav__link::after {
  content: '';
  position: absolute;
  inset-block-end: 0;
  inset-inline: 0;
  height: 1.5px;
  background: var(--brass);
  transform: scaleX(0);
  transform-origin: var(--nav-origin, left);
  transition: transform var(--d-mid) var(--e-out);
}

[dir='rtl'] .nav__link::after { --nav-origin: right; }

.nav__link[aria-current='true'] { color: var(--brand-deep); }
.nav__link[aria-current='true']::after { transform: scaleX(1); }

@media (hover: hover) {
  .nav__link:hover { color: var(--brand-deep); }
}

.hdr__end {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-inline-start: auto;
  flex: none;
}

/* Below the desktop bar the language toggle moves into the menu. */
.hdr__end .switch { display: none; }

.menu__lang { margin-block-end: var(--s-5); }

/* A segmented toggle: both languages visible, the current one filled.
   The indicator is a background colour on the active segment, not a
   sliding element, so nothing moves or resizes when it changes. */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--rule);
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--paper-lift) 70%, transparent);
}

.switch__opt {
  display: block;
  /* Equal width segments. The labels are "ع" and "EN", one glyph against
     two, so without a floor the toggle comes out lopsided. */
  min-width: 2.4rem;
  text-align: center;
  padding: 0.38rem 0.6rem;
  border-radius: var(--r-pill);
  font-size: var(--t-micro);
  font-weight: var(--w-semi);
  letter-spacing: 0.05em;
  line-height: 1.2;
  color: var(--ink-mute);
  text-decoration: none;
  white-space: nowrap;
  transition:
    color var(--d-fast) var(--e-out),
    background-color var(--d-fast) var(--e-out);
}

/* Written after the base rule, not before it: at equal specificity the
   later rule wins, and a modifier placed above silently loses.
   The fill is the brand, not the ink: as a dark navy block it read as a
   piece of the footer that had drifted up into the header, where the
   only other filled thing on the page is the brand coloured button.
   Measured: paper on --brand-deep is 5.49:1. */
.switch__opt[aria-current='true'] {
  background: var(--brand-deep);
  color: var(--paper);
}

@media (hover: hover) {
  .switch__opt:hover { color: var(--ink); }
  .switch__opt[aria-current='true']:hover { color: var(--paper); }
}

.burger {
  display: grid;
  place-content: center;
  gap: 5px;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  background: none;
  border: 1px solid var(--rule);
  border-radius: var(--r-pill);
  cursor: pointer;
}

.burger__bar {
  display: block;
  width: 1.05rem;
  height: 1.5px;
  background: var(--ink-surface);
  transition: transform var(--d-mid) var(--e-out);
}

.burger[aria-expanded='true'] .burger__bar:first-child { transform: translateY(3.25px) rotate(45deg); }
.burger[aria-expanded='true'] .burger__bar:last-child  { transform: translateY(-3.25px) rotate(-45deg); }

.menu {
  position: fixed;
  inset-block-start: var(--hdr-h);
  inset-inline: 0;
  inset-block-end: 0;
  z-index: 99;
  padding: var(--s-6) var(--gutter) var(--s-8);
  background: var(--paper);
  overflow-y: auto;
  opacity: 0;
  transition: opacity var(--d-mid) var(--e-out);
}

.menu[hidden] { display: none; }
.menu[data-open='true'] { opacity: 1; }

.menu__list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--rule-soft);
}

.menu__link {
  display: flex;
  align-items: baseline;
  gap: var(--s-4);
  padding-block: var(--s-5);
  border-bottom: 1px solid var(--rule-soft);
  font-size: 1.32rem;
  font-weight: var(--w-med);
  text-decoration: none;
  color: var(--ink);
}

.menu__num {
  font-size: var(--t-micro);
  font-weight: var(--w-med);
  color: var(--brass);
  letter-spacing: var(--track-wide);
}

.menu__foot {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  margin-block-start: var(--s-7);
  font-size: var(--t-small);
  color: var(--ink-mute);
}

.menu__mail,
.menu__wa { text-decoration: none; }

@media (min-width: 980px) {
  /* The approved layout: the brand alone at the start, the links grouped
     at the end beside the language toggle. */
  .nav { display: block; margin-inline-start: auto; }
  .hdr__end { margin-inline-start: var(--s-5); }
  .burger { display: none; }
  .menu { display: none !important; }
  .hdr__end .switch { display: inline-flex; }
  .hdr__mark { width: 2.75rem; }
  .hdr__word { width: 11.5rem; }
}


/* == 6  section furniture ================================================ */

/* --- the chapter head ----------------------------------------------------
   One head for every chapter after the hero, in the hero's language: the
   title with a single word in teal over a soft brass underlay. Built by m.shead() in macros.html. */

.shead__title {
  max-width: 20ch;
  color: var(--ink-surface);
  isolation: isolate;
}

/* A small brass label over the title, led by a short rule. */
.shead__kicker {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  margin-block-end: var(--s-4);
  font-size: var(--t-small);
  font-weight: var(--w-semi);
  color: var(--brass);
}

.shead__kicker::before {
  content: '';
  width: 1.75rem;
  height: 1px;
  background: currentColor;
}

/* The part of a title after its comma, on a line of its own. */
.shead__rest[data-break] { display: block; }

.shead--center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.accent {
  position: relative;
  font-style: normal;
  color: var(--brand-deep);
}

.accent::after {
  content: '';
  position: absolute;
  inset-inline: 0;
  bottom: 0.04em;
  height: 0.12em;
  border-radius: var(--r-sm);
  background: var(--brass-soft);
  opacity: 0.5;
  z-index: -1;
}

/* --- the licence line -------------------------------------------------------
   The licence number as a line of text between two short brass rules,
   used under the hero's title and under the footer's lockup. Not a pill:
   a pill holding a filled pill read as an iPhone switch in the owner's
   usability test, and people tried to slide it. */

.licline {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  font-size: var(--t-small);
  color: var(--ink-mute);
  cursor: default;
}

.licline::before,
.licline::after {
  content: '';
  width: 1.75rem;
  height: 1px;
  background: var(--brass);
  opacity: 0.7;
}

.licline__num {
  font-weight: var(--w-semi);
  color: var(--ink-surface);
  font-variant-numeric: tabular-nums;
}

/* A chapter's opening line, set under a centred head. */
.sintro {
  max-width: 56ch;
  margin-inline: auto;
  margin-block: var(--s-5) 0;
  text-align: center;
  color: var(--ink-mute);
}


/* == 7  hero =============================================================
   No photograph, by the owner's choice. A centred opening: the licence
   badge, the name with its one accented word and the two actions, all over
   an eight-pointed star drawn in hairline brass. The star is the
   identity's khatam, kept faint on purpose; the owner asked for it to be
   felt, not looked at. */

.sec--hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: min(100svh, 56rem);
  padding-block: calc(var(--hdr-h) + var(--s-6)) var(--s-9);
  overflow: hidden;
  text-align: center;
  background: radial-gradient(70% 60% at 50% 45%,
    var(--paper-lift) 0%, var(--paper) 62%, var(--paper-sink) 100%);
}

.sec--hero::before { content: none; }

/* The radial ground ends darker than the paper below it, and the star is
   cut by the section edge. Both would draw a hard line where About
   begins, so the last stretch fades into plain paper. */
.sec--hero::after {
  content: '';
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 28%;
  background: linear-gradient(to bottom, transparent, var(--paper));
  pointer-events: none;
  z-index: 0;
}

/* Kept to three shapes, the square and the diamond that make the
   eight-pointed star and one circle round it: the owner wanted the
   original strength of line, but fewer of them. */
.hero__art {
  position: absolute;
  inset-inline-start: 50%;
  top: 52%;
  /* Sized to the hero's height as well as its width. On a desktop the
     star overruns the section top and bottom; on a phone 130vw alone left
     it a small drawing in the middle, so the height term keeps it at the
     desktop's scale there too. */
  width: max(min(130vw, 75rem), 95svh);
  /* the reset's max-width: 100% held it to the screen width on phones */
  max-width: none;
  height: auto;
  translate: -50% -50%;
  color: var(--brass);
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
}

[dir='rtl'] .hero__art { translate: 50% -50%; }

.hero__art path,
.hero__art circle {
  stroke-dasharray: 3000;
  stroke-dashoffset: 3000;
  animation: hero-draw 4s var(--e-soft) forwards;
}

@keyframes hero-draw { to { stroke-dashoffset: 0; } }

.hero__in {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero__badge { margin-block-end: var(--s-6); }

.hero__title {
  margin-block-end: var(--s-5);
  font-size: clamp(2.5rem, 1.3rem + 5vw, 5.75rem);
  color: var(--ink-surface);
  isolation: isolate;
  /* not the headings' balance: it moved the accent word down a line */
  text-wrap: wrap;
}

@media (min-width: 640px) {
  .hero__titlestart { white-space: nowrap; }
}

/* The approved break: the name on one line, the trade on the next. */
.hero__titleend { display: block; }

/* The one accented word, in the brand teal over a soft brass underlay. */
.hero__accent {
  position: relative;
  font-style: normal;
  color: var(--brand-deep);
}

.hero__accent::after {
  content: '';
  position: absolute;
  inset-inline: 0;
  bottom: 0.06em;
  height: 0.1em;
  border-radius: var(--r-sm);
  background: var(--brass-soft);
  opacity: 0.5;
  z-index: -1;
}

.hero__lead {
  max-width: 40ch;
  font-size: var(--t-lead);
  /* not --ink-mute: see the note on --ink-on-art */
  color: var(--ink-on-art);
  margin-block-end: var(--s-6);
}

.hero__acts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s-3);
}

.hero__acts .btn--ghost {
  background: color-mix(in srgb, var(--paper-pure) 70%, transparent);
}

/* The rule above outranks the plain ghost hover, so without restating
   it here the hover turned the text to paper on a still-pale ground and
   the label vanished. */
@media (hover: hover) {
  .hero__acts .btn--ghost:hover {
    background: var(--ink-surface);
    border-color: var(--ink-surface);
    color: var(--paper);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__art path,
  .hero__art circle { animation: none; stroke-dashoffset: 0; }
}


/* == 8  about ============================================================
   The centred manifesto, chosen by the owner from the about lab: kicker,
   title and one paragraph down the middle, then the mark between two
   brass rules, and the law-firm alliance signed underneath like the line
   at the foot of a deed. The ground is a soft radial lift of paper, so
   the chapter glows at its centre without an edge anywhere. */

.sec--about {
  background: radial-gradient(70% 60% at 50% 40%,
    var(--paper-lift) 0%, var(--paper) 70%);
}

.about__in {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.sec--about .shead__title {
  max-width: none;
  font-size: clamp(2.2rem, 1.3rem + 3.4vw, 4.2rem);
}

.about__text {
  max-width: 44ch;
  margin-block-start: var(--s-5);
  color: var(--ink-mute);
}

.about__rule {
  display: flex;
  align-items: center;
  gap: var(--s-5);
  width: min(100%, 32rem);
  margin-block: var(--s-8);
  color: var(--brass);
}

.about__rule::before,
.about__rule::after {
  content: '';
  flex: 1;
  height: 1px;
}

.about__rule::before { background: linear-gradient(to left, currentColor, transparent); }
.about__rule::after  { background: linear-gradient(to right, currentColor, transparent); }

.about__mark {
  display: block;
  width: 3.4rem;
  flex: none;
}

.about__mark svg { display: block; width: 100%; height: auto; }

.about__sig {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-2);
}

.about__siglabel {
  font-size: var(--t-small);
  color: var(--ink-mute);
}

/* The name flanked by two short brass dashes, as a signature line. */
.about__signame {
  display: inline-flex;
  align-items: center;
  gap: var(--s-4);
  font-size: clamp(1.2rem, 1rem + 0.9vw, 1.7rem);
  font-weight: var(--w-semi);
  line-height: 1.5;
  color: var(--ink-surface);
}

.about__signame::before,
.about__signame::after {
  content: '';
  width: 1.25rem;
  height: 1px;
  flex: none;
  background: var(--brass);
}

@media (max-width: 640px) {
  .about__signame::before,
  .about__signame::after { display: none; }
}


/* == 9  vision and mission ===============================================
   "The two quotes", chosen from the vision lab and set side by side: the
   vision and the mission as light quotations in brass guillemets, divided
   by a brass spine with the mark at its centre. The ground is the same
   radial lift as About, so the two chapters read as one continuous page.
   Below 820px the pair stacks and the spine becomes About's horizontal
   rule. */

.sec--vision {
  background: radial-gradient(70% 60% at 50% 45%,
    var(--paper-lift) 0%, var(--paper) 70%);
}

.vision__pair {
  display: grid;
  gap: var(--s-7);
  justify-items: center;
  margin-block-start: clamp(3rem, 2rem + 3vw, 5rem);
  text-align: center;
}

.vquote {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-4);
  margin: 0;
}

.vquote__label {
  font-size: clamp(1.15rem, 1rem + 0.6vw, 1.5rem);
  font-weight: var(--w-bold);
  color: var(--brass);
}

.vquote__text {
  max-width: 26ch;
  margin: 0;
  font-size: clamp(1.3rem, 1rem + 1vw, 1.9rem);
  font-weight: var(--w-light);
  line-height: 1.85;
  color: var(--ink-surface);
}

.vquote__text::before,
.vquote__text::after {
  color: var(--brass);
  font-weight: var(--w-bold);
}

/* Joined to the text by a no-break space, so a closing mark is never
   left on a line of its own. */
[dir='rtl'] .vquote__text::before { content: '«\00A0'; }
[dir='rtl'] .vquote__text::after  { content: '\00A0»'; }
[dir='ltr'] .vquote__text::before { content: '\201C'; }
[dir='ltr'] .vquote__text::after  { content: '\201D'; }

/* Stacked: a plain brass rule lying between the quotes, faded at both
   ends. The owner asked for the line alone, without the mark. */
.vision__spine {
  display: block;
  width: min(100%, 20rem);
  height: 1px;
  background: linear-gradient(to right,
    transparent, var(--brass) 50%, transparent);
}

/* Side by side: the same rule stands up between the two quotes. */
@media (min-width: 820px) {
  .vision__pair {
    grid-template-columns: 1fr auto 1fr;
    /* Top-aligned, so "الرؤية" and "الرسالة" sit on one line however
       long either quote runs. */
    align-items: start;
    gap: clamp(var(--s-6), 1rem + 4vw, var(--s-9));
  }
  .vision__spine {
    align-self: stretch;
    width: 1px;
    height: auto;
    background: linear-gradient(to bottom,
      transparent, var(--brass) 50%, transparent);
  }
}


/* == 10  services ========================================================
   Six services, the six the old site named inside a single paragraph; no
   descriptive copy is invented for them. "The hairline grid", chosen from
   the services lab: no cards, a brass icon over each name, and the cells
   divided by brass hairlines that fade at their ends, so the grid is felt
   rather than drawn. Two columns on a phone, three from 860px. */

.sec--services {
  background: radial-gradient(70% 60% at 50% 40%,
    var(--paper-lift) 0%, var(--paper) 70%);
}

.services__intro { margin-block-end: clamp(3rem, 2rem + 3vw, 5rem); }

.svc {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.svc__item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-4);
  padding: clamp(1.8rem, 1.2rem + 2vw, 3.4rem) var(--s-4);
  text-align: center;
}

/* The dividers: a horizontal hairline under every row but the last, and a
   vertical one before every cell that is not first in its row. */
.svc__item::after,
.svc__item::before {
  content: '';
  position: absolute;
  pointer-events: none;
}

.svc__item:nth-child(-n+4)::after {
  bottom: 0;
  inset-inline: 12%;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--brass-soft), transparent);
}

.svc__item:nth-child(2n)::before {
  top: 18%;
  bottom: 18%;
  inset-inline-start: 0;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--brass-soft), transparent);
}

.svc__icon {
  display: grid;
  place-content: center;
  color: var(--brass);
  transition: color var(--d-mid) var(--e-out);
}

.svc__name {
  position: relative;
  padding-block-end: 6px;
  font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.4rem);
  font-weight: var(--w-med);
  line-height: 1.5;
  color: var(--ink-surface);
}

/* A brass rule that draws out from the centre under the name on hover. */
.svc__name::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 100%;
  height: 1.5px;
  background: var(--brass);
  translate: -50% 0;
  transform: scaleX(0);
  transition: transform var(--d-slow) var(--e-out);
}

@media (hover: hover) {
  .svc__item:hover .svc__icon { color: var(--brand-deep); }
  .svc__item:hover .svc__name::after { transform: scaleX(1); }
}

@media (min-width: 860px) {
  .svc { grid-template-columns: repeat(3, 1fr); }
  .svc__item:nth-child(-n+4)::after { content: none; }
  .svc__item:nth-child(-n+3)::after { content: ''; }
  .svc__item:nth-child(2n)::before { content: none; }
  .svc__item:not(:nth-child(3n+1))::before {
    content: '';
    top: 18%;
    bottom: 18%;
    inset-inline-start: 0;
    width: 1px;
    background: linear-gradient(to bottom, transparent, var(--brass-soft), transparent);
  }
}


/* == 11  contact and form ================================================
   "The spine split", chosen from the contact lab: a centred head, then
   the form and the details side by side across a brass spine, as in the
   Vision chapter. Fields are full boxes at the owner's request, each
   with its label inside, which rises above the text once the field is
   focused or filled. */

.sec--contact {
  background: radial-gradient(70% 60% at 50% 40%,
    var(--paper-lift) 0%, var(--paper) 70%);
}

.contact__lead { margin-block-end: clamp(3rem, 2rem + 3vw, 5rem); }

.contact__grid {
  display: grid;
  gap: var(--s-7);
}

.form {
  display: grid;
  gap: var(--s-4);
  align-content: start;
}

/* --- the boxed field with its floating label ----------------------------- */

.field { position: relative; }

.field--trap {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.field__input {
  width: 100%;
  padding: 1.6rem 1.1rem 0.6rem;
  background: var(--paper-field);
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-lg);
  color: var(--ink-surface);
  font-size: var(--t-body);
  line-height: 1.5;
  transition:
    border-color var(--d-fast) var(--e-out),
    box-shadow   var(--d-fast) var(--e-out),
    background-color var(--d-fast) var(--e-out);
}

.field__input--area {
  min-height: 9rem;
  resize: vertical;
  line-height: 1.8;
}

.field__input:focus {
  outline: none;
  background: var(--paper-lift);
  border-color: var(--brass);
  box-shadow: 0 0 0 4px rgba(201, 165, 117, 0.18);
}

/* Only after the field has been touched, so a pristine form is not a
   wall of red. motion.js sets data-touched on blur. */
.field__input[data-touched='true']:invalid {
  border-color: var(--bad);
}

/* Resting, the label sits where the text will go; focused or filled, it
   rises to the top of the box in brass. */
.field__label {
  position: absolute;
  inset-inline-start: 1.1rem;
  top: 1.05rem;
  font-size: var(--t-body);
  color: var(--ink-mute);
  pointer-events: none;
  transition:
    top       var(--d-mid) var(--e-out),
    font-size var(--d-mid) var(--e-out),
    color     var(--d-mid) var(--e-out);
}

.field__input:focus + .field__label,
.field__input:not(:placeholder-shown) + .field__label {
  top: 0.45rem;
  font-size: var(--t-micro);
  color: var(--brass);
}

/* The mark sits after the label text in both scripts. The brass is the
   site's one accent and is cleared for a glyph at this size. */
.field__req {
  margin-inline-start: 0.2em;
  color: var(--brass);
}

.form__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3) var(--s-5);
  margin-block-start: var(--s-2);
}

/* Directly under the fields, on its own line above the button. */
.contact__req {
  margin-block-start: calc(var(--s-2) * -1);
  font-size: var(--t-small);
  color: var(--ink-mute);
}

.contact__req span { color: var(--brass); }

.form__note {
  flex-basis: 100%;
  font-size: var(--t-small);
  color: var(--ink-mute);
  margin: 0;
}

.form__note:empty { display: none; }
.form__note[data-state='ok']  { color: var(--ok); }
.form__note[data-state='bad'] { color: var(--bad); }

.form[data-busy='true'] .form__send {
  pointer-events: none;
  opacity: 0.6;
}

/* --- the spine ------------------------------------------------------------ */

.contact__spine {
  display: block;
  width: min(100%, 20rem);
  height: 1px;
  margin-inline: auto;
  background: linear-gradient(to right, transparent, var(--brass) 50%, transparent);
}

/* --- the details ------------------------------------------------------------ */

.info {
  display: grid;
  gap: var(--s-6);
  align-content: start;
  text-align: start;
}

.info__list { display: grid; gap: var(--s-6); }

.info__row { display: grid; gap: var(--s-2); }

.info__key {
  font-size: var(--t-small);
  font-weight: var(--w-semi);
  color: var(--brass);
}

.info__val { margin: 0; }

/* Set like the address beneath it, at the owner's request: the same
   muted ink and weight, so the three details read as one list. */
.info__link {
  font-size: inherit;
  font-weight: var(--w-reg);
  color: var(--ink-mute);
  text-decoration: none;
  border-block-end: 1px solid transparent;
  transition:
    color var(--d-fast) var(--e-out),
    border-color var(--d-fast) var(--e-out);
}

@media (hover: hover) {
  .info__link:hover {
    color: var(--brand-deep);
    border-block-end-color: var(--brass-soft);
  }
}

.info__addr {
  max-width: 34ch;
  color: var(--ink-mute);
  line-height: 1.9;
}

.info__social { display: grid; gap: var(--s-3); }

.social { display: flex; gap: var(--s-3); }

.social__link {
  display: grid;
  place-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  color: var(--ink-mute);
  transition:
    color var(--d-fast) var(--e-out),
    border-color var(--d-fast) var(--e-out),
    background-color var(--d-fast) var(--e-out);
}

@media (hover: hover) {
  .social__link:hover {
    color: var(--paper);
    background: var(--ink-surface);
    border-color: var(--ink-surface);
  }
}

@media (min-width: 640px) {
  .form { grid-template-columns: 1fr 1fr; gap: var(--s-4) var(--s-5); }
  .field--wide,
  .contact__req,
  .form__foot { grid-column: 1 / -1; }
}

/* Side by side: the spine stands up between the form and the details. */
@media (min-width: 900px) {
  .contact__grid {
    grid-template-columns: 1.35fr auto 0.9fr;
    gap: clamp(var(--s-6), 1rem + 4vw, var(--s-9));
  }
  .contact__spine {
    align-self: stretch;
    width: 1px;
    height: auto;
    background: linear-gradient(to bottom, transparent, var(--brass) 50%, transparent);
  }
}


/* == 12  footer =========================================================
   "The centred paper", chosen from the footer lab. The page does not
   turn dark at its end: a brass hairline marks where the footer begins,
   and everything stands in one narrow centred column ("one column in
   the middle", chosen from the arrangements lab): the owner's lockup
   framed by the brass star, the office map, then the links. The map was
   the owner's one requirement for the footer; the email, WhatsApp and
   social links are left to the Contact chapter above rather than shown
   twice.

   The map is inlined SVG drawn from OpenStreetMap at build time; it
   reads the --map-* properties below, here a paper and sand palette. */

.foot {
  position: relative;
  overflow: hidden;
  padding-block: clamp(4rem, 3rem + 4vw, 6rem) 0;
  background: radial-gradient(70% 60% at 50% 30%,
    var(--paper-lift) 0%, var(--paper) 70%);
  color: var(--ink);
  text-align: center;

  --map-land:       #EEE8DD;
  --map-sea:        #CFE0E5;
  --map-green:      #E1E5D6;
  --map-road:       #FBF8F1;
  --map-road-major: #E6D6BB;
  --map-shore:      #9CC3CF;
  --map-pin:        var(--brand-deep);
  --map-pindot:     #FBF8F1;
}

/* A brass hairline along the top edge, brightest at the centre. */
.foot::before {
  content: '';
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  height: 1px;
  background: linear-gradient(to right,
    transparent, var(--brass-soft) 50%, transparent);
}

/* The star, kept from the ink footer at the owner's request and set to
   one side: large, cut by the page edge at the end of the line, centred
   on the footer's height, and faded out as it reaches the content so
   it frames the column rather than sitting behind it. Two smaller ones
   answer it from the opposite side, top and bottom. */
.foot__star {
  position: absolute;
  top: 50%;
  inset-inline-end: -13rem;
  width: 44rem;
  height: auto;
  translate: 0 -50%;
  color: var(--brass);
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
  -webkit-mask-image: linear-gradient(to right, #000 40%, transparent 92%);
  mask-image: linear-gradient(to right, #000 40%, transparent 92%);
}

[dir='ltr'] .foot__star {
  -webkit-mask-image: linear-gradient(to left, #000 40%, transparent 92%);
  mask-image: linear-gradient(to left, #000 40%, transparent 92%);
}

.foot__star--echo {
  top: auto;
  bottom: -7rem;
  inset-inline-end: auto;
  inset-inline-start: -7rem;
  width: 18rem;
  translate: none;
  opacity: 0.35;
  -webkit-mask-image: none;
  mask-image: none;
}

[dir='ltr'] .foot__star--echo { -webkit-mask-image: none; mask-image: none; }

/* A third, mid-sized, in the corner at the start of the top edge, where
   the owner found the footer empty. */
.foot__star--top {
  top: -8rem;
  bottom: auto;
  inset-inline-end: auto;
  inset-inline-start: -8rem;
  width: 24rem;
  translate: none;
  opacity: 0.32;
  -webkit-mask-image: none;
  mask-image: none;
}

[dir='ltr'] .foot__star--top { -webkit-mask-image: none; mask-image: none; }

/* On a phone the column is the full width, so the side star would sit
   behind the content; it shrinks back into the corner instead. */
@media (max-width: 760px) {
  .foot__star { top: -4rem; translate: none; width: 22rem; inset-inline-end: -11rem; }
  .foot__star--echo,
  .foot__star--top { display: none; }
}

.foot__in {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.foot__brand {
  display: block;
  width: min(78vw, 18.75rem);
  text-decoration: none;
}

.foot__lockup svg { display: block; width: 100%; height: auto; }

/* --- map and details ------------------------------------------------------ */

.foot__pair {
  width: min(100%, 44rem);
  margin-block-start: clamp(2rem, 1.6rem + 1.5vw, 2.5rem);
  text-align: start;
}

.foot__map {
  position: relative;
  display: block;
  aspect-ratio: 5 / 4;
  overflow: hidden;
  border: 1px solid var(--rule-strong);
  border-radius: calc(var(--r-lg) * 1.6);
  box-shadow: 0 30px 60px -40px rgba(14, 42, 51, 0.35);
  text-decoration: none;
  transition:
    border-color var(--d-mid) var(--e-out),
    box-shadow   var(--d-mid) var(--e-out);
}

.foot__mapart,
.foot__mapart svg {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

/* A paper scrim rising from the bottom, so the address reads on the map
   without a box drawn round it. */
.foot__mapface {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-6) var(--s-5) var(--s-5);
  background: linear-gradient(to top,
    rgba(251, 250, 247, 0.97) 15%, rgba(251, 250, 247, 0));
}

.foot__mapaddr {
  max-width: 46ch;
  font-size: var(--t-small);
  line-height: 1.8;
  color: var(--ink-mute);
}

.foot__mapgo {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--t-small);
  font-weight: var(--w-semi);
  color: var(--brand-deep);
}

.foot__mapgo .icon { transition: transform var(--d-mid) var(--e-out); }

[dir='rtl'] .foot__mapgo .icon { transform: scaleX(-1); }

/* ODbL requires this to be shown; it is as quiet as it can be while
   still being legible. */
.foot__osm {
  font-size: 0.68rem;
  line-height: 1.4;
  color: var(--ink-faint);
}

@media (hover: hover) {
  .foot__map:hover {
    border-color: var(--brass-soft);
    box-shadow: 0 34px 70px -40px rgba(14, 42, 51, 0.45);
  }
  .foot__map:hover .foot__mapgo .icon { transform: translateX(3px); }
  [dir='rtl'] .foot__map:hover .foot__mapgo .icon { transform: scaleX(-1) translateX(3px); }
}

/* --- links ------------------------------------------------------------------ */

.foot__nav { margin-block: clamp(2rem, 1.6rem + 1.5vw, 2.5rem) clamp(2.5rem, 2rem + 2vw, 3.5rem); }

.foot__navlist {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--s-2) 0;
}

.foot__navitem { display: flex; align-items: center; }

/* a small brass star between the links, as in the lab */
.foot__navitem + .foot__navitem::before {
  content: '\2726';
  margin-inline: var(--s-4);
  font-size: 0.55rem;
  color: var(--brass);
}

.foot__navlink {
  font-size: 0.97rem;
  font-weight: var(--w-med);
  color: var(--ink-surface);
  text-decoration: none;
  transition: color var(--d-fast) var(--e-out);
}

@media (hover: hover) {
  .foot__navlink:hover { color: var(--brand-deep); }
}

/* --- the closing bar ------------------------------------------------------- */

.foot__bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-3) var(--s-5);
  width: 100%;
  padding-block: var(--s-5);
  border-block-start: 1px solid var(--rule);
}

.foot__rights {
  font-size: var(--t-micro);
  line-height: 1.8;
  color: var(--ink-mute);
}

.foot__lic { margin-block-start: var(--s-4); }

.foot__top {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--t-micro);
  font-weight: var(--w-med);
  color: var(--ink-mute);
  text-decoration: none;
  transition: color var(--d-fast) var(--e-out);
}

.foot__topmark {
  display: grid;
  place-content: center;
  width: 1.9rem;
  height: 1.9rem;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  /* The arrow is drawn pointing inline-end, so -90deg aims it up. Not
     mirrored for RTL: up is up in both scripts. */
  transform: rotate(-90deg);
  transition:
    border-color var(--d-fast) var(--e-out),
    background-color var(--d-fast) var(--e-out),
    color var(--d-fast) var(--e-out);
}

@media (hover: hover) {
  .foot__top:hover { color: var(--ink-surface); }
  .foot__top:hover .foot__topmark {
    color: var(--paper);
    background: var(--ink-surface);
    border-color: var(--ink-surface);
  }
}

/* --- the designer's credit, the page's last line ----------------------- */

.foot__credit {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--s-2);
  width: 100%;
  padding-block: 0 var(--s-5);
  font-size: var(--t-micro);
  color: var(--ink-mute);
}

/* The whole line in the one muted colour and weight, at the owner's
   request. */
.foot__creditlink {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  color: inherit;
  text-decoration: none;
  transition: color var(--d-fast) var(--e-out);
}

.foot__tg { display: block; flex: none; }

@media (hover: hover) {
  .foot__creditlink:hover { color: var(--brand-deep); }
}

/* Two to one on larger screens: wide enough to read as a view of the
   district, held to the centred column. */
@media (min-width: 880px) {
  .foot__map { aspect-ratio: 2 / 1; }
}

@media (max-width: 640px) {
  /* Square on a phone: at 5/4 the address scrim covered the pin. */
  .foot__map { aspect-ratio: 1 / 1; }
  .foot__bar { justify-content: center; text-align: center; }
}


/* == 13  reveal states ===================================================
   Every hide rule below is scoped to .js-anim, which motion.js adds to
   <html> as its very first statement. If the script fails to parse or
   fails to run, the class is never added, none of these rules match, and
   the page renders in full with no animation. The alternative, hiding by
   default and revealing with script, is how a site ends up shipping a
   blank page when one bracket is wrong. */

.js-anim [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity   var(--d-slow) var(--e-soft),
    transform var(--d-slow) var(--e-soft);
}

.js-anim [data-reveal][data-shown='true'] {
  opacity: 1;
  transform: none;
}

.js-anim [data-reveal][data-delay='1'] { transition-delay: 70ms; }
.js-anim [data-reveal][data-delay='2'] { transition-delay: 140ms; }
.js-anim [data-reveal][data-delay='3'] { transition-delay: 210ms; }
.js-anim [data-reveal][data-delay='4'] { transition-delay: 280ms; }
.js-anim [data-reveal][data-delay='5'] { transition-delay: 350ms; }

@media (prefers-reduced-motion: reduce) {
  .js-anim [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .nav__link::after { transition: none; }
}


/* == 14  print =========================================================== */

@media print {
  .hdr, .menu, .skip, .hero__art, .form, .social { display: none !important; }
  body { background: #fff; color: #000; }
  .sec { padding-block: 1.5rem; break-inside: avoid; }
  .foot { background: #fff; color: #000; }
  .foot__rights, .licline { color: #333; }
}
