/* ============================================================
   ryan-analytics.co.nz - design system
   Brand: Ink / Glacial Teal / Paper (brand/brand-colours.json)
   Signature: the Confluence Thread - see docs/website-brief.md
   ============================================================ */

/* ---- Fonts (self-hosted, subset, swap; metric fallbacks) ---- */
@font-face { font-family: "Schibsted Grotesk"; src: url("/assets/fonts/schibsted-grotesk-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Schibsted Grotesk"; src: url("/assets/fonts/schibsted-grotesk-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/assets/fonts/inter-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/assets/fonts/inter-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/assets/fonts/inter-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/assets/fonts/ibm-plex-mono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
/* metric-compatible fallbacks to stop the hero geometry detaching on swap */
@font-face { font-family: "Schibsted-fallback"; src: local("Arial Bold"), local("Arial"); ascent-override: 96%; descent-override: 26%; line-gap-override: 0%; size-adjust: 101%; }
@font-face { font-family: "Inter-fallback"; src: local("Arial"); ascent-override: 97%; descent-override: 24%; line-gap-override: 0%; size-adjust: 107%; }

/* The right-hand rail shares an axis with the SVG outlet and final full stop. */
:root {
  --ink: #182b3a; --ink-900: #10202d; --teal: #2e7268; --teal-bright: #5fa79c;
  --paper: #f7f5f1; --white: #fff; --grey: #5a6672; --shingle: #dcd8d1; --mist: #e4eeeb;
  --display: "Schibsted Grotesk", "Schibsted-fallback", system-ui, sans-serif;
  --body: "Inter", "Inter-fallback", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --edge: max(48px, calc((100vw - 1160px) / 2));
  --rail-x: calc(100% - var(--edge) - 4.5px);
}
* { box-sizing: border-box; }
body, h1, h2, h3, p, figure, dl, dd { margin: 0; }
body { background: var(--paper); color: var(--ink); font: 17px/1.7 var(--body); -webkit-font-smoothing: antialiased; }
html { scroll-behavior: smooth; scroll-padding-top: 100px; }
section[id], #toolset, #opensource { scroll-margin-top: 20px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -.03em; line-height: 1.15; text-wrap: balance; }
h1 { font-size: clamp(44px, 4.25vw, 60px); }
h2 { font-size: clamp(28px, 2.5vw, 36px); }
h3 { font-size: 21px; letter-spacing: -.022em; line-height: 1.3; }
a { color: inherit; }
button, summary { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: default; }
[hidden] { display: none !important; }
a, button, summary { touch-action: manipulation; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 5px; }
::selection { background: var(--mist); color: var(--ink); }
.skip { position: fixed; z-index: 100; top: 10px; left: 12px; padding: 10px 18px; background: var(--ink); color: var(--paper); transform: translateY(-180%); }
.skip:focus { transform: none; }
.eyebrow, .index { font: 500 11px/1.6 var(--mono); letter-spacing: .11em; text-transform: uppercase; }
.eyebrow { color: var(--grey); }
.btn-primary { display: inline-flex; align-items: center; justify-content: center; gap: 22px; min-height: 48px; padding: 10px 23px; border: 0; border-radius: 3px; background: var(--teal); color: var(--white); text-decoration: none; font-size: 15px; font-weight: 600; transition: background .18s; }
.btn-primary:hover { background: #255d55; }
.btn-primary span { font-size: 20px; font-weight: 400; }
.phone-link { display: inline-flex; align-items: center; min-height: 44px; text-underline-offset: 5px; text-decoration-thickness: 1px; text-decoration-color: transparent; }
.phone-link:hover { text-decoration-color: currentColor; }
.text-link { display: inline-flex; align-items: center; gap: 16px; min-height: 44px; font-size: 14px; font-weight: 500; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.text-link:hover { text-decoration-color: var(--teal); }
/* Stable header colours also work without JavaScript. */
.site-head { position: sticky; top: 0; z-index: 20; background: var(--paper); border-bottom: 1px solid var(--shingle); }
.head-inner { display: flex; align-items: center; justify-content: space-between; min-height: 76px; margin: 0 var(--edge); gap: 24px; }
.head-lockup { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; flex-shrink: 0; }
.head-mark { width: 48px; height: 32px; }
.mk-ink { stroke: var(--ink); }
.mk-teal { stroke: var(--teal); }
.head-word { font-family: var(--display); font-size: 17px; font-weight: 700; letter-spacing: -.02em; }
.desktop-nav { display: flex; align-items: center; gap: 28px; }
.desktop-nav > a { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; text-decoration: none; }
.desktop-nav > a:not(.btn-primary):hover, .desktop-nav > a[aria-current]:not(.btn-primary) { text-decoration: underline; text-underline-offset: 7px; text-decoration-color: var(--teal); }
.mobile-menu { display: none; }
/* The mark owns the motion; text and the rest of the page remain still. */
.hero { position: relative; min-height: 560px; background: var(--ink-900); color: var(--paper); overflow: clip; }
.hero::before { content: ""; position: absolute; inset: 0; background: url('/assets/textures/braid-dark.webp') right center / cover; opacity: .12; pointer-events: none; }
.hero-copy { position: relative; width: min(610px, calc(100% - var(--edge) - 430px)); margin-left: var(--edge); padding: 94px 0 100px; }
.hero .eyebrow { color: #b1c1cb; margin-bottom: 25px; font-size: 10px; }
.hero-sub { max-width: 550px; margin-top: 27px; color: #bac7ce; font-size: 18px; line-height: 1.7; }
.hero-actions { display: flex; align-items: center; gap: 30px; margin-top: 32px; }
.hero-art { position: absolute; z-index: 1; left: calc(var(--rail-x) - 360px); top: 126px; width: 400px; }
#confluence { display: block; width: 100%; height: auto; overflow: visible; }
.confluence-channel { stroke: #d9e0e1; stroke-width: .48; stroke-linecap: round; }
#confluence-outlet { stroke: var(--teal-bright); stroke-width: 1.5; }
.hero-art figcaption { position: absolute; left: 14px; top: 226px; display: flex; align-items: center; gap: 24px; color: #b1c1cb; font: 10px/1.6 var(--mono); letter-spacing: .06em; }
.replay { background: transparent; border: 0; color: #c2cecf; min-width: 64px; min-height: 44px; padding: 8px; font: 11px var(--mono); }
.replay span { display: inline-block; padding-left: 4px; font-size: 17px; }
.replay:disabled { opacity: .5; }
.replay:hover:not(:disabled) { color: var(--white); }
.hero-thread { position: absolute; left: var(--rail-x); top: 395px; bottom: 0; width: 1px; background: var(--teal-bright); }
.page-body { position: relative; }
.page-body::before { content: ""; position: absolute; left: var(--rail-x); top: 0; bottom: 0; width: 1px; background: #b6cbc4; }
.experience { margin: 0 var(--edge); padding: 28px 44px 28px 0; display: flex; align-items: center; gap: 48px; border-bottom: 1px solid var(--shingle); font-size: 13px; }
.experience p { display: flex; align-items: center; gap: 12px; line-height: 1.6; }
.experience strong { font: 700 29px/1.1 var(--display); letter-spacing: -.04em; }
.experience p:last-child { display: block; margin-left: auto; font-size: 12px; }
.experience .experience-person { font: 500 13px/1.6 var(--body); letter-spacing: 0; }
.section { position: relative; display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 72px; margin: 0 var(--edge); padding: 76px 54px 0 0; }
.section::after { content: ""; position: absolute; top: 91px; right: .5px; width: 7px; height: 7px; border: 1.5px solid var(--teal); border-radius: 50%; background: var(--paper); }
.section-heading > p { margin-top: 18px; font-size: 15px; color: var(--grey); max-width: 260px; }
.heading-stop { color: var(--ink); }
.service { display: grid; grid-template-columns: 30px 1fr; gap: 16px; padding: 24px 0; border-bottom: 1px solid var(--shingle); }
.service .index { padding-top: 5px; color: var(--grey); }
.service p { margin-top: 12px; color: var(--grey); font-size: 16px; }
.service-lead { padding: 30px; background: var(--ink); color: var(--paper); border: 0; border-radius: 3px; margin-bottom: 4px; }
.service-lead .index { color: #aebdc6; }
.service-lead p { color: #c3cdd4; }
.service-lead h3 { font-size: 25px; }
.about { padding-top: 88px; align-items: center; }
.about::after { top: 103px; }
.portrait-wrap { width: 100%; }
.portrait { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1.12; object-fit: cover; object-position: center bottom; background: #e3e6e0; }
.portrait-wrap figcaption { display: flex; flex-direction: column; gap: 2px; margin-top: 14px; font-size: 12px; color: var(--grey); }
.portrait-wrap strong { font-size: 14px; font-weight: 600; color: var(--ink); }
.about-copy > p:not(.eyebrow) { margin-top: 22px; color: var(--grey); font-size: 16px; }
.about-copy .craft-note { border-left: 2px solid var(--shingle); padding-left: 20px; color: var(--ink) !important; }
.working { padding-top: 88px; }
.working::after { top: 103px; }
.rates { margin-top: 28px; }
.rates > div + div { margin-top: 20px; }
.rates dt { font-size: 12px; color: var(--grey); }
.rates dd { margin-top: 2px; font: 500 25px/1.5 var(--display); letter-spacing: -.025em; }
.rates dd span { font: 13px var(--body); color: var(--grey); letter-spacing: 0; }
.section-heading .rate-note { font-size: 12px; margin-top: 14px; }
.working-list { margin: 0; padding: 0; list-style: none; }
.working-list li { display: grid; grid-template-columns: 30px 1fr; gap: 16px; padding: 0 0 25px; }
.working-list li + li { padding-top: 25px; border-top: 1px solid var(--shingle); }
.working-list li:last-child { padding-bottom: 0; }
.working-list .index { color: var(--grey); padding-top: 4px; }
.working-list p { margin-top: 10px; font-size: 16px; color: var(--grey); }
.tools { margin-top: 80px; padding-top: 36px; padding-bottom: 72px; border-top: 1px solid var(--shingle); }
.tools::after { top: 51px; }
.toolset h2 { font-size: 25px; }
.toolset p { margin-top: 20px; color: var(--grey); font-size: 15px; }
.opensource { padding: 28px 32px; border: 1px solid var(--shingle); background: #fffdfa; }
.oss-title { display: flex; justify-content: space-between; align-items: center; }
.oss-symbol { font: 20px var(--mono); color: #728079; }
.opensource h2 { margin-top: 12px; font-size: 32px; }
.opensource p { color: var(--grey); font-size: 15px; margin-top: 13px; }
.opensource .oss-intro { font-weight: 500; color: var(--ink); font-size: 17px; }
.opensource .text-link { margin-top: 15px; }
.contact { background: var(--ink-900); color: var(--paper); }
.contact-main { position: relative; padding: 76px calc(var(--edge) + 54px) 0 var(--edge); }
.contact-main::before { content: ""; position: absolute; left: var(--rail-x); top: 0; bottom: 0; width: 1px; background: var(--teal-bright); }
.contact h2 { font-size: clamp(32px, 3.5vw, 48px); }
.contact-main > p:not(.eyebrow):not(.copy-status) { color: #b1c1cb; margin-top: 23px; }
.contact-email { display: flex; align-items: center; flex-wrap: wrap; gap: 22px; margin-top: 31px; }
.mail-link { font: 500 clamp(20px, 2.5vw, 34px)/1.4 var(--display); text-decoration-color: var(--teal-bright); text-underline-offset: 8px; text-decoration-thickness: 1px; overflow-wrap: anywhere; }
.copy-btn { padding: 10px 14px; min-height: 44px; border: 1px solid #63767e; border-radius: 3px; font-size: 12px; color: #c3cdd4; background: transparent; }
.copy-btn:hover { border-color: var(--paper); color: var(--paper); }
.copy-status { min-height: 26px; margin-top: 6px; font-size: 12px; color: #c3cdd4; }
.contact .phone-link { margin-top: 5px; font-size: 17px; }
.signature { position: relative; display: flex; justify-content: flex-end; padding: 68px var(--edge) 30px; }
.signature::before { content: ""; position: absolute; left: var(--rail-x); top: 0; bottom: 37.5px; width: 1px; background: var(--teal-bright); }
.signature-word { display: inline-flex; align-items: flex-end; font: 700 30px/1 var(--display); letter-spacing: -.035em; }
.signature-stop { display: inline-block; width: 9px; height: 9px; margin-left: 3px; margin-bottom: 3px; border-radius: 50%; background: var(--teal-bright); }
.site-foot { margin: 0 var(--edge); padding: 24px 0 28px; border-top: 1px solid #34444d; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 11px; color: #acbbc5; }
.site-foot p:last-child { margin-left: auto; }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; }
.footer-links a { text-underline-offset: 4px; }
.legal-page { max-width: 820px; margin: 0 auto; padding: 64px 30px 76px; font-size: 16px; }
.legal-page h1 { font-size: clamp(34px, 4vw, 48px); }
.legal-page h2 { font-size: 25px; margin-top: 34px; }
.legal-page p { margin-top: 18px; }
.legal-page .legal-updated { color: var(--grey); font-size: 13px; }
.legal-page a { text-underline-offset: 4px; }
.legal-footer .site-foot { border-top: 0; }
@media (max-width: 1150px) and (min-width: 901px) {
  h1 { font-size: 45px; }
  .hero-copy { width: calc(100% - var(--edge) - 400px); }
  .desktop-break { display: none; }
  .section { grid-template-columns: 220px minmax(0, 1fr); gap: 40px; padding-right: 35px; }
  .experience { gap: 24px; }
}
@media (max-width: 900px) {
  :root { --edge: 24px; }
  .head-inner { min-height: 70px; }
  .head-mark { width: 39px; height: 28px; }
  .head-word { font-size: 16px; }
  .head-lockup { gap: 9px; }
  .desktop-nav { display: none; }
  .mobile-menu { display: block; }
  .mobile-menu summary { list-style: none; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 0 8px 8px; font-size: 14px; cursor: pointer; }
  .mobile-menu summary::-webkit-details-marker { display: none; }
  .menu-icon { display: block; width: 16px; height: 10px; border-top: 1px solid; border-bottom: 1px solid; }
  .mobile-menu[open] .menu-icon { height: 1px; border-bottom: 0; }
  .mobile-menu nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: 1px solid var(--shingle); padding: 12px 24px 20px; box-shadow: 0 18px 20px #10202d12; max-height: calc(100dvh - 72px); overflow-y: auto; }
  .mobile-menu nav a { display: flex; align-items: center; min-height: 44px; padding: 7px 0; text-decoration: none; font-size: 15px; }
  .mobile-menu nav a[aria-current] { text-decoration: underline; text-underline-offset: 5px; }
  .hero { min-height: 0; }
  .hero-copy { width: auto; max-width: 580px; margin: 0; padding: 228px 58px 48px 24px; }
  .hero .eyebrow { font-size: 9px; letter-spacing: .08em; margin-bottom: 20px; }
  h1 { font-size: clamp(36px, 6vw, 46px); line-height: 1.1; }
  .hero-sub { margin-top: 23px; font-size: 16px; line-height: 1.7; }
  .hero-actions { gap: 22px; margin-top: 26px; }
  .hero-actions .phone-link { font-size: 14px; }
  .hero-art { width: 280px; left: calc(var(--rail-x) - 252px); top: 20px; }
  .hero-art figcaption { top: 140px; left: 9px; font-size: 9px; gap: 15px; }
  .hero-thread { top: 208px; }
  .desktop-break { display: none; }
  .experience { gap: 14px 28px; flex-wrap: wrap; padding: 23px 30px 25px 0; }
  .experience p { flex: 1 1 170px; font-size: 12px; }
  .experience p:last-child { display: none; }
  .experience strong { font-size: 25px; }
  .section { grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 48px 30px 0 0; }
  .section::after { top: 60px; }
  .section-heading > p { max-width: 520px; }
  .service-lead h3 { font-size: 23px; }
  .service { grid-template-columns: 24px minmax(0, 1fr); gap: 12px; padding: 23px 0; }
  .service-lead { padding: 25px; }
  .service h3 { font-size: 20px; }
  .service p { font-size: 15px; }
  .about { grid-template-columns: 210px minmax(0, 1fr); gap: 32px; padding-top: 60px; align-items: start; }
  .about::after { top: 74px; }
  .about-copy > p:not(.eyebrow) { font-size: 15px; }
  .rates { display: flex; gap: 32px; margin-top: 24px; }
  .rates > div + div { margin-top: 0; }
  .working-list { margin-top: 10px; }
  .tools { margin-top: 48px; padding-top: 28px; padding-bottom: 48px; gap: 28px; }
  .tools::after { top: 40px; }
  .toolset p { max-width: 540px; }
  .opensource { padding: 25px; }
  .contact-main { padding: 54px 56px 0 24px; }
  .contact-main > p:not(.eyebrow):not(.copy-status) { font-size: 15px; }
  .contact h2 { font-size: 32px; max-width: 550px; }
  .contact-email { gap: 16px; }
  .mail-link { font-size: clamp(19px, 4.8vw, 28px); }
  .copy-status { min-height: 23px; }
  .signature { padding-top: 45px; }
  .signature-word { font-size: 25px; }
  .site-foot { flex-direction: column; gap: 4px; }
  .site-foot p:last-child { margin-left: 0; }
}
@media (max-width: 600px) {
  .hero-copy { padding-top: 223px; }
  .hero-art { top: 12px; }
  .hero-thread { top: 200px; }
  .hero-actions { gap: 18px; flex-wrap: wrap; }
  .hero-actions .btn-primary { padding-left: 18px; padding-right: 18px; gap: 18px; }
  .service, .service-lead { display: block; }
  .service .index { display: block; margin-bottom: 10px; }
  .service-lead { padding: 22px; }
  .about { display: flex; flex-direction: column; gap: 28px; }
  .portrait-wrap { max-width: 240px; }
  .portrait { aspect-ratio: 1; }
  .rates { gap: 24px; }
  .rates dd { font-size: 23px; }
  .working-list li { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .working-list h3 { font-size: 20px; }
  .opensource { padding: 23px; }
  .text-link { font-size: 13px; gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
