/* knowa.css — shared base styles loaded on every page.
   Rules in here are byte-identical across all 13 HTML pages.
   Anything that drifts per page stays in the page's inline <style>. */

/* ---- Self-hosted Space Grotesk (audit round 2, Finding 2).
   Fonts are OFL-licensed and redistributable. Serving them from /fonts/
   removes the cross-origin request to fonts.gstatic.com / fonts.googleapis.com
   that would otherwise expose every visitor's IP to Google LLC without a
   lawful basis. Three subsets cover Latin-script Western European use. ---- */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/space-grotesk-latin.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;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/space-grotesk-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/space-grotesk-vietnamese.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

/* ---- Self-hosted Inter (body + UI label typeface per design system).
   Variable font at weights 400-500. Two subsets cover Western European
   Latin characters. Matches the Knowa design system spec:
   https://design-skill-blush.vercel.app/ — Inter is the body typeface,
   Space Grotesk is reserved for display + headings. ---- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/inter-latin.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;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---- Design tokens.
   Mirrors the Knowa design system at https://design-skill-blush.vercel.app/.
   The system-level tokens (--foreground, --primary, --border, --ring,
   --radius-*, --shadow-xs/md) are the canonical source.
   The brand-flavoured aliases (--ink, --purple, --pastel-*) sit on top
   and mostly resolve to system values — they let existing per-page styles
   keep working without requiring a full rewrite. ---- */
