/* ============================================
   MACNOLOGY INC - Design System & Styles
   ============================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&family=Inter:wght@300;400;500;600&display=swap');

/* CSS Custom Properties */
:root {
  /* Colors */
  --color-primary: #2c3e50;
  --color-primary-light: #34495e;
  --color-accent: #8b7355;
  --color-accent-light: #a0896b;
  --color-bg: #f8f6f3;
  --color-bg-alt: #eee9e2;
  --color-bg-dark: #3a3a3a;
  --color-text: #333333;
  --color-text-light: #666666;
  --color-text-muted: #999999;
  --color-white: #ffffff;
  --color-border: #d4cfc8;
  --color-overlay: rgba(0, 0, 0, 0.45);

  /* Typography */
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 3rem;
  --space-xl: 5rem;
  --space-xxl: 8rem;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition-fast);
}

ul {
  list-style: none;
}

/* ============================================
   HEADER / NAVIGATION
   ============================================ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all var(--transition-base);
  background: transparent;
}

.header.scrolled {
  background: rgba(44, 62, 80, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0.75rem 2rem;
  box-shadow: var(--shadow-md);
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-white);
  letter-spacing: 3px;
  text-transform: uppercase;
}

.logo span {
  color: var(--color-accent-light);
}

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

.nav-links a {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 0.5rem 0;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent-light);
  transition: width var(--transition-base);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

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

/* Mobile Nav Toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  z-index: 1001;
}

.nav-toggle span {
  width: 28px;
  height: 2px;
  background: var(--color-white);
  transition: all var(--transition-base);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(44, 62, 80, 0.7), rgba(139, 115, 85, 0.5)),
    url('../images/hero-bg.png') center/cover no-repeat;
  z-index: -1;
  transform: scale(1.05);
  animation: heroZoom 20s ease infinite alternate;
}

@keyframes heroZoom {
  from {
    transform: scale(1.05);
  }

  to {
    transform: scale(1.15);
  }
}

.hero-content {
  max-width: 800px;
  padding: 0 2rem;
  animation: fadeInUp 1s ease 0.3s both;
}

.hero-content h1 {
  font-family: var(--font-heading);
  font-size: 4rem;
  font-weight: 700;
  color: var(--color-white);
  letter-spacing: 4px;
  text-transform: uppercase;
  line-height: 1.2;
  margin-bottom: 1rem;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.hero-divider {
  width: 80px;
  height: 2px;
  background: var(--color-accent-light);
  margin: 1.5rem auto;
}

.hero-content p {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 300;
  letter-spacing: 2px;
  margin-bottom: 2.5rem;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-block;
  padding: 1rem 2.5rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--color-white);
  color: var(--color-primary);
}

.btn-primary:hover {
  background: var(--color-accent-light);
  color: var(--color-white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--color-bg-alt);
  color: var(--color-primary);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-accent);
  color: var(--color-white);
  border-color: var(--color-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: transparent;
  color: var(--color-accent);
  border: 2px solid var(--color-accent);
}

.btn-outline:hover {
  background: var(--color-accent);
  color: var(--color-white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ============================================
   SECTIONS (General)
   ============================================ */
.section {
  padding: var(--space-xxl) var(--space-md);
}

.section-light {
  background: var(--color-bg);
}

.section-alt {
  background: var(--color-bg-alt);
}

.section-dark {
  background: var(--color-primary);
  color: var(--color-white);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.section-header h2 {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

.section-header .accent-line {
  width: 60px;
  height: 2px;
  background: var(--color-accent);
  margin: 1rem auto;
}

.section-header p {
  color: var(--color-text-light);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

.section-dark .section-header h2 {
  color: var(--color-white);
}

.section-dark .section-header p {
  color: rgba(255, 255, 255, 0.7);
}

/* ============================================
   FEATURES / SERVICE CARDS
   ============================================ */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
}

.feature-card {
  text-align: center;
  padding: 3rem 2rem;
  background: var(--color-white);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-light));
  transform: scaleX(0);
  transition: transform var(--transition-base);
}

.feature-card:hover::before {
  transform: scaleX(1);
}

