/* ============================================================
   Civilised Contracting — Homepage "2a" (interactive dark)
   Self-contained stylesheet, loaded only by index.html.
   ============================================================ */

:root {
  --ink: #212528;
  --ink-2: #24272A;
  --ink-3: #1B1E20;
  --paper: #EFEEE8;
  --cream: #E7E5DC;
  --line-dark: rgba(237, 234, 224, 0.14);
  --line-light: #D8D6CC;
  --text-light: #EDEAE0;
  --text-mut: #A9ACA6;
  --text-mut-2: #9FA3A2;
  --text-faint: #6E7273;
  --charcoal: #2B2E30;
  --grey: #5B5F61;
  --blue: #00AEEF;
  --pad: clamp(20px, 5vw, 56px);
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

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

body.hp {
  margin: 0;
  background: var(--ink);
  color: var(--text-light);
  font-family: Inter, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.hp a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

h1, h2, h3 { margin: 0; font-weight: 400; }

.hp main,
.hp-header,
.hp-footer { max-width: 1560px; margin-inline: auto; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--blue); color: #fff; padding: 10px 16px; font-size: 14px;
}
.skip-link:focus { left: 8px; top: 8px; }

.hp :focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

/* ---- shared bits ---- */
.eyebrow {
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--blue); font-weight: 600; margin-bottom: 22px;
}
.eyebrow .line { width: 28px; height: 1px; background: var(--blue); flex: none; }

.dia-mono { font-family: var(--mono); letter-spacing: 0.07em; }

