/* ===========================
   View Transitions
   =========================== */
@view-transition {
  navigation: auto;
}

/* ===========================
   CSS Custom Properties
   =========================== */
:root {
  color-scheme: light dark;
}

[data-theme="dark"] {
  color-scheme: dark;
}

[data-theme="light"] {
  color-scheme: light;
}

:root {
  --bg-primary: light-dark(#ffffff, #0f1117);
  --bg-secondary: light-dark(#f5f7fa, #1a1d27);
  --bg-tertiary: light-dark(#e8ecf1, #242836);
  --text-primary: light-dark(#1a1d27, #f0f0f0);
  --text-secondary: light-dark(#5a5f72, #a0a4b8);
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --border: light-dark(#d1d5db, #2a2e3d);
  --shadow: light-dark(rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.3));
}

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

html {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 1rem;
  min-height: 100vh;
}

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

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

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

ul {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  text-wrap: balance;
}

p, li, blockquote {
  text-wrap: pretty;
}

h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); }
h3 { font-size: clamp(1.15rem, 3vw, 1.5rem); }
h4 { font-size: 1.1rem; }

/* ===========================
   Layout
   =========================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 5rem 0;
}

.section__header {
  text-align: center;
  margin-bottom: 3rem;
}

.section__header p {
  color: var(--text-secondary);
  margin-top: 0.75rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.section__label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

/* ===========================
   Buttons
   =========================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  font-family: inherit;
}

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

.btn--primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
}

.btn--outline {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border);
}

.btn--outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--shadow);
}

.btn--sm {
  padding: 0.5rem 1.25rem;
  font-size: 0.85rem;
}

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

/* ===========================
   Navigation
   =========================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
  view-transition-name: site-header;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.nav__logo:hover {
  color: var(--text-primary);
}

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
}

.nav__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  transition: all 0.3s;
}

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

.nav__links {
  display: flex;
  gap: 1.5rem;
}

.nav__links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav__links a:hover,
.nav__links a[aria-current="page"] {
  color: var(--text-primary);
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 0.25rem;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.theme-toggle:hover {
  color: var(--text-primary);
}

/* Default: respect OS preference for theme toggle icons */
.icon-sun { display: none; }
.icon-moon { display: block; }

@media (prefers-color-scheme: dark) {
  .icon-moon { display: none; }
  .icon-sun { display: block; }
}

/* User override via toggle */
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }

/* Mobile nav */
@media (max-width: 1024px) {
  .nav__toggle {
    display: flex;
  }

  .nav__menu {
    display: none;
    position: absolute;
    top: 4rem;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 1.5rem;
    gap: 1.5rem;
  }

  .nav__menu.is-open {
    display: flex;
  }

  .nav__links {
    flex-direction: column;
    width: 100%;
    gap: 0;
  }

  .nav__links a {
    display: block;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
  }

  .nav__actions {
    width: 100%;
    justify-content: space-between;
    padding-top: 0.5rem;
  }
}

/* ===========================
   Hero
   =========================== */
.hero {
  padding: 6rem 0 5rem;
  text-align: center;
  overflow: hidden;
}

.hero h1 {
  max-width: 800px;
  margin: 0 auto 1.25rem;
}

.hero p {
  color: var(--text-secondary);
  font-size: 1.15rem;
  max-width: 600px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}

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

/* ===========================
   Cards (generic)
   =========================== */
.card-grid {
  display: grid;
  gap: 1.5rem;
}

.card-grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.card-grid--2 {
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: auto;
}

@media (max-width: 768px) {
  .card-grid--2 {
    grid-template-columns: 1fr;
  }
}

.card-grid--2 > .card {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 4;
}

.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  transition: border-color 0.2s, transform 0.2s;
}

.card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--shadow);
}

.card__icon {
  width: 48px;
  height: 48px;
  background: rgba(59, 130, 246, 0.1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  color: var(--accent);
}

.card__icon svg {
  transition: transform 0.3s ease;
}

.card:hover .card__icon svg {
  animation: icon-pulse 0.4s ease;
}

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

.card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ===========================
   Check List (shared)
   =========================== */
.check-list {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.check-list li {
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding-left: 1.25rem;
  position: relative;
}

.check-list li::before {
  content: "\2713";
  color: var(--accent);
  position: absolute;
  left: 0;
  font-weight: 700;
}

/* ===========================
   Pricing
   =========================== */
.pricing-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2.5rem 2rem;
  text-align: center;
  position: relative;
  transition: border-color 0.2s;
}

.pricing-card:hover {
  border-color: var(--accent);
}

.pricing-card--featured {
  border: none;
}

.pricing-card--featured::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 13px;
  padding: 2px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover), color-mix(in srgb, var(--accent) 60%, #fff), var(--accent));
  background-size: 300% 300%;
  animation: cta-gradient-shift 8s ease infinite;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  z-index: -1;
}

.pricing-card__badge {
  position: absolute;
  top: -0.75rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 1rem;
  border-radius: 20px;
}

.pricing-card h3 {
  margin-bottom: 0.5rem;
}

.pricing-card__desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.pricing-card__price {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.pricing-card__period {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.pricing-card__features {
  text-align: left;
  margin-bottom: 2rem;
  gap: 0.75rem;
}

.pricing-card__features li {
  padding-left: 1.5rem;
}

/* ===========================
   Portfolio
   =========================== */
.portfolio-card {
  background: var(--bg-secondary);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}

.portfolio-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--shadow);
}

.portfolio-card__image {
  width: 100%;
  height: 220px;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.portfolio-card__body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.portfolio-card__body p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  flex: 1;
}

