/* ============================================================
   AMERICAN TRON — overlay stylesheet
   Loaded AFTER style.css to add Tron + flag motifs without
   destroying the base layout.
   2026-06-23
   ============================================================ */

:root {
  --tron-red: #d92340;
  --tron-blue: #1b4ddb;
  --tron-blue-bright: #4a82ff;
  --tron-white: #ffffff;
  --tron-cream: #fbf8f3;
  --tron-grid-line: rgba(27, 77, 219, 0.18);
  --tron-grid-line-strong: rgba(27, 77, 219, 0.35);
  --tron-glow-blue: rgba(74, 130, 255, 0.55);
  --tron-glow-red: rgba(217, 35, 64, 0.45);
}

/* ============================================================
   ANIMATED TRON GRID FLOOR — fixed background, page-wide
   ============================================================ */
body {
  position: relative;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    /* horizontal lines */
    linear-gradient(to bottom, transparent 0%, transparent calc(100% - 1px), var(--tron-grid-line) 100%),
    /* vertical lines */
    linear-gradient(to right,  transparent 0%, transparent calc(100% - 1px), var(--tron-grid-line) 100%);
  background-size: 60px 60px;
  background-position: 0 0, 0 0;
  pointer-events: none;
  animation: tronGridShift 18s linear infinite;
  opacity: 0.9;
}
@keyframes tronGridShift {
  0%   { background-position: 0 0, 0 0; }
  100% { background-position: 60px 60px, 60px 60px; }
}

/* CRT scanline overlay (very subtle, page-wide) */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(15, 27, 45, 0.04) 3px,
    transparent 4px
  );
  background-size: 100% 4px;
  pointer-events: none;
  mix-blend-mode: multiply;
  animation: scanlineDrift 3s linear infinite;
}
@keyframes scanlineDrift {
  0%   { background-position: 0 0; }
  100% { background-position: 0 4px; }
}

/* ============================================================
   PATRIOTIC ACCENT BAR — thin tri-color stripe under nav
   ============================================================ */
.nav {
  border-bottom: none !important;
  box-shadow: 0 1px 0 0 var(--tron-red),
              0 3px 0 0 var(--tron-white),
              0 5px 0 0 var(--tron-blue),
              0 6px 16px rgba(27, 77, 219, 0.12);
}

/* ============================================================
   HERO — electric Tom + waving flag motif behind
   ============================================================ */
.hero {
  background: transparent !important;
}
.hero::before {
  /* override the blue blob with a flag-tinted radial */
  background: radial-gradient(circle,
    rgba(217, 35, 64, 0.18) 0%,
    transparent 70%) !important;
  width: 700px !important;
  height: 700px !important;
}
.hero::after {
  background: radial-gradient(circle,
    rgba(27, 77, 219, 0.18) 0%,
    transparent 70%) !important;
  width: 600px !important;
  height: 600px !important;
}

/* Subtle waving flag layer behind hero content */
.hero {
  isolation: isolate;
}
.hero .container::before {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 90%; height: 90%;
  background-image: url('/assets/flag-wave.png');
  background-size: cover;
  background-position: center;
  opacity: 0.08;
  filter: blur(2px);
  z-index: -1;
  pointer-events: none;
  animation: flagWave 14s ease-in-out infinite;
}
@keyframes flagWave {
  0%, 100% { transform: translate(-50%, -50%) scale(1) rotate(-0.5deg); }
  50%      { transform: translate(-50%, -50%) scale(1.04) rotate(0.5deg); }
}

/* Tom hero — amped electric aura */
.hero-image::before {
  background:
    radial-gradient(ellipse at 50% 30%, rgba(74, 130, 255, 0.40) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 70%, rgba(217, 35, 64, 0.22) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 50%, rgba(255, 255, 255, 0.15) 0%, transparent 40%) !important;
  filter: blur(28px) !important;
}
.hero-image-wrap img {
  filter:
    drop-shadow(0 0 24px rgba(74, 130, 255, 0.45))
    drop-shadow(0 0 8px rgba(217, 35, 64, 0.25))
    drop-shadow(0 24px 36px rgba(15, 27, 45, 0.35)) !important;
}

