/* UIE Group — corporate web platform
   Institutional design system. Light/dark polarity, restrained motion.
   No framework runtime, no third-party dependency. */

/* ---------------------------------------------------------------- tokens */

:root {
  --navy: #061f46;
  --navy-2: #0b2e63;
  --rhodium: #c7ccd1;
  --blue: #4e5fe4;
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-soft: #eef1f6;
  --ink: #071b3b;
  --ink-soft: #31405b;
  --muted: #5f6a7d;
  --line: #dce2ec;
  --line-strong: #c9d2e0;
  --focus: #3b4bd0;
  --shadow-card: 0 24px 64px -42px rgba(6, 31, 70, .42);
  --radius: 22px;
  --radius-sm: 12px;
  --page: clamp(20px, 5vw, 72px);
  --max: 1320px;
  --header-h: 72px;
  --display: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --body: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
  color-scheme: light;
}

/* Dark tokens are declared twice on purpose:
   1. system preference, so the correct polarity paints with JavaScript unavailable;
   2. explicit data-theme, so a stored choice always wins. */

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #071026;
    --surface: #0b1632;
    --surface-soft: #101d3f;
    --ink: #f3f5fb;
    --ink-soft: #cbd2e3;
    --muted: #929db7;
    --line: rgba(103, 122, 175, .22);
    --line-strong: rgba(120, 140, 198, .34);
    --focus: #7b8bff;
    --shadow-card: 0 24px 64px -42px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #071026;
  --surface: #0b1632;
  --surface-soft: #101d3f;
  --ink: #f3f5fb;
  --ink-soft: #cbd2e3;
  --muted: #929db7;
  --line: rgba(103, 122, 175, .22);
  --line-strong: rgba(120, 140, 198, .34);
  --focus: #7b8bff;
  --shadow-card: 0 24px 64px -42px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

/* ---------------------------------------------------------------- base */

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 24px); }

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Only animate the polarity change once the user has actually chosen it.
   Without this the first paint of a stored/system theme animates on load. */
html.theme-ready body { transition: background .45s var(--ease), color .45s var(--ease); }

a { color: inherit; text-decoration: none; }
button { color: inherit; font: inherit; background: none; border: 0; }
img, svg { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--display); text-wrap: balance; }
p { text-wrap: pretty; }
::selection { background: var(--navy); color: #fff; }
:root[data-theme="dark"] ::selection { background: var(--blue); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) ::selection { background: var(--blue); }
}
:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: 4px; }

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

.skip-link {
  position: fixed;
  top: 10px; left: 10px;
  z-index: 100;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--bg);
  font-family: var(--display);
  font-size: 13.5px;
  font-weight: 650;
  transform: translateY(-160%);
  transition: transform .2s var(--ease);
}
.skip-link:focus-visible { transform: translateY(0); }

/* ---------------------------------------------------------------- header */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 var(--page);
  transition: background .3s var(--ease), border-color .3s var(--ease), height .3s var(--ease);
}
.site-header.scrolled {
  --header-h: 62px;
  background: var(--bg); /* fallback where color-mix is unsupported */
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 9px;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -.03em;
}
.brand-uie { font-size: 19px; letter-spacing: .06em; }
.brand-group { font-size: 13px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .16em; }
.nav { margin-left: auto; display: flex; align-items: center; gap: clamp(16px, 2.4vw, 34px); }
.nav a { font-size: 13.5px; color: var(--ink-soft); position: relative; padding: 8px 0; }
.nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: 3px; height: 1px; background: currentColor; transition: right .2s var(--ease); }
.nav a:hover::after, .nav a[aria-current="page"]::after { right: 0; }
.nav a[aria-current="page"] { color: var(--ink); }
.header-actions { margin-left: clamp(16px, 2.4vw, 30px); display: flex; gap: 10px; align-items: center; }
.theme-toggle, .menu-toggle {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: transparent;
  display: inline-grid;
  place-items: center;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color .2s var(--ease), color .2s var(--ease);
}
.theme-toggle:hover, .menu-toggle:hover { border-color: var(--line-strong); color: var(--ink); }
.theme-toggle svg, .menu-toggle svg { width: 17px; height: 17px; }
.menu-toggle { display: none; }

