/* =========================================================
   Crate Escape — iPhone interactive mockup
   Static preview of the booking app.
   Brand tokens mirror /css/styles.css.
   ========================================================= */

:root {
  --navy: #143E6B;
  --navy-dark: #0E2D52;
  --coral: #F37A2C;
  --coral-dark: #D85F1A;
  --sun: #FFC857;
  --cream: #FFF6EA;
  --sand: #F8E9D0;
  --ink: #0E2238;
  --slate: #4B5E78;
  --muted: #8898AE;
  --white: #FFFFFF;

  --fg-1: var(--ink);
  --fg-2: var(--slate);
  --fg-3: var(--muted);
  --fg-inverse: var(--white);
  --bg-page: var(--cream);
  --bg-surface: var(--white);
  --bg-tinted: var(--sand);
  --accent-primary: var(--coral);
  --accent-primary-2: var(--coral-dark);
  --accent-brand: var(--navy);
  --accent-brand-2: var(--navy-dark);
  --accent-warm: var(--sun);

  --border-subtle: rgba(20, 62, 107, 0.08);
  --border-default: rgba(20, 62, 107, 0.14);

  --font-sans: "Poppins", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  --shadow-sm: 0 2px 8px rgba(20, 62, 107, 0.06);
  --shadow-md: 0 8px 24px rgba(20, 62, 107, 0.10);
  --shadow-cta-coral: 0 6px 16px rgba(243, 122, 44, 0.35);

  --ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--fg-1);
  background: radial-gradient(ellipse at top, #f6e9cf 0%, #e9d5ad 55%, #d2b886 100%);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 { margin: 0; line-height: 1.15; font-weight: 700; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

/* =========================================================
   Phone frame
   ========================================================= */
.scene { display: grid; place-items: center; width: 100%; }

.phone {
  position: relative;
  width: 390px;
  height: 844px;
  background: #0b0b0d;
  border-radius: 56px;
  padding: 12px;
  box-shadow:
    0 0 0 2px #2a2a2e inset,
    0 30px 80px rgba(0, 0, 0, 0.45),
    0 8px 24px rgba(0, 0, 0, 0.25);
  transform: scale(var(--phone-scale, 1));
  transform-origin: center center;
}
.phone::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 56px;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.05) inset;
}

.phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 44px;
  overflow: hidden;
  background: var(--bg-page);
  isolation: isolate;
}

.dynamic-island {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 122px;
  height: 36px;
  border-radius: 999px;
  background: #000;
  z-index: 60;
}

.status-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--fg-1);
  z-index: 50;
  pointer-events: none;
}
.status-bar .time { letter-spacing: 0.01em; }
.status-bar .icons { display: inline-flex; align-items: center; gap: 6px; }
.status-bar .icons svg { width: 17px; height: 11px; }
.status-bar .battery { display: inline-flex; align-items: center; gap: 2px; }
.battery-body {
  width: 24px;
  height: 11px;
  border: 1.2px solid currentColor;
  border-radius: 3px;
  position: relative;
  padding: 1px;
}
.battery-body::after {
  content: "";
  display: block;
  height: 100%;
  width: 80%;
  background: currentColor;
  border-radius: 1px;
}
.battery-tip { width: 1.5px; height: 4px; background: currentColor; border-radius: 1px; opacity: 0.6; }

.viewport {
  position: absolute;
  top: 54px;
  left: 0;
  right: 0;
  bottom: 84px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.viewport::-webkit-scrollbar { display: none; }

.home-indicator {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 134px;
  height: 5px;
  border-radius: 999px;
  background: var(--fg-1);
  opacity: 0.85;
  z-index: 70;
}

/* =========================================================
   In-app header
   ========================================================= */
.app-header {
  margin: 8px 16px 2px;
  padding: 8px 0 8px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.app-header .brand-mark {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(20, 62, 107, 0.10));
}
.app-header .brand-meta { flex: 1; min-width: 0; }
.app-header .brand-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.1;
}
.app-header .brand-sub {
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-2);
  margin-top: 2px;
}
.app-header .location {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--fg-3);
  margin-top: 6px;
}
.app-header .location svg { width: 10px; height: 10px; }

