/* Integral Capital Management — site stylesheet
   Tokens mirror the ICM brand book (look book). Keep names in sync. */

@font-face { font-family: "ICM Serif"; src: url("/assets/fonts/ICMSerif-Regular.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "ICM Serif"; src: url("/assets/fonts/ICMSerif-Italic.woff") format("woff"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "ICM Sans"; src: url("/assets/fonts/ICMSans-Regular.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "ICM Sans"; src: url("/assets/fonts/ICMSans-Bold.woff") format("woff"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  /* palette */
  --leman: #0F2C35;
  --leman-deep: #0A1F26;
  --lake: #2F5D66;
  --paper: #F4F5F2;
  --limestone: #E1E5E1;
  --slate: #55636A;
  --glint: #9FC1C3;
  --mist: #B9C8C9;
  --ochre: #8E621C;
  --ochre-light: #D4A657;

  /* roles: light */
  --bg: var(--paper);
  --surface: var(--limestone);
  --fg: var(--leman);
  --muted: var(--slate);
  --rule: #C6CEC9;
  --link: var(--lake);
  --focus: var(--lake);

  --hero-bg: var(--leman);
  --hero-fg: var(--paper);
  --hero-muted: var(--mist);
  --hero-rule: #2A4A53;

  /* type */
  --serif: "ICM Serif", "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", Georgia, serif;
  --sans: "ICM Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --step--1: 0.875rem;                          /* 14  captions, meta */
  --step-0: 1.1875rem;                          /* 19  body serif */
  --step-1: clamp(1.375rem, 1.2rem + 0.6vw, 1.625rem);   /* 22–26  item titles */
  --step-2: clamp(1.75rem, 1.4rem + 1.3vw, 2.375rem);     /* 28–38  section titles */
  --step-3: clamp(2.5rem, 1.5rem + 4.6vw, 5.25rem);       /* 40–84  display */

  /* space */
  --gutter: clamp(1.25rem, 4vw, 4rem);
  --col-gap: clamp(1rem, 2vw, 1.5rem);
  --section: clamp(4.5rem, 9vw, 8.75rem);
  --max: 78rem;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--leman-deep);
    --surface: #10303A;
    --fg: #E8ECEA;
    --muted: var(--mist);
    --rule: #22424B;
    --link: var(--glint);
    --focus: var(--glint);
    --hero-bg: #0C262E;
    --hero-rule: #23434C;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  font-size: var(--step-0);
  line-height: 1.62;
  font-kerning: normal;
  font-variant-numeric: oldstyle-nums proportional-nums;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 1px; }

.skip { position: absolute; left: -999px; top: 0; padding: 0.75rem 1rem; background: var(--paper); color: var(--leman); font-family: var(--sans); z-index: 10; }
.skip:focus { left: var(--gutter); top: 0.75rem; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); }

/* ---------- hero ---------- */
.hero { background: var(--hero-bg); color: var(--hero-fg); overflow: hidden; }
.hero a { color: inherit; }

.masthead { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding-block: clamp(1.25rem, 3vw, 2rem); }
.brand { display: block; color: var(--hero-fg); width: clamp(10.5rem, 18vw, 13.5rem); }
.brand svg { width: 100%; height: auto; }

.nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.25rem clamp(1rem, 2.5vw, 2.25rem); font-family: var(--sans); font-size: 0.9375rem; letter-spacing: 0.01em; }
.nav a { text-decoration: none; color: var(--hero-muted); padding-block: 0.25rem; }
.nav a:hover { color: var(--hero-fg); text-decoration: underline; text-decoration-thickness: 1px; }

.hero-body { padding-top: clamp(3.5rem, 9vw, 8rem); }
.hero h1 {
  grid-column: 1 / span 10;
  margin: 0;
  font-weight: 400;
  font-size: var(--step-3);
  line-height: 1.04;
  letter-spacing: -0.012em;
  max-width: 17ch;
  text-wrap: balance;
}
.lede {
  grid-column: 6 / span 6;
  margin-top: clamp(2rem, 4vw, 3.25rem);
  color: var(--hero-muted);
  font-size: clamp(1.1875rem, 1.05rem + 0.45vw, 1.375rem);
  line-height: 1.55;
  max-width: 34em;
}