/* The toggles do nothing without scripting, so they are not shown until
   the head script confirms scripting is available. */
html.no-js .theme-toggle, html.no-js .menu-toggle { display: none; }

/* ---------------------------------------------------------------- hero */

.hero {
  min-height: 100svh;
  position: relative;
  display: grid;
  align-items: end;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 78% 20%, color-mix(in srgb, var(--blue) 13%, transparent), transparent 34%),
    linear-gradient(to right, color-mix(in srgb, var(--line) 38%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--line) 38%, transparent) 1px, transparent 1px);
  background-size: auto, 72px 72px, 72px 72px;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .7), transparent 88%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .7), transparent 88%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  z-index: 1;
  width: min(var(--max), 100%);
  margin: 0 auto;
  padding: clamp(150px, 19vh, 210px) var(--page) clamp(72px, 10vh, 116px);
}
.hero.short { min-height: 68svh; }
.hero.short .hero-inner { padding-top: clamp(140px, 17vh, 180px); }
.eyebrow {
  font: 500 10px/1.4 var(--mono);
  letter-spacing: .19em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: var(--blue); flex: none; }
.hero h1 {
  margin-top: 26px;
  font-size: clamp(40px, 5.4vw, 78px);
  line-height: 1.0;
  letter-spacing: -.045em;
  font-weight: 600;
  max-width: 19ch;
}
.hero.short h1 { font-size: clamp(36px, 4.4vw, 62px); max-width: 20ch; }
.hero .lede {
  margin-top: 28px;
  color: var(--ink-soft);
  font-size: clamp(17px, 1.4vw, 20px);
  font-weight: 350;
  max-width: 58ch;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

/* ---------------------------------------------------------------- controls */

.btn {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--display);
  font-size: 13.5px;
  font-weight: 650;
  transition: transform .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-secondary { border-color: var(--line-strong); background: var(--surface); }
@supports (background: color-mix(in srgb, red 50%, transparent)) {
  .btn-secondary { background: color-mix(in srgb, var(--surface) 70%, transparent); }
}

/* ---------------------------------------------------------------- sections */

.wrap { width: min(var(--max), 100%); margin: 0 auto; padding: clamp(86px, 11vh, 148px) var(--page); }
.wrap.compact { padding-top: 64px; padding-bottom: 64px; }
.section-head { display: grid; grid-template-columns: minmax(170px, .42fr) minmax(0, 1fr); gap: clamp(28px, 6vw, 96px); align-items: start; margin-bottom: clamp(42px, 6vh, 76px); }
.section-head h2 { font-size: clamp(32px, 4.2vw, 56px); line-height: 1.06; letter-spacing: -.04em; font-weight: 560; max-width: 15ch; }
.section-head h2 + p { margin-top: 24px; }
.section-head p { color: var(--ink-soft); max-width: 54ch; }

.business-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.business-card {
  min-height: 430px;
  display: flex;
  flex-direction: column;
  padding: clamp(28px, 4vw, 50px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  position: relative;
  overflow: hidden;
  transition: border-color .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease);
}
.business-card.solo { max-width: 760px; min-height: 380px; }
a.business-card:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--shadow-card); }
/* A single architectural corner sweep. Sized and offset so the arc only ever
   grazes the bottom-right corner and never crosses the text column. */
.business-card::after {
  content: "";
  position: absolute;
  right: -230px;
  bottom: -230px;
  width: 460px;
  height: 460px;
  border: 1px solid var(--line);
  border-radius: 50%;
  opacity: .55;
  pointer-events: none;
}
/* Label pinned to the top, everything else bottom-aligned, so sibling cards
   share a baseline regardless of how much copy each one carries. */