.back-link {
  font-size: 11px;
  font-weight: 700;
  color: var(--coral-dark);
  background: var(--bg-tinted);
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
  margin-top: 8px;
}

/* =========================================================
   Screens
   ========================================================= */
.screen { display: none; padding: 4px 16px 24px; }
.screen.active { display: block; }

/* ---------- Hero ---------- */
.hero-shell {
  position: relative;
  overflow: hidden;
  min-height: 398px;
  margin: 0 -16px;
  padding: 0 16px;
}
.hero { position: relative; z-index: 3; }
.hero h1 {
  font-size: 32px;
  letter-spacing: -0.035em;
  color: var(--navy);
  max-width: 310px;
  line-height: 1.02;
}
.hero .paw {
  display: inline-block;
  margin-left: 4px;
  font-size: 0.72em;
  vertical-align: 0.08em;
}
.hero .lead {
  font-size: 13px;
  color: var(--fg-2);
  margin: 14px 0 16px;
  line-height: 1.55;
  max-width: 260px;
}

.hero-photo {
  position: absolute;
  top: 168px;
  left: 0;
  right: 0;
  height: 230px;
  margin: 0;
  overflow: hidden;
  z-index: 0;
}
.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 55%;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.22) 10%, rgba(0, 0, 0, 0.84) 24%, #000 36%, #000 100%);
  mask-image: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.22) 10%, rgba(0, 0, 0, 0.84) 24%, #000 36%, #000 100%);
}
.hero-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, var(--bg-page) 0%, rgba(255, 246, 234, 0.99) 41%, rgba(255, 246, 234, 0.52) 50%, rgba(255, 246, 234, 0) 61%),
    linear-gradient(90deg, var(--bg-page) 0%, rgba(255, 246, 234, 0.92) 18%, rgba(255, 246, 234, 0.18) 31%, rgba(255, 246, 234, 0) 44%),
    linear-gradient(180deg, rgba(255, 246, 234, 0) 82%, var(--bg-page) 100%);
  pointer-events: none;
  z-index: 1;
}

.hero-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  position: relative;
  z-index: 4;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 15px;
  transition: transform 0.15s var(--ease-pop), box-shadow 0.2s ease, background 0.2s ease;
}
.btn-primary {
  background: var(--accent-primary);
  color: var(--white);
  box-shadow: var(--shadow-cta-coral);
}
.btn-badge {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  font-size: 12px;
}
.btn-primary:active { transform: translateY(1px); }
.btn-secondary {
  background: transparent;
  color: var(--fg-1);
  border: 1.5px solid var(--fg-1);
}
.btn-ghost { background: var(--bg-tinted); color: var(--fg-1); }
.btn-link {
  background: transparent;
  color: var(--navy);
  padding: 14px 0 0 2px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 0;
  box-shadow: none;
}
.btn-link:active { transform: none; }
.btn.btn-block { width: 100%; }

/* ---------- Trust strip ---------- */
.trust-strip {
  display: flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 9px 10px;
  gap: 4px;
  margin: 10px 0 14px;
  box-shadow: var(--shadow-sm);
}
.trust-strip .pill {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 600;
  color: var(--fg-2);
  text-align: center;
  line-height: 1.2;
}
.trust-strip .pill .pill-ic { font-size: 13px; }
.trust-strip .pill + .pill { border-left: 1px solid var(--border-subtle); padding-left: 6px; }

/* ---------- Service grid (2x2 home cards) ---------- */
.service-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-bottom: 14px;
}
.service-card {
  position: relative;
  aspect-ratio: 1.03 / 1;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s var(--ease-pop);
  isolation: isolate;
}
.service-card:active { transform: scale(0.98); }
.service-card::before {
  content: "";
  position: absolute;
  inset: auto -10px -10px auto;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 70%);
  z-index: 1;
}