/* ---- buttons ---- */
.hp-btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14.5px; letter-spacing: 0.02em; padding: 14px 26px;
  border: 1px solid transparent; transition: background .2s ease, color .2s ease, border-color .2s ease;
  white-space: nowrap;
}
/* `.hp` prefix keeps these ahead of `.hp a { color: inherit }` */
.hp .hp-btn-solid { background: var(--text-light); color: var(--ink); font-weight: 500; }
.hp .hp-btn-solid:hover { background: #fff; }
.hp .hp-btn-ghost { border-color: rgba(237, 234, 224, 0.4); color: var(--text-light); }
.hp .hp-btn-ghost:hover { border-color: var(--text-light); }
.hp .hp-btn-outline { border-color: rgba(237, 234, 224, 0.45); color: var(--text-light); padding: 11px 22px; font-size: 13.5px; }
.hp .hp-btn-outline:hover { border-color: var(--text-light); }
.hp .hp-btn-dark { background: var(--charcoal); color: #fff; }
.hp .hp-btn-dark:hover { background: #000; }

/* ============================================================
   HEADER
   ============================================================ */
.hp-header { position: relative; z-index: 20; }
.hp-header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px var(--pad);
  border-bottom: 1px solid rgba(237, 234, 224, 0.12);
}
.hp-logo img { height: 30px; width: auto; }
.hp-nav ul { display: flex; gap: 34px; margin: 0; padding: 0; list-style: none; }
.hp-nav a { font-size: 14px; color: var(--text-mut); transition: color .2s ease; }
.hp-nav a:hover, .hp-nav a[aria-current="page"] { color: var(--text-light); }
.hp-header-cta { display: flex; gap: 22px; align-items: center; }
.hp-phone { font-size: 14px; color: var(--text-light); font-weight: 500; }
.hp-nav-toggle {
  display: none; flex-direction: column; gap: 5px; width: 34px; height: 30px;
  background: none; border: 0; cursor: pointer; padding: 6px 4px;
}
.hp-nav-toggle span { height: 1.5px; background: var(--text-light); transition: transform .3s ease, opacity .2s ease; }

/* ============================================================
   HERO
   ============================================================ */
.hp-hero {
  display: grid; grid-template-columns: minmax(0, 470px) 1fr; gap: 64px;
  padding: 72px var(--pad) 0; align-items: center;
}
.hp-hero-copy h1 {
  font-family: Newsreader, Georgia, serif; font-weight: 300;
  font-size: clamp(40px, 4.4vw, 60px); line-height: 1.04; letter-spacing: -0.015em;
  color: #fff; margin-bottom: 24px;
}
.hp-hero-copy h1 em { font-style: italic; color: var(--text-mut-2); }
.hp-hero .lede { font-size: 16.5px; line-height: 1.65; color: var(--text-mut); margin: 0 0 34px; }
.hp-hero-actions { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-bottom: 40px; }
.hp-hero-cred { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.06em; color: var(--text-faint); text-transform: uppercase; margin: 0; }

.hp-hero-visual {
  position: relative; border: 1px solid rgba(237, 234, 224, 0.14);
  background: linear-gradient(180deg, #1E2225, #1A1D20);
  aspect-ratio: 960 / 620; overflow: hidden;
}
.hero-dia {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 1; transition: opacity .9s ease;
}
/* DA vs model sub-layers */
.dia-da { opacity: 1; transition: opacity .8s ease; }
.dia-model { opacity: 0; transition: opacity .8s ease .1s; }
.dia-sub-da { opacity: 1; transition: opacity .5s ease; }
.dia-sub-model { opacity: 0; transition: opacity .5s ease; }

.hero-media {
  position: absolute; inset: 0; margin: 0; opacity: 0;
  transition: opacity .9s ease; pointer-events: none;
}
.hero-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(0.82) contrast(1.02); }
.hero-media figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: space-between; gap: 16px;
  padding: 12px 18px; background: rgba(27, 30, 32, 0.88);
  color: var(--text-light); font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em;
}
.hero-media figcaption .stage { color: var(--blue); }

/* phase state machine (data-phase on <body>) */
.hp[data-phase="1"] .dia-da { opacity: 0; }
.hp[data-phase="1"] .dia-model { opacity: 1; }
.hp[data-phase="1"] .dia-sub-da { opacity: 0; }
.hp[data-phase="1"] .dia-sub-model { opacity: 1; }

.hp[data-phase="2"] .hero-dia,
.hp[data-phase="3"] .hero-dia,
.hp[data-phase="4"] .hero-dia,
.hp[data-phase="5"] .hero-dia { opacity: 0; }

.hp[data-phase="2"] .m-demo,
.hp[data-phase="3"] .m-shore,
.hp[data-phase="4"] .m-bulk,
.hp[data-phase="5"] .m-hand { opacity: 1; }

/* ============================================================
   STAGE STEPPER
   ============================================================ */
.hp-stepper {
  display: grid; grid-template-columns: repeat(5, 1fr);
  margin: 52px var(--pad) 0; border-top: 1px solid rgba(237, 234, 224, 0.14);
  padding-bottom: 56px;
}
.hp-step {
  text-align: left; background: none; border: 0; cursor: pointer;
  border-top: 2px solid transparent; margin-top: -1px;
  padding: 20px 24px 0 0; opacity: 0.45;
  transition: opacity .4s ease, border-color .4s ease; font: inherit; color: inherit;
  display: flex; flex-direction: column;
}
.hp-step.is-active { opacity: 1; border-top-color: var(--blue); }
.hp-step-idx { font-family: var(--mono); font-size: 12px; color: var(--blue); margin-bottom: 8px; }
.hp-step-name { font-size: 15px; font-weight: 600; color: var(--text-light); margin-bottom: 6px; }
.hp-step-desc { font-size: 12.5px; color: var(--text-mut-2); line-height: 1.5; }

/* ============================================================
   TICKER
   ============================================================ */
.hp-ticker {
  background: var(--ink-3);
  border-top: 1px solid rgba(237, 234, 224, 0.1);
  border-bottom: 1px solid rgba(237, 234, 224, 0.1);
  display: flex; align-items: center; gap: 28px;
  padding: 14px 0 14px var(--pad); font-size: 13.5px; color: var(--text-mut-2);
}
.hp-ticker-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; color: var(--text-faint); text-transform: uppercase; flex: none; }
.hp-ticker-viewport { overflow: hidden; flex: 1; min-width: 0; }
.hp-ticker-track { display: inline-flex; white-space: nowrap; will-change: transform; animation: hp-ticker 46s linear infinite; }
.hp-ticker-seq { display: inline-flex; align-items: center; }
.hp-ticker-seq span { padding: 0 24px; }
.hp-ticker-seq i { color: var(--blue); font-style: normal; }
@keyframes hp-ticker { to { transform: translateX(-50%); } }

