/* =============================================================
   MIZAN FORTIS — Family Office & Private Equity Group
   Aesthetic: Warm Heritage × Islamic Geometry
   Author: build per design brief
   ============================================================= */

/* -------------------------------------------------------------
   1. DESIGN TOKENS
   ------------------------------------------------------------- */
:root {
  /* Color — aged materials, not café pastels */
  --ink:        #1C1A17;   /* primary text, dark sections */
  --parchment:  #F0EBE1;   /* primary background */
  --oxide:      #6E3B2A;   /* deep oxidized copper-brown — accent, links */
  --oxide-deep: #5A2E20;   /* hover for oxide on light */
  --brass:      #A8834B;   /* muted brass — mark, rules, small caps */
  --brass-soft: rgba(168, 131, 75, 0.35); /* hairline rules */
  --cypress:    #2E3B34;   /* deep green-black — secondary dark, footer */
  /* Brief lists stone as #8C8578, but that is only 3.08:1 on parchment —
     below WCAG AA for the small metadata it is used for. Darkened to a
     still-muted warm grey that clears AA (4.73:1). */
  --stone:      #6E6757;   /* muted captions, metadata — on LIGHT backgrounds */

  /* On-dark tints for AA contrast */
  --parchment-dim: #D9D2C6; /* body text on dark */
  --brass-light:   #C6A063; /* brass legible on dark */
  --stone-dim:     #ADA699; /* muted metadata on DARK backgrounds (footer) */

  /* Typography */
  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-body:    "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-util:    "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-arabic:  "Amiri", "Source Serif 4", serif;

  /* Fluid type scale */
  --fs-display:  clamp(2.5rem, 6vw, 4.5rem);
  --fs-h1:       clamp(2.2rem, 5vw, 3.6rem);
  --fs-h2:       clamp(1.8rem, 3.4vw, 2.6rem);
  --fs-h3:       clamp(1.35rem, 2vw, 1.7rem);
  --fs-lead:     clamp(1.1rem, 1.6vw, 1.35rem);
  --fs-body:     1.0625rem;
  --fs-eyebrow:  0.75rem;

  /* Spacing */
  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs:  0.75rem;
  --space-s:   1rem;
  --space-m:   1.5rem;
  --space-l:   2.5rem;
  --space-xl:  4rem;
  --space-2xl: 6rem;
  --space-3xl: 8.5rem;

  /* Structure */
  --measure:    68ch;
  --content-max: 1200px;
  --rule:       1px;
  --chamfer:    14px;   /* 45° cut-corner — echoes octagonal geometry */

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur:  480ms;
}

/* -------------------------------------------------------------
   2. RESET & BASE
   ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
  overflow-x: clip; /* contain off-canvas menu without breaking sticky header */
}

body {
  margin: 0;
  overflow-x: clip;
  background: var(--parchment);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* extremely subtle paper grain */
  background-image:
    radial-gradient(rgba(28,26,23,0.018) 1px, transparent 1px);
  background-size: 3px 3px;
}

img, svg { max-width: 100%; display: block; }
img { height: auto; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1.12;
  margin: 0;
  letter-spacing: 0.005em;
}

p { margin: 0 0 var(--space-s); max-width: var(--measure); }

a {
  color: var(--oxide);
  text-decoration: none;
  transition: color 240ms var(--ease);
}
a:hover { color: var(--oxide-deep); }

::selection { background: var(--brass); color: var(--parchment); }

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

/* -------------------------------------------------------------
   3. LAYOUT PRIMITIVES
   ------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 3.5rem);
}

.section { padding-block: clamp(3.5rem, 9vw, var(--space-3xl)); }
.section--tight { padding-block: clamp(2.5rem, 6vw, var(--space-2xl)); }

/* Alternating tone sections build the rhythm */
.section--ink     { background: var(--ink);     color: var(--parchment-dim); }
.section--cypress { background: var(--cypress);  color: var(--parchment-dim); }
.section--ink h1, .section--ink h2, .section--ink h3,
.section--cypress h1, .section--cypress h2, .section--cypress h3 { color: var(--parchment); }

.measure { max-width: var(--measure); }
.center  { margin-inline: auto; text-align: center; }
.center p { margin-inline: auto; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--parchment);
  padding: var(--space-2xs) var(--space-s);
  z-index: 200;
}
.skip-link:focus { left: var(--space-s); top: var(--space-s); }

/* -------------------------------------------------------------
   4. TYPOGRAPHIC DEVICES
   ------------------------------------------------------------- */
.eyebrow {
  font-family: var(--font-util);
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--oxide);
  margin: 0 0 var(--space-m);
  display: block;
}
.section--ink .eyebrow,
.section--cypress .eyebrow { color: var(--brass-light); }