.sc-walking  { background: linear-gradient(160deg, #FFE3C4 0%, #F8C98B 100%); }
.sc-daycare  { background: linear-gradient(160deg, #FFE9A8 0%, #F8C77A 100%); }
.sc-boarding { background: linear-gradient(160deg, #DDE6F2 0%, #B7C8E0 100%); }
.sc-pickup   { background: linear-gradient(160deg, #FAD4B8 0%, #E89A65 100%); }

.service-card .card-bg {
  position: absolute;
  right: -8px;
  bottom: -14px;
  font-size: 78px;
  line-height: 1;
  opacity: 0.85;
  z-index: 2;
  pointer-events: none;
  filter: drop-shadow(0 4px 8px rgba(20, 62, 107, 0.12));
}

.service-card .card-text {
  position: absolute;
  inset: 12px;
  z-index: 3;
  color: var(--fg-1);
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
}
.service-card .card-text h3 {
  font-size: 13px;
  font-weight: 800;
  color: var(--navy-dark);
  letter-spacing: -0.01em;
  line-height: 1.15;
  max-width: 100px;
}
.service-card .card-text p {
  font-size: 9.5px;
  font-weight: 500;
  color: var(--slate);
  line-height: 1.3;
  max-width: 100px;
  margin-top: 2px;
}
.service-card .card-arrow {
  margin-top: auto;
  font-size: 14px;
  font-weight: 700;
  color: var(--coral-dark);
}

/* Service rows (Services tab) */
.service-row {
  display: flex;
  gap: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 10px;
  align-items: center;
  box-shadow: var(--shadow-sm);
}
.service-row .icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 14px;
  background: var(--bg-tinted);
  display: grid;
  place-items: center;
  font-size: 22px;
}
.service-row .meta { flex: 1; min-width: 0; }
.service-row .meta h3 { font-size: 14px; color: var(--fg-1); }
.service-row .meta p { font-size: 12px; color: var(--fg-2); margin-top: 2px; }
.service-row .price {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-primary-2);
  white-space: nowrap;
}

/* ---------- Why-us card ---------- */
.why-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 12px 12px 10px;
  margin: 2px 0 8px;
  box-shadow: var(--shadow-sm);
}
.why-card .why-logo {
  width: 54px;
  height: 54px;
  margin: 0 10px 0 0;
  border-radius: 50%;
  object-fit: contain;
  float: left;
  background: var(--cream);
}
.why-card h3 {
  font-size: 15px;
  color: var(--navy);
  margin-bottom: 4px;
  padding-top: 2px;
}
.why-card .why-sub {
  font-size: 11px;
  color: var(--fg-2);
  margin-bottom: 12px;
}
.why-card .rows {
  text-align: left;
  clear: both;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.why-card .row {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 0;
  font-size: 9px;
  color: var(--fg-2);
  text-align: center;
  line-height: 1.25;
}
.why-card .row .ic {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--bg-tinted);
  font-size: 14px;
}
.why-card .row strong { font-size: 9px; font-weight: 600; }

/* ---------- Section heading ---------- */
.section-head { margin: 6px 2px 12px; }
.section-head .eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--coral-dark);
}
.section-head h2 {
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--fg-1);
  margin-top: 4px;
}
.section-head p {
  font-size: 13px;
  color: var(--fg-2);
  margin-top: 6px;
}

/* ---------- Gallery ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.gallery-grid .tile {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-tinted);
}
.gallery-grid .tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.gallery-grid .tile:active img { transform: scale(1.02); }
.gallery-grid .tile.wide {
  grid-column: span 2;
  aspect-ratio: 16 / 9;
}
.gallery-grid .tile .label {
  position: absolute;
  bottom: 6px;
  left: 6px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: rgba(14, 34, 56, 0.65);
  padding: 3px 7px;
  border-radius: 999px;
  letter-spacing: 0.04em;
}

/* Lightbox */
.lightbox {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: none;
  z-index: 80;
  align-items: center;
  justify-content: center;
  padding: 60px 16px 100px;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius-md);
  object-fit: contain;
}
.lightbox-close {
  position: absolute;
  top: 60px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 22px;
  display: grid;
  place-items: center;
}

/* ---------- Booking ---------- */
.book-stepper {
  display: flex;
  gap: 6px;
  margin: 4px 0 14px;
}
.book-stepper .pip {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: var(--border-default);
}
.book-stepper .pip.active { background: var(--accent-primary); }
.book-stepper .pip.done { background: var(--accent-brand); }

.option-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.option {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.option .ic {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--bg-tinted);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 22px;
}
.option .meta { flex: 1; min-width: 0; }
.option .meta h4 { font-size: 13px; color: var(--fg-1); }
.option .meta p { font-size: 11px; color: var(--fg-2); margin-top: 2px; }
.option .price { font-size: 12px; font-weight: 700; color: var(--accent-primary-2); }
.option.selected {
  border-color: var(--accent-brand);
  background: rgba(20, 62, 107, 0.06);
}

.field { display: block; margin-bottom: 12px; }
.field label {
  font-size: 11px;
  font-weight: 700;
  color: var(--fg-2);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 6px;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-default);
  background: var(--bg-surface);
  color: var(--fg-1);
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent-brand); }
.field textarea { min-height: 80px; resize: vertical; }
.field-check {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 2px 0 12px;
  color: var(--fg-2);
  font-size: 12px;
  font-weight: 600;
}
.field-check input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent-brand);
}
.form-alert {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: #FDE8DD;
  color: #943A16;
  border: 1px solid rgba(148, 58, 22, 0.18);
  font-size: 12px;
  line-height: 1.45;
  font-weight: 600;
}
.form-alert[hidden] { display: none; }
.form-alert.success {
  background: #EAF7EF;
  color: #14532D;
  border-color: rgba(20, 83, 45, 0.16);
}

