/* ==========================================================================
   CounterLabs landing page
   One set of content. Desktop layout is the base; the phone block at the
   bottom (below 800px) rearranges the same content for small screens.
   ========================================================================== */

:root {
  /* Side gutter: 64px, growing on wide screens so content never exceeds 1312px */
  --gutter: max(64px, calc((100% - 1312px) / 2));
  --ink: #0B0B0B;
  --paper: #EDEAE3;
  --text-soft: #CFCBC2;
  --text-muted: #9A968E;
  --text-dim: #4A4742;
  --line: #3A3835;
  --surface: #1A1917;
  --accent: #FF5A36;

  --font-serif: 'Fraunces', Georgia, serif;
  --font-sans: 'Outfit', system-ui, sans-serif;
}

/* ---------- Base ---------- */

body { margin: 0; background: var(--ink); }
a { color: var(--paper); }
a:hover { color: #FFFFFF; }

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-sans);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--ink);
  height: 72px;
  box-sizing: border-box;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo { display: inline-flex; align-items: center; gap: 14px; font-size: 19px; font-weight: 600; letter-spacing: -0.02em; color: var(--paper); text-decoration: none; }
.brand-mark { display: block; width: auto; height: 26px; flex: none; }

/* Header button stays hidden until the hero's button has scrolled out of view */
.has-header-cta-toggle .header-cta {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, visibility 0s linear 0.2s;
}
.has-header-cta-toggle .header-cta.is-shown {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, visibility 0s;
}
@media (prefers-reduced-motion: reduce) {
  .has-header-cta-toggle .header-cta,
  .has-header-cta-toggle .header-cta.is-shown { transition: background-color 0.2s ease, color 0.2s ease; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.btn svg { transition: transform 0.2s ease; }
.btn--light, .btn--light:hover { background: var(--paper); color: var(--ink); }
.btn--dark,  .btn--dark:hover  { background: var(--ink);   color: var(--paper); }

/* Hover: fill with the accent and nudge the arrow forward */
@media (hover: hover) {
  .btn--light:hover,
  .btn--dark:hover { background: var(--accent); color: var(--ink); }
  .btn:hover svg { transform: translateX(3px); }
}
.btn:active { transform: scale(0.98); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  .btn, .btn svg { transition: background-color 0.2s ease, color 0.2s ease; }
  .btn:hover svg, .btn:active { transform: none; }
}
.btn--sm { height: 44px; padding: 0 20px; font-size: 15px; }
.btn--md { height: 52px; padding: 0 26px; font-size: 17px; }
.btn--lg { height: 56px; padding: 0 30px; font-size: 18px; }

/* ---------- Headings ---------- */

.h1, .h2, .h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1;
}
.h1, .h2 { letter-spacing: -0.02em; }
.h1 { flex: 1 1 600px; max-width: 760px; font-size: 76px; }
.h2 { font-size: 60px; }
.h3 { font-size: 52px; }

/* ---------- Hero ---------- */

.hero {
  padding: 48px var(--gutter) 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 40px 64px;
  align-items: flex-end;
  justify-content: space-between;
}
.hero-aside {
  flex: 0 1 420px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  align-items: flex-start;
}
.hero-copy { display: flex; flex-direction: column; gap: 6px; }
.lede { margin: 0; font-size: 20px; line-height: 1.4; color: var(--paper); }
.lede-sub { margin: 0; font-size: 15px; line-height: 1.5; color: var(--text-muted); }
.cta-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.note { font-size: 14px; color: var(--text-muted); }

/* ---------- Image frames ---------- */

.media-section { padding: 0 var(--gutter); }

.media-pair { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 1024px) {
  .media-pair { grid-template-columns: 1fr 1fr; }
}
.media-item { margin: 0; }
.media-pair { position: relative; }
.media-arrow {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 1px var(--line);
  color: var(--text-soft);
}
.media-arrow-icon { flex: none; display: block; }
@keyframes arrow-nudge-x {
  0%, 100% { translate: 0 0; }
  30%      { translate: 5px 0; }
  55%      { translate: 0 0; }
  75%      { translate: 3px 0; }
}
@keyframes arrow-nudge-y {
  0%, 100% { translate: 0 0; }
  30%      { translate: 0 5px; }
  55%      { translate: 0 0; }
  75%      { translate: 0 3px; }
}
.media-arrow.is-nudging .media-arrow-icon { animation: arrow-nudge-x 0.9s ease-in-out 0.3s 1; }
@media (max-width: 1023px) {
  .media-arrow-icon { transform: rotate(90deg); }
  .media-arrow.is-nudging .media-arrow-icon { animation-name: arrow-nudge-y; }
}
@media (prefers-reduced-motion: reduce) {
  .media-arrow.is-nudging .media-arrow-icon { animation: none; }
}
.media-pair .frame { border-radius: 14px; }

.cctv-icon { flex: none; display: block; }

/* 3D model: software app bar */
.app-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 40px;
  padding: 0 14px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(11, 11, 11, 0.72);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--paper);
  font-size: 13px;
}
.app-brand { font-weight: 600; letter-spacing: -0.02em; }
.app-sep { width: 1px; height: 14px; background: rgba(255, 255, 255, 0.2); }
.app-view { color: var(--text-soft); }

.frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--surface);
  overflow: hidden;
}
.frame img,
.frame-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.frame-video { pointer-events: none; }
.frame .overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.placeholder-tag {
  position: absolute;
  left: 16px;
  bottom: 16px;
  padding: 6px 10px;
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
}
.caption-row {
  padding: 16px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 40px;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text-muted);
}

.callout {
  position: absolute;
  padding: 4px 8px;
  background: var(--accent);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}
.callout--door   { left: 52.5%; top: 26%; }
.callout--time   { left: 30%;   top: 66%; }
.callout--routes { left: 73%;   top: 76%; }
.callout--table  { left: 44%;   top: 60%; }

/* ---------- Section intro ---------- */

.section-intro {
  padding: 112px var(--gutter) 56px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 64px;
  align-items: flex-end;
  justify-content: space-between;
}
.intro-head { flex: 1 1 560px; max-width: 760px; display: flex; flex-direction: column; gap: 16px; }
.eyebrow {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.intro-text {
  margin: 0;
  max-width: 420px;
  font-size: 17px;
  line-height: 1.5;
  color: var(--text-muted);
}

/* ---------- Layers ---------- */

.layers { padding: 0 var(--gutter) 64px; display: flex; flex-direction: column; }
.layer {
  display: flex;
  gap: 64px;
  padding: 40px 0;
  border-top: 1px solid var(--line);
}
.layer:last-child { border-bottom: 1px solid var(--line); }
.layer-text { flex: 0 0 380px; display: flex; flex-direction: column; gap: 14px; }
.layer-num { font-family: var(--font-serif); font-size: 28px; line-height: 1; color: var(--accent); }
.layer-body { margin: 0; font-size: 18px; line-height: 1.5; color: var(--text-soft); }
.status {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.layer-media { flex: 1 1 0; min-width: 0; align-self: flex-start; }

.legend {
  margin: auto 0 0;
  padding: 16px 0 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  border-top: 1px solid var(--line);
}
.legend li { display: flex; align-items: center; gap: 10px; }
.legend .swatch { width: 10px; height: 10px; background: var(--accent); }
.legend .off { color: var(--text-muted); }
.legend .off .swatch {
  background: none;
  box-sizing: border-box;
  border: 1px solid var(--text-muted);
}

/* ---------- Install ---------- */

.install {
  padding: 64px var(--gutter) 96px;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 40px 96px;
  align-items: start;
}
.install-title { grid-column: 1 / -1; }
.install-text { min-width: 0; display: flex; flex-direction: column; gap: 28px; }
.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
}
.steps li { display: flex; gap: 24px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.step-num { flex: 0 0 28px; font-family: var(--font-serif); font-size: 24px; line-height: 28px; color: var(--accent); }
.step-text { font-size: 18px; line-height: 28px; }
.install-close { margin: 0; max-width: 520px; font-size: 18px; line-height: 1.5; }
.privacy { display: flex; flex-direction: column; gap: 12px; padding-top: 18px; border-top: 1px solid var(--line); }
.privacy-title { margin: 0; font-family: var(--font-serif); font-weight: 400; font-size: 24px; line-height: 1.2; }
.privacy-note {
  margin: 0;
  max-width: 520px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-muted);
}


/* ---------- Booking ---------- */

.book {
  flex-grow: 1;
  padding: 104px 64px;
  background: var(--paper);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 28px;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.book-title { max-width: 820px; font-size: 76px; }
.book-lede { margin: -8px 0 0; max-width: 520px; font-size: 18px; line-height: 1.5; color: var(--text-dim); }
.book-note { font-size: 14px; color: var(--text-dim); }
.book-main { display: flex; flex-direction: column; gap: 28px; align-items: center; }

/* Desktop: pitch + "Book a call" on the left, the question form on the right */
@media (min-width: 1024px) {
  .book {
    padding: 112px var(--gutter);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 560px);
    gap: 96px;
    align-items: start;
    text-align: left;
  }
  .book-main { align-items: flex-start; position: sticky; top: 112px; }
  .book-title { font-size: 64px; line-height: 1.02; }
  .book-lede { margin: -8px 0 0; }
  .book .contact { max-width: none; margin-top: 0; padding-top: 0; border-top: 0; }
  .book .contact-title { text-align: left; }
}

/* ---------- Contact form (secondary to "Book a call") ---------- */

.contact {
  width: 100%;
  max-width: 560px;
  margin-top: 40px;
  padding-top: 40px;
  border-top: 1px solid rgba(11, 11, 11, 0.14);
  text-align: left;
}
.contact-title {
  margin: 0 0 24px;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 26px;
  line-height: 1.2;
  text-align: center;
}
.contact-form { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 16px; }
.contact-form[hidden] { display: none; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field--full { grid-column: 1 / -1; }
.field label { font-size: 15px; font-weight: 500; }
.field-optional { font-weight: 400; color: var(--text-dim); }
.field input,
.field textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid rgba(11, 11, 11, 0.35);
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 16px; /* 16px+ stops iPhone zooming in on focus */
  line-height: 1.4;
}
.field textarea { resize: vertical; }
.field input:hover,
.field textarea:hover { border-color: rgba(11, 11, 11, 0.6); }
.field input:focus-visible,
.field textarea:focus-visible {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}
.field [aria-invalid="true"] { border-color: #B3261E; }
.field [aria-invalid="true"]:focus-visible { box-shadow: 0 0 0 1px #B3261E; }
.field-error { margin: 0; font-size: 14px; color: #B3261E; }
.field-hint { margin: 0; font-size: 14px; color: var(--text-dim); }
.field-hint:empty { display: none; }
.field-hint-fix {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.field-hint-fix:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 2px; }

.contact-botcheck {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}

.contact-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.btn--outline {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--ink);
  cursor: pointer;
  font-family: inherit;
}
@media (hover: hover) {
  .btn--outline:hover { background: var(--accent); border-color: var(--accent); color: var(--ink); }
}
.btn--outline:disabled { opacity: 0.55; cursor: default; background: transparent; border-color: var(--ink); }
.contact-status { margin: 0; font-size: 14px; }
.contact-status:empty { display: none; }
.contact-status.is-error { color: #B3261E; }
.contact-fineprint { margin: 0; font-size: 13px; color: var(--text-dim); }
.book a:not(.btn) { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.book a:not(.btn):hover { color: var(--ink); text-decoration-thickness: 2px; }

.contact-done {
  padding: 20px;
  border: 1px solid rgba(11, 11, 11, 0.2);
  border-radius: 8px;
  text-align: center;
  font-size: 17px;
}
.contact-done p { margin: 0; }
.contact-done:focus { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ---------- Footer ---------- */

.footer-link { color: inherit; text-underline-offset: 3px; }
.footer-link:hover { color: var(--paper); }

.site-footer {
  height: 72px;
  box-sizing: border-box;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text-muted);
}

/* ==========================================================================
   Phone (below 800px)
   ========================================================================== */

@media (max-width: 799px) {
  .site-header { height: 60px; padding: 0 20px; }
  .logo { font-size: 18px; gap: 12px; }
  .brand-mark { height: 24px; }
  .btn--sm { padding: 0 16px; font-size: 14px; }

  /* Full-width buttons */
  .btn--md, .btn--lg {
    display: flex;
    justify-content: center;
    height: 52px;
    padding: 0 20px;
    font-size: 17px;
  }

  .h1 { flex: none; max-width: none; font-size: 46px; }
  .h2 { font-size: 38px; }
  .h3 { font-size: 36px; }

  .hero { padding: 24px 20px 40px; flex-direction: column; align-items: stretch; gap: 24px; }
  .hero-aside { flex: none; align-items: stretch; }
  .hero-aside { gap: 24px; }
  .lede { font-size: 18px; }
  .lede-sub { font-size: 14px; }
  .cta-row { flex-direction: column; align-items: stretch; gap: 12px; }
  .note { text-align: center; font-size: 13px; }

  /* Images run edge to edge on phones */
  .media-section { padding: 0; }
  .media-pair { padding: 0 20px; gap: 12px; }
  .media-pair .frame { border-radius: 10px; }
  .cctv-icon { width: 12px; height: 12px; }
  .app-bar { height: 34px; padding: 0 10px; font-size: 12px; }
  .placeholder-tag { left: 8px; bottom: 8px; padding: 4px 8px; font-size: 11px; }
  .caption-row { padding: 12px 20px 0; flex-direction: column; gap: 4px; font-size: 13px; }

  .callout { padding: 3px 6px; font-size: 11px; }
  .callout--door   { left: 45%; top: 16%; }
  .callout--time   { left: 6%;  top: 68%; }
  .callout--routes { left: 6%;  top: 76%; }
  .callout--table  { left: 6%;  top: 46%; }

  .section-intro {
    margin-top: 48px;
    padding: 48px 20px 28px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    border-top: 1px solid var(--line);
  }
  .intro-head { flex: none; gap: 12px; }
  .intro-text { max-width: none; font-size: 15px; }

  .layers { padding: 0; }
  .layer { padding: 28px 0 32px; flex-direction: column; gap: 16px; }
  .layer-text { flex: none; padding: 0 20px; gap: 10px; }
  .layer-num { font-size: 22px; }
  .layer-body { font-size: 16px; }
  .status { font-size: 11px; }
  .legend { display: none; }
  .layer-media { flex: none; align-self: stretch; }

  .install { padding: 56px 20px; grid-template-columns: 1fr; gap: 24px; }
  .privacy { margin-top: 8px; }
  .install-text { flex: none; gap: 24px; }
  .steps li { gap: 16px; padding: 16px 0; }
  .step-num { flex: 0 0 20px; font-size: 22px; line-height: 24px; }
  .step-text { font-size: 16px; line-height: 24px; }
  .install-close { max-width: none; font-size: 16px; }
  .privacy-title { font-size: 21px; }
  .privacy-note { max-width: none; font-size: 14px; }

  .book { padding: 72px 20px; gap: 24px; align-items: stretch; }
  .book-title { max-width: none; font-size: 46px; }
  .book-lede { margin: 0; max-width: none; font-size: 16px; }
  .book-note { font-size: 13px; line-height: 1.6; }
  .book-main { gap: 24px; align-items: stretch; }
  .contact { max-width: none; margin-top: 24px; padding-top: 32px; }
  .contact-title { font-size: 22px; }
  .contact-form { grid-template-columns: 1fr; }
  .contact-actions { align-items: stretch; }
  .contact-submit { justify-content: center; }

  .site-footer {
    height: auto;
    padding: 20px;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    font-size: 13px;
  }
}
