/* ==========================================================================
   Base: reset, typography, primitives
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img,
picture,
svg,
video {
  display: block;
  max-width: 100%;
}

a {
  color: var(--brand-blue);
  text-decoration: none;
}

a:hover {
  color: var(--brand-blue-700);
}

button {
  font: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid var(--brand-orange);
  outline-offset: 2px;
  border-radius: 4px;
}

/* --- Headings --- */
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
  color: var(--brand-ink);
  text-wrap: balance;
}

h1 {
  font-size: var(--text-hero);
  letter-spacing: -0.035em;
}

h2 {
  font-size: var(--text-3xl);
  letter-spacing: -0.03em;
}

h3 {
  font-size: var(--text-xl);
}

p {
  text-wrap: pretty;
}

/* --- Layout primitives --- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container-narrow {
  max-width: var(--container-narrow);
}

.section {
  padding-block: var(--space-section);
}

.section--tint {
  background: var(--surface-2);
}

/* fixed header offset for in-page anchors */
:where(section, footer)[id] {
  scroll-margin-top: 90px;
}

.measure {
  max-width: 65ch;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--space-md);
  top: -100px;
  z-index: var(--z-toast);
  background: var(--brand-blue);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  transition: top var(--dur-fast);
}

.skip-link:focus {
  top: var(--space-md);
  color: #fff;
}

/* --- Eyebrow (used sparingly, NOT above every section) --- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--brand-blue);
}

.eyebrow::before {
  content: "";
  width: 1.75rem;
  height: 3px;
  border-radius: 2px;
  background: var(--brand-orange);
}

/* --- Buttons --- */
.btn {
  --_bg: var(--brand-blue);
  --_fg: #fff;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-base);
  line-height: 1;
  padding: 0.95em 1.55em;
  border: 1px solid color-mix(in oklch, var(--_bg) 62%, black);
  border-radius: var(--radius-pill);
  color: var(--_fg);
  background-color: var(--_bg);
  /* top-lit gradient gives the face dimension */
  background-image: linear-gradient(
    180deg,
    color-mix(in oklch, var(--_bg) 90%, white),
    var(--_bg) 46%,
    color-mix(in oklch, var(--_bg) 90%, black)
  );
  /* inset highlight + ambient + brand-colored cast shadow */
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 2px 4px rgba(30, 42, 51, 0.1),
    0 10px 22px -8px color-mix(in oklch, var(--_bg) 55%, transparent);
  transition:
    transform var(--dur-fast) var(--ease-out-quint),
    box-shadow var(--dur-normal),
    filter var(--dur-fast);
}

.btn:hover {
  transform: translateY(-2px);
  color: var(--_fg);
  filter: brightness(1.045) saturate(1.03);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 3px 6px rgba(30, 42, 51, 0.12),
    0 20px 36px -10px color-mix(in oklch, var(--_bg) 68%, transparent);
}

.btn:active {
  transform: translateY(0) scale(0.99);
  filter: brightness(0.98);
  box-shadow:
    inset 0 2px 5px color-mix(in oklch, var(--_bg) 55%, black),
    0 2px 6px rgba(30, 42, 51, 0.12);
}

.btn--accent {
  --_bg: var(--brand-orange);
  --_fg: #fff;
}

.btn--ghost {
  --_bg: var(--surface);
  --_fg: var(--brand-blue);
  border-color: var(--line-strong);
  background-image: linear-gradient(180deg, #fff, var(--surface-2));
  box-shadow:
    inset 0 1px 0 #fff,
    0 1px 2px rgba(30, 42, 51, 0.06),
    0 8px 18px -10px rgba(30, 42, 51, 0.2);
}

.btn--ghost:hover {
  filter: none;
  border-color: var(--brand-blue);
  background-image: linear-gradient(180deg, #fff, var(--tint-blue-050));
  box-shadow:
    inset 0 1px 0 #fff,
    0 14px 26px -12px rgba(40, 93, 130, 0.34);
}

/* ghost on a dark surface (footer) */
.btn--on-dark {
  --_fg: #fff;
  border-color: rgba(255, 255, 255, 0.42);
  background-color: transparent;
  background-image: none;
  box-shadow: none;
}
.btn--on-dark:hover {
  filter: none;
  border-color: #fff;
  background-image: none;
  background-color: rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

.btn--lg {
  font-size: var(--text-lg);
  padding: 1.05em 1.95em;
}

.btn__arrow {
  transition: transform var(--dur-normal) var(--ease-out-expo);
}

.btn:hover .btn__arrow {
  transform: translateX(4px);
}

@media (prefers-reduced-motion: reduce) {
  .btn,
  .btn:hover,
  .btn:active {
    transform: none;
  }
}

/* --- Badges & pills --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-sm);
  padding: 0.4em 0.85em;
  border-radius: var(--radius-pill);
  background: var(--tint-blue-050);
  color: var(--brand-blue-900);
}

.badge--green {
  background: var(--tint-green-050);
  color: #3f5410;
}

.badge--orange {
  background: var(--tint-orange-050);
  color: #7a3b06;
}

/* --- 3D icon (3dicons.co, CC0, "color" finish; floats as an object, no tile) --- */
.icon3d {
  display: inline-grid;
  place-items: center;
  width: 4.75rem;
  height: 4.75rem;
  flex: none;
}

.icon3d img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* soft shadow grounds the object on the light surface */
  filter: drop-shadow(0 10px 16px rgba(30, 42, 51, 0.18));
}

.icon3d--sm {
  width: 3.5rem;
  height: 3.5rem;
}
