/* 駿峰汽車 — design tokens & layout */
:root {
  --color-primary: #253993;
  --color-primary-deep: #1a2a6e;
  --color-accent: #ffdd00;
  --color-accent-hover: #f5d400;
  --color-ink: #1a1a1a;
  --color-muted: #808285;
  --color-surface: #f9f9fb;
  --color-mist: #dadeef;
  --color-white: #ffffff;
  --font-body: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --font-display: "Barlow Condensed", "Noto Sans TC", sans-serif;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;
  --header-h: 4.25rem;
  --max-w: 72rem;
  --radius: 2px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-soft: 0 12px 40px rgba(26, 26, 26, 0.12);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--color-ink);
  background: var(--color-surface);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 1000;
  padding: 0.75rem 1rem;
  background: var(--color-accent);
  color: var(--color-ink);
}

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

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(249, 249, 251, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(37, 57, 147, 0.08);
  transition: background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 4px 24px rgba(26, 26, 26, 0.06);
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--space-md);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.brand img {
  height: 2.5rem;
  width: auto;
}

.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  color: var(--color-primary);
  line-height: 1.2;
}

.brand-text span {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--color-muted);
}

.nav-toggle {
  display: none;
  width: 2.75rem;
  height: 2.75rem;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(37, 57, 147, 0.2);
  border-radius: var(--radius);
  color: var(--color-primary);
}

.nav-toggle-bars {
  display: block;
  width: 1.25rem;
  height: 2px;
  background: currentColor;
  position: relative;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  transition: transform 0.25s var(--ease);
}

.nav-toggle-bars::before {
  top: -6px;
}

.nav-toggle-bars::after {
  top: 6px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after {
  top: 0;
  transform: rotate(-45deg);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.site-nav a {
  padding: 0.5rem 0.85rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-ink);
  border-radius: var(--radius);
  transition: color 0.2s, background 0.2s;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--color-primary);
  background: var(--color-mist);
  outline: none;
}

.site-nav a.is-active {
  color: var(--color-primary);
  font-weight: 700;
  box-shadow: inset 0 -2px 0 var(--color-accent);
}

.nav-cta {
  margin-left: 0.5rem;
  padding: 0.55rem 1.1rem !important;
  background: var(--color-primary) !important;
  color: var(--color-white) !important;
  box-shadow: none !important;
}

.nav-cta:hover,
.nav-cta:focus-visible {
  background: var(--color-primary-deep) !important;
  color: var(--color-accent) !important;
}

/* Hero */
.hero {
  position: relative;
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100dvh - var(--header-h));
  display: flex;
  align-items: flex-end;
  color: var(--color-white);
  overflow: hidden;
}

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

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  animation: heroKen 18s ease-in-out infinite alternate;
}

@keyframes heroKen {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.06);
  }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(26, 42, 110, 0.35) 0%, rgba(26, 26, 26, 0.78) 72%),
    linear-gradient(90deg, rgba(37, 57, 147, 0.55) 0%, transparent 55%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-md) var(--space-xl);
}

.hero-brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.6rem, 7vw, 4.75rem);
  line-height: 1.05;
  letter-spacing: 0.02em;
  margin: 0 0 var(--space-sm);
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
  animation: fadeUp 0.9s var(--ease) both;
}

.hero-sub {
  display: block;
  font-size: 0.42em;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--color-accent);
  margin-top: 0.35em;
}

.hero-lead {
  max-width: 36rem;
  margin: 0 0 var(--space-md);
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.92);
  animation: fadeUp 0.9s 0.12s var(--ease) both;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  animation: fadeUp 0.9s 0.24s var(--ease) both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(1.25rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.4rem;
  font-weight: 700;
  font-size: 1rem;
  border-radius: var(--radius);
  transition: transform 0.2s var(--ease), background 0.2s, color 0.2s, border-color 0.2s;
}

.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

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

.btn-accent {
  background: var(--color-accent);
  color: var(--color-ink);
}

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