.portfolio-card__body h3 {
  margin-bottom: 0.5rem;
}

.portfolio-card__tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.portfolio-card__tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent);
}

/* ===========================
   Testimonials
   =========================== */
.testimonial-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
}

.testimonial-card__quote {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.7;
  font-style: italic;
  margin-bottom: 1.25rem;
}

.testimonial-card__author {
  font-weight: 600;
  font-size: 0.95rem;
}

.testimonial-card__role {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* ===========================
   FAQ
   =========================== */
.faq-list {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem 2rem;
}

.faq-item h3 {
  font-size: 1.05rem;
  margin-bottom: 0.75rem;
}

.faq-item p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ===========================
   CTA Banner
   =========================== */
.cta-banner {
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary), rgba(59, 130, 246, 0.08), var(--bg-secondary));
  background-size: 300% 300%;
  animation: cta-gradient-shift 10s ease infinite;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 5rem 0;
  text-align: center;
}

.cta-banner h2 {
  margin-bottom: 1rem;
}

.cta-banner p {
  color: var(--text-secondary);
  max-width: 550px;
  margin: 0 auto 2rem;
}

.cta-banner__actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===========================
   Contact Form
   =========================== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

@media (max-width: 768px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

.form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form__honeypot {
  display: none;
}

.form__group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form__group label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form__group input,
.form__group textarea,
.form__group select {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

/* Select — cross-browser custom arrow fallback */
.form__group select {
  appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a0a4b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}

/* Customizable select — browsers that support it */
@supports (appearance: base-select) {
  .form__group select,
  .form__group select::picker(select) {
    appearance: base-select;
  }

  .form__group select {
    background-image: none;
    padding-right: 1rem;
  }

  .form__group select::picker-icon {
    color: var(--text-secondary);
    transition: rotate 0.2s;
  }

  .form__group select:open::picker-icon {
    rotate: 180deg;
  }

  .form__group select::picker(select) {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
  }

  .form__group select option {
    padding: 0.6rem 1rem;
    border-radius: 6px;
    transition: background 0.15s;
  }

  .form__group select option:hover {
    background: var(--bg-tertiary);
  }

  .form__group select option:checked {
    font-weight: 600;
  }

  .form__group select option:not(:checked) {
    color: var(--text-secondary);
  }
}

.form__group input:focus,
.form__group textarea:focus,
.form__group select:focus {
  outline: none;
  border-color: var(--accent);
}

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

.contact-sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  position: sticky;
  top: 6rem;
  align-self: start;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.contact-info__item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.contact-info__icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  background: rgba(59, 130, 246, 0.1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.contact-info__text h4 {
  margin-bottom: 0.25rem;
}

.contact-info__text p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.contact-note {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
}

.contact-note h4 {
  margin-bottom: 0.75rem;
}

.contact-note p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

.contact-note ol {
  list-style: none;
  counter-reset: steps;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.contact-note ol li {
  counter-increment: steps;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  padding-left: 2rem;
  position: relative;
}

.contact-note ol li::before {
  content: counter(steps);
  position: absolute;
  left: 0;
  width: 1.4rem;
  height: 1.4rem;
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent);
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  top: 0.1rem;
}

/* ===========================
   About Page
   =========================== */
.about-intro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

@media (max-width: 768px) {
  .about-intro {
    grid-template-columns: 1fr;
  }
}

.about-intro__text p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.about-intro__image {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.about-intro__blob {
  position: absolute;
  width: 320px;
  height: 320px;
  z-index: 0;
}

.about-intro__image img {
  position: relative;
  z-index: 1;
  width: 240px;
  height: 240px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--border);
}

@media (max-width: 768px) {
  .about-intro__image {
    justify-content: center;
  }
}

.values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

/* ===========================
   Page Headers
   =========================== */
.page-header {
  padding: 4rem 0 3rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

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

/* ===========================
   Footer
   =========================== */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 4rem 0 2rem;
  margin-top: 0;
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
}

@media (max-width: 768px) {
  .footer__grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .footer__grid {
    grid-template-columns: 1fr;
  }
}

.footer__brand p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 1rem;
  line-height: 1.6;
}

.footer__links h4,
.footer__contact h4 {
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.footer__links a {
  display: block;
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding: 0.3rem 0;
  transition: color 0.2s;
}

.footer__links a:hover {
  color: var(--text-primary);
}

.footer__contact li {
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding: 0.3rem 0;
}

.footer__bottom {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer__bottom p {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* ===========================
   Utilities
   =========================== */
.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }

/* ===========================
   Animations
   =========================== */
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes icon-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

@keyframes cta-gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Hero entrance — staggered fade-in-up */
.hero > .container > * {
  animation: fade-in-up 0.5s ease both;
}

.hero > .container > *:nth-child(1) { animation-delay: 0.05s; }
.hero > .container > *:nth-child(2) { animation-delay: 0.15s; }
.hero > .container > *:nth-child(3) { animation-delay: 0.25s; }
.hero > .container > *:nth-child(4) { animation-delay: 0.35s; }

/* Page header entrance */
.page-header > .container > * {
  animation: fade-in-up 0.5s ease both;
}

.page-header > .container > *:nth-child(1) { animation-delay: 0.05s; }
.page-header > .container > *:nth-child(2) { animation-delay: 0.12s; }
.page-header > .container > *:nth-child(3) { animation-delay: 0.19s; }

/* Scroll reveal — driven by IntersectionObserver in main.js */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  transition-delay: calc((sibling-index() - 1) * 0.08s);
}

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

/* Reduced motion — respect user preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}