/* Speech bubble — move down so the tail lands near his mouth */
.hero-speech-bubble {
  top: 42% !important;
  right: -28px !important;
  background: linear-gradient(135deg, #ffffff 0%, #f4f8ff 100%) !important;
  border: 2px solid var(--tron-blue) !important;
  box-shadow:
    0 0 24px rgba(74, 130, 255, 0.5),
    var(--shadow-lg) !important;
}
.hero-speech-bubble::before {
  background: linear-gradient(135deg, #ffffff 0%, #f4f8ff 100%) !important;
}

/* ============================================================
   MANIFESTO — keep dark, add Tron grid emphasis + flag echo
   ============================================================ */
.manifesto {
  background:
    linear-gradient(180deg, #0a1024 0%, #08111e 100%) !important;
  position: relative;
}
.manifesto::before {
  background:
    /* prominent grid in manifesto */
    linear-gradient(to bottom, transparent 0%, transparent calc(100% - 1px), rgba(74, 130, 255, 0.18) 100%),
    linear-gradient(to right,  transparent 0%, transparent calc(100% - 1px), rgba(74, 130, 255, 0.18) 100%),
    radial-gradient(circle at 20% 30%, rgba(27, 77, 219, 0.35), transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(217, 35, 64, 0.25), transparent 50%) !important;
  background-size: 40px 40px, 40px 40px, auto, auto !important;
  animation: manifestoGrid 20s linear infinite;
}
@keyframes manifestoGrid {
  0%   { background-position: 0 0, 0 0, 0 0, 0 0; }
  100% { background-position: 0 40px, 40px 0, 0 0, 0 0; }
}

/* Manifesto — subtle waving flag behind text */
.manifesto::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: url('/assets/flag-wave.png');
  background-size: cover;
  background-position: center;
  opacity: 0.07;
  mix-blend-mode: screen;
  pointer-events: none;
  animation: flagWave 14s ease-in-out infinite;
  z-index: 0;
}
.manifesto-inner { z-index: 1; }

/* ============================================================
   OFFERING CARDS — Tron neon circuit borders
   ============================================================ */
.box-item {
  background: #ffffff !important;
  border: 1px solid rgba(27, 77, 219, 0.25) !important;
  box-shadow:
    0 0 0 1px rgba(27, 77, 219, 0.08),
    0 4px 16px rgba(27, 77, 219, 0.08) !important;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.3s,
              border-color 0.3s !important;
}
.box-item:hover {
  border-color: var(--tron-blue) !important;
  box-shadow:
    0 0 0 1px var(--tron-blue),
    0 0 24px rgba(74, 130, 255, 0.4),
    0 0 48px rgba(74, 130, 255, 0.2),
    0 12px 24px rgba(27, 77, 219, 0.15) !important;
}

/* Animated neon corner accents on box items */
.box-item::after {
  content: "";
  position: absolute;
  top: 8px; right: 8px;
  width: 16px; height: 16px;
  border-top: 2px solid var(--tron-blue);
  border-right: 2px solid var(--tron-blue);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.box-item:hover::after { opacity: 1; }

/* ============================================================
   STEP NUMBERS — Tron glow on "01 02 03 04"
   ============================================================ */
.section--cobalt {
  background:
    linear-gradient(180deg, #1b4ddb 0%, #0f3aab 100%) !important;
  position: relative;
}
.section--cobalt::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to bottom, transparent 0%, transparent calc(100% - 1px), rgba(255,255,255,0.12) 100%),
    linear-gradient(to right,  transparent 0%, transparent calc(100% - 1px), rgba(255,255,255,0.12) 100%);
  background-size: 50px 50px;
  pointer-events: none;
  opacity: 0.6;
  animation: cobaltGrid 15s linear infinite;
}
@keyframes cobaltGrid {
  0%   { background-position: 0 0, 0 0; }
  100% { background-position: 50px 0, 0 50px; }
}
.section--cobalt .container { position: relative; z-index: 1; }
.step-num {
  text-shadow: 0 0 16px rgba(255, 255, 255, 0.4) !important;
}

/* ============================================================
   TIER CARDS — Tron glow borders (replacing animated gradient)
   ============================================================ */
.tier {
  background: #ffffff !important;
  border: 2px solid rgba(27, 77, 219, 0.25) !important;
  box-shadow:
    0 0 0 1px rgba(27, 77, 219, 0.05),
    0 8px 24px rgba(27, 77, 219, 0.08) !important;
}
.tier:hover {
  border-color: var(--tron-blue) !important;
  box-shadow:
    0 0 0 1px var(--tron-blue),
    0 0 36px rgba(74, 130, 255, 0.45),
    0 0 72px rgba(74, 130, 255, 0.2),
    0 16px 32px rgba(27, 77, 219, 0.18) !important;
}
.tier::before { display: none !important; }
.tier--featured {
  border-color: var(--tron-blue) !important;
  box-shadow:
    0 0 0 1px var(--tron-blue),
    0 0 24px rgba(74, 130, 255, 0.3),
    0 8px 24px rgba(27, 77, 219, 0.12) !important;
}

/* ============================================================
   FINAL CTA — keep cobalt + add grid + flag
   ============================================================ */
.final-cta {
  position: relative;
  overflow: hidden;
}
.final-cta::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url('/assets/flag-wave.png');
  background-size: cover;
  background-position: center;
  opacity: 0.10;
  mix-blend-mode: overlay;
  pointer-events: none;
  animation: flagWave 14s ease-in-out infinite;
}
.final-cta .container { position: relative; z-index: 1; }

/* Add scanlines to CTA */
.final-cta {
  background-image:
    linear-gradient(135deg, var(--cobalt) 0%, var(--cobalt-dark) 100%),
    repeating-linear-gradient(to bottom,
      rgba(255,255,255,0.02) 0px,
      rgba(255,255,255,0.02) 1px,
      transparent 1px,
      transparent 4px) !important;
}

/* ============================================================
   HORIZON HINT — patriotic accent
   ============================================================ */
.horizon-line {
  border-color: var(--tron-blue) !important;
  background: linear-gradient(90deg,
    rgba(217, 35, 64, 0.05),
    rgba(255, 255, 255, 0.6),
    rgba(27, 77, 219, 0.05));
  box-shadow: 0 0 24px rgba(74, 130, 255, 0.2);
}

/* ============================================================
   NAV ENHANCEMENTS — patriotic dot variants
   ============================================================ */
.nav-logo-mark {
  box-shadow:
    0 0 24px rgba(74, 130, 255, 0.6),
    var(--shadow-cobalt) !important;
}

/* ============================================================
   FAB — amped glow
   ============================================================ */
.talk-fab {
  box-shadow:
    0 0 32px rgba(74, 130, 255, 0.55),
    0 12px 40px rgba(27, 77, 219, 0.4) !important;
}
.talk-fab:hover {
  box-shadow:
    0 0 48px rgba(74, 130, 255, 0.8),
    0 0 96px rgba(74, 130, 255, 0.3),
    0 16px 48px rgba(27, 77, 219, 0.5) !important;
}

/* ============================================================
   FOUNDER NOTE — subtle flag wave behind
   ============================================================ */
.founder {
  position: relative;
  overflow: hidden;
}
.founder::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url('/assets/flag-wave.png');
  background-size: cover;
  background-position: center;
  opacity: 0.05;
  pointer-events: none;
  animation: flagWave 14s ease-in-out infinite;
  z-index: 0;
}
.founder-inner { position: relative; z-index: 1; }

