/* ============================================================
   Page styles for the homepage and the service pages.
   Shared header, footer and tokens live in styles.css.
   Everything here is scoped under .hp so it can't leak into
   the header/footer or other pages. Service-page-only pieces
   live in service.css; scroll motion lives in motion.js.
   ============================================================ */

.hp {
  --hp-navy: #0a2540;
  --hp-blue: #1e90ff;
  --hp-green: #00875a;
  --hp-green-hover: #007150;
  --hp-red: #d64545;
  --hp-body: #3d4a5c;
  --hp-label: #4a5568;
  --hp-tint: #f7f9fc;
  --hp-serif: 'Fraunces', Georgia, serif;
  --hp-sans: 'Inter', system-ui, sans-serif;
  --hp-gutter: clamp(20px, 4vw, 32px);
  --hp-pad: clamp(72px, 9vw, 110px);
  font-family: var(--hp-sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--hp-navy);
}
.hp a { color: var(--hp-navy); }
.hp a:hover { color: var(--hp-blue); }

.hp-wrap { max-width: 1200px; margin: 0 auto; padding: 0 var(--hp-gutter); }
.hp-sec { padding: var(--hp-pad) 0; }
.hp-navy { background: var(--hp-navy); color: #fff; overflow: hidden; }
.hp-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--col, 400px)), 1fr)); }

/* ---------- Type ---------- */
.hp-h1, .hp-h2, .hp-h3 { font-family: var(--hp-serif); font-weight: 600; text-wrap: pretty; }
.hp-h1 {
  font-variation-settings: 'opsz' 96;
  font-size: clamp(38px, 5vw, 60px);
  line-height: 1.1;
  letter-spacing: -.02em;
  margin-bottom: 26px;
}
.hp-h2 {
  font-variation-settings: 'opsz' 96;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.1;
  letter-spacing: -.02em;
}
.hp-h3 { line-height: 1.15; letter-spacing: -.015em; }
.hp-sub { font-size: 19px; color: var(--hp-body); text-wrap: pretty; }
.hp-num { font-family: var(--hp-serif); font-style: italic; color: var(--hp-blue); line-height: 1; }

/* Hand-drawn highlight behind a word */
.hp-nb, .hp-mark { white-space: nowrap; }
.hp-mark { position: relative; display: inline-block; }
.hp-mark > span { position: relative; }
.hp-mark svg {
  position: absolute;
  left: -10px;
  top: 4px;
  width: calc(100% + 20px);
  height: calc(100% - 4px);
  transform-origin: left center;
}
.hp-mark path { fill: var(--hp-blue); opacity: .32; }
.hp-h1 .hp-mark svg { animation: hpBlobIn .5s cubic-bezier(.2,.9,.3,1.1) both; }
.hp-h1 .hp-mark:nth-of-type(1) svg { animation-delay: .4s; }
.hp-h1 .hp-mark:nth-of-type(2) svg { animation-delay: .9s; }
.hp-h1 .hp-mark:nth-of-type(3) svg { animation-delay: 1.4s; }

