/* ============================================
   DeskMate Website - Dark Minimal Design
   ============================================ */

/* ---------- CSS Reset & Variables ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Colors - Dark theme with warm accents (avoiding blue) */
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-tertiary: #1a1a1a;
  --bg-card: #151515;

  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
  --text-muted: #666666;

  --accent-primary: #ff6b35; /* Warm orange */
  --accent-secondary: #e8e8e8;
  --accent-glow: rgba(255, 107, 53, 0.15);

  --border-color: #2a2a2a;
  --border-light: #333333;

  /* Typography */
  --font-main: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;

  /* Spacing */
  --section-padding: clamp(4rem, 10vw, 8rem);
  --container-max: 1200px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-medium: 0.3s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1.5rem 2rem;
  background: rgba(10, 10, 10, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
}

.nav-container {
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  align-items: center;
}

.nav-links a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-cta {
  color: var(--accent-primary) !important;
  font-weight: 500;
}

/* ---------- Hero Section ---------- */
.hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 4rem;
  padding: calc(var(--section-padding) + 4rem) 2rem var(--section-padding);
  max-width: var(--container-max);
  margin: 0 auto;
}

.hero-eyebrow {
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent-primary);
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: clamp(3.5rem, 8vw, 6rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}

.hero-highlight {
  background: linear-gradient(135deg, var(--accent-primary) 0%, #ff8f65 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-description {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 420px;
  margin-bottom: 2.5rem;
  line-height: 1.7;
}

.hero-cta {
  display: flex;
  gap: 1rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.875rem 1.75rem;
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: 8px;
  transition: all var(--transition-medium);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--accent-primary);
  color: #000;
}

.btn-primary:hover {
  background: #ff8a5c;
  transform: translateY(-2px);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

.btn-secondary:hover {
  background: var(--bg-tertiary);
  border-color: var(--text-muted);
}

.btn-large {
  padding: 1.125rem 2.25rem;
  font-size: 1rem;
}

/* ---------- Device Mockup ---------- */
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.device-mockup {
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 20px 60px rgba(0, 0, 0, 0.5);
}

.oled-screen {
  width: 280px;
  height: 165px;
  background: #000;
  border-radius: 8px;
  padding: 0.875rem 1rem;
  font-family: "Courier New", monospace;
  position: relative;
  overflow: hidden;
}

.oled-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 0%,
    rgba(0, 0, 0, 0.3) 100%
  );
  pointer-events: none;
}

.oled-content {
  position: relative;
  z-index: 1;
  height: 100%;
}

.oled-title {
  display: block;
  font-size: 0.7rem;
  color: #00ff00;
  margin-bottom: 0.5rem;
  opacity: 0.9;
}

.oled-menu {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.oled-item {
  font-size: 0.7rem;
  color: #00ff00;
  padding: 0.2rem 0.5rem;
  opacity: 0.7;
}

.oled-item.active {
  background: #00ff00;
  color: #000;
  opacity: 1;
}

/* Hidden screens */
.oled-screen-view.hidden {
  display: none;
}

/* Temperature Screen */
.oled-temp-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 80px;
}

.oled-temp-value {
  font-size: 1.75rem;
  font-weight: bold;
  color: #00ff00;
}

.oled-temp-humidity {
  font-size: 0.65rem;
  color: #00ff00;
  opacity: 0.8;
  margin-top: 0.5rem;
}

/* Pomodoro Screen */
.oled-pomo-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 80px;
}

.oled-pomo-time {
  font-size: 1.75rem;
  font-weight: bold;
  color: #00ff00;
}

.oled-pomo-status {
  font-size: 0.6rem;
  color: #00ff00;
  opacity: 0.7;
  margin-top: 0.5rem;
}

/* Sonar Screen */
.oled-sonar-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 80px;
  gap: 0.75rem;
}

.oled-sonar-value {
  font-size: 1.25rem;
  font-weight: bold;
  color: #00ff00;
}

.oled-sonar-bar {
  width: 90%;
  height: 10px;
  border: 1px solid #00ff00;
  border-radius: 2px;
  overflow: hidden;
}

.oled-sonar-fill {
  height: 100%;
  background: #00ff00;
  width: 50%;
  transition: width 0.2s ease;
}

/* Breathing Screen */
.oled-breath-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 80px;
}

.oled-breath-phase {
  font-size: 1rem;
  font-weight: bold;
  color: #00ff00;
}

.oled-breath-count {
  font-size: 2rem;
  font-weight: bold;
  color: #00ff00;
  margin-top: 0.25rem;
}

/* Settings Screen */
.oled-settings-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 80px;
  gap: 0.5rem;
}

.oled-settings-label {
  font-size: 0.7rem;
  color: #00ff00;
  opacity: 0.8;
}

.oled-settings-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: #00ff00;
}

/* Device Buttons - Interactive */
.device-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.btn-device {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-device:hover {
  background: var(--border-color);
  border-color: var(--text-muted);
}

.btn-device:active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  transform: scale(0.95);
}

.btn-device:active .btn-label {
  color: #000;
}

.btn-label {
  font-size: 0.625rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: var(--font-main);
  font-weight: 600;
  pointer-events: none;
}

/* Device hint for keyboard controls */
.device-hint {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 0.75rem;
  padding-top: 0.5rem;
}

.device-hint span {
  font-size: 0.625rem;
  color: var(--text-muted);
  opacity: 0.6;
}

/* Focus state for keyboard navigation */
.device-mockup:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-primary),
    0 0 0 4px rgba(255, 107, 53, 0.2),
    0 20px 60px rgba(0, 0, 0, 0.5);
}

/* ---------- Section Styling ---------- */
.section-header {
  margin-bottom: 4rem;
}

.section-title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 400px;
}

