/* ==========================================================================
   Supul Dulanka — supuld.com
   Apple Design System Theme (Pure Minimalist Light Mode)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design Tokens & CSS Variables
   -------------------------------------------------------------------------- */
:root {
  /* Colors */
  --apple-bg: #F5F5F7;
  --apple-bg-secondary: #FFFFFF;
  --apple-card-bg: rgba(255, 255, 255, 0.75);
  --apple-card-solid: #FFFFFF;
  --apple-card-hover: rgba(255, 255, 255, 0.95);
  
  --apple-text-primary: #1D1D1F;
  --apple-text-secondary: #6E6E73;
  --apple-text-tertiary: #A1A1A6;

  --apple-blue: #0071E3;
  --apple-blue-hover: #0077ED;
  --apple-blue-light: rgba(0, 113, 227, 0.08);
  --apple-blue-glow: rgba(0, 113, 227, 0.25);

  --apple-green: #34C759;
  --apple-green-light: rgba(52, 199, 89, 0.12);

  --apple-border: rgba(0, 0, 0, 0.08);
  --apple-border-highlight: rgba(0, 0, 0, 0.14);
  --apple-divider: rgba(0, 0, 0, 0.05);

  /* Shadows */
  --apple-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --apple-shadow-md: 0 12px 32px rgba(0, 0, 0, 0.06);
  --apple-shadow-lg: 0 24px 48px rgba(0, 0, 0, 0.09);

  /* Glassmorphism & Blur */
  --apple-blur: blur(20px) saturate(180%);

  /* Border Radius */
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-xl: 36px;
  --radius-pill: 9999px;

  /* Typography */
  --font-apple: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --ease-apple: cubic-bezier(0.25, 1, 0.5, 1);
  --transition-fast: 0.2s var(--ease-apple);
  --transition-normal: 0.35s var(--ease-apple);

  --container-width: 900px;
}

/* --------------------------------------------------------------------------
   2. Global Reset & Base Setup
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

html {
  font-family: var(--font-apple);
  background-color: var(--apple-bg);
  color: var(--apple-text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 16px;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Background Canvas Layer */
#bgCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 1.75rem;
}

::selection {
  background: var(--apple-blue);
  color: #FFFFFF;
}

/* --------------------------------------------------------------------------
   3. Ultra-Minimalist Hero Section
   -------------------------------------------------------------------------- */
.minimal-hero {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 4rem;
  padding-bottom: 4rem;
  text-align: center;
  position: relative;
  z-index: 1;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.38rem 1rem;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: var(--apple-blur);
  -webkit-backdrop-filter: var(--apple-blur);
  border: 1px solid var(--apple-border);
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--apple-text-primary);
  margin-bottom: 2.5rem;
  box-shadow: var(--apple-shadow-sm);
  animation: fadeInDown 0.8s var(--ease-apple);
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: var(--apple-green);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--apple-green-light);
  animation: pulseDot 2s infinite;
}

.minimal-title {
  font-size: clamp(2.5rem, 5.8vw, 4.5rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.035em;
  color: var(--apple-text-primary);
  margin-bottom: 1.5rem;
  max-width: 840px;
  margin-left: auto;
  margin-right: auto;
  animation: fadeInUp 0.9s var(--ease-apple);
}

.minimal-title .highlight {
  background: linear-gradient(135deg, #1D1D1F 0%, #0071E3 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.minimal-subtitle {
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  color: var(--apple-text-secondary);
  font-weight: 400;
  max-width: 730px;
  margin: 0 auto 3rem auto;
  line-height: 1.6;
  animation: fadeInUp 1s var(--ease-apple);
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  animation: fadeInUp 1.1s var(--ease-apple);
}

/* Apple Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-family: var(--font-apple);
  font-weight: 600;
  border-radius: var(--radius-pill);
  transition: all var(--transition-normal);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--apple-blue);
  color: #FFFFFF;
  box-shadow: 0 4px 16px var(--apple-blue-glow);
}

.btn-primary:hover {
  background: var(--apple-blue-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--apple-blue-glow);
}

/* --------------------------------------------------------------------------
   4. Apple Sheet Modal Drawer (Contact Form)
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-sheet {
  background: var(--apple-card-solid);
  width: 100%;
  max-width: 580px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--apple-border);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2);
  padding: 2.5rem;
  position: relative;
  transform: translateY(30px) scale(0.96);
  transition: transform var(--transition-normal);
}

.modal-overlay.active .modal-sheet {
  transform: translateY(0) scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--apple-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.modal-close-btn:hover {
  background: rgba(0, 0, 0, 0.12);
  color: var(--apple-text-primary);
}

.modal-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

/* Form Controls */
.form-group {
  margin-bottom: 1.25rem;
  text-align: left;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--apple-text-primary);
  margin-bottom: 0.4rem;
}

.form-input, .form-textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--apple-bg);
  border: 1px solid var(--apple-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-apple);
  font-size: 0.95rem;
  color: var(--apple-text-primary);
  outline: none;
  transition: border-color var(--transition-fast);
}

.form-input:focus, .form-textarea:focus {
  border-color: var(--apple-blue);
  box-shadow: 0 0 0 3px var(--apple-blue-light);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

/* --------------------------------------------------------------------------
   5. Toast Notification & Footer
   -------------------------------------------------------------------------- */
.toast-container {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  z-index: 3000;
  background: var(--apple-text-primary);
  color: #FFFFFF;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--apple-shadow-lg);
  opacity: 0;
  transition: all var(--transition-normal);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
}

.toast-container.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.minimal-footer {
  padding: 2.25rem 0;
  border-top: 1px solid var(--apple-divider);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: var(--apple-blur);
  -webkit-backdrop-filter: var(--apple-blur);
  font-size: 0.88rem;
  color: var(--apple-text-secondary);
  position: relative;
  z-index: 1;
}

/* Keyframes */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseDot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(52, 199, 89, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(52, 199, 89, 0); }
}
