/* ==========================================================================
   GembaSnap — job completion proof page (/demo)

   Complete stylesheet. The <head> of demo.html inlines a critical subset of
   this file (tokens, @font-face, shell, header, comparison slider) so the
   above-the-fold view paints without waiting on a round trip; this sheet is
   then loaded asynchronously and is a superset of it. Keep the two in sync —
   the duplication is deliberate, not an accident.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Tokens
   -------------------------------------------------------------------------- */

:root {
  /* Brand */
  --navy: #1b4a5e;
  --navy-ink: #26313a;
  --orange: #e8833a;
  --orange-pressed: #dd7527;

  /* Surfaces — warm stone, not grey. Reads as paper, not software. */
  --page: #eae7e1;
  --card: #f7f5f1;
  --surface: #ffffff;
  --border: #e4e0d8;

  /* Ink */
  --text: #4a463e;
  --text-muted: #6e6a60;
  --text-soft: #8a8478;
  --text-faint: #9a948a;

  /* Ribbon / overlays */
  --ink: #23211c;
  --ink-text: #b8b3a8;
  --ink-close: #7a756a;

  --shell-width: 430px;
  --radius: 12px;

  --font-body: "Barlow", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Barlow Condensed", "Barlow", -apple-system, BlinkMacSystemFont, sans-serif;
}

/* --------------------------------------------------------------------------
   Fonts — self-hosted latin subsets. No external requests.
   -------------------------------------------------------------------------- */

@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/barlow-400-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("./fonts/barlow-500-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("./fonts/barlow-600-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("./fonts/barlow-700-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("./fonts/barlow-condensed-600-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("./fonts/barlow-condensed-700-latin.woff2") format("woff2");
}

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

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

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

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

button {
  font: inherit;
  color: inherit;
}

/* One consistent focus ring, only for keyboard users. */
:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
}

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

/* --------------------------------------------------------------------------
   Demo ribbon — the tradesperson-facing layer. The homeowner never sees this
   on a real proof page; here it is the conversion path back to the landing root.
   -------------------------------------------------------------------------- */

.ribbon {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Wraps to two lines under ~410px rather than forcing the document wider
     than the viewport. */
  flex-wrap: wrap;
  gap: 2px 8px;
  padding: 8px 36px 8px 12px;
  background: var(--ink);
  color: var(--ink-text);
  font-size: 12.5px;
  letter-spacing: 0.01em;
  text-align: center;
}

.ribbon__cta {
  color: var(--orange);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.ribbon__cta:hover,
.ribbon__cta:focus-visible {
  text-decoration: underline;
}

.ribbon__dismiss {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: none;
  color: var(--ink-close);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}

.ribbon__dismiss:hover {
  color: var(--ink-text);
}

/* --------------------------------------------------------------------------
   Shell — a phone-width sheet, centred and lifted off the page on desktop.
   -------------------------------------------------------------------------- */

.shell {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: var(--shell-width);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--card);
  box-shadow: 0 0 40px rgba(27, 42, 52, 0.12);
}

.site-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}

.site-header__mark {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--navy);
}

.site-header__id {
  flex: 1;
  min-width: 0;
}

.site-header__business {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.1;
  color: var(--navy);
}

.site-header__cred {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-soft);
}

.site-header__status {
  flex-shrink: 0;
  text-align: right;
}

.site-header__badge {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--orange);
}

.site-header__date {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-soft);
}

.proof {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 16px;
  padding: 20px 16px 28px;
}

/* --------------------------------------------------------------------------
   Before/after comparison slider

   Two stacked images at identical dimensions. The AFTER frame is the base
   layer; the BEFORE frame sits on top inside a wrapper clipped from the right,
   so the revealed width of BEFORE tracks the handle. A single custom property
   (--pos) drives the clip, the divider and the handle together — one write per
   frame, no layout thrash.
   -------------------------------------------------------------------------- */

.compare-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  color: var(--text-muted);
}

.compare {
  --pos: 40%;
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--navy);
  box-shadow: 0 8px 24px rgba(27, 42, 52, 0.22);
  cursor: ew-resize;
  user-select: none;
  -webkit-user-select: none;
  /* Horizontal drags belong to the slider, vertical scrolling to the page. */
  touch-action: pan-y;
}

.compare__frame {
  position: absolute;
  inset: 0;
}

.compare__frame--before {
  clip-path: inset(0 calc(100% - var(--pos)) 0 0);
}

.compare__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-user-drag: none;
}

.compare__chip {
  position: absolute;
  top: 10px;
  z-index: 2;
  padding: 4px 9px;
  border-radius: 4px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.compare__chip--before {
  left: 10px;
  background: rgba(24, 22, 18, 0.72);
  color: #f0ede6;
}

.compare__chip--after {
  right: 10px;
  background: rgba(232, 131, 58, 0.92);
  color: #fff;
}

.compare__divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  z-index: 3;
  width: 3px;
  background: #fff;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.4);
  transform: translateX(-1.5px);
  pointer-events: none;
}

/* 46px round target — comfortably past the 44px minimum. */
.compare__handle {
  position: absolute;
  top: 50%;
  left: var(--pos);
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 46px;
  height: 46px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35);
  transform: translate(-50%, -50%);
  cursor: ew-resize;
  touch-action: none;
}

.compare.is-dragging {
  cursor: grabbing;
}

.compare.is-dragging .compare__handle {
  cursor: grabbing;
}

/* --------------------------------------------------------------------------
   Job summary
   -------------------------------------------------------------------------- */

.summary {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 18px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.summary__headline {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--navy-ink);
}

.summary__check {
  flex-shrink: 0;
  transform: translateY(2px);
}

.summary__meta {
  margin: 0;
  padding-left: 25px;
  font-size: 14.5px;
  line-height: 1.4;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Review call to action + demo popover
   -------------------------------------------------------------------------- */

.review {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.review__prompt {
  text-align: center;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}

.review__anchor {
  position: relative;
}

.review__button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 56px;
  padding: 14px 18px;
  border: none;
  border-radius: var(--radius);
  background: var(--orange);
  color: #fff;
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(232, 131, 58, 0.38);
}

.review__button:hover {
  background: var(--orange-pressed);
}

.review__button:active {
  transform: translateY(1px);
}

.review__tip {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  z-index: 20;
  width: min(280px, calc(100vw - 48px));
  padding: 12px 32px 12px 14px;
  border-radius: 10px;
  background: var(--ink);
  color: #edeae2;
  font-size: 13.5px;
  line-height: 1.5;
  text-align: left;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  transform: translateX(-50%);
}

.review__tip[hidden] {
  display: none;
}

/* Caret, pointing back down at the button. */
.review__tip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid var(--ink);
  transform: translateX(-50%);
}

.review__tip-dismiss {
  position: absolute;
  top: 2px;
  right: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: none;
  color: #9a948a;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.review__tip-dismiss:hover {
  color: #edeae2;
}

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

.proof-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--text-faint);
}

.proof-footer__brand {
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Preferences
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
