/* ==========================================================================
   OTTER LABS DESIGN SYSTEM & STYLESHEET
   Singapore Flag Theme: Vibrant Crimson Red (#E11D48) & Premium Warm White
   ========================================================================== */

/* Modern CSS Reset & Variable Definitions */
:root {
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Color Palette (Singapore Crimson Red & Warm White) */
  --bg-primary: #FCFBFA;
  --bg-secondary: #F5F4F0;
  --text-main: #1F1A1B;
  --text-muted: #786E70;
  
  --accent-red: #E11D48; /* Vibrant Flag Crimson */
  --accent-red-soft: rgba(225, 29, 72, 0.07);
  --accent-silver: #94A3B8; /* Slate Silver Gray */
  --accent-silver-soft: rgba(148, 163, 184, 0.1);
  
  --card-bg: rgba(255, 255, 255, 0.8);
  --card-border: rgba(255, 255, 255, 0.85);
  --card-shadow: 0 16px 40px -12px rgba(31, 26, 27, 0.04);
  --card-shadow-hover: 0 24px 48px -8px rgba(225, 29, 72, 0.08), 0 4px 16px -4px rgba(31, 26, 27, 0.03);
  
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --border-radius-sm: 12px;
  --border-radius-md: 20px;
  --border-radius-lg: 32px;
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Decorative Background Glows (Singapore Flag Red & Clean White)
   ========================================================================== */
.glow-bg {
  position: fixed;
  width: 50vw;
  height: 50vw;
  max-width: 600px;
  max-height: 600px;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  opacity: 0.4;
  pointer-events: none;
  animation: float-glow 20s infinite ease-in-out alternate;
}

.glow-red {
  background: radial-gradient(circle, var(--accent-red) 0%, rgba(225, 29, 72, 0.05) 80%);
  top: -10%;
  right: -5%;
  animation-delay: 0s;
}

.glow-silver {
  background: radial-gradient(circle, #FFFFFF 0%, rgba(255, 255, 255, 0.6) 80%);
  bottom: -10%;
  left: -5%;
  animation-delay: -5s;
}

@keyframes float-glow {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(8%, 10%) scale(1.1);
  }
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  background-color: rgba(252, 251, 250, 0.8);
  border-bottom: 1px solid rgba(31, 26, 27, 0.04);
  transition: var(--transition-smooth);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
}

.mini-logo-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  border: 1px solid rgba(31, 26, 27, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(31, 26, 27, 0.03);
  overflow: hidden;
  transition: var(--transition-smooth);
}

.logo-area:hover .mini-logo-circle {
  transform: rotate(15deg) scale(1.05);
  box-shadow: 0 4px 16px rgba(225, 29, 72, 0.15);
  border-color: rgba(225, 29, 72, 0.2);
}

.mini-logo {
  width: 75%;
  height: 75%;
  object-fit: contain;
}

.brand-name {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.brand-highlight {
  color: var(--accent-red);
  background: linear-gradient(135deg, var(--accent-red), #F43F5E);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.domain-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background-color: white;
  border: 1px solid rgba(31, 26, 27, 0.05);
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(31, 26, 27, 0.02);
  transition: var(--transition-smooth);
}

.domain-badge:hover {
  color: var(--accent-red);
  border-color: rgba(225, 29, 72, 0.3);
  background-color: var(--accent-red-soft);
  transform: translateY(-1px);
}

/* ==========================================================================
   Main Layout Container
   ========================================================================== */
.main-content {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--text-main);
  max-width: 800px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent-red) 0%, #BE123C 50%, #FDA4AF 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.hero-subtitle {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--text-muted);
  max-width: 650px;
  line-height: 1.6;
}

/* Mascot Wrapper with floating & glowing frame */
.mascot-wrapper {
  position: relative;
  margin-top: 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.mascot-glow {
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(225, 29, 72, 0.15) 0%, rgba(255, 255, 255, 0) 70%);
  z-index: 1;
  animation: pulse-mascot 4s infinite ease-in-out;
}

.mascot-card {
  position: relative;
  z-index: 2;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: white;
  padding: 1rem;
  border: 1px solid var(--card-border);
  box-shadow: 0 20px 48px -16px rgba(31, 26, 27, 0.06), 0 0 40px rgba(225, 29, 72, 0.04);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  animation: float-mascot 6s infinite ease-in-out;
}

.mascot-img {
  width: 90%;
  height: 90%;
  object-fit: contain;
  border-radius: 50%;
  transition: var(--transition-smooth);
}

.mascot-card:hover .mascot-img {
  transform: scale(1.06) rotate(3deg);
}

@keyframes float-mascot {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-10px) rotate(1.5deg);
  }
}

@keyframes pulse-mascot {
  0%, 100% {
    transform: scale(1);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.15);
    opacity: 0.95;
  }
}

/* ==========================================================================
   Discovery (Search & Filters) Section
   ========================================================================== */
.discovery-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.search-box-container {
  display: flex;
  align-items: center;
  width: 100%;
  position: relative;
  background-color: white;
  border: 1px solid rgba(31, 26, 27, 0.06);
  border-radius: 100px;
  padding: 0.35rem 0.5rem 0.35rem 1.5rem;
  box-shadow: 0 8px 30px rgba(31, 26, 27, 0.02);
  transition: var(--transition-smooth);
}

.search-box-container:focus-within {
  border-color: rgba(225, 29, 72, 0.3);
  box-shadow: 0 10px 32px rgba(225, 29, 72, 0.06), 0 0 0 4px rgba(225, 29, 72, 0.08);
  transform: translateY(-1px);
}

