/* ==========================================================================
   Smiltis.art Design System & Stylesheet
   ========================================================================== */

/* 1. Global Reset & Theme Variables */
:root {
  /* Default Day Theme Tokens */
  --sky-grad-1: #a1c4fd;
  --sky-grad-2: #c2e9fb;
  --sky-grad-3: #e0f2fe;
  
  --celestial-color: #fff9e6;
  --celestial-shadow: rgba(253, 224, 71, 0.4);
  --celestial-top: 15%;
  --celestial-left: 75%;
  --celestial-size: 120px;
  --celestial-radius: 50%;
  --celestial-clip: none;
  
  --wave-back-color: rgba(79, 172, 254, 0.25);
  --wave-mid-color: rgba(0, 242, 254, 0.35);
  --wave-front-color: rgba(255, 255, 255, 0.85);
  --sand-color: #f7e1bd;
  --sand-shimmer-color: rgba(255, 255, 255, 0.6);
  
  --text-color: #0f172a;
  --text-description: #334155;
  --highlight-color: #0b57d0;
  
  --glass-bg: rgba(255, 255, 255, 0.22);
  --glass-border: rgba(255, 255, 255, 0.4);
  --glass-shadow: rgba(15, 23, 42, 0.05);
  --glass-text-heading: #0f172a;
  
  --star-opacity: 0;
  --cloud-opacity: 1;
  
  --transition-speed: 2.5s; /* Ultra-smooth transitioning between times of day */
}

/* Dawn Theme Override (05:00 - 08:00) */
body.state-dawn {
  --sky-grad-1: #18193f;
  --sky-grad-2: #7b5c87;
  --sky-grad-3: #ffb0a5;
  
  --celestial-color: #ffe5d9;
  --celestial-shadow: rgba(255, 176, 165, 0.6);
  --celestial-top: 30%;
  --celestial-left: 20%;
  --celestial-size: 100px;
  --celestial-radius: 50%;
  --celestial-clip: none;
  
  --wave-back-color: rgba(123, 92, 135, 0.3);
  --wave-mid-color: rgba(255, 176, 165, 0.4);
  --wave-front-color: rgba(255, 245, 245, 0.9);
  --sand-color: #e2c2b3;
  --sand-shimmer-color: rgba(255, 229, 217, 0.7);
  
  --text-color: #ffffff;
  --text-description: #f1f5f9;
  --highlight-color: #ffd0c7;
  
  --glass-bg: rgba(24, 25, 63, 0.22);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-shadow: rgba(0, 0, 0, 0.12);
  --glass-text-heading: #ffffff;
  
  --star-opacity: 0.1;
  --cloud-opacity: 0.7;
}

/* Sunset Theme Override (17:00 - 20:00) */
body.state-sunset {
  --sky-grad-1: #1a0b2e;
  --sky-grad-2: #b23a48;
  --sky-grad-3: #fc7a1e;
  
  --celestial-color: #f9c22e;
  --celestial-shadow: rgba(252, 122, 30, 0.7);
  --celestial-top: 40%;
  --celestial-left: 80%;
  --celestial-size: 140px;
  --celestial-radius: 50%;
  --celestial-clip: none;
  
  --wave-back-color: rgba(178, 58, 72, 0.35);
  --wave-mid-color: rgba(252, 122, 30, 0.4);
  --wave-front-color: rgba(254, 243, 199, 0.9);
  --sand-color: #dcb38f;
  --sand-shimmer-color: rgba(249, 194, 46, 0.6);
  
  --text-color: #ffffff;
  --text-description: #f8fafc;
  --highlight-color: #ffd29d;
  
  --glass-bg: rgba(26, 11, 46, 0.22);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-shadow: rgba(0, 0, 0, 0.15);
  --glass-text-heading: #ffffff;
  
  --star-opacity: 0.1;
  --cloud-opacity: 0.5;
}

