/**
 * Author: Xaitheng Yang
 * GitHub: https://github.com/Xaivteev
 */

:root {
  --color-primary: #3570a0;
  --color-primary-dark: #254a68;
  --color-primary-light: #3d7aad;
  --color-primary-hover: #2f6a9e;
  --color-accent-pale: #afdef2;
  --color-accent-light: #81cbeb;
  --color-text: #161616;
  --color-text-muted: #696969;
  --color-text-light: #737373;
  --color-bg: #ffffff;
  --color-bg-alt: #f7f7f7;
  --color-bg-page: #bae3f4;
  --color-border: #d1d1d1;
  --color-overlay: rgba(22, 22, 22, 0.45);
  --shadow-card: 0 4px 12px rgba(37, 74, 104, 0.1), 0 12px 40px rgba(37, 74, 104, 0.18);
  --border-card: 1px solid rgba(53, 112, 160, 0.24);
  --font-body: 'Karla', Arial, sans-serif;
  --font-heading: 'Old Standard TT', Georgia, serif;
  --container-max: 1200px;
  --header-height: 200px;
  --transition: 0.3s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

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

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

a:hover {
  color: var(--color-primary-dark);
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.2;
  margin: 0 0 1rem;
}

p {
  margin: 0 0 1rem;
}

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

/* Header */
.site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  height: var(--header-height);
  display: flex;
  align-items: center;
  background: transparent;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo {
  width: 400px;
  height: 200px;
  object-fit: contain;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 14px 32px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: center;
  border: 2px solid transparent;
  border-radius: 0;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

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

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

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

.btn-secondary:hover {
  background: var(--color-bg-alt);
  color: var(--color-text);
}

/* Hero */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  overflow: hidden;
}

.hero-slideshow {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
}

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-slide img.hero-slide-img-bottom {
  object-position: center bottom;
}

.hero-slide.active {
  opacity: 1;
  z-index: 1;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--color-overlay);
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 80px 24px;
  max-width: 900px;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 400;
  color: #fff;
  margin-bottom: 1.25rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.hero-tagline {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  margin-bottom: 2rem;
  color: rgba(255, 255, 255, 0.95);
}

/* Quote dialog */
.quote-dialog {
  border: none;
  border-radius: 4px;
  padding: 0;
  max-width: 640px;
  width: calc(100% - 48px);
  max-height: calc(100dvh - 48px);
  background: #fff;
  color: var(--color-text);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.quote-dialog::backdrop {
  background: rgba(22, 22, 22, 0.6);
}

.quote-dialog[open] {
  animation: dialogShow 0.3s ease;
}

.quote-dialog[open]::backdrop {
  animation: backdropShow 0.3s ease;
}

@keyframes dialogShow {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes backdropShow {
  from { opacity: 0; }
  to { opacity: 1; }
}

.quote-dialog-inner {
  padding: 28px 24px;
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
}

.quote-dialog-inner h2 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--color-primary-dark);
  margin-bottom: 1.25rem;
  text-align: center;
}

.quote-form .form-section {
  border: none;
  margin: 0 0 24px;
  padding: 0;
  min-inline-size: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.quote-form .form-section-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--color-primary-dark);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
  width: 100%;
}

.form-subsection-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 6px;
}

.form-checkbox-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-checkbox-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.form-checkbox-item input[type="checkbox"] {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--color-primary);
}

.form-checkbox-item label {
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.45;
  color: var(--color-text);
  cursor: pointer;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-row .form-field {
  min-width: 0;
}

.form-field input[type="date"],
.form-field input[type="number"] {
  width: 100%;
}

.hero-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 48px;
  height: 48px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), border-color var(--transition);
}

.hero-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: #fff;
}

.hero-btn-prev {
  left: 24px;
}

.hero-btn-next {
  right: 24px;
}

.hero-dots {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.hero-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  padding: 0;
  transition: background var(--transition), transform var(--transition);
}

.hero-dot:hover {
  background: rgba(255, 255, 255, 0.7);
}

.hero-dot.active {
  background: #fff;
  transform: scale(1.2);
}

/* Sections */
.section {
  padding: 80px 0;
}