.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.feature-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-alt);
  border-radius: 50%;
  font-size: 1.75rem;
  color: var(--color-accent);
  transition: all var(--transition-base);
}

.feature-card:hover .feature-icon {
  background: var(--color-accent);
  color: var(--color-white);
  transform: scale(1.1);
}

.feature-card h3 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 1rem;
}

.feature-card p {
  color: var(--color-text-light);
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

/* ============================================
   ABOUT SECTION
   ============================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.about-image {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.about-image img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.about-image::after {
  content: '';
  position: absolute;
  top: 20px;
  left: 20px;
  right: -20px;
  bottom: -20px;
  border: 2px solid var(--color-accent);
  border-radius: var(--radius-lg);
  z-index: -1;
}

.about-text h2 {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

.about-text .accent-line {
  width: 60px;
  height: 2px;
  background: var(--color-accent);
  margin: 1rem 0;
}

.about-text p {
  color: var(--color-text-light);
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 1rem;
}

/* ============================================
   CONTACT SECTION
   ============================================ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
}

.contact-info h3 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--color-primary);
  margin-bottom: 1.5rem;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.contact-item-icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-alt);
  border-radius: 50%;
  font-size: 1.25rem;
  color: var(--color-accent);
}

.contact-item-text h4 {
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 0.25rem;
}

.contact-item-text p {
  color: var(--color-text-light);
  font-size: 0.95rem;
}

.contact-form {
  background: var(--color-white);
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--color-text-light);
  margin-bottom: 0.5rem;
}

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

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(139, 115, 85, 0.15);
}

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

.form-submit {
  width: 100%;
}

/* ============================================
   TESTIMONIALS SECTION
   ============================================ */
.testimonials-placeholder {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.testimonials-placeholder .icon {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  color: var(--color-accent);
}

.testimonials-placeholder h3 {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  color: var(--color-primary);
  margin-bottom: 1rem;
}

.testimonials-placeholder p {
  color: var(--color-text-light);
  font-size: 1rem;
}

/* ============================================
   PAGE HEADERS (Subpages)
   ============================================ */
.page-header {
  padding: 10rem 2rem 5rem;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(139, 115, 85, 0.15), transparent);
  border-radius: 50%;
}

.page-header h1 {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 700;
  color: var(--color-white);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.page-header p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.1rem;
  max-width: 500px;
  margin: 0 auto;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: var(--color-bg-dark);
  color: rgba(255, 255, 255, 0.6);
  padding: 3rem 2rem;
}

.footer-content {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-logo {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--color-white);
  letter-spacing: 2px;
}

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

.footer-links a {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--color-accent-light);
}

.footer-copyright {
  font-size: 0.85rem;
  text-align: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ============================================
   BOOKING MODAL
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

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

.modal {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(30px) scale(0.95);
  transition: transform var(--transition-base);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

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

.modal-header {
  padding: 2rem 2rem 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.modal-header h2 {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  color: var(--color-primary);
}

.modal-header p {
  color: var(--color-text-light);
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  transition: color var(--transition-fast);
}

.modal-close:hover {
  color: var(--color-text);
}

.modal-body {
  padding: 1.5rem 2rem 2rem;
}

.modal-body .form-group {
  margin-bottom: 1rem;
}

.modal-success {
  text-align: center;
  padding: 3rem 2rem;
}

.modal-success .icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

.modal-success h3 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--color-primary);
  margin-bottom: 0.75rem;
}

.modal-success p {
  color: var(--color-text-light);
  font-size: 0.95rem;
}

/* ============================================
   STATS / COUNTER SECTION
   ============================================ */
.stats-section {
  padding: var(--space-lg) var(--space-md);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  text-align: center;
}

.stat-item {
  padding: 1.5rem 1rem;
}

.stat-number {
  font-family: var(--font-heading);
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--color-accent-light);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-number::after {
  content: '+';
  font-size: 2rem;
}

.stat-label {
  font-size: 0.9rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

/* ============================================
   FAQ SECTION
   ============================================ */
.faq-list {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  background: var(--color-white);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base);
}

.faq-item:hover {
  box-shadow: var(--shadow-md);
}

.faq-question {
  width: 100%;
  padding: 1.25rem 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-primary);
  text-align: left;
  transition: color var(--transition-fast);
}