/* Night Theme Override (20:00 - 05:00) */
body.state-night {
  --sky-grad-1: #030712;
  --sky-grad-2: #0b1528;
  --sky-grad-3: #1e1b4b;
  
  /* Silver Crescent Moon using clip-path or background masking */
  --celestial-color: #f1f5f9;
  --celestial-shadow: rgba(241, 245, 249, 0.3);
  --celestial-top: 15%;
  --celestial-left: 70%;
  --celestial-size: 80px;
  --celestial-radius: 50%;
  --celestial-clip: radial-gradient(circle at 30% 30%, transparent 55%, #f1f5f9 56%);
  
  --wave-back-color: rgba(11, 21, 40, 0.6);
  --wave-mid-color: rgba(30, 27, 75, 0.7);
  --wave-front-color: rgba(15, 23, 42, 0.95);
  --sand-color: #64748b;
  --sand-shimmer-color: rgba(56, 189, 248, 0.75); /* Bioluminescent blue sand glow at night! */
  
  --text-color: #ffffff;
  --text-description: #e2e8f0;
  --highlight-color: #38bdf8; /* Glowing light blue */
  
  --glass-bg: rgba(3, 7, 18, 0.35);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: rgba(0, 0, 0, 0.25);
  --glass-text-heading: #ffffff;
  
  --star-opacity: 0.85;
  --cloud-opacity: 0.2;
}

/* Base resets */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--text-color);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: var(--sky-grad-1);
  transition: background-color var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1),
              color var(--transition-speed) ease;
}

/* 2. Interactive Seashore Background layers */
.sky-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.sky-gradient {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, var(--sky-grad-1), var(--sky-grad-2), var(--sky-grad-3));
  transition: background var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
}

.celestial-body {
  position: absolute;
  top: var(--celestial-top);
  left: var(--celestial-left);
  width: var(--celestial-size);
  height: var(--celestial-size);
  background-color: var(--celestial-color);
  border-radius: var(--celestial-radius);
  box-shadow: 0 0 50px var(--celestial-shadow), 0 0 100px var(--celestial-shadow);
  transition: top var(--transition-speed) cubic-bezier(0.34, 1.56, 0.64, 1),
              left var(--transition-speed) cubic-bezier(0.34, 1.56, 0.64, 1),
              width var(--transition-speed) ease,
              height var(--transition-speed) ease,
              background-color var(--transition-speed) ease,
              box-shadow var(--transition-speed) ease;
}

/* Masking crescent moon shape at night */
body.state-night .celestial-body {
  background: transparent;
  box-shadow: -15px 15px 30px -5px var(--celestial-shadow);
  border-radius: 50%;
  box-shadow: -12px 12px 0 0 #f1f5f9, 0 0 20px rgba(241, 245, 249, 0.2);
}

/* Starfield generation (Night only) */
.stars-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 60%;
  opacity: var(--star-opacity);
  background-image: 
    radial-gradient(1.5px 1.5px at 15% 20%, #fff 100%, transparent),
    radial-gradient(1px 1px at 35% 10%, #fff 100%, transparent),
    radial-gradient(2px 2px at 60% 30%, #fff 100%, transparent),
    radial-gradient(1.5px 1.5px at 80% 15%, #fff 100%, transparent),
    radial-gradient(1px 1px at 50% 45%, #fff 100%, transparent),
    radial-gradient(2px 2px at 20% 70%, #fff 100%, transparent),
    radial-gradient(1px 1px at 75% 60%, #fff 100%, transparent),
    radial-gradient(1.5px 1.5px at 90% 80%, #fff 100%, transparent);
  background-repeat: repeat;
  background-size: 500px 500px;
  transition: opacity var(--transition-speed) ease;
}

/* Ambient Floating Clouds */
.clouds-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: var(--cloud-opacity);
  transition: opacity var(--transition-speed) ease;
}

.cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 100px;
  filter: blur(10px);
}

.cloud::before, .cloud::after {
  content: '';
  position: absolute;
  background: inherit;
  border-radius: 50%;
}

.cloud-1 {
  width: 180px;
  height: 50px;
  top: 15%;
  left: -200px;
  animation: floatCloud 45s linear infinite;
}

.cloud-2 {
  width: 260px;
  height: 70px;
  top: 28%;
  left: -300px;
  animation: floatCloud 65s linear infinite 10s;
  background: rgba(255, 255, 255, 0.18);
}

.cloud-3 {
  width: 120px;
  height: 40px;
  top: 8%;
  left: -150px;
  animation: floatCloud 30s linear infinite 5s;
}

@keyframes floatCloud {
  0% { left: -300px; }
  100% { left: 100%; }
}

/* 3. Main Glassmorphic Wrapper & Grid Layout */
.content-wrapper {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 40px 180px 40px; /* Leave bottom space for seashore */
  flex-grow: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
}

/* Header styling */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-particle {
  width: 14px;
  height: 14px;
  background-color: var(--highlight-color);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--highlight-color);
  position: relative;
  animation: logoPulse 4s infinite ease-in-out;
}

@keyframes logoPulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 15px var(--highlight-color); }
}

.company-name {
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--glass-text-heading);
  transition: color var(--transition-speed) ease;
}

.logo-area .highlight {
  font-weight: 300;
  opacity: 0.8;
}

.timezone-indicator {
  font-size: 0.85rem;
  font-weight: 500;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: 0 4px 10px var(--glass-shadow);
  padding: 6px 14px;
  border-radius: 50px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-color);
  transition: background var(--transition-speed) ease,
              border var(--transition-speed) ease,
              color var(--transition-speed) ease;
}