.book-actions { display: flex; gap: 8px; margin-top: 8px; }
.book-actions .btn { flex: 1; }

.summary {
  background: var(--bg-tinted);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 12px;
}
.summary .row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 4px 0;
}
.summary .row .k { color: var(--fg-2); }
.summary .row .v { color: var(--fg-1); font-weight: 600; }
.summary .row.total {
  border-top: 1px dashed var(--border-default);
  margin-top: 6px;
  padding-top: 8px;
  font-size: 14px;
}
.summary .row.total .v { color: var(--accent-primary-2); font-weight: 800; }

.success {
  text-align: center;
  padding: 30px 12px;
}
.success .badge {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent-brand);
  color: #fff;
  font-size: 30px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
}
.success h3 { font-size: 18px; margin-bottom: 8px; color: var(--fg-1); }
.success p { font-size: 13px; color: var(--fg-2); }

/* =========================================================
   Bottom tab bar
   ========================================================= */
.tab-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 84px;
  padding: 6px 12px 22px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  z-index: 40;
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  color: var(--fg-3);
  border-radius: var(--radius-sm);
  padding: 6px 4px;
  transition: color 0.15s ease;
}
.tab svg { width: 22px; height: 22px; stroke-width: 1.8; }
.tab.active { color: var(--accent-primary); }
.tab:active { transform: scale(0.96); }

/* =========================================================
   Responsive — drop chrome on small screens
   ========================================================= */
@media (max-width: 480px) {
  body { padding: 0; background: var(--bg-page); }
  .phone {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    transform: none;
  }
  .phone::before { display: none; }
  .phone-screen { border-radius: 0; }
  .dynamic-island { display: none; }
  .home-indicator { display: none; }
}

/* On taller viewports, give the phone more room and hide the caption
   (it would otherwise be overlapped by the scaled-up phone). */
@media (min-width: 481px) and (min-height: 900px) {
  body { padding: 16px; }
  .scene-caption { display: none; }
}

.scene-caption {
  margin-top: 18px;
  font-size: 12px;
  color: var(--slate);
  text-align: center;
  max-width: 380px;
  opacity: 0.85;
}
@media (max-width: 480px) { .scene-caption { display: none; } }
