/*
 * The site's shared look: palette, type, and the blocks used on more than one page (navigation, buttons,
 * footer; FAQ, team and contact form on the home page). Loaded on every page by src/layout.html, after ds.css
 * and site.css. Page-specific layout lives in pages/<id>.css.
 * Scroll-linked values (--p, --d, --tx …) come from assets/js/fx.js.
 */
:root {
  --color-bg: #0c0f15; --color-surface: #141922; --color-text: #e6e9ef;
  --color-accent: #6a9fe8; --color-accent-2: #6a9fe8;
  --color-divider: color-mix(in srgb, #e6e9ef 12%, transparent);
  --color-accent-100: #eef5ff; --color-accent-200: #d8e7fd; --color-accent-300: #b6d3fa; --color-accent-400: #8fbaf4; --color-accent-500: #6a9fe8; --color-accent-600: #4f82c8; --color-accent-700: #3b649c; --color-accent-800: #2a4870; --color-accent-900: #1b2c43;
  --color-neutral-700: #545a66; --color-neutral-800: #3a3f48; --color-neutral-900: #22262d;
  --color-section: #111827; --color-section-glow: #1b2a44;
  /* the two inks of the logo mark */
  --color-mark: #7c8cff; --color-mark-ink: #eef0f5;
  --color-ok: #34c77b; --color-flag: #f5a524;
}
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--color-bg); }
::selection { background: color-mix(in srgb, var(--color-accent) 35%, transparent); }

/* tokens of the new components; any page can use them */
:root {
  --gutter: clamp(20px, 4.6vw, 72px);
  --text-2: color-mix(in srgb, var(--color-text) 74%, transparent);
  --text-3: color-mix(in srgb, var(--color-text) 52%, transparent);
  --line: color-mix(in srgb, var(--color-text) 13%, transparent);
  --display: "Schibsted Grotesk", "Inter", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --nx-radius: 20px;
  --nx-panel: color-mix(in srgb, var(--color-surface) 78%, transparent);
}
/* .nx marks markup written for this sheet: the home page root, and the nav / footer wrappers on other pages */
.nx { position: relative; overflow-x: clip; font-size: 16px; line-height: 1.6; color: var(--color-text); }
/* :where(.nx) keeps these resets at element specificity: above ds.css (loaded earlier), below any class */
:where(.nx) h1, :where(.nx) h2, :where(.nx) h3 { font-family: var(--display); font-weight: 500; margin: 0; text-wrap: balance; }
:where(.nx) p { margin: 0; text-wrap: pretty; }
:where(.nx) ul, :where(.nx) ol, :where(.nx) dl, :where(.nx) dd { margin: 0; padding: 0; list-style: none; }
:where(.nx) a { color: inherit; }
.nx :focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }
.nx-wrap { width: min(1280px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.nx-main { position: relative; z-index: 1; }

.nx-h1 { font-size: clamp(2.6rem, 6.6vw, 6.25rem); line-height: .97; letter-spacing: -.042em; }
.nx-h2 { font-size: clamp(2rem, 4.5vw, 3.9rem); line-height: 1.02; letter-spacing: -.036em; }
.nx-lead { font-size: clamp(1.05rem, 1.35vw, 1.25rem); line-height: 1.55; color: var(--text-2); max-width: 34em; }
.nx-kicker { margin: 0; display: flex; align-items: center; gap: .65em; font: 500 .9375rem/1.2 var(--display); color: var(--color-accent-300); }
.nx-kicker::before { content: ""; width: .5em; height: .5em; border-radius: 50%; background: var(--color-mark); box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-mark) 22%, transparent); }

/* words of a [data-split] heading rise as the nearest [data-p] ancestor enters */
.nx .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .14em; margin-bottom: -.14em; }
.nx .w > span { display: inline-block; }
.fx .nx [data-split] .w > span { transform: translateY(calc((1 - clamp(0, var(--p, 1) * 1.7 - var(--i) * .07, 1)) * 108%)); }
@keyframes nx-rise { from { transform: translateY(108%); } to { transform: none; } }