/* Premium Glassmorphism Cards */
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: 0 10px 30px var(--glass-shadow);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 40px;
  color: var(--text-color);
  transition: background var(--transition-speed) ease,
              border var(--transition-speed) ease,
              box-shadow var(--transition-speed) ease,
              color var(--transition-speed) ease,
              transform 0.3s ease;
}

.glass-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 35px var(--glass-shadow);
}

.main-card {
  max-width: 800px;
}

.hero-title {
  font-family: 'Outfit', sans-serif;
  font-size: 3.2rem;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 20px;
  letter-spacing: -1px;
  color: var(--glass-text-heading);
  transition: color var(--transition-speed) ease;
}

.hero-description {
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--text-description);
  margin-bottom: 30px;
  transition: color var(--transition-speed) ease;
}

.hero-description em {
  font-family: 'Outfit', sans-serif;
  color: var(--highlight-color);
  font-weight: 500;
  font-style: normal;
  transition: color var(--transition-speed) ease;
}

/* Styled Tags */
.tag-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--text-color);
  transition: background 0.3s ease, transform 0.2s ease, color var(--transition-speed) ease;
}

.tag:hover {
  background: var(--highlight-color);
  color: #fff;
  border-color: var(--highlight-color);
  transform: translateY(-2px);
}

/* Info Section (Grid split) */
.info-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
}

@media (min-width: 900px) {
  .content-wrapper {
    grid-template-columns: 3fr 2.2fr;
    align-items: start;
    padding-top: 40px;
  }
  
  .header {
    grid-column: span 2;
  }
  
  .info-section {
    grid-template-columns: 1fr;
  }
}

.contact-card h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.8rem;
  margin-bottom: 8px;
  color: var(--glass-text-heading);
}

.card-subtitle {
  font-size: 0.95rem;
  color: var(--text-description);
  margin-bottom: 24px;
}

/* 4. Modern Accessible Form Design */
.form-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-description);
}

/* Tap targets at least 48px, iOS zoom prevented (min 16px font-size) */
.form-group input,
.form-group textarea {
  font-family: inherit;
  font-size: 1rem;
  color: var(--text-color);
  background: transparent;
  border: none;
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.25);
  padding: 12px 4px;
  min-height: 48px;
  outline: none;
  width: 100%;
  border-radius: 0;
  transition: border-color 0.4s ease, color var(--transition-speed) ease;
}

.form-group textarea {
  min-height: 80px;
  resize: vertical;
}

/* Accessible focus overrides - elegant minimalist bottom line */
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--highlight-color);
  background: transparent;
  box-shadow: none;
}

/* Validation validation states using user-invalid */
.form-group input:invalid:user-invalid,
.form-group textarea:invalid:user-invalid {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.05);
}

