/* ============================================
   ClosedRoom - Minimal Professional Design
   Following Research Specifications
   ============================================ */

/* === Color Palette (Research Spec) === */
:root {
  --purple: #6366F1;
  --purple-dark: #4F46E5;
  --teal: #14B8A6;
  --white: #F9FAFB;
  --graphite: #1F2937;
  --gray: #6B7280;
  
  --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--graphite);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* === Typography === */
h1, h2, h3 {
  font-family: var(--font-heading);
  line-height: 1.2;
}

h1 {
  font-size: 64px;
  font-weight: 700;
}

h3 {
  font-size: 32px;
  font-weight: 600;
}

/* === Hero Section === */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  margin-bottom: 48px;
}

.logo img {
  display: block;
}

.hero h1 {
  margin-bottom: 60px;
}

/* === Split-Flap Display (Hero Feature) === */
.split-flap-wrapper {
  margin: 60px 0;
}

.split-flap {
  display: inline-flex;
  gap: 8px;
  padding: 40px 56px;
  background: var(--graphite);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.char {
  position: relative;
  width: 64px;
  height: 96px;
  perspective: 700px;
}

.char.space {
  width: 32px;
  background: transparent;
}

/* Top and Bottom Halves */
.char-top,
.char-bottom {
  position: absolute;
  left: 0;
  right: 0;
  height: 50%;
  background: #2a2a2a;
  border: 1px solid rgba(99, 102, 241, 0.3);
  overflow: hidden;
  backface-visibility: hidden;
}

.char-top {
  top: 0;
  border-radius: 8px 8px 0 0;
  border-bottom: 0.5px solid rgba(99, 102, 241, 0.5);
  transform-origin: bottom;
}

.char-bottom {
  bottom: 0;
  border-radius: 0 0 8px 8px;
  border-top: 0.5px solid rgba(99, 102, 241, 0.5);
  transform-origin: top;
}

.char-top span,
.char-bottom span {
  font-family: 'SF Mono', 'Monaco', monospace;
  font-size: 56px;
  font-weight: 700;
  color: #FFFFFF;
  line-height: 96px;
  height: 96px;
  display: block;
  text-align: center;
}

/* Flip Animation */
.char-top.flip {
  animation: flipTop 0.3s ease-in-out;
}

.char-bottom.flip {
  animation: flipBottom 0.3s ease-in-out;
}

@keyframes flipTop {
  0% { transform: rotateX(0deg); }
  100% { transform: rotateX(-90deg); }
}

@keyframes flipBottom {
  0% { transform: rotateX(90deg); }
  100% { transform: rotateX(0deg); }
}

/* === Tagline === */
.tagline {
  font-size: 32px;
  font-weight: 400;
  color: var(--gray);
  margin: 60px 0 40px;
}

/* === CTA Button === */
.cta {
  display: inline-block;
  background: var(--purple);
  color: #FFFFFF;
  font-size: 18px;
  font-weight: 600;
  padding: 18px 48px;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.cta:hover {
  background: var(--purple-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3);
}

.subtext {
  margin-top: 16px;
  font-size: 14px;
  color: var(--gray);
}

/* === Value Props Section === */
.values {
  max-width: 1200px;
  margin: 0 auto;
  padding: 120px 40px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 60px;
  text-align: center;
}

.value h3 {
  margin-bottom: 16px;
  color: var(--graphite);
}

.value p {
  font-size: 19px;
  color: var(--gray);
}

/* === Footer === */
footer {
  padding: 80px 40px;
  text-align: center;
  background: var(--white);
}

footer p {
  font-size: 24px;
  font-weight: 400;
  color: var(--gray);
}

/* === Responsive Design === */
@media (max-width: 768px) {
  h1 {
    font-size: 40px;
  }
  
  .tagline {
    font-size: 21px;
  }
  
  .split-flap {
    padding: 28px 32px;
    gap: 4px;
  }
  
  .char {
    width: 40px;
    height: 60px;
  }
  
  .char.space {
    width: 20px;
  }
  
  .char-top span,
  .char-bottom span {
    font-size: 36px;
    line-height: 60px;
    height: 60px;
  }
  
  .char-bottom span {
    transform: translateY(-30px);
  }
  
  .values {
    grid-template-columns: 1fr;
    gap: 48px;
    padding: 80px 24px;
  }
  
  .cta {
    width: 100%;
    max-width: 400px;
  }
}

/* === Accessibility === */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

*:focus-visible {
  outline: 3px solid var(--purple);
  outline-offset: 4px;
}