/* ---------- Features Section ---------- */
.features {
  padding: var(--section-padding) 2rem;
  max-width: var(--container-max);
  margin: 0 auto;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2rem;
  transition: all var(--transition-medium);
}

.feature-card:hover {
  border-color: var(--border-light);
  transform: translateY(-4px);
}

.feature-large {
  grid-column: span 2;
  grid-row: span 2;
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 1.25rem;
}

.feature-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.feature-description {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.feature-large .feature-title {
  font-size: 1.75rem;
}

.feature-large .feature-description {
  font-size: 1.0625rem;
  max-width: 400px;
}

.feature-stats {
  margin-top: auto;
  padding-top: 2rem;
  display: flex;
  gap: 3rem;
}

.stat {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--accent-primary);
}

.stat-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ---------- Architecture Section ---------- */
.architecture {
  background: var(--bg-secondary);
  padding: var(--section-padding) 2rem;
}

.architecture-content {
  max-width: var(--container-max);
  margin: 0 auto;
}

.architecture-diagram {
  margin: 3rem 0;
}

.state-machine {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.state {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem 2rem;
  text-align: center;
  min-width: 160px;
}

.state-idle {
  border-color: var(--text-muted);
}

.state-menu {
  border-color: var(--accent-primary);
  box-shadow: 0 0 30px var(--accent-glow);
}

.state-name {
  display: block;
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
}

.state-desc {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.state-arrow {
  color: var(--text-muted);
  font-size: 1.5rem;
}

.state-branches {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.state-app {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.75rem 1.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.code-block {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  max-width: 500px;
  margin-top: 3rem;
}

.code-header {
  background: var(--bg-tertiary);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.code-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-light);
}

.code-dot:nth-child(1) {
  background: #ff5f56;
}
.code-dot:nth-child(2) {
  background: #ffbd2e;
}
.code-dot:nth-child(3) {
  background: #27c93f;
}

.code-filename {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.code-block pre {
  padding: 1.5rem;
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 0.875rem;
  line-height: 1.8;
  overflow-x: auto;
}

.code-block code {
  color: var(--text-secondary);
}

.code-block .comment {
  color: var(--text-muted);
}

/* ---------- Hardware Section ---------- */
.hardware {
  padding: var(--section-padding) 2rem;
  max-width: var(--container-max);
  margin: 0 auto;
}

.hardware-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-top: 3rem;
}

.hardware-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.hardware-item {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  transition: all var(--transition-fast);
}

.hardware-item:hover {
  border-color: var(--border-light);
}

.hardware-icon {
  font-size: 1.25rem;
  width: 40px;
  text-align: center;
  color: var(--accent-primary);
}

.hardware-info {
  display: flex;
  flex-direction: column;
}

.hardware-name {
  font-weight: 600;
  font-size: 0.9375rem;
}

.hardware-role {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.wiring-diagram {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
}

.wiring-header {
  background: var(--bg-tertiary);
  padding: 1rem 1.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border-color);
}

.wiring-content {
  padding: 1rem;
}

.pin-row {
  display: flex;
  align-items: center;
  padding: 0.5rem;
  gap: 1rem;
}

.pin {
  font-family: "SF Mono", monospace;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent-primary);
  width: 30px;
}

.wire {
  flex: 1;
  height: 2px;
  background: linear-gradient(
    90deg,
    var(--border-light) 0%,
    var(--text-muted) 100%
  );
  position: relative;
}

.wire::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  background: var(--text-muted);
  border-radius: 50%;
}

.wire-i2c {
  background: linear-gradient(
    90deg,
    var(--border-light) 0%,
    var(--accent-primary) 100%
  );
}

.wire-i2c::after {
  background: var(--accent-primary);
}

.connection {
  font-family: "SF Mono", monospace;
  font-size: 0.75rem;
  color: var(--text-secondary);
  min-width: 100px;
}

/* ---------- Why Section ---------- */
.why {
  background: var(--bg-secondary);
  padding: var(--section-padding) 2rem;
}

.why-content {
  max-width: var(--container-max);
  margin: 0 auto;
  text-align: center;
}

.why-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 3rem;
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  max-width: 900px;
  margin: 0 auto;
}

.why-card {
  padding: 2rem;
}

.why-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 1rem;
}

.why-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.why-card p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

/* ---------- CTA Section ---------- */
.cta {
  padding: var(--section-padding) 2rem;
  text-align: center;
}

.cta-content {
  max-width: 600px;
  margin: 0 auto;
}

.cta-title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.cta-description {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* ---------- Footer ---------- */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 3rem 2rem;
}

.footer-content {
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-logo {
  font-size: 1.25rem;
  font-weight: 700;
}

.footer-tagline {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

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

.footer-links a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--text-primary);
}

.footer-copy {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
  }

  .hero-description {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-cta {
    justify-content: center;
  }

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

  .feature-large {
    grid-column: span 2;
    grid-row: span 1;
  }

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

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .hero-title {
    font-size: clamp(2.5rem, 12vw, 4rem);
  }

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

  .feature-large {
    grid-column: span 1;
  }

  .why-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .state-branches {
    flex-wrap: wrap;
    justify-content: center;
  }

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

/* ---------- Animations ---------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-content > * {
  animation: fadeInUp 0.6s ease forwards;
  opacity: 0;
}

.hero-eyebrow {
  animation-delay: 0.1s;
}
.hero-title {
  animation-delay: 0.2s;
}
.hero-description {
  animation-delay: 0.3s;
}
.hero-cta {
  animation-delay: 0.4s;
}

.hero-visual {
  animation: fadeInUp 0.8s ease 0.3s forwards;
  opacity: 0;
}

/* Subtle hover glow on feature cards */
.feature-card:hover {
  box-shadow: 0 0 40px var(--accent-glow);
}
