/* ============================================================
   SMART — Staff Mentoring And Resourcing Tool
   Showcase site for itsorted.co.uk/poc/smart/. Shared stylesheet.
   Aesthetic: "Keynote" (ITS-64 selection) — light Apple
   product-launch minimalism. Bricolage Grotesque display + IBM
   Plex Sans body, electric-blue accent, full-bleed scientific
   imagery, generous air. All paths relative (subdirectory deploy).
   ============================================================ */

@layer reset, base, components, utilities;

:root {
  color-scheme: light;

  /* palette — near-white surface, ink, one electric-blue accent */
  --bg:            oklch(0.99 0.003 95);
  --bg-2:          oklch(0.965 0.004 95);
  --surface:       oklch(0.975 0.004 95);
  --ink:           oklch(0.18 0.01 260);
  --ink-soft:      oklch(0.42 0.012 260);
  --ink-dim:       oklch(0.55 0.012 260);
  --line:          oklch(0.9 0.004 260);
  --line-strong:   oklch(0.82 0.006 260);
  --accent:        oklch(0.62 0.19 256);          /* electric blue */
  --accent-ink:    oklch(0.45 0.17 256);          /* readable on light */
  --accent-soft:   color-mix(in oklch, var(--accent) 12%, transparent);
  --on-accent:     oklch(0.99 0.003 95);
  --focus:         var(--accent);

  /* inverted surface (dark band) */
  --dark:          oklch(0.18 0.01 260);
  --dark-2:        oklch(0.24 0.012 260);
  --on-dark:       oklch(0.97 0.004 95);
  --on-dark-soft:  oklch(0.78 0.01 260);

  /* type */
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-sans:    "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* spacing rhythm */
  --pad-x: clamp(1.25rem, 5vw, 4rem);
  --maxw: 74rem;
  --radius: 16px;
  --radius-lg: 24px;
}

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; }
  body, h1, h2, h3, h4, p, figure, ul, ol { margin: 0; }
  ul, ol { padding: 0; list-style: none; }
  img { display: block; max-width: 100%; height: auto; }
  a { color: inherit; }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }
  }
}

@layer base {
  html { scroll-behavior: smooth; }
  body {
    font-family: var(--font-sans);
    font-weight: 400;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.6;
    font-size: clamp(1rem, 0.95rem + 0.3vw, 1.18rem);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    min-height: 100dvh;
  }

  h1, h2, h3 { font-family: var(--font-display); font-weight: 800; line-height: 0.99; letter-spacing: -0.02em; text-wrap: balance; }
  h2 { font-size: clamp(2rem, 1rem + 3.4vw, 3.4rem); }
  h3 { font-size: clamp(1.3rem, 0.9rem + 1.2vw, 1.65rem); letter-spacing: -0.015em; }
  p  { text-wrap: pretty; overflow-wrap: anywhere; }

  a { text-decoration: none; }
  :focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }

  ::selection { background: var(--accent); color: var(--on-accent); }
}

