/* ==========================================================================
   Stellar Kydeon — Design System
   ========================================================================== */

:root {
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-surface-elevated: #ffffff;
  --color-text: #1e293b;
  --color-text-muted: #64748b;
  --color-heading: #0f172a;
  --color-border: #e2e8f0;
  --color-accent: #4a7c9b;
  --color-accent-hover: #3d6a85;
  --color-accent-soft: rgba(74, 124, 155, 0.1);
  --color-star: #00b8d9;

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 8px 32px rgba(15, 23, 42, 0.1);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --header-height: 72px;
  --container-max: 1120px;
  --section-spacing: clamp(5rem, 10vw, 7.5rem);

  color-scheme: light;
}

[data-theme="dark"] {
  --color-bg: #2a2a2a;
  --color-surface: #353535;
  --color-surface-elevated: #404040;
  --color-text: #d1d5db;
  --color-text-muted: #9ca3af;
  --color-heading: #f3f4f6;
  --color-border: #4a4a4a;
  --color-accent: #6ba3c4;
  --color-accent-hover: #8bb8d4;
  --color-accent-soft: rgba(107, 163, 196, 0.12);
  --color-star: #00c6ff;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.35);

  color-scheme: dark;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

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

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-accent-hover);
}

h1, h2, h3 {
  color: var(--color-heading);
  line-height: 1.25;
  margin: 0;
}

h1 {
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.025em;
}

h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
}

p {
  margin: 0;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ==========================================================================
   Utilities
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2rem);
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 200;
  padding: 0.75rem 1.25rem;
  background: var(--color-accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.skip-link:focus {
  top: 1rem;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: color-mix(in srgb, var(--color-bg) 85%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 1.5rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--color-heading);
  font-weight: 600;
  font-size: 1.0625rem;
  flex-shrink: 0;
}

.nav-brand:hover {
  color: var(--color-heading);
}

.nav-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

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

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

.nav-links a {
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

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

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.theme-toggle:hover {
  color: var(--color-heading);
  border-color: var(--color-accent);
}

.theme-toggle .icon-moon {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  display: block;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  width: 18px;
  height: 2px;
  margin-inline: auto;
  background: var(--color-text);
  border-radius: 1px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8125rem 1.75rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  color: #fff;
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-heading);
  border-color: var(--color-border);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

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

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  padding-block: clamp(4rem, 12vw, 8rem) clamp(5rem, 14vw, 9rem);
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 720px;
}

.hero-logo {
  width: min(320px, 75vw);
  margin-bottom: 2.5rem;
}

.hero-heading {
  margin-bottom: 1.25rem;
}

.hero-subheading {
  font-size: clamp(1.0625rem, 2vw, 1.25rem);
  color: var(--color-text-muted);
  max-width: 580px;
  margin-bottom: 2.5rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

/* ==========================================================================
   Sections
   ========================================================================== */

.section {
  padding-block: var(--section-spacing);
}

.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.section-lead {
  margin-top: 0.75rem;
  color: var(--color-text-muted);
  font-size: 1.0625rem;
}

/* ==========================================================================
   Services
   ========================================================================== */

.services {
  background: var(--color-surface);
  border-block: 1px solid var(--color-border);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  max-width: 880px;
  margin-inline: auto;
}

@media (min-width: 640px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.service-card {
  padding: 2rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s ease, transform 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.service-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.service-card h3 {
  margin-bottom: 0.75rem;
}

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

.service-price {
  margin-top: 1.25rem !important;
  font-weight: 600;
  color: var(--color-heading) !important;
  font-size: 0.9375rem !important;
}

/* ==========================================================================
   About
   ========================================================================== */

.about-card {
  max-width: 720px;
  margin-inline: auto;
  padding: clamp(2.5rem, 5vw, 3.5rem);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  text-align: center;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.about-card h2 {
  margin-bottom: 1.25rem;
}

.about-card p {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  line-height: 1.75;
}

/* ==========================================================================
   Contact
   ========================================================================== */

.contact-inner {
  max-width: 560px;
  margin-inline: auto;
  text-align: center;
  padding: clamp(2.5rem, 5vw, 3.5rem);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.contact-inner h2 {
  margin-bottom: 1rem;
}

.contact-inner > p {
  color: var(--color-text-muted);
  margin-bottom: 2rem;
  font-size: 1.0625rem;
}

.contact-email {
  margin-top: 1.25rem;
  font-size: 0.9375rem;
}

.contact-email a {
  font-weight: 500;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  padding-block: 2.5rem;
  border-top: 1px solid var(--color-border);
  transition: border-color 0.3s ease;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 2rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.footer-inner a {
  color: var(--color-text-muted);
}

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

.footer-copy,
.footer-location,
.footer-privacy,
.footer-email {
  margin: 0;
}

/* ==========================================================================
   Animations
   ========================================================================== */

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Privacy Page
   ========================================================================== */

.page-content {
  padding-block: calc(var(--header-height) + 3rem) 4rem;
}

.page-content .container {
  max-width: 680px;
}

.page-content h1 {
  margin-bottom: 0.5rem;
}

.page-content .page-updated {
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  margin-bottom: 2.5rem;
}

.page-content h2 {
  font-size: 1.25rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.page-content p,
.page-content li {
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.page-content ul {
  list-style: disc;
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.page-content li {
  margin-bottom: 0.5rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin-bottom: 2rem;
  font-size: 0.9375rem;
  font-weight: 500;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

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

  .nav-menu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 1.5rem;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
  }

  .nav-menu.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    width: 100%;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links a {
    display: block;
    padding: 0.875rem 0;
    font-size: 1rem;
    border-bottom: 1px solid var(--color-border);
  }

  .theme-toggle {
    align-self: flex-start;
    margin-top: 1rem;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
    max-width: 320px;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .footer-inner {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .btn:active {
    transform: none;
  }

  .service-card:hover {
    transform: none;
  }
}