.display { font-size: var(--fs-display); letter-spacing: 0.01em; }
.h1 { font-size: var(--fs-h1); }
.h2 { font-size: var(--fs-h2); }
.h3 { font-size: var(--fs-h3); }

.lead {
  font-size: var(--fs-lead);
  line-height: 1.55;
  color: color-mix(in srgb, var(--ink) 88%, transparent);
}
.section--ink .lead, .section--cypress .lead { color: var(--parchment-dim); }

.stone { color: var(--stone); }
.smallcaps {
  font-family: var(--font-util);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.8rem;
  font-weight: 500;
}

/* Hairline rule with an optional star at center */
.rule {
  border: 0;
  height: var(--rule);
  background: var(--brass-soft);
  margin-block: var(--space-l);
}
.rule-star {
  display: flex;
  align-items: center;
  gap: var(--space-m);
  margin-block: clamp(2.5rem, 6vw, var(--space-2xl));
}
.rule-star::before,
.rule-star::after {
  content: "";
  flex: 1;
  height: var(--rule);
  background: var(--brass-soft);
}
.rule-star svg { width: 20px; height: 20px; flex: none; }
.rule-star img { width: 28px; height: 28px; flex: none; opacity: 0.9; }

/* Quiet text link with left-to-right underline draw */
.link-quiet {
  font-family: var(--font-util);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--oxide);
  display: inline-block;
  position: relative;
  padding-bottom: 3px;
}
.section--ink .link-quiet,
.section--cypress .link-quiet { color: var(--brass-light); }
.link-quiet::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 320ms var(--ease);
}
.link-quiet:hover::after,
.link-quiet:focus-visible::after { transform: scaleX(1); }
.link-quiet .arrow { transition: transform 320ms var(--ease); display: inline-block; }
.link-quiet:hover .arrow { transform: translateX(4px); }

/* -------------------------------------------------------------
   5. HEADER / NAV
   ------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--parchment) 90%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: var(--rule) solid var(--brass-soft);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-m);
  padding-block: var(--space-s);
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--ink);
}
.brand:hover { color: var(--ink); }
.brand__mark { width: 40px; height: 40px; flex: none; }
.brand__name {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 3vw, 2.5rem);
  list-style: none;
  margin: 0; padding: 0;
}
.nav__links a {
  font-family: var(--font-util);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--ink);
  position: relative;
  padding-bottom: 4px;
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--oxide);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 300ms var(--ease);
}
.nav__links a:hover, .nav__links a[aria-current="page"] { color: var(--oxide); }
.nav__links a:hover::after,
.nav__links a[aria-current="page"]::after { transform: scaleX(1); }

.nav__toggle {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  padding: var(--space-2xs);
  color: var(--ink);
}
.nav__toggle svg { width: 26px; height: 26px; }

/* -------------------------------------------------------------
   6. HERO (Home)
   ------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: min(88vh, 780px);
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero__bg {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.hero__bg > * { grid-area: 1 / 1; } /* stack watermark + construction lines */
.hero__mark,
.hero__lines {
  width: min(78vh, 68vw);
  max-width: 680px;
  height: auto;
}
.hero__mark { opacity: 0.16; } /* faint watermark — resting state */
.hero__lines { opacity: 0; }   /* only appears during the load animation */
.hero__inner { position: relative; z-index: 2; }
.hero__headline { max-width: 16ch; margin-bottom: var(--space-m); }
.hero__lead { max-width: 46ch; margin-bottom: var(--space-l); }

/* -------------------------------------------------------------
   7. PHILOSOPHY STRIP
   ------------------------------------------------------------- */
.principles {
  display: grid;
  gap: clamp(1.5rem, 4vw, var(--space-xl));
  grid-template-columns: repeat(3, 1fr);
  text-align: center;
}
.principle {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  line-height: 1.2;
  color: var(--parchment);
}
.principle span { color: var(--brass-light); display: block; font-size: 0.72em; margin-top: var(--space-2xs); }

/* -------------------------------------------------------------
   8. TRIPTYCH — three divisions of equal weight
   ------------------------------------------------------------- */
