/* ==========================================================================
   KAI ELECTRICAL TECH (kaielectrical.com.au)
   Design System: Swiss International Style / Editorial Layout
   Brand Accent: #00dd66 (Official Logo Electric Green)
   Australian English (en-AU) / Simplified Chinese (zh-CN)
   ========================================================================== */

:root {
  /* Brand & Theme Colors */
  --color-brand: #00dd66;
  --color-brand-hover: #00c258;
  --color-brand-light: #e6fcf0;
  
  --color-dark: #0f172a;       /* Slate 900 - Primary text & ink */
  --color-slate: #1e293b;      /* Slate 800 */
  --color-muted: #64748b;      /* Slate 500 - Metadata & descriptions */
  --color-light-gray: #94a3b8; /* Slate 400 */
  --color-border: #e2e8f0;     /* Slate 200 - 1px hairline rules */
  --color-bg: #ffffff;         /* Pure crisp white */
  --color-surface: #f8fafc;    /* Soft neutral editorial surface */
  
  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Layout */
  --max-width: 1200px;
  --header-height: 72px;
  --hairline: 1px solid var(--color-border);
}

/* 1. Global Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-dark);
  background-color: var(--color-bg);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

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

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

@media (min-width: 1024px) {
  .container {
    padding: 0 2.5rem;
  }
}

/* 2. Minimalist Swiss Header */
.site-header {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: var(--hairline);
  z-index: 100;
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo-link {
  display: flex;
  align-items: center;
}

.brand-logo {
  height: 38px;
  width: auto;
  object-fit: contain;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-link {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-slate);
  padding: 0.35rem 0.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  position: relative;
}

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

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background-color: var(--color-brand);
  transition: width 0.2s ease;
}

.nav-link:hover::after {
  width: 100%;
}

.external-arrow {
  font-size: 0.75rem;
  opacity: 0.6;
}

.lang-btn {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--color-slate);
  border-radius: 4px;
  background-color: transparent;
  color: var(--color-slate);
  transition: all 0.2s ease;
}

.lang-btn:hover {
  background-color: var(--color-slate);
  color: #ffffff;
}

/* 3. Hero Section (Swiss Typography) */
.hero-section {
  padding: 5.5rem 0 4.5rem;
  border-bottom: var(--hairline);
}

.hero-title {
  font-size: clamp(2rem, 5.2vw, 3.75rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--color-dark);
  text-transform: uppercase;
  max-width: 1100px;
  margin-bottom: 1.5rem;
}

.hero-sub {
  font-size: clamp(1.0625rem, 2vw, 1.25rem);
  line-height: 1.6;
  color: var(--color-muted);
  max-width: 860px;
}

/* 4. Services Section (Editorial Ordered Rows) */
.services-section {
  padding: 3.5rem 0 4rem;
}

.section-editorial-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 2.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 2px solid var(--color-dark);
}

@media (min-width: 768px) {
  .section-editorial-header {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }
}

.editorial-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--color-muted);
  text-transform: uppercase;
}

.editorial-heading {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--color-dark);
}

/* Service Entry Row */
.service-entry {
  padding: 2.5rem 0 3rem;
  border-bottom: var(--hairline);
}

.service-entry:last-child {
  border-bottom: none;
}

.service-meta-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .service-meta-grid {
    grid-template-columns: 80px 1fr;
    gap: 1.5rem;
    align-items: baseline;
  }
}

.service-index {
  font-family: var(--font-mono);
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 800;
  line-height: 1;
  color: var(--color-dark);
  letter-spacing: -0.04em;
}

.service-header-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.service-title {
  font-size: clamp(1.25rem, 2.2vw, 1.625rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--color-dark);
}

.service-desc {
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--color-slate);
  max-width: 960px;
}

/* 3-Photo Horizontal Row (Square Thumbnails, Zero Scroll) */
.service-photo-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.625rem;
  width: 100%;
}

@media (min-width: 768px) {
  .service-photo-row {
    gap: 1.25rem;
  }
}

.service-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: var(--hairline);
  background-color: var(--color-surface);
  cursor: pointer;
  border-radius: 2px;
}

.thumb-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), filter 0.25s ease;
}