.card-label { font: 500 10px/1.4 var(--mono); letter-spacing: .17em; text-transform: uppercase; color: var(--muted); margin-bottom: auto; position: relative; z-index: 1; }
.business-card h3 { font-size: clamp(31px, 3.6vw, 46px); line-height: 1.02; letter-spacing: -.04em; font-weight: 580; position: relative; z-index: 1; }
.business-card p { margin-top: 16px; max-width: 40ch; color: var(--ink-soft); position: relative; z-index: 1; }
.card-link, .card-note { margin-top: 28px; display: inline-flex; gap: 10px; align-items: center; font-family: var(--display); font-size: 13.5px; position: relative; z-index: 1; }
.card-link { font-weight: 650; }
.card-note { font-weight: 500; color: var(--muted); font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
/* The arrows are inline SVG, not text: U+2192 and U+2197 are absent from the
   shipped font subsets and would otherwise fall back inconsistently per OS. */
.ext, .arrow { display: inline-flex; align-items: center; flex: none; vertical-align: -0.08em; }
.ext svg { width: 10px; height: 10px; }
.arrow svg { width: 13px; height: 11px; }
.card-link .arrow { transition: transform .2s var(--ease); }
a.business-card:hover .card-link .arrow { transform: translateX(4px); }
.sub-business { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); position: relative; z-index: 1; }
.sub-business strong { display: block; font-family: var(--display); font-size: 17px; }
.sub-business small { color: var(--muted); font-size: 13px; }

.statement { border-block: 1px solid var(--line); background: var(--surface-soft); }
.statement .wrap { padding-top: clamp(72px, 9vh, 110px); padding-bottom: clamp(72px, 9vh, 110px); }
.statement p { font-family: var(--display); font-size: clamp(28px, 3.9vw, 54px); line-height: 1.14; letter-spacing: -.035em; max-width: 22ch; font-weight: 420; }
.statement strong { font-weight: 650; }

.principles { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--line); gap: 1px; }
.principle { background: var(--surface); padding: clamp(26px, 3vw, 38px); min-height: 230px; }
.principle .n { font: 500 10px/1.4 var(--mono); color: var(--muted); letter-spacing: .16em; }
.principle h3 { margin-top: 44px; font-size: 20px; letter-spacing: -.02em; }
.principle p { margin-top: 12px; color: var(--muted); font-size: 14.5px; }

.systems-flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; counter-reset: steps; }
.system-step { border-top: 1px solid var(--line-strong); padding-top: 22px; min-height: 190px; }
.system-step::before { counter-increment: steps; content: "0" counter(steps); font: 500 10px/1 var(--mono); letter-spacing: .14em; color: var(--muted); }
.system-step h3 { margin-top: 36px; font-size: 22px; letter-spacing: -.02em; }
.system-step p { margin-top: 10px; color: var(--muted); font-size: 14.5px; max-width: 34ch; }

/* ---------------------------------------------------------------- registry table */

.registry-scroll {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
  overscroll-behavior-x: contain;
}
.registry-scroll:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.registry { width: 100%; min-width: 560px; border-collapse: collapse; background: var(--surface); text-align: left; }
.registry caption { text-align: left; padding: 0 26px; font: 500 10px/1.4 var(--mono); letter-spacing: .15em; text-transform: uppercase; color: var(--muted); }
.registry caption.visually-hidden { padding: 0; }
.registry th, .registry td { padding: 22px 26px; border-bottom: 1px solid var(--line); vertical-align: top; }
.registry thead th { background: var(--surface-soft); font: 500 10px/1.4 var(--mono); letter-spacing: .15em; text-transform: uppercase; color: var(--muted); }
.registry tbody tr:last-child th, .registry tbody tr:last-child td { border-bottom: 0; }
.registry tbody th { font-family: var(--display); font-weight: 650; font-size: 16px; white-space: nowrap; }
.registry td { color: var(--ink-soft); font-size: 14px; }

/* ---------------------------------------------------------------- prose */