.device { margin: clamp(2.5rem, 5vw, 4.5rem) 0 0; }
.device svg { width: 100%; height: auto; aspect-ratio: 1600 / 340; }
.device figcaption {
  font-family: var(--sans);
  font-size: var(--step--1);
  line-height: 1.45;
  color: var(--hero-muted);
  padding-block: 1rem clamp(1.5rem, 3vw, 2.25rem);
  border-top: 1px solid var(--hero-rule);
}
.device figcaption span { display: block; max-width: 46em; }

/* the one orchestrated moment: the curve draws itself, then the area fills */
.sa-curve { stroke-dasharray: 1; stroke-dashoffset: 1; animation: sa-draw 2.6s cubic-bezier(0.55, 0, 0.25, 1) 0.35s forwards; }
.sa-area { opacity: 0; animation: sa-fill 1.4s ease-out 2.2s forwards; }
@keyframes sa-draw { to { stroke-dashoffset: 0; } }
@keyframes sa-fill { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .sa-curve { animation: none; stroke-dashoffset: 0; }
  .sa-area { animation: none; opacity: 1; }
}

/* ---------- sections ---------- */
.section { padding-block: var(--section); border-top: 1px solid var(--rule); }
.section:first-of-type { border-top: 0; }
.section-title {
  grid-column: 1 / span 4;
  margin: 0;
  font-weight: 400;
  font-size: var(--step-2);
  line-height: 1.15;
  letter-spacing: -0.005em;
}
.section-body { grid-column: 5 / span 8; }
.section-intro { font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem); line-height: 1.5; max-width: 30em; margin-bottom: clamp(2.5rem, 5vw, 4rem); }

/* the name */
.meanings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(2rem, 4vw, 3.5rem); }
.meaning h3 { margin: 0 0 0.75rem; font-weight: 400; font-size: var(--step-1); line-height: 1.2; }
.meaning p { max-width: 32em; }

.formulae { margin: clamp(3rem, 6vw, 4.5rem) 0 0; padding-top: clamp(2rem, 4vw, 2.75rem); border-top: 1px solid var(--rule); }
.formulae .eq { display: flex; flex-wrap: wrap; gap: clamp(1.5rem, 4vw, 4.5rem); align-items: center; color: var(--fg); }
.formulae .eq svg { height: clamp(2.6rem, 2rem + 1.6vw, 3.6rem); width: auto; }
.formulae figcaption { margin-top: 1.25rem; font-family: var(--sans); font-size: var(--step--1); line-height: 1.5; color: var(--muted); max-width: 44em; }
.formulae figcaption i, .formulae figcaption .num { font-family: var(--serif); font-size: 1.08em; font-variant-numeric: lining-nums; }

/* activities */
.activities { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.activity { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 5fr); column-gap: var(--col-gap); padding-block: clamp(1.5rem, 3vw, 2.25rem); border-bottom: 1px solid var(--rule); }
.activity h3 { margin: 0; font-weight: 400; font-size: var(--step-1); line-height: 1.25; }
.activity p { max-width: 34em; }
.activity.past h3, .activity.past p { color: var(--muted); }
.tag { display: inline-block; margin-top: 0.5rem; font-family: var(--sans); font-size: 0.8125rem; letter-spacing: 0.01em; color: var(--muted); border: 1px solid var(--rule); padding: 0.1rem 0.5rem; border-radius: 2px; }

/* offices */
.offices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(2rem, 4vw, 3.5rem); margin-bottom: clamp(3rem, 6vw, 4.5rem); }
.office h3 { margin: 0; font-weight: 400; font-size: var(--step-1); line-height: 1.2; }
.office .role { margin: 0.25rem 0 1rem; font-family: var(--sans); font-size: var(--step--1); color: var(--muted); }
.office address { font-style: normal; font-variant-numeric: lining-nums; }
.contact { padding-top: clamp(2rem, 4vw, 2.75rem); border-top: 1px solid var(--rule); }
.contact .mail { font-size: var(--step-1); line-height: 1.3; overflow-wrap: anywhere; }

/* ---------- footer ---------- */
.footer { background: var(--hero-bg); color: var(--hero-muted); font-family: var(--sans); font-size: var(--step--1); line-height: 1.55; }
.footer .wrap { padding-block: clamp(2.5rem, 5vw, 3.75rem); }
.footer-mark { grid-column: 1 / span 3; color: var(--hero-fg); width: 2.25rem; }
.footer-mark svg { width: 100%; height: auto; }
.footer-text { grid-column: 4 / span 7; max-width: 52em; }
.footer-links { grid-column: 11 / span 2; display: flex; flex-direction: column; gap: 0.35rem; align-items: flex-start; }
.footer a { color: var(--hero-fg); }