.service-thumb:hover .thumb-image {
  transform: scale(1.04);
}

.thumb-zoom-icon {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  width: 24px;
  height: 24px;
  background-color: rgba(15, 23, 42, 0.7);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.service-thumb:hover .thumb-zoom-icon {
  opacity: 1;
}

.thumb-zoom-icon svg {
  width: 14px;
  height: 14px;
  stroke: #ffffff;
}

/* 5. Credentials & Certifications Section (Bottom Strip) */
.credentials-section {
  padding: 4rem 0 3.5rem;
  background-color: var(--color-surface);
  border-top: var(--hairline);
  border-bottom: var(--hairline);
}

.cred-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 900px) {
  .cred-grid {
    grid-template-columns: 1.2fr 1fr;
    gap: 3.5rem;
  }
}

.cred-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--color-dark);
  margin-bottom: 0.75rem;
}

.cred-sub {
  font-size: 1rem;
  color: var(--color-muted);
  margin-bottom: 1.5rem;
}

.licence-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.licence-item {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-slate);
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.licence-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-brand);
  flex-shrink: 0;
}

.cert-image-frame {
  background-color: #ffffff;
  padding: 1.25rem;
  border: var(--hairline);
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.cert-image {
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* 6. Direct Contact Section (#contact) */
.contact-section {
  padding: 4.5rem 0 4rem;
  border-bottom: var(--hairline);
}

.contact-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

@media (min-width: 860px) {
  .contact-layout {
    grid-template-columns: 1.1fr 1fr;
    gap: 4rem;
  }
}

.contact-title {
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: var(--color-dark);
  margin-bottom: 0.875rem;
}

.contact-sub {
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--color-muted);
  margin-bottom: 2rem;
}

.contact-actions-vertical {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-card-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  background-color: var(--color-surface);
  border: var(--hairline);
  border-radius: 4px;
  transition: all 0.2s ease;
}

.contact-card-link:hover {
  border-color: var(--color-dark);
  background-color: #ffffff;
  transform: translateX(4px);
}

.contact-card-link.primary-card {
  border-color: var(--color-brand);
  background-color: var(--color-brand-light);
}

.contact-card-link.primary-card:hover {
  background-color: #d1fae5;
}

.contact-card-left {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.contact-card-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted);
}

.contact-card-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-dark);
  letter-spacing: -0.01em;
}

.contact-card-arrow {
  font-size: 1.25rem;
  color: var(--color-slate);
}

.wechat-icon-action {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}

.contact-card-hint {
  font-size: 0.8125rem;
  color: var(--color-muted);
  margin-top: 0.35rem;
  display: block;
}

/* 7. Legal Footer */
.site-footer {
  padding: 2.5rem 0 3rem;
  background-color: #ffffff;
  font-size: 0.8125rem;
  color: var(--color-muted);
}

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

@media (min-width: 768px) {
  .footer-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.footer-legal-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.footer-divider {
  color: var(--color-light-gray);
}

/* 8. Lightbox Modal & Gestures */
.lightbox-modal {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  touch-action: pan-y;
}

.lightbox-modal.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.lightbox-content-box {
  position: relative;
  z-index: 2;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-image {
  max-width: 90vw;
  max-height: 75vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transition: opacity 0.2s ease;
  pointer-events: auto;
}

.lightbox-top-bar {
  position: absolute;
  top: 1.25rem;
  left: 1.5rem;
  right: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 3;
}

.lightbox-counter {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #ffffff;
  background-color: rgba(0, 0, 0, 0.4);
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
}

.lightbox-close-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1.5rem;
  transition: background-color 0.2s ease;
}

.lightbox-close-btn:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.5);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  z-index: 3;
  transition: background-color 0.2s ease;
}

.lightbox-nav-btn:hover {
  background-color: rgba(0, 0, 0, 0.8);
}

.lightbox-prev {
  left: 1rem;
}

.lightbox-next {
  right: 1rem;
}

.lightbox-bottom-hint {
  margin-top: 0.875rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.05em;
  text-align: center;
  pointer-events: none;
}

/* 9. Toast Alert */
.toast-alert {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background-color: var(--color-dark);
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 10000;
  white-space: nowrap;
}

.toast-alert.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