.faq-question:hover {
  color: var(--color-accent);
}

.faq-icon {
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--color-accent);
  transition: transform var(--transition-base);
  flex-shrink: 0;
  margin-left: 1rem;
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
}

.faq-item.active .faq-answer {
  max-height: 300px;
}

.faq-answer p {
  padding: 0 1.5rem 1.25rem;
  color: var(--color-text-light);
  font-size: 0.95rem;
  line-height: 1.8;
}

/* ============================================
   FLOATING CONTACT BUTTON
   ============================================ */
.floating-contact {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1500;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 0.75rem;
}

.floating-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: all var(--transition-base);
  text-decoration: none;
}

.floating-main {
  background: var(--color-accent);
  color: var(--color-white);
  z-index: 2;
}

.floating-main:hover {
  transform: scale(1.1);
  background: var(--color-accent-light);
}

.floating-main.active {
  transform: rotate(45deg);
}

.floating-phone {
  background: #25d366;
  transform: scale(0);
  opacity: 0;
  transition: all var(--transition-base);
}

.floating-email {
  background: var(--color-primary);
  transform: scale(0);
  opacity: 0;
  transition: all var(--transition-base) 0.05s;
}

.floating-contact.open .floating-phone,
.floating-contact.open .floating-email {
  transform: scale(1);
  opacity: 1;
}

.floating-phone:hover,
.floating-email:hover {
  transform: scale(1.15) !important;
}

/* ============================================
   SOCIAL MEDIA LINKS
   ============================================ */
.footer-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-tagline {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
}