.error-msg {
  font-size: 0.8rem;
  color: #ef4444;
  font-weight: 500;
  min-height: 16px;
  margin-top: 2px;
}

/* Action button with integrated spinner state */
#submit-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  background-color: var(--highlight-color);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(11, 87, 208, 0.3);
  transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
  position: relative;
}

#submit-btn:hover {
  background-color: #0842a0;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(11, 87, 208, 0.4);
}

#submit-btn:active {
  transform: translateY(1px);
}

#submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#submit-btn.submitting .btn-spinner {
  display: inline-block;
}

#submit-btn.submitting .btn-text {
  opacity: 0.8;
}

.form-status {
  margin-top: 15px;
  font-size: 0.95rem;
  text-align: center;
  font-weight: 500;
}

.form-status.success {
  color: #10b981;
}

.form-status.error {
  color: #ef4444;
}

/* 5. Shoreline Waves & Sand Bank layers */
.shoreline {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 1; /* Sits in front of sky background, behind content-wrapper */
  pointer-events: none; /* Let clicks pass through to debugger buttons */
}

/* Prevent layout overlapping and support click on sand container */
.sand-bank {
  width: 100%;
  height: 100px;
  background: linear-gradient(to bottom, var(--wave-front-color) 0%, var(--sand-color) 25px, var(--sand-color) 100%);
  position: relative;
  overflow: hidden;
  pointer-events: auto; /* Sand particles canvas needs hover events! */
  transition: background var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
}

#sand-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Waves container */
.waves-svg {
  display: block;
  width: 100%;
  height: 12vh;
  min-height: 80px;
  max-height: 140px;
  margin-bottom: -2px; /* Blend waves into sand bank */
}

.wave-parallax > use {
  animation: move-forever 20s cubic-bezier(.55,.5,.45,.5) infinite;
  fill: var(--wave-front-color);
  transition: fill var(--transition-speed) ease;
}

.wave-parallax > use:nth-child(1) {
  animation-delay: -2s;
  animation-duration: 9s;
  fill: var(--wave-back-color);
}

.wave-parallax > use:nth-child(2) {
  animation-delay: -4s;
  animation-duration: 13s;
  fill: var(--wave-mid-color);
}

.wave-parallax > use:nth-child(3) {
  animation-delay: -6s;
  animation-duration: 18s;
  fill: var(--wave-front-color);
}

@keyframes move-forever {
  0% {
    transform: translate3d(-90px, 0, 0);
  }
  100% {
    transform: translate3d(86px, 0, 0);
  }
}

/* Footer elements */
.footer {
  margin-top: 40px;
  padding: 20px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.85rem;
  color: var(--text-description);
  transition: border-color var(--transition-speed) ease, color var(--transition-speed) ease;
  grid-column: span 1;
}

@media (min-width: 900px) {
  .footer {
    grid-column: span 2;
  }
}

.footer-links {
  display: flex;
  gap: 15px;
}

.footer-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--highlight-color);
  text-decoration: underline;
}

/* 6. Theme Debugger Tool */
.theme-debugger {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
  display: flex;
  gap: 6px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px;
  border-radius: 12px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0.1;
  transition: opacity 0.3s ease;
}

.theme-debugger:hover {
  opacity: 1;
}

.theme-debugger button {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 6px;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.theme-debugger button:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.theme-debugger button:active {
  transform: translateY(0);
}

/* 7. Micro-animations & Entrance Effects */
.animate-fade-in {
  opacity: 0;
  animation: fadeIn 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-fade-in-delayed {
  opacity: 0;
  animation: fadeIn 1s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
}

.animate-fade-in-delayed-more {
  opacity: 0;
  animation: fadeIn 1s cubic-bezier(0.16, 1, 0.3, 1) 0.6s forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
  .content-wrapper {
    padding: 10px 20px 160px 20px;
  }
  .hero-title {
    font-size: 2.2rem;
  }
  .glass-card {
    padding: 24px;
  }
  .theme-debugger {
    bottom: 20px;
    top: auto;
    right: 50%;
    transform: translateX(50%);
    opacity: 0.8;
  }
}
