/* ==========================================================================
   kylen.vc — styles
   Palette & tokens live in :root. Branch accent colours are set per branch
   via [data-key] further down.
   ========================================================================== */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/assets/fonts/inter-latin-var.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #1c302e;
  --sub: #536f69;
  --subtle: #5f756d;      /* AA on page background */
  --label: #3f7a6c;       /* teal small-caps labels, AA */
  --line: rgba(91, 132, 117, .19);
  --accent: #22715f;
  --bg: #f7faf8;

  --tone-levl: #83d7bc;
  --tone-agi: #9ab5e4;
  --tone-fair: #e3ca86;
  --tone-human: #d5addd;

  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-feature-settings: "cv11", "ss01";
  background: var(--bg);
  min-width: 320px;
  line-height: 1.54;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  overflow-x: hidden;
}
button, a { font: inherit; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
a:focus-visible, button:focus-visible { outline: 3px solid #2e9e90; outline-offset: 3px; }
::selection { background: rgba(123, 227, 186, .4); }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 10;
  background: #14312f; color: #fff; padding: 10px 16px; border-radius: 99px;
  font-size: 13px; font-weight: 700; transition: top .2s;
}
.skip-link:focus { top: 12px; }

/* ---------- Layout & background ---------- */
.page { width: min(1250px, calc(100% - 72px)); margin-inline: auto; position: relative; z-index: 2; }
.background { pointer-events: none; position: absolute; inset: 0 0 auto; height: 1200px; overflow: hidden; z-index: 0; }
.background::before {
  content: ""; position: absolute; left: -20%; top: -260px; width: 85vw; height: 700px;
  background:
    radial-gradient(ellipse 43% 35% at 70% 55%, rgba(176, 239, 216, .31), transparent 96%),
    radial-gradient(ellipse 31% 33% at 50% 37%, rgba(193, 218, 251, .35), transparent 96%),
    radial-gradient(ellipse 22% 38% at 90% 75%, rgba(232, 195, 230, .34), transparent 96%);
  filter: blur(17px);
}
.background::after {
  content: ""; position: absolute; right: -17%; top: 350px; width: 74vw; height: 700px;
  background:
    radial-gradient(ellipse 38% 36% at 65% 50%, rgba(231, 205, 238, .28), transparent 96%),
    radial-gradient(ellipse 48% 50% at 25% 40%, rgba(248, 222, 167, .18), transparent 92%),
    radial-gradient(ellipse 40% 40% at 30% 75%, rgba(176, 232, 237, .29), transparent 95%);
  filter: blur(14px);
}

/* ---------- Header ---------- */
.sitehead { height: 78px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.brand { font-size: 24px; letter-spacing: -.07em; font-weight: 800; }
.brand em { color: #4f8a7c; font-style: normal; }
.nav { display: flex; align-items: center; gap: 24px; font-size: 13px; font-weight: 650; color: #3f5f58; }
.nav a { transition: color .2s; }
.nav a:hover { color: #067d72; }
.nav .link { border: 1px solid rgba(83, 123, 107, .28); border-radius: 100px; padding: 9px 15px; background: rgba(255, 255, 255, .5); transition: background .2s, border-color .2s, color .2s; }
.nav .link:hover { background: #fff; border-color: rgba(39, 124, 108, .45); }

/* ---------- Intro ---------- */
.intro { padding: 48px 0 40px; text-align: center; }
.kicker { color: var(--label); letter-spacing: .17em; text-transform: uppercase; font-size: 11px; font-weight: 800; }
.intro h1 { font-weight: 730; font-size: clamp(37px, 4.6vw, 62px); letter-spacing: -.055em; line-height: 1.13; margin: 16px 0 14px; text-wrap: balance; }
.intro h1 .gradient {
  background: linear-gradient(95deg, #258d77 5%, #5185ae 48%, #ab83af 87%, #5185ae 120%);
  background-size: 140% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: drift 14s ease-in-out infinite alternate;
}
@keyframes drift { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
.intro .lead { max-width: 700px; color: var(--sub); margin: 0 auto; font-size: 17px; line-height: 1.6; text-wrap: pretty; }
.intro .byline { margin: 16px auto 0; color: var(--subtle); font-size: 13px; }

/* ---------- Network map ---------- */
.map {
  position: relative; border: 1px solid rgba(142, 188, 177, .37); background: rgba(255, 255, 255, .43);
  border-radius: 30px; box-shadow: 0 26px 100px rgba(32, 93, 75, .06);
  padding: 38px 30px 26px; isolation: isolate; overflow: hidden; scroll-margin-top: 16px;
}
.map::before {
  content: ""; position: absolute; z-index: -1; inset: -150px -20% auto; height: 450px;
  background:
    radial-gradient(ellipse 28% 50% at 34% 39%, rgba(166, 245, 219, .19), transparent 100%),
    radial-gradient(ellipse 25% 40% at 66% 25%, rgba(181, 212, 250, .24), transparent 95%),
    radial-gradient(ellipse 25% 50% at 59% 70%, rgba(234, 204, 232, .21), transparent 96%);
}
.topline { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 0 0 20px; color: var(--label); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.topline h2 { font: inherit; letter-spacing: inherit; margin: 0; color: inherit; }
.topline .hint { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 12px; color: var(--subtle); }

/* Root: HyperAbundance */
.root {
  position: relative; margin: 0 auto; width: min(100%, 890px); padding: 32px 36px 28px; text-align: center;
  background: linear-gradient(109deg, rgba(222, 252, 239, .76), rgba(234, 245, 255, .84) 49%, rgba(251, 232, 240, .81) 78%, rgba(255, 246, 223, .74));
  border: 1px solid rgba(139, 192, 180, .48); border-radius: 24px;
  box-shadow: 0 16px 50px rgba(77, 142, 129, .075), inset 0 1px 0 rgba(255, 255, 255, .88);
}
.root .over { font-size: 11px; font-weight: 800; letter-spacing: .21em; text-transform: uppercase; color: #376e60; margin: 0; }
.root h2 { font-size: clamp(33px, 4.2vw, 51px); line-height: 1.12; letter-spacing: -.055em; margin: 8px 0 6px; font-weight: 800; }
.root .tag { font-size: 18px; font-weight: 550; color: #3a6359; margin: 0 0 14px; }
.root .description { max-width: 720px; margin: 0 auto; font-size: 15px; line-height: 1.7; color: #4b6a62; text-wrap: pretty; }
.root .principles { margin: 20px auto 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 7px; }
.root .principles li { border: 1px solid rgba(92, 152, 137, .28); border-radius: 100px; background: rgba(255, 255, 255, .55); padding: 5px 11px; font-size: 11.5px; color: #33685d; font-weight: 700; }
.root .principles .warn { color: #7a5f3c; background: rgba(255, 249, 229, .75); border-color: rgba(210, 182, 122, .35); }

/* Connector lines (decorative) */
.connector { position: relative; height: 67px; }
.connector span { position: absolute; display: block; }
.connector .trunk { width: 1px; background: linear-gradient(#a2c6b9, #8dafaa); height: 31px; left: 50%; top: 0; }
.connector .rail { top: 30px; left: 12.5%; right: 12.5%; height: 1px; background: linear-gradient(90deg, rgba(107, 175, 156, .62), rgba(105, 155, 191, .52), rgba(202, 155, 208, .47), rgba(213, 179, 128, .5)); }
.connector .drop { top: 30px; height: 37px; width: 1px; background: #a0bbb1; }
.connector .drop::after { content: ""; position: absolute; bottom: 0; left: -3px; width: 7px; height: 7px; border-bottom: 1.5px solid #8caaa1; border-right: 1.5px solid #8caaa1; transform: rotate(45deg); }
.connector .d1 { left: 12.5%; } .connector .d2 { left: 37.5%; } .connector .d3 { left: 62.5%; } .connector .d4 { left: 87.5%; }

/* Branch cards */
.nodes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; position: relative; }
.branch { margin: 0; font-size: inherit; font-weight: inherit; display: flex; }
.branch[data-key="levl"]  { --tone: var(--tone-levl); }
.branch[data-key="agi"]   { --tone: var(--tone-agi); }
.branch[data-key="fair"]  { --tone: var(--tone-fair); }
.branch[data-key="human"] { --tone: var(--tone-human); }

.node {
  width: 100%; min-height: 200px; text-align: left; display: flex; flex-direction: column; position: relative;
  padding: 21px 20px 19px; border: 1px solid rgba(154, 181, 171, .42); border-radius: 19px;
  /* 3px tone bar along the top, clipped by the radius */
  background: linear-gradient(var(--tone), var(--tone)) top / 100% 3px no-repeat, rgba(255, 255, 255, .8);
  box-shadow: 0 7px 19px rgba(32, 68, 56, .022);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s, background-color .25s;
  color: #203d34;
}
@media (hover: hover) {
  .node:hover { transform: translateY(-3px); box-shadow: 0 13px 35px rgba(63, 112, 101, .09); border-color: color-mix(in srgb, var(--tone) 70%, #9ab5ab); }
}
.node[aria-expanded="true"] {
  border-color: var(--tone);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tone) 22%, transparent), 0 13px 35px rgba(63, 112, 101, .11);
  background-color: #fff;
}
.node .index { font-size: 11px; letter-spacing: .14em; font-weight: 800; color: var(--subtle); }
.node .title { display: block; font-size: 23px; font-weight: 750; letter-spacing: -.045em; margin: 14px 0 5px; line-height: 1.1; }
.node .promise { display: block; font-weight: 650; font-size: 14px; color: #2f5a4e; margin-bottom: 6px; }
.node .topic { display: block; font-size: 13px; color: var(--subtle); line-height: 1.5; }
.node .action { font-size: 12px; color: var(--accent); font-weight: 750; margin-top: auto; padding-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plus { position: relative; width: 14px; height: 14px; flex: none; }
.plus::before, .plus::after { content: ""; position: absolute; left: 0; top: 6px; width: 14px; height: 1.75px; border-radius: 2px; background: currentColor; transition: transform .25s var(--ease); }
.plus::after { transform: rotate(90deg); }
.node[aria-expanded="true"] .plus::after { transform: rotate(0deg); }

/* Expanded detail panel */
.detail {
  grid-column: 1 / -1; position: relative;
  border: 1px solid color-mix(in srgb, var(--tone, #bed9cf) 55%, #bed9cf); border-radius: 19px;
  background: linear-gradient(108deg, rgba(247, 255, 250, .97), rgba(252, 250, 255, .98));
  padding: 26px 30px 26px; box-shadow: 0 12px 35px rgba(68, 123, 104, .06);
  animation: rise .3s var(--ease);
}
.detail[hidden] { display: none; }
.detail[data-key="levl"]  { --tone: var(--tone-levl); }
.detail[data-key="agi"]   { --tone: var(--tone-agi); }
.detail[data-key="fair"]  { --tone: var(--tone-fair); }
.detail[data-key="human"] { --tone: var(--tone-human); }
/* small notch pointing at the open card (position set by main.js) */
.detail::before {
  content: ""; position: absolute; top: -7px; left: var(--notch-x, 50%); width: 12px; height: 12px; margin-left: -6px;
  background: rgb(248, 254, 251); border-left: 1px solid color-mix(in srgb, var(--tone, #bed9cf) 55%, #bed9cf); border-top: 1px solid color-mix(in srgb, var(--tone, #bed9cf) 55%, #bed9cf);
  transform: rotate(45deg); border-top-left-radius: 3px;
}
.detail .detailheader { display: flex; gap: 14px; justify-content: space-between; align-items: flex-start; }
.detail .label { font-size: 11px; letter-spacing: .15em; text-transform: uppercase; color: var(--label); font-weight: 800; margin: 0; }
.detail h4 { font-size: 25px; letter-spacing: -.04em; line-height: 1.2; margin: 4px 0 0; }
.detail .close {
  border: 0; background: #e7f1ed; color: #3f6559; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; flex: none; transition: background .2s;
}
.detail .close:hover { background: #d9eae3; }
.detail .close svg { width: 14px; height: 14px; }
.detailcontent { margin-top: 14px; display: grid; grid-template-columns: 1.3fr 1fr; gap: 44px; }
.detail p { color: #4b6a61; font-size: 15px; line-height: 1.72; margin: 0 0 10px; }
.detail .big { font-size: 17px; color: #2a5145; font-weight: 620; line-height: 1.5; }
.detail h5 { margin: 0 0 6px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--label); font-weight: 800; }
.detail .rel { border-left: 1px solid rgba(106, 165, 142, .22); padding-left: 24px; }
.detail .links { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.detail .links a { font-size: 13px; font-weight: 700; padding: 10px 15px; border-radius: 99px; background: #e4f3ec; color: #245f4e; display: inline-flex; gap: 6px; transition: background .2s, filter .2s; }
.detail .links a:first-child { background: #234a3e; color: #fff; }
.detail .links a:hover { filter: brightness(.94); }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.socials { display: flex; flex-wrap: wrap; gap: 7px; list-style: none; margin: 14px 0 0; padding: 0; }
.socials a {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  color: #3f6559; background: rgba(255, 255, 255, .7); border: 1px solid rgba(92, 152, 137, .26);
  transition: color .2s, background .2s, border-color .2s, transform .2s var(--ease);
}
.socials a:hover { color: #14312f; background: #fff; border-color: var(--tone, #9ab5ab); transform: translateY(-1px); }
.socials svg { width: 16px; height: 16px; fill: currentColor; }
@keyframes rise { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.belowmap { text-align: center; font-size: 12.5px; color: var(--subtle); padding-top: 14px; margin: 0; }

/* ---------- Invest ---------- */
.invest {
  margin: 32px 0 44px; background: #14312f; color: #f0fff9; border-radius: 24px; padding: 34px 40px;
  position: relative; overflow: hidden; isolation: isolate; display: flex; align-items: center; justify-content: space-between; gap: 32px;
  scroll-margin-top: 16px;
}
.invest::before {
  content: ""; position: absolute; z-index: -1; right: -70px; top: -150px; width: 440px; height: 390px;
  background: radial-gradient(circle at 51% 53%, rgba(117, 224, 187, .36), rgba(129, 168, 240, .27) 34%, rgba(219, 172, 230, .16) 53%, transparent 71%);
  filter: blur(17px);
}
.invest .kicker { color: #a3d7bc; }
.invest h2 { font-weight: 730; line-height: 1.17; letter-spacing: -.05em; font-size: clamp(27px, 3vw, 37px); margin: 10px 0; text-wrap: balance; }
.invest p { font-size: 15px; color: #bbd4ca; max-width: 720px; margin: 0; line-height: 1.7; }
.invest .ctas { display: flex; flex-direction: column; gap: 10px; flex: none; }
.invest .ctas a {
  border: 1px solid rgba(183, 227, 208, .42); color: #ebfff8; background: rgba(255, 255, 255, .05);
  font-size: 13px; font-weight: 750; padding: 13px 20px; border-radius: 100px; white-space: nowrap; text-align: center;
  transition: background .2s, border-color .2s;
}
.invest .ctas a:hover { background: rgba(255, 255, 255, .14); }
.invest .ctas a.primary { background: #ecfff7; color: #14312f; border-color: #ecfff7; }
.invest .ctas a.primary:hover { background: #fff; }

/* ---------- Footer ---------- */
.footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); padding: 18px 0 28px; color: var(--subtle); font-size: 12.5px; }
.footer .footerbrand { font-weight: 800; color: #3f6c60; }

/* ==========================================================================
   Tablet
   ========================================================================== */
@media (max-width: 950px) {
  .page { width: min(1250px, calc(100% - 48px)); }
  .nodes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .connector { height: 56px; }
  .connector .trunk { height: 27px; }
  .connector .rail { left: 25%; right: 25%; top: 26px; }
  .connector .drop { top: 26px; height: 30px; }
  .connector .d1 { left: 25%; } .connector .d2 { left: 75%; }
  .connector .d3, .connector .d4 { display: none; }
  .node { min-height: 168px; }
  .map { padding: 28px 22px 24px; }
  .invest { flex-direction: column; align-items: flex-start; }
  .invest .ctas { flex-direction: row; flex-wrap: wrap; }
}

/* ==========================================================================
   Mobile — cards stack on a vertical "spine" so the network reads as a tree
   ========================================================================== */
@media (max-width: 620px) {
  .page { width: calc(100% - 32px); }
  .sitehead { height: 64px; }
  .brand { font-size: 22px; }
  .nav { gap: 10px; }
  .nav .hide { display: none; }
  .nav .link { padding: 8px 13px; }
  .intro { padding: 40px 0 32px; }
  .intro .kicker { font-size: 10.5px; letter-spacing: .1em; }
  .intro h1 { font-size: clamp(32px, 8.6vw, 45px); margin-top: 14px; }
  .intro .lead { font-size: 15.5px; }
  .map { border-radius: 23px; padding: 20px 14px 18px; }
  .topline .hint { display: none; }
  .root { padding: 26px 18px 22px; border-radius: 18px; }
  .root h2 { font-size: 35px; }
  .root .tag { font-size: 16px; }
  .root .description { font-size: 14px; }
  .root .principles { gap: 6px; }
  .root .principles li { font-size: 11px; padding: 4px 9px; }

  /* trunk → short rail to the left → spine */
  .connector { height: 22px; }
  .connector .trunk { height: 12px; }
  .connector .rail { top: 12px; left: 7px; right: 50%; background: linear-gradient(90deg, rgba(107, 175, 156, .62), #a2c6b9); }
  .connector .d1 { left: 7px; top: 12px; height: 10px; }
  .connector .d1::after, .connector .d2 { display: none; }

  .nodes { grid-template-columns: 1fr; gap: 9px; padding-left: 22px; }
  .nodes::before {
    content: ""; position: absolute; left: 7px; top: 0; bottom: 48px; width: 1px;
    background: linear-gradient(#a2c6b9, rgba(105, 155, 191, .55) 40%, rgba(202, 155, 208, .5) 70%, rgba(213, 179, 128, .45));
  }
  .branch { position: relative; }
  .branch::before { /* tick from spine to card */
    content: ""; position: absolute; left: -15px; top: 31px; width: 15px; height: 1px; background: #b5cdc4;
  }
  .branch::after { /* node dot on the spine */
    content: ""; position: absolute; left: -19px; top: 28px; width: 7px; height: 7px; border-radius: 50%;
    background: var(--tone); box-shadow: 0 0 0 3px var(--bg);
  }
  .node { min-height: 0; padding: 15px 52px 16px 16px; border-radius: 15px; }
  .node .title { font-size: 21px; margin: 8px 0 2px; }
  .node .promise { font-size: 14px; margin-bottom: 2px; }
  .node .topic { font-size: 13px; }
  .node .action { position: absolute; right: 18px; top: 50%; margin-top: -7px; padding: 0; }
  .node .action-text { display: none; }

  .detail { padding: 20px 18px; border-radius: 15px; }
  .detail h4 { font-size: 21px; }
  .detailcontent { grid-template-columns: 1fr; gap: 10px; }
  .detail p { font-size: 14.5px; }
  .detail .big { font-size: 16px; }
  .detail .rel { border-left: 0; border-top: 1px solid rgba(106, 165, 142, .22); padding: 14px 0 0; }

  .invest { margin: 24px 0 26px; padding: 28px 24px; gap: 22px; }
  .invest p { font-size: 14.5px; }
  .invest .ctas { width: 100%; flex-direction: column; }
  .footer { flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