/* ============================================================
   GLOBAL — subtle blue under-glow on body when scrolling
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  body::before, body::after,
  .hero .container::before,
  .manifesto::before, .manifesto::after,
  .section--cobalt::before,
  .final-cta::after,
  .founder::after {
    animation: none !important;
  }
}

/* ============================================================
   TOM ON TAP — chat modal UI
   ============================================================ */

.tom-chat-modal {
  max-width: 540px !important;
  width: 100% !important;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  max-height: 80vh;
  overflow: hidden;
}

.tom-chat-header {
  background: linear-gradient(135deg, var(--cobalt) 0%, var(--cobalt-dark) 100%);
  color: white;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
}
.tom-chat-header::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to bottom,
      rgba(255,255,255,0.04) 0px,
      rgba(255,255,255,0.04) 1px,
      transparent 1px,
      transparent 4px);
  background-size: 100% 4px;
  pointer-events: none;
}
.tom-chat-avatar {
  width: 54px; height: 54px;
  border-radius: 50%;
  background: white center/cover no-repeat;
  border: 3px solid rgba(255,255,255,0.4);
  box-shadow: 0 0 24px rgba(74, 130, 255, 0.6);
  position: relative;
  flex-shrink: 0;
}
.tom-chat-live {
  position: absolute;
  bottom: 2px; right: 2px;
  width: 14px; height: 14px;
  background: #6dffba;
  border-radius: 50%;
  border: 3px solid var(--cobalt);
  animation: livePulse 1.6s ease-out infinite;
}
.tom-chat-id {
  flex: 1;
  position: relative;
}
.tom-chat-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}
.tom-chat-status {
  font-size: 0.82rem;
  opacity: 0.85;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.tom-chat-status .dots {
  display: inline-flex;
  gap: 2px;
}
.tom-chat-status .dots span {
  animation: dotPulse 1.4s infinite;
}
.tom-chat-status .dots span:nth-child(2) { animation-delay: 0.2s; }
.tom-chat-status .dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotPulse {
  0%, 100% { opacity: 0.3; }
  50%      { opacity: 1; }
}
.tom-chat-timer {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-weight: 700;
  font-size: 1.15rem;
  padding: 6px 14px;
  background: rgba(0,0,0,0.25);
  border-radius: 999px;
  letter-spacing: 0.04em;
  position: relative;
}
.tom-chat-timer.tom-timer-warn {
  background: var(--red);
  animation: timerPulse 1s ease-in-out infinite;
}
@keyframes timerPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(217, 35, 64, 0.7); }
  50%      { box-shadow: 0 0 0 8px rgba(217, 35, 64, 0); }
}

