/* Reset and ensure the viewport occupies full device screen */
html, body {
  margin: 0;
  padding: 0;
  height: 100vh;
  width: 100vw;
  background-color: #0b0f12; /* Dark ambient background outside the app frame */
  overflow: hidden; /* Prevents unwanted full-page scrollbars */
}

/* Parent container: Centers the app frame on any screen size */
.app-viewport {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100vh;
  padding: 1rem;
  box-sizing: border-box;
}

/* The locked 1080x1350 canvas frame */
.app-canvas {
  /* 1. Dimensions and Aspect Ratio */
  width: 100%;
  max-width: 1080px;
  max-height: 1350px;
  aspect-ratio: 4 / 5; /* Enforces 1080:1350 proportion dynamically */

  /* 2. Visual & Layout Controls */
  background-color: #12181b; /* Internal app dark background */
  border-radius: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden; /* Clips any overflowing elements inside the canvas */
}

/* Flex layout inside canvas so content fills height naturally */
.app-header {
  padding: 2rem;
  flex-shrink: 0;
}

.app-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

/* 1. Root Variables: Desaturated, low-stimulation palette */
:root {
  /* Dark Slate / Charcoal Backgrounds (Avoid pure #000000) */
  --bg-primary: #12181b;       /* Deep slate/charcoal base */
  --bg-surface: #1e262b;       /* Elevated surface for cards/containers */
  --bg-card: #283238;          /* Lightly elevated interactive surface */

  /* Muted Accents & Calming Hues */
  --accent-sage: #8ab49c;      /* Calming sage green for primary actions */
  --accent-teal: #6db3b1;      /* Soft teal for secondary highlights */
  --accent-lavender: #a3a7db;  /* Soft lavender for subtle indicators */

  /* Readable Text Colors (Avoid pure #FFFFFF) */
  --text-primary: #e0e6ed;     /* Soft off-white for primary headlines */
  --text-secondary: #94a3b8;   /* Muted gray for body copy & subtext */
  --text-muted: #64748b;       /* Subtle text for timers and footers */

  /* Spacing and Borders */
  --radius-smooth: 16px;       /* Soft, organic rounded corners */
  --transition-speed: 0.4s ease-in-out;
}

/* 2. Global Layout & Reset */
/* Clean, modern system font stack with zero download overhead */
body {
  font-family: 
    -apple-system,              /* Safari / iOS (San Francisco) */
    BlinkMacSystemFont,         /* Chrome / macOS */
    "SF Pro Text",              /* Apple San Francisco */
    "Segoe UI",                 /* Windows */
    Roboto,                     /* Android */
    Helvetica, Arial,           /* Fallback sans-serif */
    sans-serif;
  
  /* Rendering optimizations for high-density mobile screens */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;

  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.8;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  font-size: 1.1rem
}

/* 3. Single-View Container (Reduces Cognitive Load) */
.wellbeing-container {
  background-color: var(--bg-surface);
  border-radius: var(--radius-smooth);
  padding: 2rem;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  text-align: center;
  transition: background-color var(--transition-speed);
}

/* 4. Typography & Readable Content */
h1 {
  color: var(--text-primary);
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

p.instruction-text {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

/* 5. Calming Micro-Interaction Control */
.reset-button {
  background-color: var(--accent-sage);
  color: var(--bg-primary);
  border: none;
  border-radius: 24px;
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, background-color var(--transition-speed);
}

.reset-button:hover,
.reset-button:focus-visible {
  background-color: var(--accent-teal);
  outline: none;
  transform: scale(1.02);
}

/* 6. Soft Breathing Circle Animation */
.breathing-guide {
  width: 120px;
  height: 120px;
  margin: 2rem auto;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-sage) 0%, var(--accent-teal) 100%);
  opacity: 0.8;
  animation: breathe 10s infinite ease-in-out;
}

@keyframes breathe {
  0%, 100% {
    transform: scale(0.85);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.15);
    opacity: 0.95;
  }
}
