/* Level2 Ventures — refreshed site
   Warm editorial / human aesthetic
   ------------------------------------------------------------------ */

:root {
  /* Level2 brand palette */
  --navy:        #04004d;  /* primary brand */
  --navy-2:      #0a0866;
  --blue:        #2f94e4;  /* accent */
  --blue-2:      #1b7bca;

  --paper:       #ffffff;
  --paper-2:     #f3f4f8;  /* cool tint */
  --paper-3:     #e7e9f1;
  --ink:         #04004d;  /* navy as primary text */
  --ink-body:    #14132e;  /* slightly softer for body */
  --ink-2:       #2b2a55;
  --ink-3:       #6c6c8a;
  --rule:        #dadcea;
  --accent:      #2f94e4;
  --accent-ink:  #1b7bca;

  --serif: "Newsreader", "Source Serif 4", Georgia, serif;
  --sans:  "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  /* Quotes & testimonials — screen-optimized serif for trust/credibility */
  --quote: Georgia, "Times New Roman", Times, serif;

  --maxw: 80rem;
  --gutter: clamp(20px, 4vw, 56px);
  --radius: 0.25rem;
}

/* Fluid root: the whole site scales with viewport width like a zoom.
   1rem = 16px baseline. Below ~800px the root pins to 15px (mobile/small screens
   stay readable — body ≈16px), then scales up proportionally through the desktop
   range to a 22px cap on large monitors. Keeps mobile comfortable while still
   making text track window size on laptops/desktops, in step with %/fr layout. */
html { font-size: clamp(15px, 11px + 0.5vw, 22px); }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--paper);
  color: var(--ink-body);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--navy); color: var(--paper); }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ===== Typography ===================================================== */

.eyebrow {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--ink-3);
}
.eyebrow .dot {
  display: inline-block;
  width: 0.375rem; height: 0.375rem;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 0.625rem;
  vertical-align: middle;
  transform: translateY(-1px);
}

/* Quotes & testimonials default to the screen-optimized serif */
blockquote, .quote, .testimonial {
  font-family: var(--quote);
}

.h-display {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(48px, 8vw, 124px);
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}
.h-display em {
  font-style: italic;
  font-weight: 300;
  color: var(--accent-ink);
}

.h-section {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(36px, 5.5vw, 72px);
  line-height: 1;
  letter-spacing: -0.018em;
  margin: 0;
  text-wrap: balance;
}
.h-section em { font-style: italic; color: var(--accent-ink); }

.h-card {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.75rem;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0;
}

.lede {
  font-size: clamp(18px, 1.5vw, 22px);
  line-height: 1.45;
  color: var(--ink-2);
  max-width: 60ch;
  text-wrap: pretty;
}

/* ===== Buttons ======================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.875rem 1.375rem;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.9375rem;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  transition: transform .25s ease, background .25s ease, color .25s ease, border-color .25s ease;
}
.btn .arrow {
  display: inline-block;
  transition: transform .25s ease;
}
.btn:hover .arrow { transform: translateX(4px); }
.btn-primary {
  background: var(--ink);
  color: var(--paper);
}
.btn-primary:hover { background: var(--accent); }
.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn-secondary:hover { background: var(--ink); color: var(--paper); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  padding-left: 0;
  padding-right: 0;
}
.btn-ghost:hover { color: var(--accent-ink); }

/* ===== Nav ============================================================ */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--paper) 96%, transparent);
  border-bottom: 1px solid color-mix(in oklab, var(--rule) 60%, transparent);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.5rem;
  gap: 1.5rem;
  position: relative;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
}
.brand-logo {
  height: 2.8125rem;
  width: auto;
  display: block;
}
.foot-grid .brand-logo {
  height: 2.25rem;
  filter: brightness(0) invert(1); /* fallback if logo-white.png is unavailable */
}
/* If using the dedicated white logo file, neutralise the filter via opacity */
.foot-grid .brand-logo[src*="logo-white"] {
  filter: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.nav-links a {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--ink-2);
  position: relative;
  padding: 0.375rem 0;
  transition: color .25s ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--ink); }
/* Sliding indicator — positioned by site.js */
.nav-indicator {
  position: absolute;
  bottom: -2px;
  height: 1px;
  background: var(--accent);
  width: 0;
  left: 0;
  pointer-events: none;
  transition:
    transform .42s cubic-bezier(.6, .05, .2, 1),
    width .42s cubic-bezier(.6, .05, .2, 1),
    opacity .25s ease;
  opacity: 0;
  will-change: transform, width;
}
.nav-links.is-ready .nav-indicator { opacity: 1; }

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5625rem 1rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 700;
  transition: background .2s ease;
}
.nav-cta:hover { background: var(--accent); }

.nav-burger {
  display: none;
  background: none; border: 0; padding: 0.5rem;
  color: var(--ink);
}