.search-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  margin-right: 0.75rem;
}

.search-box-container:focus-within .search-icon {
  color: var(--accent-red);
}

.search-icon {
  transition: var(--transition-smooth);
}

#project-search {
  flex: 1;
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-main);
  background: transparent;
  padding: 0.5rem 0;
}

#project-search::placeholder {
  color: #94A3B8;
}

.clear-btn {
  background: none;
  border: none;
  outline: none;
  padding: 0.5rem;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition-smooth);
  margin-right: 0.25rem;
}

.clear-btn:hover {
  background-color: rgba(31, 26, 27, 0.04);
  color: var(--text-main);
}

.filter-stats {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  transition: var(--transition-smooth);
}

.stat-count {
  color: var(--accent-red);
  font-weight: 700;
}

/* ==========================================================================
   Projects Dynamic Grid & Cards
   ========================================================================== */
.projects-section {
  width: 100%;
}

.grid-container {
  position: relative;
  min-height: 300px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  width: 100%;
}

/* Base Card Style */
.project-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius-md);
  padding: 2.25rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  transition: var(--transition-smooth);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px);
  animation: reveal-card 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes reveal-card {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.project-card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: var(--card-shadow-hover);
  border-color: rgba(225, 29, 72, 0.2);
}

/* Accent top-bar dynamic decoration on hover (Crimson to pinkish rose red gradient) */
.project-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-red), #F43F5E);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card:hover::after {
  transform: scaleX(1);
}

/* Card Header (Logo & Subdomain badge) */
.card-header-layout {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
}

.card-logo-container {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: white;
  border: 1px solid rgba(31, 26, 27, 0.04);
  box-shadow: 0 4px 12px rgba(31, 26, 27, 0.02);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.project-card:hover .card-logo-container {
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(225, 29, 72, 0.1);
  border-color: rgba(225, 29, 72, 0.15);
}

.card-logo {
  width: 80%;
  height: 80%;
  object-fit: contain;
}

.card-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-red);
  background-color: var(--accent-red-soft);
  padding: 0.35rem 0.75rem;
  border-radius: 100px;
  font-family: var(--font-heading);
  letter-spacing: 0.02em;
  transition: var(--transition-smooth);
}

.project-card:hover .card-badge {
  background-color: var(--accent-red);
  color: white;
}

/* Card Content */
.card-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.project-name {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.project-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Card Footer Action */
.card-action-bar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-red);
  transition: var(--transition-smooth);
  margin-top: 0.5rem;
}

.arrow-icon {
  transition: transform 0.3s ease;
}

.project-card:hover .card-action-bar {
  color: #BE123C;
}

.project-card:hover .arrow-icon {
  transform: translateX(4px);
}

/* ==========================================================================
   Loading Skeleton Structure
   ========================================================================== */
.loading-skeleton {
  display: contents; /* Renders inside grid automatically */
}

.skeleton-card {
  height: 240px;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--border-radius-md);
  position: relative;
  overflow: hidden;
}

.skeleton-card::before {
  content: '';
  display: block;
  position: absolute;
  left: -150px;
  top: 0;
  height: 100%;
  width: 150px;
  background: linear-gradient(to right, transparent 0%, rgba(255, 255, 255, 0.8) 50%, transparent 100%);
  animation: loading-pulse 1.5s infinite;
}

@keyframes loading-pulse {
  0% { left: -150px; }
  100% { left: 100%; }
}

/* ==========================================================================
   No Results State
   ========================================================================== */
.no-results-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 4rem 2rem;
  background: rgba(255, 255, 255, 0.3);
  border: 1px dashed rgba(31, 26, 27, 0.08);
  border-radius: var(--border-radius-lg);
  backdrop-filter: blur(12px);
  gap: 1rem;
}

.no-results-illustration {
  font-size: 3rem;
  animation: wiggle 2s infinite ease-in-out;
}

.no-results-view h3 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--text-main);
}

.no-results-view p {
  color: var(--text-muted);
  max-width: 320px;
  margin-bottom: 0.5rem;
}

.reset-btn {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: white;
  background: linear-gradient(135deg, var(--accent-red), #BE123C);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 100px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(225, 29, 72, 0.2);
  transition: var(--transition-smooth);
}

.reset-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(225, 29, 72, 0.3);
}

@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(10deg) scale(1.1); }
}

/* ==========================================================================
   Footer
   ========================================================================== */
footer {
  margin-top: auto;
  border-top: 1px solid rgba(31, 26, 27, 0.04);
  background-color: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(8px);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition-smooth);
}

.footer-links a:hover {
  color: var(--accent-red);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: rgba(34, 197, 94, 0.08);
  color: #16A34A;
  padding: 0.35rem 0.75rem;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid rgba(34, 197, 94, 0.15);
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: #22C55E;
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* ==========================================================================
   Responsive Viewports
   ========================================================================== */
@media (max-width: 768px) {
  .nav-container {
    padding: 1rem 1.5rem;
  }
  
  .main-content {
    padding: 2rem 1.5rem 4rem;
    gap: 3rem;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
    padding: 2rem 1.5rem;
  }

  .footer-links {
    flex-direction: column;
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .logo-area .brand-name {
    font-size: 1.2rem;
  }
  
  .domain-badge {
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
  }

  .mascot-card {
    width: 180px;
    height: 180px;
  }
  
  .mascot-glow {
    width: 220px;
    height: 220px;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }
}