/* buttons */
.nx-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em; box-sizing: border-box;
  min-height: 50px; padding: 0 1.5em; border-radius: 999px; cursor: pointer; text-decoration: none; white-space: nowrap;
  border: 1px solid color-mix(in srgb, var(--color-text) 24%, transparent); background: transparent; color: var(--color-text);
  font: 500 1rem/1 var(--display); letter-spacing: -.01em;
  transition: background .25s ease, border-color .25s ease, color .25s ease, transform .25s var(--ease), box-shadow .25s ease;
}
.nx-btn:hover { border-color: var(--color-accent); color: var(--color-accent-200); }
.nx-btn:active { transform: scale(.98); }
.nx-btn-solid { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-bg); }
.nx-btn-solid:hover { background: var(--color-accent-300); border-color: var(--color-accent-300); color: var(--color-bg); box-shadow: 0 14px 40px -18px var(--color-accent); }
.nx-btn-sm { min-height: 38px; padding: 0 1.15em; font-size: .875rem; }
.nx-btn-block { width: 100%; }
.nx-btn:disabled { opacity: .5; cursor: progress; }
.nx-mail { color: var(--color-accent-300); text-decoration-color: color-mix(in srgb, var(--color-accent-300) 40%, transparent); text-underline-offset: 4px; }
.nx-mail:hover { color: var(--color-accent-200); }

/* navigation */
.nx-nav {
  position: fixed; inset: 0 0 auto 0; z-index: 60; height: 68px; padding: 0 var(--gutter); box-sizing: border-box;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  transition: background .35s ease, backdrop-filter .35s ease;
}
.nx-nav.is-scrolled, .nx-nav.is-open { background: color-mix(in srgb, var(--color-bg) 74%, transparent); -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3); }
.nx-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 600 1.1875rem/1 var(--display); letter-spacing: -.025em; color: var(--color-text); }
.nx-brand:hover { color: var(--color-text); }
.nx-brand img { display: block; transition: transform .8s var(--ease); }
.nx-brand:hover img { transform: rotate(-90deg); }
.nx-links { display: flex; gap: clamp(14px, 2.3vw, 34px); }
.nx-links a { position: relative; padding: 8px 0; font-size: .9375rem; text-decoration: none; color: var(--text-2); transition: color .2s ease; }
.nx-links a::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--color-mark); transform: scale(0); transition: transform .3s var(--ease); }
.nx-links a:hover, .nx-links a.is-on { color: var(--color-text); }
.nx-links a.is-on::after { transform: scale(1); }
.nx-nav-end { display: flex; align-items: center; gap: 12px; }
.nx .nx-lang { border-radius: 999px; border-color: var(--line); }
.nx .nx-lang a { padding: 8px 12px; }
.nx-menu-btn { display: none; position: relative; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: transparent; cursor: pointer; }
.nx-menu-btn i { position: absolute; left: 13px; right: 13px; height: 1.5px; background: var(--color-text); transition: transform .3s var(--ease); }
.nx-menu-btn i:first-child { top: 17px; } .nx-menu-btn i:last-child { top: 25px; }
.nx-nav.is-open .nx-menu-btn i:first-child { transform: translateY(4px) rotate(45deg); }
.nx-nav.is-open .nx-menu-btn i:last-child { transform: translateY(-4px) rotate(-45deg); }
.nx-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: linear-gradient(90deg, var(--color-mark), var(--color-accent)); transform-origin: 0 50%; transform: scaleX(0); }
@media (max-width: 920px) {
  .nx-menu-btn { display: inline-block; }
  .nx-links { position: fixed; inset: 68px 0 auto 0; display: none; flex-direction: column; gap: 0; padding: 8px var(--gutter) 28px; background: color-mix(in srgb, var(--color-bg) 96%, transparent); border-bottom: 1px solid var(--line); }
  .nx-nav.is-open .nx-links { display: flex; }
  .nx-links a { padding: 14px 0; font: 500 1.5rem/1.2 var(--display); letter-spacing: -.02em; border-bottom: 1px solid var(--line); }
  .nx-links a::after { left: auto; right: 0; bottom: 50%; margin: 0 0 -2.5px; }
}
@media (max-width: 520px) { .nx-nav-end .nx-btn-sm { display: none; } }