:root {
  color-scheme: light;

  /* ---- Design system core ---- */
  --background: #FCFCFF;
  --foreground: #101828;
  --card: #FFFFFF;
  --primary: #9647D7;
  --primary-hover: #7A38B5;
  --secondary: #F1F4F9;
  --accent: rgba(150, 71, 215, 0.12);
  --destructive: #F04438;
  --border: #E7ECF3;
  --muted-foreground: rgba(16, 24, 40, 0.48);
  --ring: rgba(150, 71, 215, 0.24);
  --sidebar: #181023;

  /* Radius scale (design system) */
  --radius-xs: 2px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 14px;
  --radius-2xl: 16px;
  --radius-3xl: 24px;
  --radius-4xl: 32px;
  --radius-full: 9999px;

  /* Shadow scale (design system — minimal by design) */
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(16, 24, 40, 0.08);

  /* ---- Brand aliases (preserved for marketing pages).
     These map onto the system tokens above; pastels are marketing-only. ---- */
  --ink: var(--foreground);
  --ink-soft: #344054;
  --ink-mute: #667085;
  --purple: var(--primary);
  --purple-deep: var(--primary-hover);
  --purple-soft: #C28EE8;
  --paper: var(--card);
  --grey-50: #F7F7F9;
  --grey-100: #EEF0F5;
  --grey-200: var(--border);
  --nav-dark: #0E0423;
  --pastel-pink: #FFE4F2;
  --pastel-mint: #CCF5E5;
  --pastel-peach: #FFE4C8;
  --pastel-lilac: #E4C3F3;
  --pastel-blue: #D1E8FE;
  --pastel-cream: #FEF3D8;
  --accent-pink: #FF4E83;
  --accent-mint: #00CC7E;
  --accent-peach: #FFA24E;
  --line: var(--border);
  --line-soft: rgba(16, 24, 40, 0.05);
  /* Marketing-page decorative shadows (kept for hero mocks etc.
     App / product UI should use --shadow-xs / --shadow-md above). */
  --shadow-soft: 0 2px 8px rgba(16, 24, 40, 0.04), 0 12px 32px rgba(16, 24, 40, 0.06);
  --shadow-lift: 0 4px 16px rgba(16, 24, 40, 0.08), 0 24px 56px rgba(16, 24, 40, 0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* Body: Inter for prose + UI labels per design system. Fallback chain keeps
   the site readable if the font file is blocked or still loading. */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  font-size: 16px;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Headings: Space Grotesk bold for display presence. Kept global so
   per-page styles that set h1/h2 sizes inherit the right family
   without needing to restate it. */
h1, h2, h3, h4, h5, h6, .logo, .hero-title, .hero-sub-title, .trusted-logo {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
}

a { color: inherit; text-decoration: none; }
.container { max-width: 1280px; margin: 0 auto; padding: 0 32px; }

/* Keyboard-only focus ring (design system: focus-visible only). */
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: var(--radius-sm); }

/* ---- Skip-to-content link ---- */
.skip-link { position: absolute; left: 0; top: 0; background: #9647D7; color: white; padding: 10px 16px; border-radius: 0 0 8px 0; font-size: 14px; font-weight: 600; transform: translateY(-100%); transition: transform 0.18s ease; z-index: 1000; }
.skip-link:focus { transform: translateY(0); outline: 2px solid white; outline-offset: -4px; text-decoration: none; }

/* ---- Nav wrap (the absolute outer; .nav-inner stays per-page due to max-width drift) ---- */
.nav-wrap { position: absolute; top: 24px; left: 0; right: 0; z-index: 100; }
.logo { display: flex; align-items: center; gap: 10px; color: white; font-weight: 700; font-size: 20px; letter-spacing: -0.02em; }
.nav-links { display: flex; gap: 36px; list-style: none; }
.nav-links > li { position: relative; }
.nav-links a { color: rgba(255,255,255,0.85); font-size: 15px; font-weight: 500; transition: color 0.2s; }
.nav-links a:hover, .nav-links a.active { color: white; }

/* ---- Nav dropdown (e.g. Pensions → Pension funds / Pension advisers) ---- */
.nav-links .submenu-trigger { cursor: default; display: inline-flex; align-items: center; gap: 4px; }
.nav-links .submenu-trigger::after { content: ''; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translate(-1px, -1px); margin-left: 4px; opacity: 0.75; transition: transform 0.2s ease; }
.nav-links .has-submenu:hover .submenu-trigger::after,
.nav-links .has-submenu:focus-within .submenu-trigger::after { transform: rotate(225deg) translate(-1px, -1px); opacity: 1; }
.nav-links .submenu { position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%) translateY(-4px); min-width: 220px; background: rgba(14, 4, 35, 0.95); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid rgba(255,255,255,0.1); border-radius: 14px; padding: 8px; list-style: none; display: flex; flex-direction: column; gap: 2px; opacity: 0; visibility: hidden; transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease; z-index: 200; }
.nav-links .has-submenu:hover .submenu,
.nav-links .has-submenu:focus-within .submenu { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.nav-links .submenu a { display: block; padding: 10px 14px; border-radius: 8px; font-size: 14px; font-weight: 500; color: rgba(255,255,255,0.82); white-space: nowrap; }
.nav-links .submenu a:hover, .nav-links .submenu a.active { background: rgba(255,255,255,0.08); color: white; }
/* Invisible hover bridge so the gap between trigger and panel doesn't close the menu. */
.nav-links .has-submenu::before { content: ''; position: absolute; top: 100%; left: 0; right: 0; height: 14px; }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 100px; font-size: 15px; font-weight: 600; font-family: inherit; border: none; cursor: pointer; transition: all 0.22s ease; white-space: nowrap; }
.btn-primary { background: var(--purple); color: white; }
.btn-primary:hover { background: var(--purple-deep); transform: translateY(-1px); box-shadow: 0 8px 24px rgba(155,92,255,0.35); }
.btn-light { background: white; color: var(--ink); }
.btn-light:hover { background: var(--pastel-lilac); }

/* ---- Hero base (gradient, padding, positioning — identical across all 13 pages) ---- */
.hero { background: radial-gradient(ellipse at top, #2a1555 0%, var(--nav-dark) 70%); color: white; padding: 140px 0 100px; position: relative; overflow: hidden; }
h1.hero-title span { color: var(--purple-soft); }

/* ---- Region toggle pill (segmented control with inline SVG flags) ---- */
.nav-end { display: flex; align-items: center; gap: 14px; }
.region-switch { display: inline-flex; align-items: center; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.15); border-radius: 100px; padding: 3px; font-size: 13px; font-weight: 600; }
.region-link { display: inline-flex; align-items: center; gap: 7px; color: rgba(255,255,255,0.75); padding: 6px 14px; border-radius: 100px; transition: all 0.22s ease; letter-spacing: 0.02em; }
.region-link:hover { color: white; }
.region-link.active { color: var(--ink); background: white; box-shadow: 0 1px 4px rgba(0,0,0,0.15); }
.region-flag { width: 18px; height: 12px; border-radius: 2px; display: block; flex-shrink: 0; overflow: hidden; }

/* ---- Inline info tooltip as a superscript annotation.
   Rendered next to terms like "Knowa × PSCA" as a tiny raised ⓘ marker.
   Click OR hover OR keyboard-focus the button to reveal a styled panel
   with an explanatory passage. Click-to-toggle is handled in knowa.js;
   hover + focus-visible are pure CSS for desktop/keyboard fallback. ---- */
.info-tip { position: relative; display: inline-block; vertical-align: super; font-size: 0; margin-left: 2px; line-height: 0; }
.info-tip-btn { background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.35); color: white; width: 15px; height: 15px; border-radius: 50%; padding: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease; font-family: inherit; vertical-align: baseline; }
.info-tip-btn svg { width: 9px; height: 9px; display: block; }
.info-tip-btn:hover, .info-tip-btn:focus-visible, .info-tip-btn[aria-expanded="true"] { background: white; color: var(--purple-deep); border-color: white; }
.info-tip-content {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  width: max-content;
  max-width: min(340px, calc(100vw - 48px));
  background: #0e0423;
  color: rgba(255,255,255,0.95);
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.55;
  text-align: left;
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease;
  z-index: 250;
  pointer-events: none;
}
.info-tip-content::after { content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border: 6px solid transparent; border-top-color: #0e0423; }
.info-tip:hover .info-tip-content,
.info-tip:focus-within .info-tip-content,
.info-tip-btn[aria-expanded="true"] + .info-tip-content {
  opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); pointer-events: auto;
}

/* ---- Region-suggestion banner (shown client-side on UK home for en-US visitors only) ---- */
.region-suggest { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: inline-flex; align-items: center; gap: 14px; background: rgba(14, 4, 35, 0.92); color: white; padding: 12px 16px 12px 18px; border-radius: 100px; font-size: 14px; font-weight: 500; box-shadow: 0 12px 32px rgba(0,0,0,0.25); backdrop-filter: blur(10px); max-width: calc(100vw - 40px); }
.region-suggest-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.region-suggest-go { color: var(--purple-soft); font-weight: 600; white-space: nowrap; }
.region-suggest-go:hover { color: white; }
.region-suggest-x { background: transparent; border: none; color: rgba(255,255,255,0.55); font-size: 22px; line-height: 1; cursor: pointer; padding: 0 2px; font-family: inherit; }
.region-suggest-x:hover { color: white; }
@media (max-width: 640px) {
  .region-suggest { left: 12px; right: 12px; bottom: 12px; justify-content: space-between; font-size: 13px; padding: 10px 10px 10px 14px; }
}

/* ---- Footer ---- */
footer { background: #050110; color: rgba(255,255,255,0.6); padding: 64px 0 32px; font-size: 14px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 56px; margin-bottom: 48px; }
.footer-brand .logo { color: white; margin-bottom: 16px; display: inline-flex; }
.footer-brand p { font-size: 14px; line-height: 1.6; max-width: 340px; }
.footer-col h4 { color: white; font-size: 13px; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 18px; font-weight: 600; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { transition: color 0.2s; }
.footer-col a:hover { color: var(--purple-soft); }
.footer-bottom { padding-top: 32px; border-top: 1px solid rgba(255,255,255,0.08); display: flex; justify-content: space-between; font-size: 13px; color: rgba(255,255,255,0.4); }

/* ---- Mobile hamburger + slide-down menu panel ----
   On desktop the hamburger is hidden and the nav-links render inline.
   On tablet / phone (≤1024px) the nav-links hide by default and the
   hamburger reveals them as a drop-down panel anchored below the nav pill.
   The dropdown "Pensions" submenu flattens inline inside the panel so
   every destination is one tap away. ---- */
.nav-toggle { display: none; align-items: center; justify-content: center; background: transparent; border: 1px solid rgba(255,255,255,0.22); border-radius: 10px; width: 40px; height: 40px; padding: 0; cursor: pointer; color: white; transition: background 0.2s ease, border-color 0.2s ease; }
.nav-toggle:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.35); }
.nav-toggle svg { width: 20px; height: 20px; display: block; }
.nav-toggle svg.open { display: none; }
.nav-toggle[aria-expanded="true"] svg.closed { display: none; }
.nav-toggle[aria-expanded="true"] svg.open { display: block; }

@media (max-width: 1024px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }

  /* Body scroll lock while the menu is open. */
  body.menu-open { overflow: hidden; }

  /* Backdrop rendered at BODY level — not inside .nav-wrap.
     .nav-inner has backdrop-filter which creates a stacking context, so the
     panel's z-index only stacks within .nav-inner. A ::before inside
     .nav-wrap would render above the panel and eat all clicks on nav links.
     Putting the backdrop on body::before + raising .nav-wrap's own z-index
     when open puts the entire nav pill (panel included) above the backdrop. */
  body.menu-open::before { content: ''; position: fixed; inset: 0; background: rgba(10, 4, 25, 0.6); z-index: 170; pointer-events: auto; }
  .nav-wrap.menu-open { z-index: 200; }

  /* The opened panel — fully opaque, no backdrop-filter (see above). */
  .nav-wrap.menu-open .nav-links {
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: fixed;
    top: 84px;
    left: 14px;
    right: 14px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    background: #0e0423;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 18px;
    padding: 12px;
    z-index: 180;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  .nav-wrap.menu-open .nav-links > li { position: static; width: 100%; }
  .nav-wrap.menu-open .nav-links a {
    display: block;
    font-size: 17px;
    font-weight: 500;
    color: #ffffff;
    padding: 13px 14px;
    border-radius: 10px;
    white-space: normal;
  }
  .nav-wrap.menu-open .nav-links a:hover,
  .nav-wrap.menu-open .nav-links a.active { background: rgba(255,255,255,0.1); color: #ffffff; }

  /* Pensions trigger renders as a small section label, not a link. */
  .nav-wrap.menu-open .has-submenu .submenu-trigger {
    font-size: 12px;
    font-weight: 700;
    color: #C28EE8;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 16px 14px 4px;
    cursor: default;
  }
  .nav-wrap.menu-open .has-submenu .submenu-trigger::after { display: none; }
  .nav-wrap.menu-open .has-submenu .submenu-trigger.active { color: #C28EE8; background: transparent; }

  /* Flatten the Pensions submenu inline. */
  .nav-wrap.menu-open .submenu {
    position: static;
    display: flex;
    flex-direction: column;
    gap: 2px;
    opacity: 1;
    visibility: visible;
    transform: none;
    background: transparent;
    border: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    padding: 0 0 8px 6px;
    min-width: 0;
    box-shadow: none;
  }
  .nav-wrap.menu-open .submenu a { font-size: 16px; padding: 11px 14px; }
}

/* ---- Phone-only adjustments (identical across all pages) ---- */
@media (max-width: 640px) {
  .hero { padding: 120px 0 80px; }
  .footer-bottom { flex-direction: column; gap: 8px; }
  .container { padding: 0 20px; }
  .nav-inner { padding: 10px 14px; }
  .nav-end { gap: 8px; }
  .logo-img { height: 24px; }
  .btn-primary { padding: 9px 14px; font-size: 13px; }
  .region-switch { padding: 2px; }
  .region-link { padding: 4px 8px; gap: 5px; font-size: 12px; letter-spacing: 0; }
  .region-flag { width: 14px; height: 10px; }
}
@media (max-width: 480px) {
  /* Keep region toggle visible on phones but drop the UK/US labels — flags only */
  .region-link { font-size: 0; padding: 5px 7px; gap: 0; }
  .region-link .region-flag { width: 16px; height: 11px; }
  .nav-inner { padding: 10px 12px; }
  .container { padding: 0 16px; }
}