/* ---------- Buttons ---------- */
.hp-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--hp-green);
  color: #fff;
  padding: 16px 28px;
  border: none;
  border-radius: 999px;
  font-family: var(--hp-sans);
  font-weight: 700;
  font-size: 15.5px;
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s, box-shadow .18s, background .18s;
}
.hp a.hp-btn, .hp a.hp-btn:hover { color: #fff; }
.hp-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px -10px rgba(0,135,90,.8);
  background: var(--hp-green-hover);
}
.hp-btn-outline {
  display: inline-flex;
  align-items: center;
  background: transparent;
  border: 2px solid var(--hp-navy);
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15.5px;
  line-height: 1.3;
  text-decoration: none;
  transition: background .18s;
}
.hp a.hp-btn-outline:hover { background: #eef6ff; color: var(--hp-navy); }

/* ---------- 1. Hero ---------- */
.hp-hero { padding: clamp(40px, 6vw, 72px) 0 clamp(60px, 8vw, 100px); overflow: hidden; }
.hp-hero .hp-two { --col: 460px; gap: 40px; align-items: center; }
.hp-hero-lede {
  font-size: clamp(17px, 1.5vw, 19px);
  line-height: 1.55;
  color: var(--hp-body);
  max-width: 520px;
  margin-bottom: 34px;
  text-wrap: pretty;
}
.hp-actions { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }

/* Orbit illustration: all positions are % of the square */
.hp-orbit { position: relative; width: 100%; max-width: 560px; aspect-ratio: 1; margin: 0 auto; }
.hp-ring {
  position: absolute;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px dashed rgba(10,37,64,.3);
}
.hp-ring-in { left: 25%; top: 19%; width: 50%; animation: hpSpin 36s linear infinite; }
.hp-ring-out { left: 14.3%; top: 8.3%; width: 71.4%; animation: hpSpinRev 56s linear infinite; }
.hp-tile {
  position: absolute;
  width: 60px;
  height: 60px;
  margin: -30px 0 0 -30px;
  border-radius: 16px;
  background: #fff;
  border: 3px solid var(--hp-navy);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 24px -14px rgba(10,37,64,.5);
}
.hp-ring-in .hp-tile { animation: hpSpinRev 36s linear infinite; }
.hp-ring-out .hp-tile { animation: hpSpin 56s linear infinite; }
.hp-tile-top { left: 50%; top: 0; }
.hp-tile-left { left: 0; top: 50%; }
.hp-tile-right { left: 100%; top: 50%; background: var(--hp-blue); }
.hp-tile img { object-fit: contain; }
.hp-gear {
  position: absolute;
  left: 50%;
  top: 100%;
  width: 60px;
  height: 60px;
  margin: -30px 0 0 -30px;
  border-radius: 50%;
  background: #fff;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hp-gear svg { animation: hpSpinRev 9s linear infinite; }
.hp-gear:focus-visible { outline: 3px solid var(--hp-blue); outline-offset: 3px; }
.hp-orbit.is-turbo .hp-ring,
.hp-orbit.is-turbo .hp-tile { animation-duration: 3s; }

.hp-window {
  position: absolute;
  left: 28.5%;
  top: 28.3%;
  width: 43%;
  min-width: 170px;
  height: auto;
  filter: drop-shadow(0 20px 24px rgba(10,37,64,.18));
  animation: hpBob 6s ease-in-out infinite;
}
.hp-window .hp-trend { animation: hpDrawLoop 5s ease-in-out infinite; }

.hp-stat {
  position: absolute;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 3px solid var(--hp-navy);
  border-radius: 18px;
  padding: 14px 18px;
  box-shadow: 0 18px 30px -18px rgba(10,37,64,.5);
  text-decoration: none;
  transition: transform .25s;
}
.hp a.hp-stat:hover { color: var(--hp-navy); transform: translateY(-4px) rotate(-1.5deg); }
.hp-stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--hp-green);
  border: 2px solid var(--hp-navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hp-stat-text { display: block; }
.hp-stat-num {
  display: block;
  font-family: var(--hp-serif);
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.03em;
}
.hp-stat-label { display: block; font-size: 12px; color: var(--hp-label); margin-top: 4px; line-height: 1.4; }
.hp-stat-cta {
  display: block;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  color: var(--hp-green);
  font-weight: 600;
  font-size: 13px;
  transition: max-height .25s ease, opacity .25s ease, margin .25s ease;
}
.hp-stat:hover .hp-stat-cta,
.hp-stat:focus-visible .hp-stat-cta { max-height: 24px; opacity: 1; margin-top: 8px; }

/* ---------- 2. Sound familiar? ---------- */
.hp-sf { padding: var(--hp-pad) 0 0; position: relative; }
.hp-sf .hp-two { --col: 360px; gap: clamp(24px, 4vw, 64px); align-items: end; }
.hp-sf-text { padding-bottom: var(--hp-pad); }
.hp-sf-h2 {
  font-family: var(--hp-serif);
  font-variation-settings: 'opsz' 96;
  font-weight: 600;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1;
  letter-spacing: -.025em;
  margin-bottom: 22px;
}
.hp-sf-lead {
  font-family: var(--hp-serif);
  font-variation-settings: 'opsz' 24;
  font-size: clamp(19px, 1.7vw, 22px);
  line-height: 1.4;
  margin-bottom: 40px;
  text-wrap: pretty;
  color: rgba(255,255,255,.92);
}
.hp-rows { list-style: none; display: flex; flex-direction: column; }
.hp-row {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 14px;
  padding: 20px 0;
  border-top: 2px dashed rgba(255,255,255,.3);
}
.hp-row:last-child { border-bottom: 2px dashed rgba(255,255,255,.3); }
.hp-row .hp-num { font-size: 32px; }
.hp-row p { font-size: 16px; line-height: 1.55; color: rgba(255,255,255,.82); text-wrap: pretty; }

.hp-sf-art { position: relative; padding: 0 10px; align-self: end; width: 100%; max-width: 560px; margin: 0 auto; }
.hp-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; position: relative; z-index: 2; margin: 0 18px; }
.hp-card {
  background: #fff;
  color: var(--hp-navy);
  border: 3px solid var(--hp-navy);
  border-radius: 14px;
  padding: 14px 14px 12px;
  box-shadow: 0 18px 26px rgba(0,0,0,.35);
}
.hp-card:nth-child(1) { margin-top: 22px; animation: hpFloat1 6s ease-in-out infinite; }
.hp-card:nth-child(2) { animation: hpFloat2 7s ease-in-out infinite .6s; }
.hp-card:nth-child(3) { animation: hpFloat3 6.5s ease-in-out infinite 1.2s; }
.hp-card:nth-child(4) { margin-top: 16px; animation: hpFloat4 7.5s ease-in-out infinite .3s; }
.hp-card-label {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 10px;
  font-weight: 600;
  color: var(--hp-body);
  margin-bottom: 6px;
  white-space: nowrap;
}
.hp-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.hp-card-head .hp-card-label { margin-bottom: 0; }
.hp-card-cap { font-family: var(--hp-serif); font-style: italic; font-size: 13px; color: var(--hp-body); margin-top: 6px; }
.hp-chart { display: block; width: 100%; height: 44px; }
.hp-chart .hp-line { animation: hpDrawLine 1.8s cubic-bezier(.4,0,.2,1) both; }
.hp-alert { display: flex; align-items: center; gap: 8px; }
.hp-alert-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--hp-red);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--hp-serif);
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  flex-shrink: 0;
}
.hp-alert-text { font-family: var(--hp-serif); font-weight: 600; font-size: 17px; color: var(--hp-red); line-height: 1.1; }
.hp-track { margin-top: 12px; height: 8px; border-radius: 999px; background: #e9edf3; overflow: hidden; }
.hp-track div { height: 100%; border-radius: 999px; background: var(--hp-red); animation: hpCrawl 5s ease-in-out infinite; }

.hp-figure { position: relative; margin: -10px 0 24px; }
.hp-figure img { display: block; }
.hp-figure > img:first-child { width: 100%; height: auto; }
.hp-sprite { position: absolute; height: auto; animation: hpQFloat 5s ease-in-out infinite; }
.hp-scribble { filter: brightness(0) invert(1); opacity: .85; transform-origin: center; animation-name: hpWobble; }

/* ---------- 3. Results ---------- */
.hp-results { text-align: center; position: relative; overflow: hidden; }
.hp-results .hp-h2 { font-size: clamp(32px, 3.8vw, 48px); max-width: 640px; margin: 0 auto 56px; }
.hp-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 32px; align-items: end; }
.hp-big {
  font-family: var(--hp-serif);
  font-variation-settings: 'opsz' 144;
  font-size: clamp(64px, 8vw, 116px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.04em;
  margin-bottom: 12px;
}
.hp-big-blue { color: var(--hp-blue); }
.hp-big-label { text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 600; color: var(--hp-label); }
.hp-foot { margin-top: 56px; font-size: 15px; color: var(--hp-label); }
.hp-ulink {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--hp-blue);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

/* ---------- 4. Services ---------- */
.hp-services-head { max-width: 720px; margin-bottom: 52px; }
.hp-services-head .hp-h2 { margin-bottom: 16px; }
.hp-services { --col: 400px; gap: 24px; }
.hp-service {
  background: var(--hp-tint);
  border: 3px solid transparent;
  border-radius: 22px;
  padding: 34px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform .22s, border-color .22s, box-shadow .22s;
}
.hp-service:hover {
  transform: translateY(-5px);
  border-color: var(--hp-navy);
  box-shadow: 0 24px 40px -24px rgba(10,37,64,.3);
}
.hp-service-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 8px; }
.hp-service-top svg { transition: transform .3s; }
.hp-service:hover .hp-service-top svg { transform: translateY(-6px) rotate(-4deg); }
.hp-service-top .hp-num { font-size: 34px; }
.hp-service .hp-h3 { font-size: clamp(22px, 2vw, 27px); }
.hp-service p { font-size: 16px; line-height: 1.55; color: var(--hp-body); }

