/* Home page. Builds on assets/css/site.css. */

/* Hero */
.hero { position: relative; padding: var(--space-8) 0 var(--space-9); overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 60% at 85% 20%, rgba(3, 105, 161, 0.07), transparent 70%),
    linear-gradient(var(--bg), var(--bg));
}
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: var(--space-7); align-items: center; }
.hero-title { margin-bottom: var(--space-5); }
.hero-title .accent { color: var(--brand); }
.hero-subtitle { max-width: 34rem; margin-bottom: var(--space-6); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-bottom: var(--space-7); }
.hero-proof { list-style: none; margin: 0; padding: var(--space-5) 0 0; display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); border-top: 1px solid var(--line); color: var(--muted); font-size: 0.92rem; }
.hero-proof strong { color: var(--ink); font-weight: 600; }

.hero-logo-showcase { display: flex; flex-direction: column; align-items: center; gap: var(--space-4); }
.badge-frame {
  position: relative; width: 340px; height: 340px; max-width: 72vw; max-height: 72vw;
  border-radius: 50%; padding: 10px; overflow: hidden;
  background: radial-gradient(circle at 30% 25%, #ffffff, #e9eef4 60%, #d8e1ea);
  box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  animation: floatBadge 7s ease-in-out infinite;
  cursor: crosshair;
}
.badge-frame .badge-img, .badge-frame canvas { position: absolute; inset: 10px; width: calc(100% - 20px); height: calc(100% - 20px); border-radius: 50%; object-fit: cover; }
.badge-frame .badge-img { z-index: 1; }
.badge-frame canvas { z-index: 2; }
@keyframes floatBadge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.hero-hint { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.04em; color: var(--faint); }

/* Services */
.card-text { color: var(--muted); margin: var(--space-2) 0 var(--space-5); font-size: 0.97rem; }

/* Selected work */
.section-head-row { max-width: none; display: flex; justify-content: space-between; align-items: flex-end; gap: var(--space-5); flex-wrap: wrap; }
.work-card { display: flex; flex-direction: column; overflow: hidden; color: inherit; }
.work-card:hover { color: inherit; }
.work-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--bg-sunken); border-bottom: 1px solid var(--line); }
.work-body { padding: var(--space-5); display: grid; gap: var(--space-2); justify-items: start; }
.work-body h3 { font-size: 1.1rem; }
.work-body p { color: var(--muted); font-size: 0.95rem; }

/* Approach */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-5); counter-reset: step; }
.steps li { position: relative; padding-top: var(--space-5); border-top: 2px solid var(--line); }
.steps li::before { content: ""; position: absolute; top: -2px; left: 0; width: 40px; height: 2px; background: var(--brand); }
.step-num { display: block; font-family: var(--font-mono); font-size: 0.8rem; color: var(--brand); margin-bottom: var(--space-3); }
.steps h3 { margin-bottom: var(--space-2); }
.steps p { color: var(--muted); font-size: 0.95rem; }

/* Neon sign stage (animated by assets/js/neon-worker.js) */
.neon-stage { --neon-floor: calc(var(--space-9) + var(--space-5)); position: relative; display: flex; flex-direction: column; align-items: center; gap: var(--space-6); padding: var(--space-9) var(--gutter) var(--neon-floor); overflow: hidden; }
.neon-text-off, .neon-text-powered {
  font-family: 'Caveat', cursive; font-size: clamp(4.5rem, 11vw, 8rem); line-height: 0.85;
  display: inline-block; transform: rotate(-2deg);
}
.neon-text-off { color: var(--faint); opacity: 0.3; text-shadow: none; transition: color 0.3s, opacity 0.3s; }
.neon-text-powered { color: var(--brand); animation: neonFlicker 3.5s infinite alternate; }
@keyframes neonFlicker {
  0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
    opacity: 1; color: #0284c7;
    text-shadow: 0 0 2px #fff, 0 0 6px #38bdf8, 0 0 12px #38bdf8, 0 0 22px rgba(2, 132, 199, 0.4);
  }
  20%, 24%, 55% { opacity: 0.35; color: #0369a1; text-shadow: 0 0 1px #fff, 0 0 4px #38bdf8; }
}
.neon-pedestal {
  position: relative; width: 64px; height: 16px; margin-top: var(--space-2); cursor: pointer; z-index: 6;
  display: flex; align-items: flex-end; justify-content: center;
  background: linear-gradient(180deg, #94a3b8, #64748b); border: 2px solid #475569; border-radius: 8px;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.15);
}
.neon-button {
  width: 48px; height: 12px; border-radius: 4px 4px 2px 2px; transform: translateY(-4px);
  background: linear-gradient(180deg, #ef4444, #dc2626); box-shadow: 0 -2px 6px rgba(239, 68, 68, 0.4);
  transition: transform 0.15s, height 0.15s, background 0.15s;
}
.neon-note {
  position: absolute; top: 18px; left: 50%; transform: translateX(-50%) rotate(-4deg); width: 92px; padding: 4px 6px;
  background: #fef08a; border: 1px solid #fde047; border-radius: 2px; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
  font-family: 'Caveat', cursive; font-size: 1.15rem; font-weight: 700; color: #854d0e; line-height: 1.1; text-align: center; pointer-events: none;
}
.neon-note::before { content: ""; position: absolute; top: -5px; left: 50%; transform: translateX(-50%); width: 28px; height: 8px; background: rgba(255, 255, 255, 0.65); border: 1px solid rgba(203, 213, 225, 0.5); }

/* Contact */
.contact { background: var(--bg-soft); border-top: 1px solid var(--line); }
.contact-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: var(--space-8); align-items: start; }
.contact-intro h2 { margin-bottom: var(--space-4); }
.contact-intro .lead { margin-bottom: var(--space-5); }
.contact-points li { color: var(--muted); }
.contact-card { padding: var(--space-6); display: grid; gap: var(--space-4); box-shadow: var(--shadow); }
.contact-row { gap: var(--space-4); }
.contact-submit { justify-self: start; }
.contact-submit svg { width: 16px; height: 16px; }
.hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; text-align: left; }
  .hero-logo-showcase { order: -1; }
  .badge-frame { width: 260px; height: 260px; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact-grid { grid-template-columns: 1fr; gap: var(--space-6); }
}
@media (max-width: 560px) {
  .hero { padding-top: var(--space-6); }
  .hero-actions .button { flex: 1 1 100%; }
  .steps { grid-template-columns: 1fr; }
  .contact-card { padding: var(--space-5); }
  .contact-submit { justify-self: stretch; }
}