.btn-ghost {
  background: transparent;
  color: var(--color-white);
  border: 1.5px solid rgba(255, 255, 255, 0.65);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--color-white);
}

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

.btn-primary:hover {
  background: var(--color-primary-deep);
  color: var(--color-accent);
}

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

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

/* Sections */
.section {
  padding: var(--space-xl) var(--space-md);
}

.section-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

.section-label {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin: 0 0 0.35rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
  margin: 0 0 var(--space-md);
  color: var(--color-ink);
}

.section-lead {
  max-width: 40rem;
  margin: 0 0 var(--space-lg);
  color: var(--color-muted);
}

.section-lead--center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

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

.section--primary .section-label {
  color: var(--color-accent);
}

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

.section--mist {
  background:
    linear-gradient(160deg, var(--color-mist) 0%, var(--color-surface) 55%, #fff 100%);
}

.section--dark {
  background:
    linear-gradient(135deg, var(--color-ink) 0%, var(--color-primary-deep) 100%);
  color: var(--color-white);
}

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

.section--dark .section-label {
  color: var(--color-accent);
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(1.5rem);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

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

/* Page hero (inner pages) */
.page-hero {
  position: relative;
  min-height: 42vh;
  display: flex;
  align-items: flex-end;
  color: var(--color-white);
  overflow: hidden;
}

.page-hero .hero-media,
.page-hero .hero-overlay {
  position: absolute;
  inset: 0;
}

.page-hero .hero-overlay {
  background: linear-gradient(180deg, rgba(26, 42, 110, 0.4) 0%, rgba(26, 26, 26, 0.82) 100%);
  z-index: 1;
}

.page-hero .hero-media {
  z-index: 0;
}

.page-hero .hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.page-hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--space-xl) var(--space-md) var(--space-lg);
}

.page-hero .section-label {
  color: var(--color-accent);
}

.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800;
  margin: 0;
  letter-spacing: 0.03em;
  animation: fadeUp 0.8s var(--ease) both;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Services list */
.service-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.service-item {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: var(--space-lg);
  align-items: center;
  padding: var(--space-lg) 0;
  border-bottom: 1px solid rgba(37, 57, 147, 0.12);
}

.service-item:first-child {
  border-top: 1px solid rgba(37, 57, 147, 0.12);
}

.service-item:nth-child(even) {
  direction: rtl;
}

.service-item:nth-child(even) > * {
  direction: ltr;
}

.service-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  filter: saturate(1.05) contrast(1.02);
}

.service-num {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

.service-item h3 {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  font-weight: 700;
  margin: 0 0 0.75rem;
  line-height: 1.25;
}

.service-item p {
  margin: 0;
  color: var(--color-muted);
}

.service-grid-home {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1px;
  background: rgba(37, 57, 147, 0.15);
  border: 1px solid rgba(37, 57, 147, 0.15);
}

/* 上 3 下 2：前三項各占 2 欄，後兩項各占 3 欄 */
.service-grid-home a:nth-child(-n + 3) {
  grid-column: span 2;
}

.service-grid-home a:nth-child(n + 4) {
  grid-column: span 3;
}

.service-grid-home a {
  display: block;
  padding: var(--space-md);
  background: var(--color-white);
  transition: background 0.25s, color 0.25s;
}

.service-grid-home a:hover,
.service-grid-home a:focus-visible {
  background: var(--color-primary);
  color: var(--color-white);
  outline: none;
}

.service-grid-home a:hover .service-num,
.service-grid-home a:focus-visible .service-num {
  color: var(--color-accent);
}

.service-grid-home h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.3;
}

/* About split */
.about-split {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: var(--space-lg);
  align-items: center;
}

.about-copy p {
  margin: 0 0 1rem;
}

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

.about-photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.about-photos img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.about-photos img:first-child {
  margin-top: 2rem;
}

.about-photos img:last-child {
  margin-bottom: 2rem;
}

/* Gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 0.5rem;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  cursor: zoom-in;
  padding: 0;
  display: block;
  width: 100%;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.gallery-item:hover img,
.gallery-item:focus-visible img {
  transform: scale(1.05);
}

.gallery-item:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.gallery-preview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.gallery-preview a {
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.gallery-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s var(--ease);
}

.gallery-preview a:hover img {
  transform: scale(1.06);
}

/* Contact */
.contact-block {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: var(--space-lg);
  align-items: start;
}

.contact-tagline {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.5vw, 2.1rem);
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 var(--space-md);
  color: var(--color-primary);
}

.contact-meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.contact-meta dt {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: 0.25rem;
}

.contact-meta dd {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
}

.contact-meta a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

.contact-panel {
  background: var(--color-primary);
  color: var(--color-white);
  padding: var(--space-lg);
  min-height: 100%;
}

.contact-panel h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin: 0 0 1rem;
}

.contact-panel p {
  margin: 0 0 0.75rem;
  opacity: 0.92;
}

.contact-panel .btn {
  margin-top: var(--space-sm);
}

.cta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.cta-bar h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  margin: 0 0 0.35rem;
}

.cta-bar p {
  margin: 0;
  opacity: 0.9;
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Footer */
.site-footer {
  background: var(--color-ink);
  color: rgba(255, 255, 255, 0.75);
  padding: var(--space-lg) var(--space-md);
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-md);
  align-items: flex-start;
}

.footer-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--color-white);
  margin-bottom: 0.5rem;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

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

.footer-copy {
  width: 100%;
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.85rem;
}

/* WhatsApp float */
.wa-float {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 90;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: #25d366;
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s var(--ease);
}

.wa-float:hover,
.wa-float:focus-visible {
  transform: scale(1.08);
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.wa-float img {
  width: 2rem;
  height: 2rem;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(10, 12, 20, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox img {
  max-width: min(96vw, 56rem);
  max-height: 88vh;
  object-fit: contain;
  box-shadow: var(--shadow-soft);
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.75rem;
  height: 2.75rem;
  color: var(--color-white);
  font-size: 1.75rem;
  line-height: 1;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius);
}

.lightbox-close:hover,
.lightbox-close:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  outline: 2px solid var(--color-accent);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.75rem;
  height: 2.75rem;
  color: var(--color-white);
  font-size: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius);
}

.lightbox-nav:hover,
.lightbox-nav:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  outline: 2px solid var(--color-accent);
}

.lightbox-prev {
  left: 1rem;
}

.lightbox-next {
  right: 1rem;
}

body.lightbox-open {
  overflow: hidden;
}

/* Utilities */
.text-center {
  text-align: center;
}

.mt-lg {
  margin-top: var(--space-lg);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Responsive */
@media (max-width: 900px) {
  .service-item,
  .service-item:nth-child(even) {
    grid-template-columns: 1fr;
    direction: ltr;
  }

  .service-grid-home {
    grid-template-columns: repeat(2, 1fr);
  }

  .service-grid-home a:nth-child(-n + 3),
  .service-grid-home a:nth-child(n + 4) {
    grid-column: auto;
  }

  .about-split,
  .contact-block {
    grid-template-columns: 1fr;
  }

  .about-photos img:first-child,
  .about-photos img:last-child {
    margin: 0;
  }

  .gallery-preview {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--space-sm);
    background: var(--color-white);
    border-bottom: 1px solid rgba(37, 57, 147, 0.1);
    box-shadow: var(--shadow-soft);
    transform: translateY(-120%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.35s var(--ease), opacity 0.35s, visibility 0.35s;
  }

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

  .site-nav a {
    padding: 0.9rem 1rem;
  }

  .nav-cta {
    margin: 0.5rem 0 0 !important;
    text-align: center;
  }

  .brand-text {
    display: none;
  }

  .hero {
    min-height: 85vh;
    align-items: center;
  }

  .hero-content {
    padding-top: var(--space-xl);
  }

  .cta-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }

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