.section-title {
  text-align: center;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  color: var(--color-text);
  margin-bottom: 3rem;
}

.about,
.services,
.contact {
  background: var(--color-bg-page);
}

.about-card {
  background: #fff;
  padding: 32px;
  border-radius: 4px;
  border: var(--border-card);
  box-shadow: var(--shadow-card);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: stretch;
}

.about-image-wrap {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 4px;
  background: var(--color-accent-pale);
}

.about-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-text {
  align-self: center;
}

.about-text p {
  color: var(--color-text-muted);
  font-size: 1rem;
}

.about-text p:last-child {
  margin-bottom: 0;
}

/* Services carousel */
.carousel {
  position: relative;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 56px;
  overflow: hidden;
}

.carousel-viewport {
  overflow: visible;
  perspective: 1400px;
  padding: 20px 0 40px;
}

.carousel-track {
  position: relative;
  height: 420px;
  transform-style: preserve-3d;
  transition: height 0.35s ease, transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card {
  position: absolute;
  top: 0;
  left: 50%;
  width: min(680px, 90vw);
  margin-left: calc(min(680px, 90vw) / -2);
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
  align-items: start;
  background: #fff;
  border-radius: 4px;
  border: var(--border-card);
  box-shadow: var(--shadow-card);
  padding: 24px;
  min-height: 360px;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.6s ease, z-index 0s;
  backface-visibility: hidden;
  opacity: 0.4;
  pointer-events: none;
}

.service-card.active {
  opacity: 1;
  pointer-events: auto;
  z-index: 10;
}

.service-card-image {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 4px;
  background: var(--color-accent-pale);
}

.service-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.service-card-body h3 {
  font-size: 1.25rem;
  color: var(--color-primary-dark);
  margin-bottom: 0.75rem;
}

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

.service-card-body p:first-of-type {
  font-weight: 700;
  color: var(--color-text);
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: var(--color-primary);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
  z-index: 2;
}

.carousel-btn:hover {
  background: var(--color-primary);
  color: #fff;
}

.carousel-btn-prev {
  left: 0;
}

.carousel-btn-next {
  right: 0;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  background: var(--color-border);
  cursor: pointer;
  padding: 0;
  transition: background var(--transition), transform var(--transition);
}

.carousel-dot.active {
  background: var(--color-primary);
  transform: scale(1.2);
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: stretch;
}

.contact-info,
.contact-form-wrap {
  background: #fff;
  padding: 32px;
  border-radius: 4px;
  border: var(--border-card);
  box-shadow: var(--shadow-card);
}

.contact-info h3,
.contact-form-wrap h3 {
  font-size: 1.25rem;
  color: var(--color-primary-dark);
  margin-bottom: 1.5rem;
}

.contact-detail {
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

.contact-detail a {
  color: inherit;
}

.contact-detail a:hover {
  color: var(--color-primary);
}

.social-link {
  display: inline-flex;
  margin-top: 1.5rem;
  color: var(--color-primary);
}

.social-link:hover {
  color: var(--color-primary-dark);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--color-text);
}

.form-field input,
.form-field textarea,
.custom-select-trigger {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  border: 1px solid var(--color-border);
  border-radius: 0;
  background-color: #fff;
  color: var(--color-text);
  transition: border-color var(--transition), color var(--transition);
}

.custom-select {
  position: relative;
  width: 100%;
  min-width: 0;
}

.custom-select-native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.custom-select-trigger {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 48px;
  margin: 0;
  padding-right: 44px;
  font-weight: 400;
  text-align: left;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%233570a0' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 8px;
}

.custom-select-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-trigger.is-placeholder {
  color: var(--color-text-muted);
}

.custom-select-trigger:hover {
  border-color: var(--color-text-light);
}

.custom-select.is-open .custom-select-trigger,
.custom-select-trigger:focus {
  outline: none;
  border-color: var(--color-primary);
}

.custom-select.is-invalid .custom-select-trigger {
  border-color: #b42318;
}

.custom-select-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 20;
  max-height: 260px;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-y: auto;
  border: 1px solid var(--color-border);
  background: #fff;
  box-shadow: 0 8px 24px rgba(22, 22, 22, 0.12);
}