/* ---------- 5. How I work ---------- */
.hp-how { --col: 380px; gap: 64px; align-items: start; }
.hp-photo { position: relative; width: min(100%, 440px); }
.hp-photo::before {
  content: '';
  position: absolute;
  inset: 16px -16px -16px 16px;
  border-radius: 28px;
  border: 2px dashed rgba(10,37,64,.3);
}
.hp-photo img {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  border-radius: 28px;
  border: 3px solid var(--hp-navy);
}
.hp-sticker {
  position: absolute;
  background: #fff;
  border: 3px solid var(--hp-navy);
  border-radius: 14px;
  padding: 10px 14px;
  font-family: var(--hp-serif);
  font-style: italic;
  font-size: 17px;
  line-height: 1.3;
}
.hp-photo .hp-sticker { left: -14px; bottom: 28px; transform: rotate(-3deg); }
.hp-how .hp-h2 { margin-bottom: 18px; }
.hp-how .hp-sub { margin-bottom: 40px; }
.hp-points { list-style: none; display: flex; flex-direction: column; }
.hp-point {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  padding: 22px 0;
  border-top: 2px dashed #cbd5e1;
}
.hp-point:last-child { border-bottom: 2px dashed #cbd5e1; }
.hp-point .hp-num { font-size: 30px; line-height: 1.1; }
.hp-point .hp-h3 { font-size: 22px; margin-bottom: 8px; }
.hp-point p { font-size: 16px; color: var(--hp-body); }

/* ---------- 6. Beyond the basics ---------- */
.hp-beyond { --col: 400px; gap: 64px; align-items: center; }
.hp-beyond .hp-h2 { margin-bottom: 24px; }
.hp-beyond p { color: rgba(255,255,255,.8); text-wrap: pretty; }
.hp-beyond p + p { margin-top: 18px; }
.hp-beyond em { font-family: var(--hp-serif); color: #fff; font-size: 1.08em; }
.hp-code-wrap { position: relative; padding: 20px 0; }
.hp-code {
  background: #fff;
  color: var(--hp-navy);
  border: 3px solid var(--hp-navy);
  border-radius: 16px;
  padding: 20px 22px;
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 13px;
  line-height: 1.75;
  white-space: pre;
  overflow-x: auto;
  box-shadow: 0 30px 50px -30px rgba(0,0,0,.6);
  transform: rotate(-2deg);
  transition: transform .3s;
}
.hp-code:hover { transform: rotate(0deg); }
.hp-dots { display: flex; gap: 6px; margin-bottom: 12px; }
.hp-dots span { width: 10px; height: 10px; border-radius: 50%; background: var(--hp-navy); }
.hp-dots span:nth-child(2) { background: var(--hp-blue); }
.hp-dots span:nth-child(3) { background: none; border: 2px solid var(--hp-navy); }
.hp-code .k { color: var(--hp-blue); }
.hp-code .s { color: var(--hp-green); }
.hp-code .c { color: #6b7a8c; font-style: italic; }
.hp-code-wrap .hp-sticker {
  right: -8px;
  bottom: -6px;
  background: var(--hp-blue);
  color: var(--hp-navy);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 18px;
  transform: rotate(3deg);
}

/* ---------- 7. Contact ---------- */
.hp-contact { background: var(--hp-tint); }
.hp-contact .hp-wrap { max-width: 720px; text-align: center; }
.hp-contact .hp-h2 { font-size: clamp(36px, 5vw, 64px); margin-bottom: 20px; }
.hp-contact .hp-sub { margin-bottom: 28px; }
.hp-form {
  background: #fff;
  padding: clamp(24px, 3vw, 36px);
  border-radius: 22px;
  border: 3px solid var(--hp-navy);
  display: flex;
  flex-direction: column;
  gap: 18px;
  text-align: left;
  margin-top: 44px;
}
.hp-form-title { font-family: var(--hp-serif); font-style: italic; font-size: 20px; }
.hp-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.hp-form label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.hp-form input,
.hp-form textarea {
  width: 100%;
  padding: 13px 16px;
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  font-family: var(--hp-sans);
  font-size: 15px;
  color: #1a1a1a;
  background: #fff;
}
.hp-form textarea { resize: vertical; min-height: 120px; }
.hp-form input:focus,
.hp-form textarea:focus { outline: none; border-color: var(--hp-blue); box-shadow: 0 0 0 3px rgba(30,144,255,.15); }
.hp-form .hp-btn { align-self: flex-start; padding: 15px 26px; }
.hp-sent {
  font-size: 14px;
  color: var(--hp-green);
  font-weight: 600;
  padding: 12px 14px;
  background: rgba(0,135,90,.08);
  border-radius: 12px;
}
/* Error note, and the hidden spam trap (bots fill it, people never see it) */
.hp-sent-error { color: #b42318; background: rgba(214,69,69,.08); }
.hp-form-note { font-size: 13px; color: var(--hp-label); margin-top: -6px; }
.hp-form-note a { text-decoration: underline; }
.hp-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.hp-form .hp-btn:disabled { opacity: .6; cursor: wait; transform: none; }
.hp-contact-line {
  display: flex;
  justify-content: center;
  gap: 12px 36px;
  flex-wrap: wrap;
  margin-top: 32px;
  font-size: 15px;
  color: var(--hp-body);
}
.hp-contact-line a,
.hp-contact-line span { display: inline-block; padding: 10px 0; }
.hp-contact-line a { text-decoration: none; font-weight: 500; }

/* ---------- Scroll-in (JS adds .hp-js to <html>) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hp-js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
  .hp-js [data-reveal].is-in { opacity: 1; transform: none; }
  .hp-js [data-blob] svg { transform: scale(0, 1); transition: transform .5s cubic-bezier(.2,.9,.3,1.1) .3s; }
  .hp-js [data-blob].is-in svg { transform: scale(1, 1); }
  .hp-js [data-draw] * { stroke-dasharray: 1; stroke-dashoffset: 1; fill-opacity: 0; transition: stroke-dashoffset 1s ease, fill-opacity .4s ease .6s; }
  .hp-js [data-draw].is-in * { stroke-dashoffset: 0; fill-opacity: var(--fo, 1); }
}

/* ---------- Small screens ---------- */
@media (max-width: 760px) {
  .hp-sf-text { padding-bottom: 40px; }
}

/* ---------- Motion ---------- */
@keyframes hpSpin { to { transform: rotate(360deg); } }
@keyframes hpSpinRev { to { transform: rotate(-360deg); } }
@keyframes hpBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes hpBlobIn { from { transform: scale(0, 1); } }
@keyframes hpDrawLoop { 0% { stroke-dashoffset: 1; } 55%, 100% { stroke-dashoffset: 0; } }
@keyframes hpDrawLine { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes hpFloat1 { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-10px) rotate(-3deg); } }
@keyframes hpFloat2 { 0%, 100% { transform: translateY(0) rotate(2deg); } 50% { transform: translateY(-12px) rotate(2deg); } }
@keyframes hpFloat3 { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-8px) rotate(-2deg); } }
@keyframes hpFloat4 { 0%, 100% { transform: translateY(0) rotate(3deg); } 50% { transform: translateY(-11px) rotate(3deg); } }
@keyframes hpCrawl { 0% { width: 8%; } 80%, 100% { width: 34%; } }
@keyframes hpQFloat { 0%, 100% { transform: translateY(0) rotate(-8deg); } 50% { transform: translateY(-10px) rotate(8deg); } }
@keyframes hpWobble { 0%, 100% { transform: rotate(-8deg) scale(1); } 50% { transform: rotate(8deg) scale(1.08); } }

@media (prefers-reduced-motion: reduce) {
  .hp *, .hp *::before, .hp *::after { animation: none !important; transition: none !important; }
  /* Static resting poses */
  .hp-card:nth-child(1) { transform: rotate(-3deg); }
  .hp-card:nth-child(2) { transform: rotate(2deg); }
  .hp-card:nth-child(3) { transform: rotate(-2deg); }
  .hp-card:nth-child(4) { transform: rotate(3deg); }
  .hp-track div { width: 34%; }
}