/* ---------- legal page ---------- */
.page-head { padding-block: clamp(3rem, 7vw, 6rem) clamp(2.5rem, 5vw, 4rem); }
.page-head h1 { grid-column: 1 / span 10; margin: 0; font-weight: 400; font-size: clamp(2.25rem, 1.6rem + 2.8vw, 3.75rem); line-height: 1.08; }
.prose { grid-column: 5 / span 7; }
.prose h2 { margin: 2.75rem 0 0.75rem; font-weight: 400; font-size: var(--step-1); line-height: 1.25; }
.prose h2:first-child { margin-top: 0; }
.prose ul { padding-left: 1.2em; margin: 0 0 1em; }
.prose li { margin-bottom: 0.4em; }
.prose .note { font-family: var(--sans); font-size: var(--step--1); color: var(--muted); }

/* ---------- full-height opening (v2) ---------- */
.hero-full { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; }
.hero-full .hero-body { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; padding-top: clamp(4rem, 10vh, 8rem); padding-bottom: clamp(2.5rem, 6vh, 4.5rem); }
.hero-full h1 { max-width: 21ch; font-size: clamp(2.5rem, 1.4rem + 4vw, 4.75rem); }
.hero-full .lede { margin-top: clamp(1.25rem, 2.5vw, 2rem); max-width: 30em; }
.hero-full .device { margin: 0; }
.hero-full .device svg { aspect-ratio: auto; height: clamp(7.5rem, 22vh, 14rem); }

.about p { font-size: clamp(1.25rem, 1.1rem + 0.55vw, 1.5rem); line-height: 1.5; max-width: 32em; margin-bottom: 0.9em; }
.about p:last-child { color: var(--muted); font-size: var(--step-0); margin-bottom: 0; }

.areas { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: clamp(2rem, 5vw, 4rem); }
.area-group h3, .principle h3 { margin: 0 0 1rem; font-family: var(--sans); font-weight: 400; font-size: var(--step--1); letter-spacing: 0.01em; color: var(--muted); }
.area-group ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.area-group li { font-size: var(--step-1); line-height: 1.25; padding-block: 1rem; border-bottom: 1px solid var(--rule); }

.principles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.5rem, 3vw, 2.5rem); }
.principle { border-top: 1px solid var(--rule); padding-top: 1.25rem; }
.principle h3 { font-family: var(--serif); font-size: var(--step-1); line-height: 1.2; color: var(--fg); margin-bottom: 0.6rem; }
.principle p { color: var(--muted); max-width: 22em; }

#contact .offices { margin-bottom: clamp(2rem, 4vw, 3rem); }
#contact .mail { font-size: var(--step-1); line-height: 1.3; padding-top: clamp(1.5rem, 3vw, 2rem); border-top: 1px solid var(--rule); overflow-wrap: anywhere; }

/* ---------- responsive ---------- */
@media (max-width: 60rem) {
  .principles { grid-template-columns: 1fr; }
  .hero h1 { grid-column: 1 / -1; }
  .lede { grid-column: 3 / -1; }
  .section-title { grid-column: 1 / -1; margin-bottom: 2rem; }
  .section-body, .prose { grid-column: 1 / -1; }
  .footer-mark { grid-column: 1 / -1; margin-bottom: 1.25rem; }
  .footer-text { grid-column: 1 / span 9; }
  .footer-links { grid-column: 10 / span 3; }
}
@media (max-width: 40rem) {
  .device svg { aspect-ratio: auto; height: 9.5rem; }
  .areas, .principles { grid-template-columns: 1fr; }
  .masthead { flex-direction: column; align-items: flex-start; }
  .nav { justify-content: flex-start; }
  .lede { grid-column: 1 / -1; }
  .meanings, .offices { grid-template-columns: 1fr; }
  .activity { grid-template-columns: 1fr; row-gap: 0.6rem; }
  .footer-text, .footer-links { grid-column: 1 / -1; }
  .footer-links { margin-top: 1.25rem; flex-direction: row; gap: 1.25rem; }
}

@media print {
  .hero, .footer { background: none; color: #000; }
  .nav, .device, .skip { display: none; }
  .section { padding-block: 1.5rem; }
}
