/* Two Keys Security — custom styles
   Tailwind owns utilities; this file owns typography rhythm,
   subtle paper texture, scroll-triggered reveals, hover effects. */

:root {
  --paper: #F7F4EE;
  --paper-deep: #EFEAD8;
  --ink: #0A0A0A;
  --ink-soft: #1F1B16;
  --line: #C9C2AE;
  --line-soft: #E0D9C5;
  --red: #D72638;
  --red-deep: #B91C2B;
}

html { scroll-behavior: smooth; }

body {
  background-color: var(--paper);
  color: var(--ink);
  font-feature-settings: "ss01", "ss02", "kern", "liga", "calt";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Subtle paper texture — much softer than before; no blend mode so it doesn't murder contrast.
   Sits behind everything; sections paint cleanly on top. */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  background-image:
    radial-gradient(at 20% 10%, rgba(215,38,56,0.04), transparent 50%),
    radial-gradient(at 80% 90%, rgba(10,10,10,0.05), transparent 55%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.5  0 0 0 0 0.45  0 0 0 0 0.4  0 0 0 0.04 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: auto, auto, 220px 220px;
}

/* Typography */
.font-display {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-optical-sizing: auto;
  font-variation-settings: "opsz" 144, "SOFT" 0, "WONK" 0;
  letter-spacing: -0.025em;
  line-height: 0.95;
}
.font-display-soft {
  font-family: "Fraunces", Georgia, serif;
  font-optical-sizing: auto;
  font-variation-settings: "opsz" 36, "SOFT" 100;
  font-style: italic;
}
.eyebrow {
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 500;
  color: inherit;
  opacity: 0.78;
}
.section-num {
  font-family: "Fraunces", serif;
  font-style: italic;
  font-variation-settings: "opsz" 12;
  font-size: 0.95rem;
  color: inherit;
  opacity: 0.72;
}
.hero-headline { font-variation-settings: "opsz" 144, "SOFT" 30; }

/* Buttons */
.btn-primary {
  display: inline-flex; align-items: center; gap: 0.6rem;
  background: var(--red);
  color: #fff;
  font-weight: 600;
  padding: 0.95rem 1.4rem;
  border-radius: 999px;
  letter-spacing: -0.005em;
  transition: transform 220ms cubic-bezier(.2,.8,.2,1), background 200ms ease, box-shadow 240ms ease;
  box-shadow: 0 1px 0 rgba(0,0,0,0.05), 0 10px 28px -14px rgba(215,38,56,0.55);
  position: relative;
  overflow: hidden;
}
.btn-primary::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.18) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 600ms cubic-bezier(.2,.8,.2,1);
}
.btn-primary:hover { background: var(--red-deep); transform: translateY(-2px); box-shadow: 0 1px 0 rgba(0,0,0,0.05), 0 14px 36px -10px rgba(215,38,56,0.65); }
.btn-primary:hover::after { transform: translateX(100%); }
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 0.6rem;
  background: transparent;
  color: currentColor;
  font-weight: 500;
  padding: 0.9rem 1.2rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  transition: background 200ms ease, color 200ms ease, transform 200ms ease, border-color 200ms ease;
}
.btn-ghost:hover { transform: translateY(-2px); }
/* Default-context (paper background): hovering inverts to dark fill */
section:not(.bg-ink) .btn-ghost:hover,
.bg-paper .btn-ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
/* Dark-context: hovering inverts to paper fill */
.bg-ink .btn-ghost:hover { background: var(--paper); color: var(--ink); border-color: var(--paper); }

/* Animated underline on text links */
.link-underline {
  position: relative;
  display: inline-block;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 100% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 380ms cubic-bezier(.7,0,.3,1);
}
.link-underline:hover { background-size: 0% 1px; background-position: 100% 100%; }

/* Hairlines */
.rule { border-top: 1px solid var(--line); }
.rule-soft { border-top: 1px solid var(--line-soft); }