/* ============================================================
   SERVICES (hover to preview)
   ============================================================ */
.hp-services { background: var(--paper); color: var(--charcoal); padding: 96px var(--pad); }
.hp-services-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 50px; }
.hp-services-head .eyebrow { margin-bottom: 16px; }
.hp-services-head h2 { font-family: Newsreader, Georgia, serif; font-size: clamp(30px, 3.4vw, 42px); line-height: 1.15; letter-spacing: -0.01em; }
.hp-services-meta { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.08em; color: #8A8D85; text-transform: uppercase; flex: none; }

.hp-services-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: start; }
.hp-svc-list { border-top: 1px solid var(--line-light); }
.hp-svc {
  display: grid; grid-template-columns: 52px 1fr 28px; gap: 22px;
  padding: 24px 12px; border-bottom: 1px solid var(--line-light);
  align-items: baseline; background: transparent; transition: background .3s ease;
}
.hp-svc.is-active, .hp-svc:hover { background: var(--cream); }
.hp-svc-idx { font-family: Newsreader, serif; color: var(--blue); font-size: 14px; }
.hp-svc-name { display: block; font-family: Newsreader, Georgia, serif; font-size: 24px; letter-spacing: -0.01em; margin-bottom: 5px; }
.hp-svc-desc { display: block; font-size: 13.5px; color: var(--grey); line-height: 1.6; }
.hp-svc-arrow { font-size: 18px; color: var(--blue); opacity: 0; transition: opacity .3s ease; }
.hp-svc.is-active .hp-svc-arrow, .hp-svc:hover .hp-svc-arrow { opacity: 1; }

.hp-svc-preview { position: sticky; top: 24px; }
.hp-svc-preview figure { position: relative; margin: 0; height: 540px; overflow: hidden; border: 1px solid var(--line-light); background: var(--cream); }
.hp-svc-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(0.8) contrast(1.02); }
.hp-svc-preview video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  filter: saturate(0.8) contrast(1.02); opacity: 0; pointer-events: none;
  transition: opacity .3s ease;
}
.hp-svc-preview video.is-on { opacity: 1; }
.hp-svc-count { position: absolute; top: 0; left: 0; padding: 12px 18px; background: rgba(27, 30, 32, 0.85); color: var(--text-light); font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; }
.hp-svc-preview figcaption { position: absolute; bottom: 0; left: 0; right: 0; padding: 14px 18px; background: rgba(27, 30, 32, 0.85); color: var(--text-light); font-size: 12.5px; letter-spacing: 0.02em; }

/* ============================================================
   PROJECTS (hover to expand)
   ============================================================ */