.footer-social {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

.social-link {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  transition: all var(--transition-base);
}

.social-link:hover {
  background: var(--color-accent);
  color: var(--color-white);
  transform: translateY(-3px);
}

/* ============================================
   DARK MODE TOGGLE
   ============================================ */
.dark-mode-toggle {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all var(--transition-base);
  line-height: 1;
  margin-right: 0.5rem;
}

.dark-mode-toggle:hover {
  transform: scale(1.2);
}

/* Dark Mode Theme */
body.dark-mode {
  --color-bg: #1a1a2e;
  --color-bg-alt: #16213e;
  --color-bg-dark: #0f0f1a;
  --color-text: #e0e0e0;
  --color-text-light: #b0b0b0;
  --color-text-muted: #777777;
  --color-white: #1e1e32;
  --color-border: #2a2a45;
  --color-primary: #e0e0e0;
  --color-primary-light: #2a2a45;
}

body.dark-mode .header.scrolled {
  background: rgba(15, 15, 26, 0.95);
}

body.dark-mode .feature-card,
body.dark-mode .faq-item,
body.dark-mode .contact-form {
  background: #1e1e32;
}

body.dark-mode .hero-bg {
  background:
    linear-gradient(135deg, rgba(15, 15, 26, 0.8), rgba(139, 115, 85, 0.5)),
    url('../images/hero-bg.png') center/cover no-repeat;
}

body.dark-mode .section-header h2,
body.dark-mode .feature-card h3,
body.dark-mode .faq-question {
  color: #e0e0e0;
}

body.dark-mode .page-header {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
}

body.dark-mode .modal {
  background: #1e1e32;
}

body.dark-mode .modal-header h2 {
  color: #e0e0e0;
}

body.dark-mode .form-group input,
body.dark-mode .form-group textarea {
  background: #16213e;
  border-color: #2a2a45;
  color: #e0e0e0;
}

/* ============================================
   TYPING EFFECT
   ============================================ */
.typing-text {
  min-height: 1.5em;
}

.typing-text::after {
  content: '|';
  animation: blink 0.8s infinite;
  color: var(--color-accent-light);
  font-weight: 100;
}

@keyframes blink {

  0%,
  50% {
    opacity: 1;
  }

  51%,
  100% {
    opacity: 0;
  }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   iOS / MOBILE OPTIMIZATIONS
   ============================================ */

/* Prevent iOS tap highlight flash */
* {
  -webkit-tap-highlight-color: transparent;
}

/* Smooth momentum scrolling on iOS */
html {
  -webkit-overflow-scrolling: touch;
}

/* Prevent iOS auto-zoom on input focus (must be >= 16px) */
@media screen and (max-width: 768px) {

  input,
  textarea,
  select {
    font-size: 16px !important;
  }
}

/* ============================================
   RESPONSIVE - TABLET
   ============================================ */
@media (max-width: 992px) {
  .features-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero-content h1 {
    font-size: 2.75rem;
  }

  .about-image::after {
    display: none;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .stat-number {
    font-size: 2.5rem;
  }
}

/* ============================================
   RESPONSIVE - MOBILE (iPhone etc.)
   ============================================ */
@media (max-width: 768px) {

  /* Fix iOS 100vh bug — use dvh with fallback */
  .hero {
    min-height: 100vh;
    min-height: 100dvh;
  }

  /* Header */
  .header {
    padding: 0.75rem 1rem;
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  .logo {
    font-size: 1.2rem;
    letter-spacing: 2px;
  }

  /* Mobile Navigation — full-screen overlay */
  .nav-toggle {
    display: flex;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
  }

  .nav-toggle span {
    width: 24px;
  }

  .nav-links {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background: rgba(44, 62, 80, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1.25rem;
    padding: 2rem;
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
  }

  .nav-links.open {
    opacity: 1;
    pointer-events: all;
  }

  .nav-links a {
    font-size: 1.1rem;
    padding: 0.75rem 1.5rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  /* Hero */
  .hero-content {
    padding: 0 1.5rem;
  }

  .hero-content h1 {
    font-size: 1.75rem;
    letter-spacing: 2px;
    line-height: 1.3;
  }

  .hero-content p {
    font-size: 1rem;
    letter-spacing: 1px;
    margin-bottom: 2rem;
  }

  /* Buttons — 44px min touch target */
  .btn {
    padding: 0.875rem 2rem;
    min-height: 44px;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Sections */
  .section {
    padding: var(--space-lg) var(--space-sm);
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  .section-header h2 {
    font-size: 1.75rem;
  }

  .section-header p {
    font-size: 0.95rem;
  }

  /* Feature cards — full width with more padding */
  .feature-card {
    padding: 2rem 1.5rem;
  }

  .feature-card p {
    font-size: 0.9rem;
  }

  /* Page headers */
  .page-header {
    padding: 7rem 1.5rem 3rem;
  }

  .page-header h1 {
    font-size: 1.75rem;
    letter-spacing: 2px;
  }

  .page-header p {
    font-size: 0.95rem;
  }

  /* Contact form */
  .contact-form {
    padding: 1.5rem;
  }

  .form-group input,
  .form-group textarea {
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
  }

  .form-submit {
    min-height: 48px;
  }

  /* Modal — full-screen on mobile */
  .modal {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    display: flex;
    flex-direction: column;
  }

  .modal-header {
    padding: 1.5rem 1.5rem 0;
    padding-top: max(1.5rem, env(safe-area-inset-top));
    flex-shrink: 0;
  }

  .modal-header h2 {
    font-size: 1.5rem;
  }

  .modal-close {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
  }

  .modal-body {
    padding: 1.5rem;
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Footer */
  .footer {
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
  }

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

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }

  .footer-links a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}

/* ============================================
   RESPONSIVE - SMALL PHONES (iPhone SE, etc.)
   ============================================ */
@media (max-width: 375px) {
  .hero-content h1 {
    font-size: 1.5rem;
  }

  .hero-content p {
    font-size: 0.9rem;
  }

  .section-header h2 {
    font-size: 1.5rem;
  }

  .feature-card {
    padding: 1.5rem 1.25rem;
  }

  .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.75rem;
  }

  .contact-item-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    font-size: 1rem;
  }
}

/* ============================================
   iOS LANDSCAPE
   ============================================ */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding: 5rem 2rem 3rem;
  }

  .hero-content h1 {
    font-size: 1.75rem;
  }

  .page-header {
    padding: 5rem 1.5rem 2rem;
  }
}