@layer reset, base, theme, components, utilities;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { -moz-text-size-adjust: none; -webkit-text-size-adjust: none; text-size-adjust: none; }
  body, h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin-block-end: 0; }
  ul[role='list'], ol[role='list'] { list-style: none; }
  body { min-height: 100vh; line-height: 1.6; }
  h1, h2, h3, h4, button, input, label { line-height: 1.1; }
  h1, h2, h3, h4 { text-wrap: balance; }
  a:not([class]) { text-decoration-skip-ink: auto; color: currentColor; }
  img, picture { max-width: 100%; display: block; }
  input, button, textarea, select { font-family: inherit; font-size: inherit; }
  textarea:not([rows]) { min-height: 10em; }
  :target { scroll-margin-block: 5ex; }
}

@layer theme {
  :root {
    /* Minimalist Enterprise Light Mode Tokens */
    --color-bg-base: #f8fafc; /* Slate 50 */
    --color-bg-surface: #ffffff; /* Pure White */
    
    /* Vibrant Solid Accents */
    --color-accent-primary: #00B388; /* Tachyon Green */
    --color-accent-primary-hover: #009973;
    --color-accent-secondary: #2563eb; /* DoctoBuzz Blue */
    --color-accent-secondary-hover: #1d4ed8;

    /* High Contrast Text */
    --color-text-primary: #0f172a; /* Slate 900 */
    --color-text-secondary: #475569; /* Slate 600 */
    --color-text-muted: #94a3b8; /* Slate 400 */
    
    /* Precise Borders & Minimal Shadows */
    --color-border: #e2e8f0; /* Slate 200 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* Strict border radius for Bento boxes */
    --radius-bento: 1.5rem;
  }
}

@layer base {
  body {
    font-family: 'Inter', -apple-system, sans-serif;
    background-color: var(--color-bg-base);
    color: var(--color-text-primary);
    overflow-x: hidden;
    scroll-behavior: smooth;
  }

  /* Very subtle dot grid pattern for the background */
  .pattern-bg {
    background-image: radial-gradient(var(--color-border) 1px, transparent 1px);
    background-size: 24px 24px;
    background-position: -12px -12px;
  }
}

@layer components {
  /* Typography */
  .section-title { 
    color: var(--color-text-primary); 
    font-weight: 800; 
    letter-spacing: -0.03em;
  }
  .section-subtitle { 
    color: var(--color-text-secondary); 
    font-size: 1.125rem;
    line-height: 1.6;
  }

  /* Bento Box / Enterprise Cards */
  .bento-card {
    background: var(--color-bg-surface);
    border: 2px solid #cbd5e1; /* Slate 300 */
    border-radius: var(--radius-bento);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
  }
  
  .bento-card:hover {
    transform: translateY(-8px); 
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border-color: #94a3b8; /* Slate 400 */
  }

  .clean-header {
    background: rgba(248, 250, 252, 0.9); 
    backdrop-filter: blur(8px); 
    -webkit-backdrop-filter: blur(8px); 
    border-bottom: 1px solid var(--color-border);
  }

  /* Solid Buttons */
  .btn-primary { 
    background: var(--color-text-primary); 
    color: white !important;
    font-weight: 600;
    border-radius: 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .btn-primary:hover { 
    background: var(--color-text-secondary);
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
  }

  .btn-accent { 
    background: var(--color-accent-primary); 
    color: white !important;
    font-weight: 600;
    border-radius: 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .btn-accent:hover { 
    background: var(--color-accent-primary-hover);
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 179, 136, 0.3);
  }

  .btn-secondary {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text-primary);
    font-weight: 600;
    border-radius: 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .btn-secondary:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
  }

  /* DoctoBuzz Accent Badge */
  .doctobuzz-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--color-accent-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    transition: background 0.2s ease;
    text-decoration: none;
  }
  .doctobuzz-badge:hover {
    background: rgba(37, 99, 235, 0.15);
  }

  /* Navigation */
  .nav-link { 
    color: var(--color-text-secondary); 
    transition: color 0.2s ease, border-color 0.2s ease; 
    font-weight: 500;
    border-bottom: 2px solid transparent;
    padding-bottom: 4px;
  }
  .nav-link:hover { 
    color: var(--color-text-primary); 
  }
  .nav-link.active {
    color: var(--color-text-primary);
    border-bottom-color: var(--color-accent-primary);
  }

  /* Forms */
  input[type="text"], input[type="email"], textarea {
    background: var(--color-bg-surface) !important;
    border: 1px solid var(--color-border) !important;
    color: var(--color-text-primary) !important;
    border-radius: 0.75rem !important;
  }
  input[type="text"]:focus, input[type="email"]:focus, textarea:focus {
    border-color: var(--color-accent-primary) !important;
    outline: none;
    box-shadow: 0 0 0 1px var(--color-accent-primary) !important;
  }
}

@layer utilities {
  .fade-in-up { opacity: 0; transform: translateY(15px); }
  .fade-in-up.revealed { 
    opacity: 1; 
    transform: translateY(0);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
  }

  .text-balance {
    text-wrap: balance;
  }

  /* Clean subtle gradient text if absolutely needed, though we prefer solid */
  .gradient-text-subtle {
    background: linear-gradient(135deg, var(--color-text-primary), var(--color-text-secondary));
    -webkit-background-clip: text; 
    background-clip: text; 
    -webkit-text-fill-color: transparent;
  }

  .content-auto {
    content-visibility: auto;
    contain-intrinsic-size: 1000px; /* Provides a placeholder height for the scrollbar */
  }
}