.custom-select-option {
  padding: 12px 14px;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--color-text);
  cursor: pointer;
  border-bottom: 1px solid var(--color-bg-alt);
}

.custom-select-option:last-child {
  border-bottom: none;
}

.custom-select-option:hover,
.custom-select-option.is-focused {
  background: var(--color-bg-alt);
}

.custom-select-option.is-selected {
  background: var(--color-accent-pale);
  color: var(--color-primary-dark);
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}

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

.form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.form-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.form-status {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.form-status-loading {
  color: var(--color-text-muted);
}

.form-status-success {
  color: #2d6a4f;
}

.form-status-error {
  color: #b42318;
}

/* Footer */
.site-footer {
  background: rgb(21, 21, 21);
  color: rgba(255, 255, 255, 0.9);
  padding: 32px 0;
  text-align: center;
}

.site-footer p {
  margin: 0;
  font-size: 0.875rem;
}

.site-footer-links {
  margin-bottom: 0.75rem !important;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-footer a:hover {
  color: #fff;
}

/* Legal / privacy page */
.site-header-static {
  position: relative;
  background: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

.legal-page {
  background: var(--color-bg);
  padding-top: 48px;
}

.legal-content {
  max-width: 760px;
}

.legal-content h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  color: var(--color-primary-dark);
  margin-bottom: 0.5rem;
  text-align: center;
}

.legal-effective {
  text-align: center;
  color: var(--color-text-muted);
  margin-bottom: 2rem;
}

.legal-content h2 {
  font-size: 1.35rem;
  color: var(--color-primary-dark);
  margin: 2rem 0 1rem;
}

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

.legal-content ul {
  color: var(--color-text-muted);
  margin: 0 0 1rem;
  padding-left: 1.5rem;
}

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

.legal-content a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-content a:hover {
  color: var(--color-primary-dark);
}

/* 404 / error page */
.error-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, #ffffff 0%, var(--color-bg-page) 100%);
}

.error-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 0;
}

.error-content {
  max-width: 560px;
  text-align: center;
}

.error-logo-link {
  display: inline-block;
  margin-bottom: 1.5rem;
}

.error-logo {
  width: min(320px, 80vw);
  height: auto;
  aspect-ratio: 2 / 1;
  object-fit: contain;
  margin: 0 auto;
}

.error-code {
  font-family: var(--font-heading);
  font-size: clamp(3.5rem, 12vw, 5.5rem);
  line-height: 1;
  color: var(--color-primary);
  margin: 0 0 0.75rem;
  letter-spacing: 0.04em;
}

.error-content h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  color: var(--color-primary-dark);
  margin-bottom: 0.75rem;
}

.error-content p {
  color: var(--color-text-muted);
  margin-bottom: 2rem;
}

.error-content .btn {
  min-width: 180px;
}

/* Cookie banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: #fff;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
  padding: 20px 0;
}

.cookie-banner[hidden] {
  display: none;
}

.cookie-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.cookie-text h2 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.cookie-text p {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0;
  max-width: 600px;
}

.cookie-actions {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

/* Responsive */
@media (max-width: 900px) {
  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .service-card {
    grid-template-columns: 1fr;
    min-height: auto;
    width: min(520px, 88vw);
    margin-left: calc(min(520px, 88vw) / -2);
  }

  .carousel {
    padding: 0 44px;
  }
}

@media (max-width: 600px) {
  :root {
    --header-height: min(200px, 50vw);
  }

  .logo {
    width: min(400px, 90vw);
    height: auto;
    aspect-ratio: 2 / 1;
  }

  .section {
    padding: 56px 0;
  }

  .hero-content {
    padding-bottom: 72px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .hero-btn {
    width: 40px;
    height: 40px;
  }

  .hero-btn-prev {
    left: 12px;
  }

  .hero-btn-next {
    right: 12px;
  }

  .hero-dots {
    bottom: 24px;
  }

  .carousel-btn {
    width: 36px;
    height: 36px;
  }

  .cookie-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .cookie-actions {
    justify-content: flex-end;
  }

  .form-actions .btn {
    flex: 1;
  }
}
