:root {
  --bg: #ffffff;
  --bg-alt: #f5f7fa;
  --surface: #ffffff;
  --line: #e3e8ef;
  --text: #121826;
  --muted: #5b6475;
  --brand: #2b9ce0;        /* logo blue */
  --primary: #1a7fc1;      /* darker logo blue for buttons/links (AA on white) */
  --primary-dark: #14699f;
  --c1: #1a7fc1;
  --c2: #7c5cff;
  --c3: #0e9f86;
  --c4: #e57a14;
  --c5: #d6336c;
  --c6: #0891b2;
  --c7: #65a30d;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(18, 24, 38, .06);
  --shadow: 0 1px 2px rgba(18, 24, 38, .04), 0 8px 24px -12px rgba(18, 24, 38, .14);
  --shadow-lg: 0 2px 4px rgba(18, 24, 38, .04), 0 18px 40px -18px rgba(18, 24, 38, .22);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(35px, 5vw, 50px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font); font-weight: 700; line-height: 1.15; letter-spacing: -0.025em; margin: 0; }
p { margin: 0; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--primary); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 var(--gutter); }
.wrap--narrow { max-width: 720px; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 6px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 22px; border-radius: 10px; border: 1px solid var(--primary);
  background: var(--primary); color: #fff;
  font: 600 0.97rem var(--font); text-decoration: none; cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn--ghost { background: var(--surface); color: var(--text); border-color: var(--line); box-shadow: var(--shadow-sm); }
.btn--ghost:hover { background: var(--bg-alt); border-color: #cfd6e0; }
.btn__icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Hero */
.hero {
  padding: clamp(56px, 9vw, 112px) 0;
  background:
    radial-gradient(#dfe5ee 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(180deg, #f7f9fc, #ffffff);
  border-bottom: 1px solid var(--line);
}
.hero__logo { display: block; height: clamp(104px, 12vw, 140px); width: auto; margin-bottom: clamp(24px, 3vw, 36px); }
.hero__inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero__copy { max-width: 760px; }

/* Hat stack: the circle sits at the bottom, hats pile up above it */
.hero__art {
  position: relative; align-self: stretch;
  width: clamp(260px, 32vw, 420px); min-height: clamp(340px, 42vw, 560px);
}
.hero__art::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--primary) 12%, white), color-mix(in srgb, var(--primary) 4%, white) 70%);
  border: 1px solid color-mix(in srgb, var(--primary) 14%, white);
}
.hat {
  position: absolute; left: 50%; bottom: 22%; width: 58%;
  transform: translateX(calc(-50% + var(--x, 0px))) rotate(var(--tilt, 0deg));
  transform-origin: 50% 80%;
}
.hat svg { width: 100%; overflow: visible; }
.hat svg * { stroke: var(--text); stroke-width: 4; stroke-linejoin: round; }
.hat .hat__white { fill: #fff; }
.hat .hat__lid { fill: color-mix(in srgb, var(--hat-color, var(--primary)) 10%, white); }
.hat .hat__accent { fill: var(--hat-color, var(--primary)); }
.hat .hat__outline { fill: none; }
.hat [stroke="none"] { stroke: none; }

/* Phones: static stack of 3 hats, top right, beside the logo */
.hero__mini { display: none; }
.hero__mini .hat { width: 100%; pointer-events: none; }
/* Only the drawn hat is tappable, not the empty space around it */
.hero__mini .hat svg * { pointer-events: visiblePainted; cursor: pointer; }
.hero__mini { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.hero__mini .hat.is-swapped svg { animation: hat-swap .4s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes hat-swap {
  0% { transform: scale(.4) rotate(-25deg); opacity: .3; }
  100% { transform: none; opacity: 1; }
}
.hero__mini > svg { position: absolute; bottom: 0; width: 100%; overflow: visible; transform: rotate(10deg); }
.hero__mini > svg * { stroke: var(--text); stroke-width: 4; stroke-linejoin: round; }
.hero__mini > svg .hat__accent { fill: var(--c2); }
.hero__mini > svg .hat__white { fill: #fff; }
.hat.is-new svg { animation: hat-drop .75s cubic-bezier(.3, 1.35, .5, 1) both; }
.hat.is-falling {
  transition: transform .8s cubic-bezier(.5, 0, .9, .5), opacity .8s ease;
  transform: translateX(calc(-50% + var(--x, 0px) + var(--fx, 0px))) translateY(120px) rotate(var(--fall, 40deg));
  opacity: 0;
}
@keyframes hat-drop {
  from { transform: translateY(-220px); opacity: 0; }
  30% { opacity: 1; }
  to { transform: none; }
}
.eyebrow { display: inline-block; font-size: 0.82rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); margin-bottom: 18px; }
.hero h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); text-wrap: balance; }
.accent { color: var(--primary); }
.lede { margin-top: 20px; max-width: 520px; font-size: clamp(1.03rem, 1.4vw, 1.15rem); color: var(--muted); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* Sections */
.section { padding: clamp(64px, 9vw, 104px) 0; }
.section__head { max-width: 640px; margin-bottom: clamp(28px, 4vw, 44px); }
.kicker { font-size: 0.82rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--primary); margin-bottom: 12px; }
.section__sub { margin-top: 12px; color: var(--muted); font-size: 1.05rem; }
.section h2, .contact h2 { font-size: clamp(1.75rem, 3.2vw, 2.4rem); }

.grid { display: grid; gap: 20px; }
.grid--services { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Service cards */
.card {
  display: flex; flex-direction: column;
  padding: clamp(24px, 3vw, 30px); border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: box-shadow .2s ease, transform .2s ease;
}
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.card__icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 18px; background: color-mix(in srgb, var(--accent) 12%, white); color: var(--accent); }
.card__icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.card h3 { font-size: 1.25rem; margin-bottom: 6px; }
.card > p { color: var(--muted); flex: 1; }
/* Hat cards that fill empty spots on the last row (added by script.js) */
.card--hat {
  display: grid; place-items: center; min-height: 220px; cursor: pointer;
  background: color-mix(in srgb, var(--accent, var(--primary)) 6%, white);
  border-style: dashed; box-shadow: none;
  -webkit-tap-highlight-color: transparent;
}
.card--hat .hat { position: static; width: min(60%, 200px); transform: rotate(var(--tilt, 0deg)); transition: transform .3s ease; }
.card--hat:hover .hat { transform: rotate(calc(var(--tilt, 0deg) * -1)) translateY(-4px); }
.card--hat .hat.is-swapped svg { animation: hat-swap .4s cubic-bezier(.3, 1.4, .5, 1); }

.card__link { margin-top: 18px; color: var(--primary); font-weight: 600; font-size: 0.95rem; text-decoration: none; }
.card__link span { display: inline-block; transition: transform .15s; }
.card__link:hover span { transform: translateX(3px); }

/* Contact */
.contact { padding: clamp(64px, 9vw, 104px) 0; background: var(--bg-alt); border-top: 1px solid var(--line); text-align: center; }
.contact__inner > p { margin-top: 12px; color: var(--muted); font-size: 1.05rem; }
.contact__email {
  display: inline-block; margin-top: 28px;
  font-size: clamp(1.5rem, 4.5vw, 2.6rem); font-weight: 700; letter-spacing: -0.025em;
  color: var(--primary); text-decoration: none; overflow-wrap: anywhere;
  border-bottom: 2px solid color-mix(in srgb, var(--primary) 25%, transparent);
  transition: border-color .15s;
}
.contact__email:hover { border-color: var(--primary); }
.contact__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 28px; }
.contact__status { min-height: 1.5em; margin-top: 12px; font-size: 0.92rem; color: var(--c3); }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); font-size: 0.9rem; }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }

/* Reveal on scroll (subtle) */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .5s ease, transform .5s ease; }
.reveal.is-in { opacity: 1; transform: none; }

/* Responsive */
@media (max-width: 900px) {
  .grid--services { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .grid--services { grid-template-columns: 1fr; }
  .hero__inner { grid-template-columns: 1fr; }
  .hero__art { display: none; }
  .hero__inner { position: relative; }
  .eyebrow { max-width: 225px; }
  .hero__logo { margin-bottom: 48px; }
  .hero__mini {
    display: block; position: absolute; top: -32px; right: calc(var(--gutter) + 4px);
    width: 108px; height: 176px;
  }
}

@media (max-width: 560px) {
  .hero__cta .btn, .contact__actions .btn { flex: 1 1 100%; }
  .footer__inner { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