/* Maintenance worker (assets/js/neon-worker.js): leg swing while walking */
.neon-worker .worker-leg-l, .neon-worker .worker-leg-r { transform-box: fill-box; transform-origin: 50% 0; }
.neon-worker.is-walking .worker-leg-l { animation: workerStep 0.26s ease-in-out infinite alternate; }
.neon-worker.is-walking .worker-leg-r { animation: workerStep 0.26s ease-in-out infinite alternate-reverse; }
.neon-worker.is-walking svg { animation: workerBob 0.26s ease-in-out infinite alternate; }
@keyframes workerStep { from { transform: rotate(-22deg); } to { transform: rotate(22deg); } }
@keyframes workerBob { from { transform: translateY(0); } to { transform: translateY(-2px); } }

/* Ladder from the floor line up to the button (created by neon-worker.js inside the pedestal) */
.neon-ladder {
  position: absolute; right: calc(100% + 38px); top: -10px; bottom: calc(-1 * var(--neon-floor) - 2px); width: 22px;
  border-left: 3px solid #64748b; border-right: 3px solid #64748b; border-radius: 2px;
  background: repeating-linear-gradient(to top, transparent 0 9px, #94a3b8 9px 12px);
  pointer-events: none; z-index: -1;
}

/* Ladder states: stowed (he took it with him), lying on the floor, upright */
.neon-ladder { transform-origin: 50% 100%; transition: transform 0.5s cubic-bezier(0.3, 1.25, 0.5, 1), opacity 0.15s; }
.neon-ladder.is-lying { transform: rotate(-90deg); }
.neon-ladder.is-stowed { transform: rotate(-90deg); opacity: 0; transition: none; }

/* Ladder carried on his shoulder */
.worker-carried-ladder {
  display: none; position: absolute; top: 12px; right: 8px; height: 14px;
  border-top: 3px solid #64748b; border-bottom: 3px solid #64748b; border-radius: 2px;
  background: repeating-linear-gradient(to right, transparent 0 9px, #94a3b8 9px 12px);
  transform: rotate(12deg); transform-origin: 100% 50%;
}
.neon-worker.is-carrying .worker-carried-ladder { display: block; }
.neon-worker.face-left .worker-body { scale: -1 1; }
.neon-worker.face-left .worker-carried-ladder { right: auto; left: 8px; transform: rotate(-12deg); transform-origin: 0 50%; }

/* Grumbling speech bubble */
.worker-bubble {
  position: absolute; bottom: 54px; left: 50%; transform: translate(-50%, 4px); opacity: 0;
  white-space: nowrap; pointer-events: none;
  background: #fff; color: var(--ink); font: 600 12px/1.3 var(--font-sans);
  padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow);
  transition: opacity 0.2s, transform 0.2s;
}
.worker-bubble::after {
  content: ""; position: absolute; left: 50%; bottom: -6px; width: 10px; height: 10px;
  background: #fff; border-right: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong);
  transform: translateX(-50%) rotate(45deg);
}
.worker-bubble.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* Head shake of disapproval */
.neon-worker.is-shaking .worker-body { animation: workerShake 0.5s ease-in-out; transform-origin: 50% 40%; }
@keyframes workerShake { 0%, 100% { rotate: 0deg; } 20% { rotate: -7deg; } 40% { rotate: 7deg; } 60% { rotate: -5deg; } 80% { rotate: 4deg; } }

/* Launched at the viewer: splat and slide (neon-worker.js, launchAtViewer) */
.worker-launched { will-change: transform; filter: drop-shadow(0 1px 1px rgba(15, 23, 42, 0.25)); }
.worker-impact {
  position: fixed; z-index: 9998; width: 40px; height: 40px; margin: -20px 0 0 -20px; pointer-events: none;
  border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.15), inset 0 0 0 2px rgba(15, 23, 42, 0.1);
  animation: workerImpact 0.6s ease-out forwards;
}
@keyframes workerImpact { from { transform: scale(1); opacity: 1; } to { transform: scale(14); opacity: 0; } }
.worker-ow {
  position: fixed; z-index: 10000; transform: translate(-50%, 0); pointer-events: none;
  background: #fff; color: var(--ink); font: 600 15px/1.2 var(--font-sans); padding: 6px 12px;
  border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow);
  animation: workerOw 0.25s ease-out;
}
.worker-ow.is-leaving { transition: opacity 1.2s 0.8s; opacity: 0; }
@keyframes workerOw { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translate(-50%, 0); } }