.triptych {
  display: grid;
  gap: clamp(1.25rem, 3vw, var(--space-l));
  grid-template-columns: repeat(3, 1fr);
}
.division {
  display: flex;
  flex-direction: column;
  padding: var(--space-l) var(--space-m);
  background: color-mix(in srgb, var(--ink) 3%, var(--parchment));
  border: var(--rule) solid var(--brass-soft);
  /* 45° chamfered corners — octagonal echo */
  clip-path: polygon(
    var(--chamfer) 0, 100% 0, 100% calc(100% - var(--chamfer)),
    calc(100% - var(--chamfer)) 100%, 0 100%, 0 var(--chamfer)
  );
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease);
}
.division:hover { transform: translateY(-2px); background: color-mix(in srgb, var(--ink) 5%, var(--parchment)); }
.division__glyph { width: 52px; height: 52px; margin-bottom: var(--space-m); }
.division__glyph path, .division__glyph line, .division__glyph circle { stroke: var(--brass); }
.division h3 { margin-bottom: var(--space-xs); }
.division p { font-size: 0.98rem; color: color-mix(in srgb, var(--ink) 82%, transparent); flex: 1; }
.division .link-quiet { margin-top: var(--space-s); }

/* Division sections on Strategy */
.division-block { scroll-margin-top: 6rem; }
.focus-list {
  list-style: none;
  margin: var(--space-m) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-2xs) var(--space-l);
}
.focus-list li {
  font-family: var(--font-util);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  padding: var(--space-2xs) 0;
  border-top: var(--rule) solid var(--brass-soft);
  color: color-mix(in srgb, var(--ink) 78%, transparent);
}
.section--ink .focus-list li,
.section--cypress .focus-list li { color: var(--parchment-dim); }

/* -------------------------------------------------------------
   9. MANDATE SNAPSHOT — labeled facts, hairline separated
   ------------------------------------------------------------- */
.mandate {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  border-top: var(--rule) solid var(--brass-soft);
}
.mandate__item {
  padding: var(--space-l) var(--space-m);
  border-bottom: var(--rule) solid var(--brass-soft);
  border-right: var(--rule) solid var(--brass-soft);
}
.mandate__label {
  font-family: var(--font-util);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.7rem;
  color: var(--stone);
  margin-bottom: var(--space-2xs);
}
.mandate__value {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.2vw, 1.7rem);
  font-weight: 300;
  line-height: 1.25;
}

/* -------------------------------------------------------------
   10. TWO-COLUMN "BALANCE" LAYOUTS
   ------------------------------------------------------------- */
.balance {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 6vw, var(--space-2xl));
  align-items: start;
}
.balance--aside { grid-template-columns: 0.85fr 1.15fr; }

.value-item { margin-bottom: var(--space-l); }
.value-item h3 { margin-bottom: var(--space-2xs); }
.value-item .num {
  font-family: var(--font-util);
  color: var(--oxide); /* brass fails AA on parchment even for large text */
  letter-spacing: 0.14em;
  font-size: 0.8rem;
  font-weight: 600;
  display: block;
  margin-bottom: var(--space-2xs);
}

/* Process steps — a true sequence, numbered */
.process { counter-reset: step; margin-top: var(--space-l); }
.process__step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-m);
  padding-block: var(--space-m);
  border-top: var(--rule) solid var(--brass-soft);
}
.process__step:last-child { border-bottom: var(--rule) solid var(--brass-soft); }
.process__num {
  counter-increment: step;
  font-family: var(--font-util);
  font-weight: 600;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  color: var(--brass);
  padding-top: 0.35rem;
}
.process__num::before { content: counter(step, decimal-leading-zero); }
.process__step h3 { margin-bottom: var(--space-3xs); }

/* -------------------------------------------------------------
   11. CONTACT FORM
   ------------------------------------------------------------- */
.form { max-width: 640px; }
.field { margin-bottom: var(--space-m); }
.field label {
  display: block;
  font-family: var(--font-util);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--stone);
  margin-bottom: var(--space-2xs);
}
.field input,
.field select,
.field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 2%, var(--parchment));
  border: var(--rule) solid var(--brass-soft);
  padding: var(--space-xs) var(--space-s);
  border-radius: 0;
  transition: border-color 200ms var(--ease), background 200ms var(--ease);
}
.field textarea { min-height: 160px; resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--oxide);
  background: var(--parchment);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-m); }

.btn {
  font-family: var(--font-util);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--parchment);
  background: var(--oxide);
  border: var(--rule) solid var(--oxide);
  padding: var(--space-s) var(--space-l);
  cursor: pointer;
  clip-path: polygon(
    10px 0, 100% 0, 100% calc(100% - 10px),
    calc(100% - 10px) 100%, 0 100%, 0 10px
  );
  transition: background 240ms var(--ease), transform 240ms var(--ease);
}
.btn:hover { background: var(--oxide-deep); transform: translateY(-1px); }

.form__note {
  font-size: 0.9rem;
  color: var(--stone);
  margin-top: var(--space-m);
}
.contact-direct { margin-top: var(--space-xl); }
.contact-direct a { font-family: var(--font-body); }

/* -------------------------------------------------------------
   12. FOOTER
   ------------------------------------------------------------- */