.hp-projects { background: var(--ink-2); padding: 96px var(--pad); }
.hp-projects-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 44px; }
.hp-projects-head h2 { font-family: Newsreader, Georgia, serif; font-weight: 300; font-size: clamp(30px, 3.4vw, 42px); line-height: 1.15; letter-spacing: -0.01em; color: #fff; }
.hp-link { font-size: 14px; color: var(--text-light); border-bottom: 1px solid rgba(237, 234, 224, 0.5); padding-bottom: 2px; flex: none; }
.hp-link:hover { border-bottom-color: var(--blue); color: var(--blue); }

.hp-proj-strip { display: flex; gap: 4px; height: 440px; }
.hp-proj { position: relative; flex: 1; overflow: hidden; transition: flex .7s cubic-bezier(0.4, 0, 0.2, 1); min-width: 0; }
.hp-proj img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(0.75) contrast(1.02); transition: transform .7s ease; }
.hp-proj:hover { flex: 2.6; }
.hp-proj:hover img { transform: scale(1.04); }
.hp-proj-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 44px 20px 16px; background: linear-gradient(transparent, rgba(27, 30, 32, 0.92)); }
.hp-proj-cap b { display: block; font-family: Newsreader, Georgia, serif; font-weight: 400; font-size: 19px; color: #fff; margin-bottom: 3px; }
.hp-proj-cap { font-size: 12.5px; color: var(--text-mut-2); }

.hp-proj-stats { display: flex; flex-wrap: wrap; gap: 40px; margin-top: 34px; font-size: 13.5px; color: var(--text-mut-2); }
.hp-proj-stats b { color: var(--text-light); font-weight: 500; }
.hp-proj-stats a { border-bottom: 1px solid transparent; }
.hp-proj-stats a:hover { color: var(--blue); }

/* ============================================================
   CTA
   ============================================================ */
.hp-cta {
  background: var(--paper); color: var(--charcoal); padding: 84px var(--pad);
  display: flex; justify-content: space-between; align-items: center; gap: 40px; flex-wrap: wrap;
}
.hp-cta h2 { font-family: Newsreader, Georgia, serif; font-weight: 300; font-size: clamp(28px, 3.6vw, 46px); line-height: 1.15; letter-spacing: -0.01em; max-width: 680px; }
.hp-cta-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.hp-cta-call { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; color: var(--grey); text-transform: uppercase; }
.hp-cta-call:hover { color: var(--blue); }

/* ============================================================
   FOOTER
   ============================================================ */
.hp-footer { background: var(--ink-3); color: var(--text-mut-2); padding: 56px var(--pad) 28px; }
.hp-footer-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; padding-bottom: 36px; border-bottom: 1px solid rgba(255, 255, 255, 0.14); flex-wrap: wrap; }
.hp-footer .hp-logo img { height: 30px; }
.hp-footer-cols { display: flex; gap: 56px; flex-wrap: wrap; }
.hp-footer-cols > div { display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.hp-footer-cols a:hover { color: var(--blue); }
.hp-footer-social { flex-direction: row !important; gap: 16px !important; }
.hp-footer-social a { color: var(--text-mut-2); transition: color .2s ease; }
.hp-footer-social a:hover { color: var(--blue); }
.hp-footer-bottom { display: flex; justify-content: space-between; gap: 16px; padding-top: 22px; font-size: 12px; color: var(--text-faint); flex-wrap: wrap; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .hp-hero { grid-template-columns: 1fr; gap: 40px; padding-top: 56px; }
  .hp-hero-visual { max-width: 640px; }
  .hp-services-grid { grid-template-columns: 1fr; gap: 32px; }
  .hp-svc-preview { position: static; }
  .hp-svc-preview figure { height: 360px; }
}

@media (max-width: 860px) {
  .hp-nav, .hp-phone { display: none; }
  .hp-nav-toggle { display: flex; }
  .hp-header-cta .hp-btn-outline { display: none; }
  .hp-nav.is-open {
    display: block; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--ink); border-bottom: 1px solid var(--line-dark); padding: 8px var(--pad) 20px; z-index: 30;
  }
  .hp-nav.is-open ul { flex-direction: column; gap: 0; }
  .hp-nav.is-open li { border-bottom: 1px solid rgba(237, 234, 224, 0.08); }
  .hp-nav.is-open a { display: block; padding: 14px 0; font-size: 16px; }

  .hp-stepper { grid-template-columns: 1fr; border-top: 0; margin-top: 32px; padding-bottom: 40px; gap: 2px; }
  .hp-step { border-top: 0; border-left: 2px solid rgba(237, 234, 224, 0.14); padding: 12px 0 12px 18px; margin-top: 0; opacity: 0.55; }
  .hp-step.is-active { border-top: 0; border-left-color: var(--blue); }

  .hp-services, .hp-projects, .hp-cta { padding-top: 60px; padding-bottom: 60px; }
  .hp-proj-strip { flex-direction: column; height: auto; gap: 10px; }
  .hp-proj { height: 220px; flex: none; }
  .hp-proj:hover { flex: none; }
  .hp-proj-cap { padding-top: 32px; }

  .hp-cta { flex-direction: column; align-items: flex-start; }
  .hp-cta-actions { align-items: flex-start; }
}

@media (max-width: 520px) {
  .hp-svc { grid-template-columns: 40px 1fr; }
  .hp-svc-arrow { display: none; }
  .hp-svc-name { font-size: 20px; }
  .hp-footer-top { flex-direction: column; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .hp-ticker-track { animation: none; }
  .hero-dia, .dia-da, .dia-model, .dia-sub-da, .dia-sub-model, .hero-media,
  .hp-step, .hp-proj, .hp-proj img, .hp-svc { transition: none; }
}