/* Service cards (homepage v2 — clean, scannable) */
.svc-card {
  display: grid;
  grid-template-columns: 56px 1fr;
  grid-template-rows: auto auto;
  column-gap: 1.5rem;
  row-gap: 0.85rem;
  padding: 1.75rem 1.75rem 1.5rem;
  background: #FFFCF5;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  transition: transform 260ms cubic-bezier(.2,.8,.2,1), box-shadow 260ms ease, border-color 260ms ease;
  position: relative;
  color: var(--ink);
  text-decoration: none;
  overflow: hidden;
}
.svc-card::after {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--red);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 320ms cubic-bezier(.2,.8,.2,1);
}
.svc-card:hover {
  transform: translateY(-3px);
  border-color: var(--line);
  box-shadow: 0 24px 40px -28px rgba(10,10,10,0.18);
}
.svc-card:hover::after { transform: scaleY(1); }
.svc-card:hover .svc-title { color: var(--red); }
.svc-card:hover .svc-icon { color: var(--red); }
.svc-card:hover .arrow { transform: translateX(4px); color: var(--red); }
.svc-icon {
  grid-column: 1; grid-row: 1 / span 1;
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--ink);
  transition: color 260ms ease, border-color 260ms ease;
}
.svc-icon svg { width: 28px; height: 28px; display: block; }
.svc-body {
  grid-column: 2; grid-row: 1;
  display: flex; flex-direction: column; gap: 0.55rem;
}
.svc-title {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.45rem;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--ink);
  transition: color 240ms ease;
}
.svc-desc {
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 0.98rem;
  line-height: 1.55;
  color: rgba(10,10,10,0.72);
}
.svc-cta {
  grid-column: 2; grid-row: 2;
  font-family: "DM Sans", sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink);
  margin-top: 0.5rem;
  display: inline-flex; align-items: center; gap: 0.4rem;
}
.svc-cta .arrow { transition: transform 240ms cubic-bezier(.2,.8,.2,1), color 200ms ease; }
.arrow { display: inline-block; transition: transform 240ms cubic-bezier(.2,.8,.2,1); }
@media (max-width: 640px) {
  .svc-card { padding: 1.4rem; column-gap: 1.2rem; grid-template-columns: 48px 1fr; }
  .svc-icon { width: 48px; height: 48px; }
  .svc-icon svg { width: 24px; height: 24px; }
  .svc-title { font-size: 1.3rem; }
}

/* Town list — editorial typography */
.town-list {
  font-family: "Fraunces", Georgia, serif;
  font-variation-settings: "opsz" 72;
  line-height: 1.1;
  letter-spacing: -0.015em;
}

/* Initial fade-up (page-load, hero only) */
.fade-up { opacity: 0; transform: translateY(14px); animation: fadeUp 800ms cubic-bezier(.2,.8,.2,1) forwards; }
.fade-up.d-1 { animation-delay: 80ms; }
.fade-up.d-2 { animation-delay: 180ms; }
.fade-up.d-3 { animation-delay: 280ms; }
.fade-up.d-4 { animation-delay: 380ms; }
.fade-up.d-5 { animation-delay: 480ms; }
@keyframes fadeUp { to { opacity: 1; transform: none; } }

/* Scroll-triggered reveals */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 900ms cubic-bezier(.2,.8,.2,1), transform 900ms cubic-bezier(.2,.8,.2,1);
  will-change: opacity, transform;
}
.reveal.in { opacity: 1; transform: none; }

.reveal-left { opacity: 0; transform: translateX(-40px); transition: opacity 900ms cubic-bezier(.2,.8,.2,1), transform 900ms cubic-bezier(.2,.8,.2,1); }
.reveal-left.in { opacity: 1; transform: none; }

.reveal-right { opacity: 0; transform: translateX(40px); transition: opacity 900ms cubic-bezier(.2,.8,.2,1), transform 900ms cubic-bezier(.2,.8,.2,1); }
.reveal-right.in { opacity: 1; transform: none; }

.reveal-scale { opacity: 0; transform: scale(0.94); transition: opacity 900ms cubic-bezier(.2,.8,.2,1), transform 900ms cubic-bezier(.2,.8,.2,1); }
.reveal-scale.in { opacity: 1; transform: none; }

[data-delay="1"] { transition-delay: 80ms; }
[data-delay="2"] { transition-delay: 160ms; }
[data-delay="3"] { transition-delay: 240ms; }
[data-delay="4"] { transition-delay: 320ms; }
[data-delay="5"] { transition-delay: 400ms; }
[data-delay="6"] { transition-delay: 480ms; }