/* services, cases, steps: bare content, laid out by pages/home.css */
.svc-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.svc-list em { font-style: normal; font-size: .8125rem; color: var(--text-3); white-space: nowrap; }
.case { display: flex; flex-direction: column; text-decoration: none; }
.case-facts div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); font-size: .875rem; }
.case-facts dt { color: var(--text-3); }
.case-facts dd { text-align: right; color: var(--text-2); }
.case-read { color: var(--color-accent-300); font: 500 .9375rem/1 var(--display); }

/* FAQ */
.faq-list { border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-q { all: unset; box-sizing: border-box; display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 24px; padding: 22px 0; cursor: pointer; font: 500 clamp(1.05rem, 1.55vw, 1.3rem)/1.3 var(--display); letter-spacing: -.018em; color: var(--color-text); transition: color .2s ease; }
.faq-q:hover, .faq-item.is-open .faq-q { color: var(--color-accent-200); }
.faq-q:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; border-radius: 6px; }
.faq-q i { position: relative; flex: none; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); transition: transform .45s var(--ease), background .3s ease, border-color .3s ease; }
.faq-q i::before, .faq-q i::after { content: ""; position: absolute; left: 50%; top: 50%; width: 11px; height: 1.5px; margin: -.75px 0 0 -5.5px; background: currentColor; transition: transform .45s var(--ease); }
.faq-q i::after { transform: rotate(90deg); }
.faq-item.is-open .faq-q i { transform: rotate(180deg); background: color-mix(in srgb, var(--color-accent) 18%, transparent); border-color: var(--color-accent); }
.faq-item.is-open .faq-q i::after { transform: rotate(0deg); }
.faq-a { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .5s var(--ease); }
.faq-a > div { min-height: 0; overflow: hidden; visibility: hidden; transition: visibility 0s .5s; }
.faq-item.is-open .faq-a { grid-template-rows: 1fr; }
.faq-item.is-open .faq-a > div { visibility: visible; transition-delay: 0s; }
.faq-a p { max-width: 62ch; padding: 0 56px 26px 0; color: var(--text-2); }

/* team */
.team-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 2.4vw, 32px); }
.member {
  display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 22px; align-items: start; padding: clamp(20px, 2.4vw, 32px);
  border: 1px solid var(--line); border-radius: var(--nx-radius); background: var(--nx-panel); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transform: perspective(900px) rotateY(calc(var(--tx, 0) * 5deg)) rotateX(calc(var(--ty, 0) * -5deg));
  transition: transform .5s var(--ease), border-color .3s ease;
}
.member.is-tilt { transition: transform .12s linear, border-color .3s ease; border-color: color-mix(in srgb, var(--color-accent) 50%, var(--line)); }
.member img { display: block; width: 104px; height: 104px; object-fit: cover; border-radius: calc(var(--nx-radius) * .7); }
.member h3 { font-size: 1.375rem; letter-spacing: -.02em; }
.member-role { margin-top: 4px; font-size: .875rem; color: var(--color-accent-300); }
.member-bio { margin-top: 12px; font-size: .9375rem; color: var(--text-2); }
.member-link { display: inline-block; margin-top: 14px; font: 500 .875rem/1 var(--display); color: var(--text-2); text-underline-offset: 4px; }
.member-link:hover { color: var(--color-text); }
@media (max-width: 820px) { .team-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 460px) { .member { grid-template-columns: 72px minmax(0, 1fr); gap: 16px; } .member img { width: 72px; height: 72px; } }