@layer components {

  /* ---- layout primitives ---- */
  .shell { width: min(100%, var(--maxw)); margin-inline: auto; padding-inline: var(--pad-x); }
  section { padding-block: clamp(3.5rem, 8vw, 7rem); }
  .lede { font-size: clamp(1.1rem, 0.98rem + 0.7vw, 1.45rem); color: var(--ink-soft); max-width: 56ch; line-height: 1.5; }
  .eyebrow {
    font-family: var(--font-mono);
    font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase;
    color: var(--accent-ink); margin-bottom: 1rem; display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 500;
  }
  .eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

  /* ---- header / nav ---- */
  .site-header {
    position: sticky; top: 0; z-index: 50;
    backdrop-filter: saturate(1.4) blur(12px);
    background: color-mix(in oklch, var(--bg) 84%, transparent);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
  }
  .site-header.is-scrolled { border-bottom-color: var(--line); }
  .nav { display: flex; align-items: center; gap: 1.5rem; padding-block: 0.95rem; }
  .brand { display: inline-flex; align-items: baseline; gap: 0.55rem; font-family: var(--font-display); font-weight: 800; font-size: 1.4rem; letter-spacing: -0.03em; }
  .brand .dot { color: var(--accent-ink); }
  .brand small { font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-dim); font-weight: 400; }
  .nav-links { display: flex; align-items: center; gap: 0.3rem; margin-left: auto; flex-wrap: wrap; }
  .nav-links a {
    font-size: 0.94rem; color: var(--ink-soft); padding: 0.45rem 0.7rem; border-radius: 8px; font-weight: 500;
    transition: color 0.18s ease, background-color 0.18s ease;
  }
  .nav-links a:hover { color: var(--ink); background: var(--bg-2); }
  .nav-links a[aria-current="page"] { color: var(--ink); }
  .nav-links a[aria-current="page"]::after { content: ""; display: block; height: 2px; background: var(--accent); border-radius: 2px; margin-top: 3px; }

  /* ---- buttons ---- */
  .btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    font-family: var(--font-sans); font-weight: 600; font-size: 0.98rem;
    padding: 0.85rem 1.5rem; border-radius: 999px; cursor: pointer;
    border: 1px solid transparent; white-space: nowrap;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.25s cubic-bezier(.2,.7,.3,1), color 0.2s ease;
    touch-action: manipulation;
  }
  .btn-primary { background: var(--ink); color: var(--on-accent); border-color: var(--ink); }
  .btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); transform: translateY(-2px); }
  .btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
  .btn-ghost:hover { border-color: var(--ink); background: var(--bg-2); }
  .btn-sm { padding: 0.55rem 1rem; font-size: 0.88rem; }

  /* ---- hero ---- */
  .hero { padding-block: clamp(3.5rem, 9vw, 7rem) clamp(2rem, 5vw, 3.5rem); position: relative; }
  .hero h1 { font-size: clamp(3rem, 1.5rem + 6.5vw, 8rem); }
  .hero h1 .grad { color: var(--accent-ink); }
  .hero .lede { margin-top: 1.5rem; }
  .hero-cta { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 2.2rem; }
  .hero.center { text-align: center; }
  .hero.center .lede { margin-inline: auto; }
  .hero.center .eyebrow { justify-content: center; }
  .hero.center .hero-cta { justify-content: center; }

  /* ---- full-bleed hero stage + scene visuals (Keynote signature) ---- */
  .stage {
    width: min(100%, var(--maxw)); margin: clamp(2.5rem, 6vw, 5rem) auto 0;
    border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 16 / 9;
    background: var(--bg-2);
    box-shadow: 0 40px 90px -50px oklch(0.18 0.01 260 / 0.5), 0 2px 10px -4px oklch(0.18 0.01 260 / 0.2);
  }
  .stage img { width: 100%; height: 100%; object-fit: cover; }
  .stage.short { aspect-ratio: 21 / 9; }

  .scene .shell { display: grid; gap: clamp(2rem, 5vw, 5rem); align-items: center; grid-template-columns: 1fr 1fr; }
  .scene.flip .copy { order: 2; }
  .scene .copy h2 { font-size: clamp(2rem, 1rem + 3vw, 3.6rem); }
  .scene .copy p { margin-top: 1.2rem; color: var(--ink-soft); font-size: clamp(1.05rem, 1rem + 0.4vw, 1.3rem); }
  .scene .visual { border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 4 / 5; background: var(--bg-2); box-shadow: 0 30px 70px -45px oklch(0.18 0.01 260 / 0.55); }
  .scene .visual img { width: 100%; height: 100%; object-fit: cover; }
  @media (max-width: 52rem) { .scene .shell { grid-template-columns: 1fr; } .scene.flip .copy { order: 0; } .scene .visual { aspect-ratio: 16 / 10; } }

  /* ---- the chain: asset → skill → role → lever → £ ---- */
  .chain { display: flex; flex-wrap: wrap; align-items: stretch; gap: 0.5rem; margin-top: 2.4rem; }
  .chain .node {
    flex: 1 1 7rem; min-width: 6.8rem;
    background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px;
    padding: 1rem 1.2rem;
  }
  .chain .node b { display: block; font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; letter-spacing: -0.02em; color: var(--ink); }
  .chain .node span { font-size: 0.72rem; color: var(--ink-dim); }
  .chain .node.is-money b, .chain .node:last-of-type b { color: var(--accent-ink); }
  .chain .arrow { align-self: center; color: var(--ink-dim); font-weight: 600; }
  @media (max-width: 40rem) { .chain .arrow { transform: rotate(90deg); } }

  /* ---- cards / bento ---- */
  .card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: clamp(1.4rem, 3vw, 2rem);
    transition: border-color 0.2s ease, transform 0.25s cubic-bezier(.2,.7,.3,1), box-shadow 0.25s ease;
  }
  .card:hover { border-color: var(--line-strong); transform: translateY(-3px); box-shadow: 0 24px 50px -40px oklch(0.18 0.01 260 / 0.5); }
  .card h3 { margin-bottom: 0.5rem; }
  .card .kicker { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 0.7rem; font-weight: 500; }
  .card p { color: var(--ink-soft); font-size: 1rem; }

  .grid { display: grid; gap: 1.1rem; }
  .grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 21rem), 1fr)); }
  .grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }

  .bento { display: grid; gap: 1.1rem; grid-template-columns: repeat(6, 1fr); }
  .bento > * { grid-column: span 6; }
  @media (min-width: 48rem) {
    .bento > * { grid-column: span 2; }
    .bento > .span-3 { grid-column: span 3; }
    .bento > .span-4 { grid-column: span 4; }
    .bento > .span-6 { grid-column: span 6; }
  }

  /* ---- inverted dark band (one crafted idea) ---- */
  .band { background: var(--dark); color: var(--on-dark); border-radius: var(--radius-lg); }
  .band h2, .band h3 { color: var(--on-dark); }
  .band .eyebrow { color: oklch(0.78 0.12 256); }
  .band .lede, .band p { color: var(--on-dark-soft); }
  .band .powers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.3rem; margin-top: clamp(2rem, 4vw, 3rem); }
  .band .power { border: 1px solid var(--dark-2); border-radius: 18px; padding: 1.7rem; }
  .band .power .n { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.1em; color: oklch(0.74 0.13 256); font-weight: 500; }
  .band .power h3 { font-size: 1.45rem; margin: 0.6rem 0 0.5rem; }
  .band .power p { color: var(--on-dark-soft); font-size: 0.98rem; }
  @media (max-width: 52rem) { .band .powers { grid-template-columns: 1fr; } }

  /* ---- stats ---- */
  .stats { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); }
  .stat { border-top: 2px solid var(--line-strong); padding-top: 1rem; }
  .band .stat { border-top-color: var(--dark-2); }
  .stat .n { font-family: var(--font-display); font-weight: 800; font-size: clamp(2.2rem, 1rem + 3vw, 3.4rem); line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; color: var(--accent-ink); }
  .band .stat .n { color: oklch(0.82 0.13 256); }
  .stat .l { color: var(--ink-soft); font-size: 0.86rem; margin-top: 0.4rem; }
  .band .stat .l { color: var(--on-dark-soft); }

  /* ---- numbered steps ---- */
  .steps { display: grid; gap: 1rem; counter-reset: step; }
  .step { display: grid; grid-template-columns: auto 1fr; gap: 1.1rem; align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.6rem; }
  .step::before {
    counter-increment: step; content: counter(step, decimal-leading-zero);
    font-family: var(--font-mono); font-size: 0.95rem; color: var(--accent-ink); font-weight: 500;
    border: 1px solid var(--accent-soft); border-radius: 9px; padding: 0.35rem 0.55rem; background: var(--accent-soft);
  }
  .step h3 { font-size: 1.2rem; margin-bottom: 0.3rem; }
  .step p { color: var(--ink-soft); font-size: 0.98rem; }

  /* ---- feature list with mono arrow ---- */
  .ticks li { display: grid; grid-template-columns: auto 1fr; gap: 0.7rem; padding-block: 0.6rem; border-bottom: 1px solid var(--line); }
  .ticks li::before { content: "→"; color: var(--accent-ink); font-family: var(--font-mono); }
  .ticks strong { font-weight: 600; }
  .ticks span { color: var(--ink-soft); }

  /* ---- callout / note ---- */
  .note {
    border: 1px solid var(--line); border-left: 3px solid var(--accent);
    background: var(--bg-2);
    border-radius: 12px; padding: 1.1rem 1.3rem; color: var(--ink-soft); font-size: 0.95rem;
  }
  .note b { color: var(--ink); }

  /* ---- code / mono block ---- */
  .mono-block {
    font-family: var(--font-mono); font-size: 0.85rem; color: var(--ink-soft);
    background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px;
    padding: 1.2rem 1.4rem; overflow-x: auto; line-height: 1.7;
  }
  .mono-block .k { color: var(--accent-ink); }
  .mono-block .c { color: var(--ink-dim); }

  /* ---- demo frame ---- */
  .demo-shot {
    border: 1px solid var(--line-strong); border-radius: var(--radius-lg); overflow: hidden;
    box-shadow: 0 40px 90px -50px oklch(0.18 0.01 260 / 0.45); background: var(--surface);
  }
  .demo-shot .bar { display: flex; align-items: center; gap: 0.5rem; padding: 0.7rem 1rem; border-bottom: 1px solid var(--line); background: var(--bg-2); font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-dim); }
  .demo-shot .bar .dots { display: inline-flex; gap: 0.35rem; }
  .demo-shot .bar .dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); }
  .demo-frame { width: 100%; aspect-ratio: 16 / 10; border: 0; background: #fff; display: block; }

  /* ---- pill / tag ---- */
  .pills { display: flex; flex-wrap: wrap; gap: 0.45rem; }
  .pill { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.02em; color: var(--ink-soft); border: 1px solid var(--line); border-radius: 999px; padding: 0.3rem 0.7rem; }
  .pill.on { color: var(--accent-ink); border-color: var(--accent-soft); background: var(--accent-soft); }

  /* ---- divider ---- */
  .rule { height: 1px; background: var(--line); border: 0; margin: 0; }

  /* ---- footer ---- */
  .site-footer { border-top: 1px solid var(--line); padding-block: 2.6rem; color: var(--ink-dim); font-size: 0.88rem; margin-top: 2rem; }
  .site-footer .row { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; justify-content: space-between; }
  .site-footer a { color: var(--ink-soft); }
  .site-footer a:hover { color: var(--accent-ink); }

  /* ---- staged entry + scroll reveals ---- */
  .reveal { opacity: 0; transform: translateY(20px); }
  .reveal.in, .reveal.show { opacity: 1; transform: none; transition: opacity 0.8s cubic-bezier(.2,.7,.3,1), transform 0.8s cubic-bezier(.2,.7,.3,1); }
  .hero .reveal:nth-child(1).in { transition-delay: 0.04s; }
  .hero .reveal:nth-child(2).in { transition-delay: 0.12s; }
  .hero .reveal:nth-child(3).in { transition-delay: 0.22s; }
  .hero .reveal:nth-child(4).in { transition-delay: 0.32s; }
  @media (prefers-reduced-motion: reduce) { .reveal { opacity: 1 !important; transform: none !important; } }
}

@layer utilities {
  .mono { font-family: var(--font-mono); }
  .accent { color: var(--accent-ink); }
  .muted { color: var(--ink-soft); }
  .center { text-align: center; }
  .mt-1 { margin-top: 0.6rem; } .mt-2 { margin-top: 1.2rem; } .mt-3 { margin-top: 2rem; } .mt-4 { margin-top: 3rem; }
  .stack > * + * { margin-top: 1rem; }
}