/* Headline word-by-word reveal */
.headline-words .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(40%) rotate(-2deg);
  transition: opacity 900ms cubic-bezier(.2,.8,.2,1), transform 900ms cubic-bezier(.2,.8,.2,1);
}
.headline-words.in .word { opacity: 1; transform: none; }
.headline-words.in .word:nth-child(1) { transition-delay: 0ms; }
.headline-words.in .word:nth-child(2) { transition-delay: 80ms; }
.headline-words.in .word:nth-child(3) { transition-delay: 160ms; }
.headline-words.in .word:nth-child(4) { transition-delay: 240ms; }
.headline-words.in .word:nth-child(5) { transition-delay: 320ms; }
.headline-words.in .word:nth-child(6) { transition-delay: 400ms; }
.headline-words.in .word:nth-child(7) { transition-delay: 480ms; }
.headline-words.in .word:nth-child(8) { transition-delay: 560ms; }

/* Hero keys — drift + parallax */
.drift { animation: drift 14s ease-in-out infinite alternate; transform-origin: center; will-change: transform; }
@keyframes drift {
  0%   { transform: translateY(0)   rotate(0deg);  }
  100% { transform: translateY(-8px) rotate(2deg); }
}
.parallax { will-change: transform; transition: transform 80ms linear; }

/* Image hover zoom */
.img-hover { overflow: hidden; }
.img-hover img { transition: transform 800ms cubic-bezier(.2,.8,.2,1); }
.img-hover:hover img { transform: scale(1.05); }

/* Sticky header — appears on scroll */
header {
  background: var(--paper);
  transition: box-shadow 240ms ease, background 240ms ease, backdrop-filter 240ms ease;
}
header.is-scrolled {
  position: sticky; top: 0;
  background: rgba(247, 244, 238, 0.92);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  box-shadow: 0 1px 0 var(--line-soft), 0 8px 24px -18px rgba(0,0,0,0.18);
}

/* Floating WhatsApp button — appears on desktop/tablet, hidden on mobile (sticky bar covers it) */
.floating-wa {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.1rem 0.85rem 0.85rem;
  background: #25D366;
  color: #fff;
  border-radius: 999px;
  text-decoration: none;
  font-family: "DM Sans", system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 8px 24px -8px rgba(37, 211, 102, 0.45), 0 1px 0 rgba(0,0,0,0.05);
  transition: transform 220ms cubic-bezier(.2,.8,.2,1), box-shadow 220ms ease, background 200ms ease;
  animation: wa-pulse 2.6s ease-in-out infinite;
}
.floating-wa:hover {
  background: #128C7E;
  transform: translateY(-3px);
  box-shadow: 0 14px 32px -10px rgba(18, 140, 126, 0.55), 0 1px 0 rgba(0,0,0,0.05);
  animation: none;
}
.floating-wa svg {
  width: 22px;
  height: 22px;
  display: block;
  flex-shrink: 0;
}
.floating-wa-label {
  white-space: nowrap;
  display: inline-block;
}
@media (max-width: 767px) {
  .floating-wa { display: none; }
}
@keyframes wa-pulse {
  0%, 100% { box-shadow: 0 8px 24px -8px rgba(37, 211, 102, 0.45), 0 0 0 0 rgba(37, 211, 102, 0.45); }
  50% { box-shadow: 0 8px 24px -8px rgba(37, 211, 102, 0.45), 0 0 0 16px rgba(37, 211, 102, 0); }
}

/* Mobile bar */
.mobile-bar { box-shadow: 0 -8px 24px -12px rgba(0,0,0,0.25); }

/* Forms */
input, textarea, select {
  font-family: inherit;
  font-size: 1rem;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 0.85rem 0;
  width: 100%;
  outline: none;
  color: var(--ink);
  transition: border-color 220ms ease;
}
input:focus, textarea:focus, select:focus { border-color: var(--red); }
textarea { min-height: 7rem; resize: vertical; }
label .label-text {
  display: block;
  font-family: "DM Sans", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.7;
  margin-bottom: 0.25rem;
}

::selection { background: var(--red); color: #fff; }

/* Focus-visible — keyboard navigation */
*:focus { outline: none; }
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Marquee for trust strip */
.marquee { display: flex; overflow: hidden; mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: flex; gap: 4rem; animation: marquee 40s linear infinite; flex-shrink: 0; }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal, .reveal-left, .reveal-right, .reveal-scale, .headline-words .word { opacity: 1 !important; transform: none !important; }
}

/* Print */
@media print {
  body::before, .mobile-bar, header nav { display: none; }
}