.tom-chat-thread {
  flex: 1;
  overflow-y: auto;
  padding: 22px;
  background: linear-gradient(180deg, #f7f4ee 0%, #fbf8f3 100%);
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 280px;
  max-height: 50vh;
}

.tom-msg {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  animation: msgIn 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tom-msg--assistant { justify-content: flex-start; }
.tom-msg--user { justify-content: flex-end; }

.tom-msg-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: url('/assets/tom-mini.png') center/cover no-repeat;
  flex-shrink: 0;
}

.tom-msg-bubble {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 0.97rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.tom-msg--assistant .tom-msg-bubble {
  background: white;
  color: var(--navy);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(15, 27, 45, 0.05);
}
.tom-msg--user .tom-msg-bubble {
  background: linear-gradient(135deg, var(--cobalt), var(--cobalt-light));
  color: white;
  border-bottom-right-radius: 4px;
}

.tom-msg--thinking .tom-msg-bubble {
  opacity: 0.5;
  font-style: italic;
}

.tom-chat-form {
  display: flex;
  gap: 10px;
  padding: 16px 22px;
  background: white;
  border-top: 1px solid var(--line);
}
.tom-chat-form input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 14px 22px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--navy);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.tom-chat-form input:focus {
  border-color: var(--cobalt);
  box-shadow: 0 0 0 4px rgba(27, 77, 219, 0.12);
}
.tom-chat-form input:disabled {
  background: #f5f1e8;
  cursor: not-allowed;
}
.tom-chat-form .btn {
  padding: 12px 22px;
  font-size: 0.95rem;
}

.tom-chat-hangup {
  padding: 12px;
  background: #f5f1e8;
  color: var(--red);
  border-top: 1px solid var(--line);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 0.2s;
}
.tom-chat-hangup:hover {
  background: #f0e9d8;
}

/* Mobile */
@media (max-width: 540px) {
  .tom-chat-modal { max-height: 92vh; }
  .tom-chat-thread { padding: 16px; min-height: 240px; }
  .tom-chat-header { padding: 14px 18px; }
  .tom-chat-name { font-size: 1.3rem; }
  .tom-chat-timer { font-size: 1rem; padding: 5px 10px; }
}

/* ============================================================
   TOM ON TAP — voice modal additions (v2 — voice-first)
   ============================================================ */

.tom-voice-body {
  background: linear-gradient(180deg, #f7f4ee 0%, #fbf8f3 100%);
  padding: 28px 22px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.tom-voice-tom {
  width: 180px; height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle at center,
    rgba(74, 130, 255, 0.3) 0%,
    rgba(217, 35, 64, 0.1) 50%,
    transparent 70%);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.tom-voice-tom img {
  width: 130%;
  max-width: none;
  height: auto;
  filter: drop-shadow(0 0 18px rgba(74, 130, 255, 0.45))
          drop-shadow(0 16px 28px rgba(15, 27, 45, 0.3));
  position: relative;
  z-index: 1;
  transform: translateY(8px);
}
.tom-voice-aura {
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 2px solid rgba(27, 77, 219, 0.3);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}
.tom-voice-tom.is-live {
  transform: scale(1.05);
  animation: tomBreath 3s ease-in-out infinite;
}
.tom-voice-tom.is-live .tom-voice-aura {
  opacity: 1;
  animation: tomAuraPulse 1.8s ease-out infinite;
}
@keyframes tomBreath {
  0%, 100% { transform: scale(1.03); }
  50%      { transform: scale(1.07); }
}
@keyframes tomAuraPulse {
  0% { box-shadow: 0 0 0 0 rgba(74, 130, 255, 0.5); opacity: 1; }
  100% { box-shadow: 0 0 0 30px rgba(74, 130, 255, 0); opacity: 0; }
}

.tom-voice-helper {
  text-align: center;
  font-size: 0.95rem;
  color: var(--grey);
  max-width: 360px;
  line-height: 1.5;
}
.tom-voice-helper strong {
  color: var(--navy);
  font-weight: 700;
  font-size: 1rem;
}
.tom-voice-mic-note {
  font-size: 0.82rem;
  color: var(--grey-light);
  display: inline-block;
  margin-top: 6px;
}

.tom-voice-controls {
  padding: 14px 22px 18px;
  background: white;
  border-top: 1px solid var(--line);
}
.tom-voice-call {
  width: 100%;
  justify-content: center;
  padding: 18px 28px;
  font-size: 1.05rem;
}
.btn.btn--ending {
  background: linear-gradient(135deg, var(--tron-red), #ec3a58) !important;
  color: white !important;
  box-shadow: 0 12px 36px rgba(217, 35, 64, 0.45) !important;
}

/* Status states */
.tom-chat-status.is-live {
  color: #6dffba;
  font-weight: 600;
}
.tom-chat-status.is-error {
  color: #ffb38a;
  font-weight: 600;
}
.tom-chat-status.is-connecting {
  opacity: 0.85;
}

@media (max-width: 540px) {
  .tom-voice-body { padding: 22px 16px; min-height: 200px; }
  .tom-voice-tom { width: 150px; height: 150px; }
}
