/* Rubix Innovations — rubixin.com
   Palette: ballpoint ink on cool paper, with a gold accent. */
:root {
  --paper: #EEF1F6;
  --paper-2: #E2E7F0;
  --ink: #1D2F8C;
  --ink-soft: #3B4FB0;
  --night: #0E1640;
  --text: #1A2142;
  --muted: #4D5676;
  --rule: #C6CEDF;
  --gold: #F2B705;
  --leaf: #1F8A5B;
  --white: #FFFFFF;

  --display: "Bricolage Grotesque Variable", "Bricolage Grotesque", system-ui, sans-serif;
  --body: "Bricolage Grotesque Variable", "Bricolage Grotesque", system-ui, sans-serif;
  --hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3125rem;
  --step-2: 1.75rem;
  --step-3: 2.375rem;
  --step-4: clamp(2.5rem, 5.2vw, 4.25rem);

  --wrap: 72rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.6;
  font-optical-sizing: auto;
}

img, svg { max-width: 100%; display: block; }
a { color: var(--ink); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--night); text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 {
  font-family: var(--display);
  color: var(--night);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  font-weight: 700;
}
h1 { font-size: var(--step-4); font-variation-settings: "wdth" 85; letter-spacing: -0.035em; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); letter-spacing: -0.01em; }
p { margin: 0 0 1em; max-width: 62ch; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.lede { font-size: var(--step-1); line-height: 1.5; color: var(--muted); max-width: 46ch; }
.hand { font-family: var(--hand); font-weight: 600; color: var(--ink); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip-link { position: absolute; left: 1rem; top: -4rem; background: var(--night); color: var(--white); padding: .6rem 1rem; border-radius: 6px; z-index: 100; }
.skip-link:focus { top: 1rem; color: var(--white); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.site-header.scrolled { border-bottom-color: var(--rule); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.25rem; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--night); }
.brand img { width: 34px; height: 34px; }
.brand span { font-family: var(--display); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.02em; line-height: 1; }
.brand small { display: block; font-weight: 500; font-size: .75rem; color: var(--muted); letter-spacing: 0; margin-top: .2rem; }

.nav { display: flex; align-items: center; gap: .25rem; }
.nav a { text-decoration: none; color: var(--text); padding: .5rem .75rem; border-radius: 6px; font-weight: 500; font-size: .98rem; }
.nav a:hover { background: var(--paper-2); color: var(--night); }
.nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); border-radius: 0; }
.nav .btn { margin-left: .5rem; }
.nav-toggle { display: none; background: none; border: 1px solid var(--rule); border-radius: 6px; padding: .5rem .7rem; font: inherit; color: var(--night); cursor: pointer; }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .nav { position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--rule); padding: .5rem var(--gutter) 1rem; display: none; }
  .nav.open { display: flex; }
  .nav a { padding: .8rem .25rem; border-radius: 0; border-bottom: 1px solid var(--paper-2); }
  .nav a[aria-current="page"] { box-shadow: none; font-weight: 700; }
  .nav .btn { margin: .75rem 0 0; text-align: center; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: inherit; font-weight: 600; font-size: 1rem;
  padding: .8rem 1.3rem; border-radius: 6px; border: 2px solid var(--ink);
  background: var(--ink); color: var(--white) !important; text-decoration: none; cursor: pointer;
  transition: background .15s, transform .15s;
}
.btn:hover { background: var(--night); border-color: var(--night); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--ink) !important; }
.btn.ghost:hover { background: var(--ink); color: var(--white) !important; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--night) !important; }
.btn.gold:hover { background: #FFC933; border-color: #FFC933; }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }

/* ---------- Hero with the innovation tree ---------- */
.hero { padding: clamp(2rem, 5vw, 4rem) 0 clamp(2.5rem, 6vw, 5rem); overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
.hero h1 { margin-bottom: .4em; }
.hero .lede { margin-bottom: 0; }
.hero-note { margin-top: 2rem; font-size: var(--step--1); color: var(--muted); max-width: 40ch; }

.tree-stage { position: relative; }
.tree-svg { width: 100%; height: auto; overflow: visible; }
.tree-svg .scribble { fill: none; stroke: var(--ink); stroke-width: 1.1; stroke-linecap: round; opacity: .78; }
.tree-svg .trunk { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.tree-svg .ground { fill: none; stroke: var(--ink); stroke-width: 1.2; opacity: .45; }
.tree-svg .branch-line { stroke: var(--ink); stroke-width: 1.2; fill: none; opacity: .55; transition: opacity .2s, stroke-width .2s; }
.tree-svg .branch-label { font-family: var(--hand); font-size: 25px; font-weight: 600; fill: var(--ink); cursor: pointer; }
.tree-svg .branch { outline: none; }
.tree-svg .branch .hit { fill: transparent; }
.tree-svg .branch:hover .branch-line,
.tree-svg .branch.active .branch-line,
.tree-svg .branch:focus-visible .branch-line { opacity: 1; stroke-width: 2.2; }
.tree-svg .branch.active .branch-label,
.tree-svg .branch:focus-visible .branch-label { fill: var(--night); }
.tree-svg .branch .mark { fill: var(--gold); opacity: 0; transition: opacity .2s; }
.tree-svg .branch.active .mark, .tree-svg .branch:focus-visible .mark { opacity: 1; }
.tree-svg .root-label { font-family: var(--hand); font-size: 24px; font-weight: 600; fill: var(--muted); }
.tree-svg .trunk-text { font-family: var(--hand); font-size: 30px; font-weight: 700; fill: var(--ink); letter-spacing: 1px; }

.tree-panel {
  margin: .5rem auto 0; max-width: 30rem; min-height: 6.5rem;
  border-left: 3px solid var(--gold); padding: .25rem 0 .25rem 1rem;
}
.tree-panel h3 { margin: 0 0 .25rem; font-size: var(--step-1); }
.tree-panel p { margin: 0; color: var(--muted); }

@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .tree-svg .branch-label { font-size: 28px; }
}

/* ---------- Sections ---------- */
.section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }
.section.tint { background: var(--paper-2); }
.section-head { max-width: 44rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head p { color: var(--muted); font-size: var(--step-1); line-height: 1.5; }

/* Growth model: roots → trunk → canopy */
.growth { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 2px solid var(--ink); }
.growth > div { padding: 1.75rem 1.75rem 0 0; }
.growth > div + div { padding-left: 1.75rem; border-left: 1px solid var(--rule); }
.growth .hand { font-size: 2.4rem; line-height: 1; display: block; margin-bottom: .75rem; }
.growth ul { list-style: none; padding: 0; margin: 1rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.growth li { font-size: .9rem; padding: .2rem .65rem; border: 1px solid var(--rule); border-radius: 999px; background: var(--paper); }
@media (max-width: 760px) {
  .growth { grid-template-columns: 1fr; }
  .growth > div, .growth > div + div { padding: 1.5rem 0; border-left: 0; border-bottom: 1px solid var(--rule); }
}

/* Sector index */
.sector-index { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0 2.5rem; }
.sector-index button {
  all: unset; box-sizing: border-box; display: block; width: 100%; cursor: pointer;
  padding: 1rem 0 1.1rem; border-top: 1px solid var(--rule);
}
.sector-index button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.sector-index strong { display: block; font-family: var(--display); font-size: 1.1rem; color: var(--night); font-weight: 650; }
.sector-index span { display: block; color: var(--muted); font-size: .95rem; line-height: 1.5; margin-top: .2rem; }
.sector-index button:hover strong { color: var(--ink); text-decoration: underline; text-underline-offset: .2em; }

/* Offerings */
.offer-filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2rem; }
.offer-filters button {
  font: inherit; font-size: .95rem; padding: .45rem .95rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--rule); background: var(--paper); color: var(--text);
}
.offer-filters button[aria-pressed="true"] { background: var(--night); border-color: var(--night); color: var(--white); }
.offer-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); gap: 1.25rem; }
.offer {
  background: var(--white); border: 1px solid var(--rule); border-radius: 10px;
  padding: 1.5rem; display: flex; flex-direction: column; gap: .6rem;
}
.offer .meta { display: flex; justify-content: space-between; align-items: center; gap: .5rem; font-size: .88rem; color: var(--muted); }
.offer h3 { margin: 0; }
.offer p { color: var(--muted); margin: 0; flex: 1; }
.offer .actions { margin-top: .75rem; }
.offer .actions .btn { padding: .6rem 1rem; font-size: .95rem; }
.status { font-size: .8rem; font-weight: 600; padding: .15rem .6rem; border-radius: 999px; white-space: nowrap; }
.status.available { background: #DDF1E7; color: #145C3C; }
.status.in-development { background: #E3E8FA; color: var(--ink); }
.status.coming-soon { background: #FFF3CC; color: #6B5100; }
.empty { padding: 2rem; border: 1px dashed var(--rule); border-radius: 10px; color: var(--muted); }

/* Partner band */
.band { background: var(--night); color: #DCE2F5; }
.band h2, .band h3 { color: var(--white); }
.band p { color: #B9C2E0; }
.band a:not(.btn) { color: var(--gold); }
.paths { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem; margin-top: 2.5rem; }
.paths > div { border-top: 2px solid var(--gold); padding-top: 1.25rem; }
@media (max-width: 760px) { .paths { grid-template-columns: 1fr; gap: 2rem; } }

/* Split layout (about, partner) */
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.page-hero { padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(2rem, 4vw, 3rem); }
.facts { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.facts li { display: grid; grid-template-columns: 9rem 1fr; gap: 1rem; padding: .9rem 0; border-bottom: 1px solid var(--rule); }
.facts li b { color: var(--night); font-weight: 650; }
@media (max-width: 520px) { .facts li { grid-template-columns: 1fr; gap: .1rem; } }
.prose p { max-width: 62ch; }
.prose h2 { font-size: var(--step-2); margin-top: 2.5rem; }

/* Forms */
.form { display: grid; gap: 1.1rem; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
@media (max-width: 560px) { .form .row { grid-template-columns: 1fr; } }
.field label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: .35rem; color: var(--night); }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--text);
  padding: .75rem .85rem; border: 1px solid #AEB8CF; border-radius: 6px; background: var(--white);
}
.field textarea { min-height: 9rem; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid var(--gold); outline-offset: 0; border-color: var(--ink); }
.hp { position: absolute; left: -9999px; }
.form-status { min-height: 1.5rem; font-weight: 500; margin: 0; }
.form-status.ok { color: var(--leaf); }
.form-status.err { color: #A3261B; }

dialog { border: 0; border-radius: 12px; padding: 2rem; max-width: 28rem; width: calc(100% - 2rem); color: var(--text); background: var(--paper); }
dialog::backdrop { background: rgba(14, 22, 64, .55); }
dialog h3 { margin-top: 0; }
.dialog-close { position: absolute; top: .75rem; right: .75rem; background: none; border: 0; font-size: 1.5rem; cursor: pointer; color: var(--muted); line-height: 1; padding: .25rem .5rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--night); color: #B9C2E0; padding: 3.5rem 0 2rem; font-size: .95rem; }
.site-footer a { color: #DCE2F5; text-decoration: none; }
.site-footer a:hover { color: var(--gold); text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; }
.footer-grid h4 { color: var(--white); font-family: var(--display); font-size: 1rem; margin: 0 0 .75rem; font-weight: 650; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; }
.footer-brand { display: flex; gap: .75rem; align-items: center; margin-bottom: 1rem; }
.footer-brand img { width: 40px; height: 40px; }
.footer-brand b { color: var(--white); font-family: var(--display); font-size: 1.2rem; }
.footer-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,.12); font-size: .88rem; }
.footer-base .hand { color: var(--gold); font-size: 1.35rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > div:first-child { grid-column: 1 / -1; } }

/* 404 */
.notfound { min-height: 60vh; display: grid; place-items: center; text-align: center; }
.notfound p { margin-inline: auto; }

.sketch { margin: 2rem 0 0; }
.sketch img { width: 100%; height: auto; border-radius: 4px; box-shadow: 0 1px 0 var(--rule), 0 18px 40px -24px rgba(14, 22, 64, .45); transform: rotate(-1.2deg); }
.sketch figcaption { font-family: var(--hand); font-size: 1.35rem; color: var(--muted); margin-top: .75rem; }