.site-footer { background: var(--cypress); color: var(--parchment-dim); }
.footer__top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: var(--space-l);
  padding-block: var(--space-xl);
}
.footer__brand { display: flex; align-items: center; gap: var(--space-xs); margin-bottom: var(--space-m); }
.footer__brand img { width: 46px; height: 46px; }
.footer__brand .brand__name { color: var(--parchment); }
.footer__col h4 {
  font-family: var(--font-util);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--brass-light);
  font-weight: 600;
  margin-bottom: var(--space-s);
}
.footer__col ul { list-style: none; margin: 0; padding: 0; }
.footer__col li { margin-bottom: var(--space-2xs); }
.footer__col a { color: var(--parchment-dim); font-family: var(--font-util); font-size: 0.85rem; letter-spacing: 0.04em; }
.footer__col a:hover { color: var(--parchment); }
.footer__bottom {
  border-top: var(--rule) solid rgba(168,131,75,0.25);
  padding-block: var(--space-m);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-s) var(--space-l);
  justify-content: space-between;
  align-items: center;
}
.footer__legal { font-size: 0.78rem; color: var(--stone-dim); max-width: 70ch; }
/* Any .stone inside the dark footer uses the on-dark muted tint for AA */
.site-footer .stone { color: var(--stone-dim); }

/* -------------------------------------------------------------
   13. PAGE HEADERS (interior pages)
   ------------------------------------------------------------- */
.page-head { padding-block: clamp(3rem, 8vw, var(--space-2xl)) clamp(2rem, 5vw, var(--space-xl)); }
.page-head .display { max-width: 18ch; margin-bottom: var(--space-m); }
.page-head .lead { max-width: 52ch; }

/* -------------------------------------------------------------
   14. MOTION — reveals + hero draw-in
   Reveals hide ONLY when JS is present (.js on <html>), so the
   site degrades to fully visible content without JavaScript.
   ------------------------------------------------------------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}
.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* Hero load moment: construction lines draw in, then resolve into the mark.
   pathLength="1" normalises every path so one dash rule fits all shapes. */
.hero__lines .draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 1.3s var(--ease) 0.15s forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

/* Lines appear while drawing, then dissolve away */
.hero__lines {
  animation: linesReveal 2.5s var(--ease) forwards;
}
@keyframes linesReveal {
  0%   { opacity: 0; }
  12%  { opacity: 0.5; }
  60%  { opacity: 0.5; }
  100% { opacity: 0; }
}

/* The real mark fades up as the guides dissolve, and remains */
.hero__mark {
  animation: markIn 1100ms var(--ease) 1.3s both;
}
@keyframes markIn {
  from { opacity: 0; }
  to   { opacity: 0.16; }
}

/* Hero content fades up on load. `both` fill = hidden during the
   delay, then settles visible; final state is opacity:1 regardless
   of JS, so above-the-fold copy can never be stranded invisible. */
.hero__inner {
  animation: fadeUp 700ms var(--ease) 0.9s both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

/* -------------------------------------------------------------
   15. RESPONSIVE
   ------------------------------------------------------------- */
@media (max-width: 860px) {
  .nav__toggle { display: inline-flex; }
  .nav__links {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(78vw, 320px);
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: var(--space-l);
    padding: var(--space-2xl) var(--space-xl);
    background: var(--ink);
    transform: translateX(100%);
    transition: transform 360ms var(--ease);
    box-shadow: -20px 0 60px rgba(0,0,0,0.25);
  }
  .nav__links.is-open { transform: none; }
  .nav__links a { color: var(--parchment); font-size: 1rem; }
  .nav__links a::after { background: var(--brass-light); }
  body.nav-open { overflow: hidden; }

  .triptych { grid-template-columns: 1fr; }
  .principles { grid-template-columns: 1fr; gap: var(--space-l); }
  .balance, .balance--aside { grid-template-columns: 1fr; }
  .footer__top { grid-template-columns: 1fr; gap: var(--space-l); }
}

@media (max-width: 560px) {
  .field-row { grid-template-columns: 1fr; }
  .mandate__item { border-right: 0; }
  .footer__bottom { flex-direction: column; align-items: flex-start; }
}

/* Nav scrim */
.nav__scrim {
  position: fixed;
  inset: 0;
  background: rgba(28,26,23,0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 300ms var(--ease), visibility 300ms;
  z-index: 90;
}
.nav__scrim.is-open { opacity: 1; visibility: visible; }
@media (min-width: 861px) { .nav__scrim { display: none; } }

/* -------------------------------------------------------------
   16. REDUCED MOTION
   ------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
  .hero__inner { opacity: 1; transform: none; }
  .hero__mark { opacity: 0.16; transform: none; }
  .hero__lines { opacity: 0; } /* skip the draw-in flourish */
}