.content-grid { display: grid; grid-template-columns: .78fr 1.22fr; gap: clamp(30px, 7vw, 100px); }
.prose h2 { font-size: clamp(30px, 3.8vw, 48px); line-height: 1.1; letter-spacing: -.035em; }
.prose h3 { margin-top: 34px; font-size: 20px; }
.prose p { margin-top: 18px; color: var(--ink-soft); max-width: 68ch; }
.prose ul { margin: 20px 0 0 1.1em; color: var(--ink-soft); }
.prose li { margin: 8px 0; }
.meta-block { border-top: 1px solid var(--line-strong); padding-top: 18px; }
.meta-block + .meta-block { margin-top: 32px; }
.meta-block .k { font: 500 10px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .16em; color: var(--muted); }
.meta-block p { margin-top: 10px; color: var(--ink-soft); font-size: 14.5px; }
.meta-block .provisional { display: block; margin-top: 6px; color: var(--muted); font-size: 12.5px; }

/* ---------------------------------------------------------------- footer */

.site-footer { border-top: 1px solid var(--line); }
.footer-grid { width: min(var(--max), 100%); margin: 0 auto; padding: 50px var(--page) 36px; display: grid; grid-template-columns: 1.4fr repeat(3, .6fr); gap: 32px; }
.footer-brand p { margin-top: 14px; color: var(--muted); font-size: 13.5px; max-width: 36ch; }
.footer-col h2 { font: 500 10px/1.4 var(--mono); letter-spacing: .15em; text-transform: uppercase; color: var(--muted); }
.footer-col a { display: block; margin-top: 10px; color: var(--ink-soft); font-size: 13.5px; width: fit-content; }
.footer-col a:hover { color: var(--ink); }
.footer-bottom { width: min(var(--max), 100%); margin: 0 auto; padding: 20px var(--page) 36px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- mobile nav */

.mobile-panel { display: none; }

@media (max-width: 900px) {
  .nav { display: none; }
  .menu-toggle { display: inline-grid; }

  /* Without scripting the menu button is hidden, so the links themselves
     have to remain reachable. */
  html.no-js .nav { display: flex; flex-wrap: wrap; gap: 14px 20px; margin-left: auto; justify-content: flex-end; }
  html.no-js .nav a { font-size: 12.5px; padding: 4px 0; }
  html.no-js .site-header { height: auto; min-height: var(--header-h); padding-block: 12px; flex-wrap: wrap; gap: 10px; }

  .mobile-panel.open {
    display: grid;
    position: fixed;
    z-index: 49;
    inset: var(--header-h) 0 auto 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 22px var(--page) 28px;
    gap: 12px;
    max-height: calc(100svh - var(--header-h));
    overflow-y: auto;
  }
  .mobile-panel a { padding: 9px 0; font-family: var(--display); font-size: 18px; color: var(--ink-soft); }
  .mobile-panel a[aria-current="page"] { color: var(--ink); font-weight: 650; }

  .business-grid, .content-grid { grid-template-columns: 1fr; }
  .business-card { min-height: 350px; }
  .business-card.solo { max-width: none; }
  .principles, .systems-flow { grid-template-columns: 1fr; }
  .section-head { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

body.menu-open { overflow: hidden; }

@media (max-width: 580px) {
  :root { --header-h: 64px; }
  .brand { gap: 7px; }
  .brand-uie { font-size: 17px; }
  .brand-group { font-size: 10px; letter-spacing: .14em; }
  .hero h1 { font-size: clamp(38px, 11vw, 52px); }
  .hero.short h1 { font-size: clamp(32px, 9.5vw, 44px); }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; }
}

/* ---------------------------------------------------------------- motion */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ---------------------------------------------------------------- print */

@media print {
  .site-header, .mobile-panel, .skip-link, .header-actions { display: none !important; }
  .hero { min-height: 0; border-bottom: 0; }
  .hero-inner, .wrap { padding-block: 24px; }
  .business-card::after, .hero::before { display: none; }
  body { background: #fff; color: #000; }
}
