/* Upstream Group one-pager. One narrow column: language switch, intro, the core as two
   stacked layers (services on top of infrastructure), the brand tiles, the company line. */

@font-face { font-family: 'Space Grotesk'; src: url('../fonts/space-grotesk-500.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Space Grotesk'; src: url('../fonts/space-grotesk-700.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Instrument Sans'; src: url('../fonts/instrument-sans.woff2') format('woff2'); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('../fonts/jetbrains-mono-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('../fonts/jetbrains-mono-500.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --ink: #142231;
  --muted: #5a6878;
  --line: #dde3ea;
  --accent: #1d5f99;
  --on-accent: #ffffff;
  --plate: #ffffff;
  --plate-line: #e4e8ee;
  --base-layer: #f9fafb;
  --display: 'Space Grotesk', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
  --body: 'Instrument Sans', 'Helvetica Neue', Arial, system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0d151e; --surface: #142030; --ink: #e8edf2; --muted: #98a6b5;
    --line: #233245; --accent: #7db4e6; --on-accent: #0d151e;
    --plate: #f4f6f8; --plate-line: #233245; --base-layer: #111b28;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }

.skip-link { position: absolute; left: -9999px; top: 8px; background: var(--surface); color: var(--ink); padding: 8px 12px; border-radius: 8px; }
.skip-link:focus { left: 16px; z-index: 10; }

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 24px 40px;
  display: grid;
  gap: 32px;
}
main { display: grid; gap: 56px; }

/* Language switch */
.topbar { display: flex; justify-content: flex-end; }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; background: var(--surface); }
.lang a {
  font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.06em;
  color: var(--muted); text-decoration: none;
  padding: 5px 11px; border-radius: 999px;
}
.lang a:hover { color: var(--ink); }
.lang a[aria-current="true"] { background: var(--accent); color: var(--on-accent); }
.lang a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Intro */
.intro-block { display: grid; gap: 18px; max-width: 640px; }
.group-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}
.group-name span { color: var(--accent); }
.intro { margin: 0; color: var(--muted); font-size: 1.125rem; max-width: 60ch; }
.intro-block p { margin: 0; }

.section-label {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
}

/* Brand rows and tiles share one anatomy */
.brand {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  color: inherit;
  text-decoration: none;
}
.plate {
  width: 64px; height: 64px;
  border-radius: 14px;
  background: var(--plate);
  border: 1px solid var(--plate-line);
  display: grid; place-items: center;
  overflow: hidden;
}
.plate img { width: 40px; height: 40px; display: block; }
.plate.full img { width: 100%; height: 100%; }
.brand-text { display: grid; gap: 6px; min-width: 0; }
.brand h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.3rem;
  line-height: 1.15;
  margin: 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
}
.brand p { margin: 0; color: var(--muted); max-width: 52ch; }
.domain {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
  display: inline-flex; gap: 6px; align-items: center;
  margin-top: 4px;
}
.domain .arrow { transition: transform .2s ease; }
.brand:hover .domain .arrow, .brand:focus-visible .domain .arrow, a.domain:hover .arrow { transform: translateX(3px); }
.brand:focus-visible, a.domain:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: 12px; }
.badge {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  color: var(--accent);
}

/* Core: two layers stacked, services on top of infrastructure */
.core {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}
.layer { padding: 28px; display: grid; gap: 14px; }
.layer + .layer { border-top: 1px dashed var(--line); }
.layer-infra { background: var(--base-layer); }
.layer-tag {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.layer-row { display: grid; gap: 24px; }
.layer-row.pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Other brands */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  transition: border-color .2s ease;
}
.tile:hover { border-color: var(--accent); }

footer {
  border-top: 1px solid var(--line);
  padding-top: 24px;
  display: flex; flex-wrap: wrap; gap: 8px 28px;
  color: var(--muted);
  font-size: 0.9rem;
}
footer strong { color: var(--ink); font-weight: 600; }

@media (max-width: 680px) {
  .wrap { padding-block: 16px 32px; }
  main { gap: 40px; }
  .grid, .layer-row.pair { grid-template-columns: minmax(0, 1fr); }
  .layer, .tile { padding: 22px; }
  .brand { grid-template-columns: 52px minmax(0, 1fr); gap: 14px; }
  .plate { width: 52px; height: 52px; border-radius: 12px; }
  .plate img { width: 32px; height: 32px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