/* contact */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 520px); gap: clamp(32px, 6vw, 96px); align-items: start; }
.contact-copy .nx-lead { margin-top: 24px; }
.contact-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 24px; margin-top: 36px; }
.contact-form {
  padding: clamp(22px, 3vw, 36px); border: 1px solid var(--line); border-radius: var(--nx-radius);
  background: var(--nx-panel); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
}
.form-title { font-size: 1.375rem; letter-spacing: -.02em; }
.form-sub { margin-top: 6px; font-size: .9375rem; color: var(--text-2); }
.contact-form form { display: grid; gap: 18px; margin-top: 24px; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { display: grid; gap: 8px; min-width: 0; }
.field > span { font-size: .8125rem; color: var(--text-2); }
.field small { margin-left: 6px; font-size: .75rem; color: var(--text-3); }
.nx-input {
  box-sizing: border-box; width: 100%; min-height: 46px; padding: 11px 14px; border-radius: 12px; font: inherit; font-size: 1rem;
  color: var(--color-text); caret-color: var(--color-accent); background: color-mix(in srgb, var(--color-bg) 70%, transparent);
  border: 1px solid var(--line); transition: border-color .2s ease, box-shadow .2s ease;
}
.nx-input:hover { border-color: color-mix(in srgb, var(--color-text) 34%, transparent); }
.nx .nx-input:focus-visible { outline: none; border-color: var(--color-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-accent) 20%, transparent); }
textarea.nx-input { min-height: 104px; resize: vertical; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 38px; padding: 0 14px; border-radius: 999px; cursor: pointer; font: inherit; font-size: .875rem; color: var(--text-2); background: transparent; border: 1px solid var(--line); transition: background .2s ease, border-color .2s ease, color .2s ease; }
.chip:hover { border-color: color-mix(in srgb, var(--color-text) 34%, transparent); color: var(--color-text); }
.chip.is-on { border-color: var(--color-accent); background: color-mix(in srgb, var(--color-accent) 20%, transparent); color: var(--color-accent-200); }
.nx-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-error { padding: 12px 14px; border-radius: 12px; font-size: .875rem; color: var(--color-flag); border: 1px solid color-mix(in srgb, var(--color-flag) 40%, transparent); }
.form-note { font-size: .8125rem; color: var(--text-3); }
.form-note a { color: var(--text-2); text-underline-offset: 3px; }
.form-done { padding: 28px 0; }
.form-done .nx-mail { display: inline-block; margin-top: 18px; }
@media (max-width: 960px) { .contact-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 460px) { .field-row { grid-template-columns: minmax(0, 1fr); } }

/* footer */
.nx-foot { position: relative; z-index: 1; padding: 64px 0 96px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--color-bg) 88%, transparent); font-size: .9375rem; }
.foot-top { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 32px clamp(40px, 8vw, 120px); }
.foot-brand img { display: block; }
.foot-col { display: grid; gap: 8px; align-content: start; color: var(--text-2); }
.nx .foot-col h2 { margin-bottom: 6px; font: 500 .8125rem/1.2 var(--font-body); letter-spacing: 0; color: var(--text-3); }
.foot-col a { color: inherit; text-decoration: none; width: fit-content; transition: color .2s ease; }
.foot-col a:hover { color: var(--color-text); }
.foot-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--line); font-size: .8125rem; color: var(--text-3); }
@media (max-width: 720px) { .foot-top { grid-template-columns: repeat(2, minmax(0, 1fr)); } .foot-brand { grid-column: 1 / -1; } }

/* pages other than home: the shared nav and footer around their own content, and a small block scene in the hero */
.nx-top-space { height: 68px; }
.sub-scene { position: absolute; top: -4px; right: -12px; width: min(44%, 540px); aspect-ratio: 1.25; pointer-events: none; }
.sub-scene canvas { display: block; width: 100%; height: 100%; }
.sub-scene.no-gl { display: none; }
.sub-scene-lost { position: relative; top: 0; width: 100%; aspect-ratio: 1.22; }
@media (max-width: 900px) { .sub-scene { position: relative; top: 0; width: 100%; max-width: 440px; aspect-ratio: 1.75; margin: 0 auto 14px; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .nx *, .nx *::before, .nx *::after { animation: none !important; transition-duration: .01ms !important; }
  .fx .nx [data-split] .w > span { transform: none; }
}