@media (max-width: 880px) {
  .nav-links { display: none; }
  .nav-cta { display: none; }
  /* Mobile nav: frosted bar + a labelled "Menu" pill instead of a bare hamburger. */
  .nav { background: color-mix(in oklab, var(--paper) 80%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
  .nav-burger {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.45rem 0.8rem 0.45rem 0.7rem;
    border: 1px solid color-mix(in oklab, var(--ink) 16%, transparent);
    border-radius: 999px; color: var(--ink); background: transparent;
    transition: color .2s ease, border-color .2s ease;
  }
  .nav-burger::after { content: "Menu"; font-family: var(--mono); font-size: 0.6875rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.14em; }
  .nav-burger:hover, .nav-burger:active { color: var(--accent-ink); border-color: color-mix(in oklab, var(--accent) 55%, transparent); }
}

/* ===== Footer ========================================================= */

footer.foot {
  background: var(--ink);
  color: var(--paper);
  margin-top: 7.5rem;
}
.foot-cta {
  padding: clamp(78px, 11.76vw, 157px) 0 clamp(60px, 8vw, 100px);
  border-bottom: 1px solid #0a0866;
}
.foot-cta .h-display { color: var(--paper); }
.foot-cta .h-display em { color: #7cb7e8; }
.foot-cta-row {
  margin-top: 3rem;
  display: flex; flex-wrap: wrap; gap: 0.875rem;
}
.foot-cta .btn-primary { background: var(--paper); color: var(--ink); }
.foot-cta .btn-primary:hover { background: var(--accent); color: var(--paper); }
.foot-cta .btn-secondary { color: var(--paper); border-color: var(--paper); }
.foot-cta .btn-secondary:hover { background: var(--paper); color: var(--ink); }

.foot-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 1.25rem 2rem;
  padding: 1.75rem 0 1.25rem;
}
.foot-grid h4 {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.6875rem;
  font-weight: 500;
  color: #8a8caa;
  margin: 0 0 0.625rem;
}
.foot-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.375rem; }
.foot-grid a { color: #b8bad6; font-size: 0.875rem; }
.foot-grid a:hover { color: var(--paper); }
.foot-grid .foot-blurb { color: #8a8caa; font-size: 0.875rem; max-width: 36ch; margin-top: 0.5rem; line-height: 1.45; }

.foot-meta {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem 1rem;
  padding: 0.875rem 0 1.25rem;
  border-top: 1px solid #0a0866;
  color: #8a8caa;
  font-size: 0.75rem;
  font-family: var(--mono);
}
.foot-meta a { color: #8a8caa; }
.foot-meta a:hover { color: var(--paper); }

@media (max-width: 720px) {
  .foot-grid { grid-template-columns: 1fr 1fr; }
}

/* ===== Generic placeholder image slot ================================ */

.ph {
  position: relative;
  background-image: repeating-linear-gradient(
    45deg,
    color-mix(in oklab, var(--ink) 6%, transparent),
    color-mix(in oklab, var(--ink) 6%, transparent) 10px,
    transparent 10px, transparent 22px
  ), linear-gradient(0deg, var(--paper-2), var(--paper-2));
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  overflow: hidden;
}
.ph.dark {
  background-image: repeating-linear-gradient(
    45deg,
    rgba(255,255,255,.05),
    rgba(255,255,255,.05) 10px,
    transparent 10px, transparent 22px
  ), linear-gradient(0deg, #0a0866, #0a0866);
  border-color: #0e0c5a;
  color: #8a8caa;
}
.ph-label {
  background: var(--paper);
  padding: 0.375rem 0.625rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
}
.ph.dark .ph-label { background: #0a0866; border-color: #0e0c5a; color: #8a8caa; }

/* ===== Page header (used by sub-pages) =============================== */

.page-head {
  padding: clamp(32px, 4vw, 56px) 0 clamp(56px, 8vw, 96px);
  border-bottom: 1px solid var(--rule);
}
.page-head .eyebrow { margin-bottom: 1.75rem; }
.page-head .lede { margin-top: 1.75rem; }

/* ===== Section spacing =============================================== */

section.bleed { padding: clamp(72px, 10vw, 140px) 0; }
.section-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: end;
  margin-bottom: 4rem;
}
.section-head .right { color: var(--ink-2); max-width: 44ch; }
@media (max-width: 760px) {
  .section-head { grid-template-columns: 1fr; gap: 1.25rem; }
  /* Stack every page-level two-column split (hero, image+text sections,
     heading+intro rows) on small screens. Targets only the .wrap-level grids;
     small inner grids keep their own layout. */
  .wrap[style*="grid-template-columns"] { grid-template-columns: 1fr !important; gap: 2rem !important; }
}

/* ===== Utility ======================================================== */

.divider { height: 1px; background: var(--rule); border: 0; margin: 0; }
.row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.spacer-xs { height: 0.75rem; }
.spacer-sm { height: 1.5rem; }
.spacer-md { height: 3rem; }
.spacer-lg { height: 6rem; }

.muted { color: var(--ink-3); }
.tag {
  display: inline-flex; align-items: center;
  font-family: var(--mono);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.625rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--ink-2);
  background: var(--paper);
}
.tag.accent { color: var(--accent-ink); border-color: color-mix(in oklab, var(--accent) 35%, var(--rule)); }

/* ===== Reveal-on-scroll ============================================== */
/* Only hide for the animation when JS is active (html.js). If scripts are
   blocked or fail (e.g. some Brave configs), content stays visible. */
html.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.6,.2,1); }
html.js .reveal.in { opacity: 1; transform: none; }

/* ===== Cross-page navigation animation ==============================
   Manual ink-drop overlay: a navy panel with the big logo wipes out
   from the top-left brand position, covers the screen, then wipes
   back into the corner on the next page. Works in all browsers.
*/
#page-transition {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  /* Hidden state — collapsed to a tiny circle at the brand logo position */
  clip-path: circle(0% at 60px 36px);
  transition: clip-path .7s cubic-bezier(.76, 0, .24, 1);
}
#page-transition img {
  width: clamp(220px, 28vw, 460px);
  height: auto;
  opacity: 0;
  transform: scale(.35);
  transition:
    opacity .35s ease,
    transform .7s cubic-bezier(.76, 0, .24, 1);
}
/* Cover state — circle expands to fill the viewport */
#page-transition.cover {
  clip-path: circle(140% at 60px 36px);
}
#page-transition.cover img {
  opacity: 1;
  transform: scale(1);
}

/* Respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
  #page-transition,
  #page-transition img {
    transition: none !important;
  }
  html.js .reveal { transition: none !important; opacity: 1; transform: none; }
}

/* ===== Mobile nav drawer ============================================ */
.drawer {
  position: fixed; inset: 0; z-index: 60;
  background: var(--ink);
  color: var(--paper);
  display: flex;
  flex-direction: column;
  padding: 1.5rem var(--gutter) 2.5rem;
  overflow: hidden;
  /* Hidden but animatable: fade + gentle slide from the top, dismissed cleanly. */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity .28s ease, transform .28s cubic-bezier(.2,.7,.2,1), visibility 0s linear .28s;
}
.drawer.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity .28s ease, transform .28s cubic-bezier(.2,.7,.2,1), visibility 0s;
}
@media (prefers-reduced-motion: reduce) {
  .drawer, .drawer.open { transition: visibility 0s; transform: none; }
}
.drawer::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(130% 90% at 100% 0%, color-mix(in oklab, var(--accent) 22%, transparent), transparent 58%); }
.drawer-top { display: flex; justify-content: space-between; align-items: center; height: 3rem; position: relative; z-index: 1; }
.drawer .brand-logo { filter: brightness(0) invert(1); }
.drawer [data-close] { color: var(--paper) !important; }
.drawer-links { display: flex; flex-direction: column; margin-top: clamp(2rem, 8vh, 4rem); counter-reset: navi; position: relative; z-index: 1; }
.drawer-links a {
  font-family: var(--serif); font-size: clamp(2rem, 9vw, 2.75rem); line-height: 1.05; letter-spacing: -0.01em;
  color: var(--paper); padding: 0.7rem 0; border-bottom: 1px solid rgba(255,255,255,0.10);
  display: flex; align-items: baseline; gap: 0.9rem;
  opacity: 0; transform: translateY(14px);
}
.drawer-links a::before { counter-increment: navi; content: "0" counter(navi); font-family: var(--mono); font-size: 0.7rem; font-weight: 500; letter-spacing: 0.12em; color: var(--accent); align-self: center; }
.drawer.open .drawer-links a { animation: drawer-link-in 0.5s cubic-bezier(.2,.7,.2,1) forwards; }
.drawer.open .drawer-links a:nth-child(1) { animation-delay: 0.05s; }
.drawer.open .drawer-links a:nth-child(2) { animation-delay: 0.11s; }
.drawer.open .drawer-links a:nth-child(3) { animation-delay: 0.17s; }
.drawer.open .drawer-links a:nth-child(4) { animation-delay: 0.23s; }
.drawer.open .drawer-links a:nth-child(5) { animation-delay: 0.29s; }
@keyframes drawer-link-in { to { opacity: 1; transform: none; } }
.drawer-links a:active { color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .drawer.open .drawer-links a { animation: none; opacity: 1; transform: none; } }

/* ===== True 4K only (>= 3000px, i.e. a 3840px panel at 100% browser zoom) =====
   The fluid root font caps at 22px around 2200px wide and the px-capped headings
   stop too, so a 4K panel otherwise looks small and lost in empty margins. Past
   3000px, continue the zoom (22px -> 32px at 3840px) and grow the capped headings
   in step. Gated at 3000px so a 150% zoom on 4K (~2560px CSS) behaves like a
   normal desktop and does NOT re-trigger this. (Home widths: see index.html) */
@media (min-width: 3000px) {
  html       { font-size: clamp(22px, 0.83vw, 32px); }
  .h-display { font-size: clamp(124px, 4.9vw, 188px); }
  .h-section { font-size: clamp(72px, 2.8vw, 108px); }
  .lede      { font-size: clamp(22px, 0.83vw, 32px); }
}

/* ===== Keyboard focus (accessibility / EAA) =====
   :where() keeps specificity at 0 so it never fights component styles;
   visible only during keyboard navigation, no change to mouse/touch use. */
:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}
