:root {
  /* Primary colors */
  --color-primary: #2E9AA6;
  --color-primary-hover: #1E7A84;
  --color-primary-dark: #0F5960;

  /* Accent & neutrals */
  --color-accent: #FF6B6B;
  --color-bg-primary: #F8FAFB;
  --color-bg-secondary: #FFFFFF;
  --color-bg-dark: #1A1F24;
  --color-text-primary: #1A1F24;
  --color-text-secondary: #6B7280;
  --color-text-light: #FFFFFF;
  --color-border: #E5E7EB;
  --color-error: #DC2626;
  --color-success: #059669;

  /* Typography */
  --font-family-base: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif;
  --font-family-mono: "Monaco", "Menlo", "Ubuntu Mono", monospace;

  /* Spacing (8px scale) */
  --space-4: 4px;
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-24: 24px;
  --space-32: 32px;
  --space-40: 40px;
  --space-64: 64px;
  --space-80: 80px;

  /* Radius & shadows */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg-primary: #111827;
    --color-bg-secondary: #1F2937;
    --color-text-primary: #F3F4F6;
    --color-text-secondary: #9CA3AF;
    --color-border: #374151;
  }
}

body {
  font-family: var(--font-family-base);
  font-size: 16px;
  line-height: 1.6;
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
  margin: 0;
}

h1, h2, h3 {
  margin: 0 0 16px;
  letter-spacing: -0.01em;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover {
  color: var(--color-primary-hover);
  text-decoration: underline;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

@media (max-width: 768px) {
  .container { padding: 0 16px; }
}

/* Header */
header {
  position: sticky;
  top: 0;
  height: 60px;
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border);
  z-index: 100;
  display: flex;
  align-items: center;
}
header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.logo {
  font-weight: 700;
  font-size: 18px;
  color: var(--color-primary);
}
nav a {
  margin-left: 20px;
  color: var(--color-text-secondary);
  font-weight: 500;
}
nav a:hover {
  color: var(--color-primary);
}

/* Hero */
.hero {
  padding: 80px 0;
  text-align: center;
  background: var(--color-bg-primary);
}
.hero h1 {
  font-size: 48px;
  margin-bottom: 16px;
}
.hero p {
  font-size: 20px;
  color: var(--color-text-secondary);
  margin-bottom: 32px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 40px;
  font-size: 16px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  background: var(--color-primary);
  color: #fff;
  transition: background 0.2s ease, transform 0.1s ease;
}
.btn-primary:hover { background: var(--color-primary-hover); text-decoration: none; }
.btn-primary:active { background: var(--color-primary-dark); transform: scale(0.98); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-secondary:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  text-decoration: none;
}

/* Sections */
.section {
  padding: 64px 0;
}
.section-white {
  background: var(--color-bg-secondary);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.card {
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Tool Layout */
.tool-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
  padding-top: 32px;
  padding-bottom: 64px;
}

.tool-interface {
  background: var(--color-bg-secondary);
  padding: 32px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}

.input-group {
  margin-bottom: 24px;
}
.input-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}

input, textarea {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-bg-primary); /* Slightly distinct from card bg */
  color: var(--color-text-primary);
  font-size: 16px;
  font-family: var(--font-family-base);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(46,154,166,0.12);
}
textarea {
  font-family: var(--font-family-mono);
  font-size: 14px;
  min-height: 200px;
  resize: vertical;
}

.action-bar {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

/* Footer */
footer {
  background: var(--color-bg-dark);
  color: var(--color-text-secondary);
  padding: 64px 0;
}
footer h3 {
  color: var(--color-text-light);
  font-size: 18px;
}
footer ul {
  list-style: none;
  padding: 0;
}
footer li {
  margin-bottom: 12px;
}
footer a {
  color: var(--color-text-secondary);
}
footer a:hover {
  color: var(--color-primary);
}

/* Mobile */
@media (max-width: 1024px) {
  .tool-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .hero h1 { font-size: 32px; }
  .grid-3 { grid-template-columns: 1fr; }
  nav { display: none; } /* Simplified for this snippet, typically needs JS toggle */
  .mobile-menu-btn { display: block; } /* Add hamburger if implementing full menu */
}

/* Card Showcase (Timer Swap) */
.interactive-card {
  position: relative;
  width: 200px;
  height: 300px; 
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  /* Removed transform transition to stop the "sliding" effect */
}

.interactive-card img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Removed transition to avoid conflict with animation */
}

/* Animation for the Alternate Image */
@keyframes expressionSwap {
  0%, 45% { opacity: 0; }   /* Normal face for ~2.25s */
  55%, 95% { opacity: 1; }  /* Expression for ~2s */
  100% { opacity: 0; }
}

.interactive-card .alt-img {
  opacity: 0;
  z-index: 2;
  animation: expressionSwap 5s infinite; 
}

/* Stagger the animations */
.floating-card-left .alt-img { animation-delay: 0s; }
.floating-card-right .alt-img { animation-delay: 1.5s; }
.floating-card-bottom .alt-img { animation-delay: 3s; }

/* Staggered Decorative Cards - Inside the content container */
.card-stagger-container {
  position: relative;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  column-gap: 24px;
}

.card-stagger-container.card-stagger-rail-right {
  grid-template-columns: minmax(0, 1fr) 220px;
}

.card-stagger {
  position: relative;
  display: flex;
  pointer-events: none;
  z-index: 1;
  grid-row: 1 / -1;
}

.card-stagger-left {
  justify-content: flex-start;
  align-items: flex-start;
  padding: 12px 0 0 12px;
  grid-column: 1;
  align-self: start;
}

.card-stagger-right {
  justify-content: flex-end;
  align-items: center;
  padding: 0 12px 0 0;
  grid-column: 2;
  justify-self: end;
  align-self: center;
}

.card-stagger-bottom {
  justify-content: flex-start;
  align-items: flex-end;
  padding: 0 0 12px 12px;
  grid-column: 1;
  align-self: end;
}

.card-stagger .interactive-card {
  pointer-events: auto;
}

.card-stagger-container > *:not(.card-stagger) {
  position: relative;
  z-index: 1;
  grid-column: 2;
  min-width: 0;
}

.card-stagger-container.card-stagger-rail-right > *:not(.card-stagger) {
  grid-column: 1;
}

.floating-card-left,
.floating-card-right,
.floating-card-bottom {
  position: relative;
  left: auto;
  right: auto;
  top: auto;
  bottom: auto;
  z-index: 0;
}

.floating-card-left { transform: rotate(-3deg); }
.floating-card-right { transform: rotate(3deg); }
.floating-card-bottom { transform: rotate(-2deg); }

@media (max-width: 1024px) {
  .card-stagger-container {
    grid-template-columns: 1fr;
  }

  .card-stagger {
    position: static;
    grid-row: auto;
    grid-column: 1;
    justify-content: center;
    align-items: center;
    margin-bottom: 24px;
    padding: 0;
  }

  .card-stagger-left,
  .card-stagger-right,
  .card-stagger-bottom {
    justify-content: center;
    align-items: center;
    grid-column: 1;
    justify-self: center;
    align-self: center;
  }

  .card-stagger-container > *:not(.card-stagger) {
    grid-column: 1;
  }
}
