/* ============================================
   S-BB Baustoffprüfung GmbH – Modern Redesign
   ============================================ */

:root {
  --c-primary: #1a3963;
  --c-accent: #1a3963;
  --c-gradient: linear-gradient(135deg, #1a3963, #2a5090);
  --c-dark: #0e1e35;
  --c-dark-card: rgba(255, 255, 255, 0.06);
  --c-dark-border: rgba(255, 255, 255, 0.10);
  --c-bg: #f4f6fa;
  --c-surface: #f9fafb;
  --c-text: #374151;
  --c-text-light: #6b7280;
  --c-heading: #111827;
  --radius: 16px;
  --radius-sm: 8px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* --- Global image effect: subtle desaturation, full color on hover --- */
.about-image,
.timeline-image,
.contact-map {
  filter: saturate(0.7);
  transition: filter 0.5s ease;
}
.about-image:hover,
.timeline-image:hover,
.contact-map:hover {
  filter: saturate(1);
}

::selection { background: rgba(26, 57, 99, 0.2); color: var(--c-heading); }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--c-primary); }
address { font-style: normal; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* --- Scroll Animations --- */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* --- Header --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 10, 26, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: box-shadow 0.3s;
}

.header.scrolled {
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 0.35em;
}

.logo img {
  height: 40px;
  width: auto;
  opacity: 0;
  transition: opacity 0.3s;
}

.logo-text {
  font-size: 0.95rem;
  font-weight: 500;
  color: #fff;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s;
}

.header.show-logo .logo img,
.header.show-logo .logo-text {
  opacity: 1;
}

.nav {
  display: none;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  background: rgba(10, 10, 26, 0.98);
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 20px;
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav.open { display: flex; }

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.nav-link {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.05rem;
  font-weight: 500;
  padding: 12px 24px;
  display: block;
  transition: color 0.2s;
  letter-spacing: -0.01em;
}

.nav-link:hover, .nav-link.active { color: #fff; }

.nav-phone {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
  margin-top: 20px;
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 100px;
  transition: all 0.2s;
}

.nav-phone:hover { color: #fff; border-color: rgba(255, 255, 255, 0.4); }

.nav-social {
  display: inline-flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 12px;
  transition: color 0.2s;
}
.nav-social:hover { color: #fff; }

/* Hamburger */
.menu-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 101;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --- Hero --- */
.hero {
  position: relative;
  height: 70vh;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: url('images/hero-bg.jpg') center/cover no-repeat fixed;
  color: #fff;
  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(26, 57, 99, 0.85) 0%, rgba(10, 10, 26, 0.5) 50%, rgba(0, 0, 0, 0.7) 100%);
}

.hero-grain {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 128px;
  pointer-events: none;
}

.hero-content {
  position: relative;
  text-align: center;
  padding: 0 5px;
}

.animate-in { animation: fadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

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

.hero-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  padding: 10px 24px;
  margin-top: 24px;
  backdrop-filter: blur(4px);
}

@media (min-width: 480px) {
  .hero-badge {
    flex-direction: row;
    gap: 0.4em;
    border-radius: 100px;
    padding: 6px 20px;
  }
}

@media (min-width: 768px) {
  .hero-badge {
    font-size: 1.05rem;
    padding: 8px 28px;
  }
}

.hero h1 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25em;
  font-size: clamp(0.9rem, 6.5vw, 4.5rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin-bottom: 12px;
  text-shadow: 0 2px 40px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
}

.hero-logo {
  height: clamp(1.4rem, 10.5vw, 7.3rem);
  width: auto;
  flex-shrink: 0;
  border-radius: 4px;
}

.hero-scroll {
  display: flex;
  justify-content: center;
  color: #fff;
  margin-top: 32px;
  opacity: 0.5;
  animation: bounce 2.5s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(10px); }
}

/* --- Stats --- */
.stats {
  background: linear-gradient(135deg, #1a3963 0%, #0f2e3d 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 40px 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  text-align: center;
}

.stat-item { padding: 8px; }

.stat-number {
  display: block;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #fff, #7dafd4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  display: block;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

/* --- Section Shared --- */
.section { padding: 80px 0; }
#ueber-uns { background: linear-gradient(160deg, #faf8f5, #e8edf4); }
.section-dark { background: linear-gradient(170deg, #0e1e35, #1a3348); color: #e0e0e0; }
#historie { background: linear-gradient(160deg, #edf0f5, #f5f3ef); }
.section-contact { background: linear-gradient(180deg, #f8f7f5, #edf1f6); }

.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-accent);
  margin-bottom: 12px;
}

.section-label-light { color: rgba(255, 255, 255, 0.5); }

.section-title {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  font-weight: 800;
  color: var(--c-heading);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 48px;
}

.section-title-light { color: #fff; }

.section-header {
  text-align: center;
  margin-bottom: 16px;
}

/* --- About --- */
.about-content {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.about-text p { margin-bottom: 16px; color: var(--c-text-light); }
.about-text .section-title { text-align: left; }

.about-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0;
}

.pill {
  display: inline-block;
  padding: 6px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--c-primary);
  background: rgba(26, 57, 99, 0.06);
  border: 1px solid rgba(26, 57, 99, 0.12);
  border-radius: 100px;
}

.about-buttons { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }

.about-image {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.1);
}

.about-image::after {
  content: '';
  position: absolute;
  bottom: -8px;
  right: -8px;
  width: 60%;
  height: 60%;
  border: 3px solid var(--c-accent);
  border-radius: var(--radius);
  opacity: 0.25;
  z-index: -1;
}

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

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 24px;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 0.25s;
  font-family: inherit;
  letter-spacing: -0.01em;
}

.btn-outline {
  background: transparent;
  color: var(--c-primary);
  border-color: rgba(26, 57, 99, 0.25);
}

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

.btn-gradient {
  background: var(--c-gradient);
  color: #fff;
  border: none;
  padding: 13px 28px;
  font-size: 0.95rem;
  box-shadow: 0 4px 16px rgba(26, 57, 99, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-gradient:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(26, 57, 99, 0.45);
  color: #fff;
}

/* --- Bento Grid (Services) --- */
.bento-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.bento-card {
  background: var(--c-dark-card);
  border: 1px solid var(--c-dark-border);
  border-radius: var(--radius);
  padding: 28px 24px;
  backdrop-filter: blur(8px);
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}

.bento-card:hover {
  border-color: rgba(26, 57, 99, 0.3);
  box-shadow: 0 8px 40px rgba(26, 57, 99, 0.12);
  transform: translateY(-4px);
}

.bento-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: #7dafd4;
}

.bento-card h3 {
  font-size: 1.25rem;
  color: #fff;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.bento-list {
  list-style: none;
  columns: 1;
}

.bento-list li {
  padding: 5px 0;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.55);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.bento-list li:last-child { border-bottom: none; }

.bento-more {
  display: block;
  margin-top: 8px;
  font-size: 1.1rem;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.15em;
}

.bento-footer {
  text-align: center;
  margin-top: 32px;
  font-size: 0.95rem;
  color: rgba(255,255,255,0.5);
}
.bento-footer a {
  color: #7dafd4;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
}
.bento-footer a:hover {
  color: #fff;
}
.bento-footer a:hover { color: #a5b4fc; }

/* --- Timeline --- */
.timeline { position: relative; padding-left: 0; }

.timeline::before {
  content: '';
  position: absolute;
  left: 25px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--c-accent), rgba(26, 57, 99, 0.1));
  border-radius: 3px;
}

.timeline-item {
  position: relative;
  padding-left: 72px;
  padding-bottom: 56px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-marker {
  position: absolute;
  left: 2px;
  top: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(150deg, #1a3963, #244e7a);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  box-shadow: 0 0 0 4px var(--c-bg);
}

.timeline-marker span {
  font-size: 0.65rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
}

.timeline-content h3 {
  font-size: 1.2rem;
  color: var(--c-primary);
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.timeline-content p { margin-bottom: 10px; color: var(--c-text-light); font-size: 0.93rem; }

.timeline-image {
  margin-top: 16px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.timeline-image img {
  width: 100%;
  object-fit: cover;
}

.slideshow {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: inherit;
}

.slideshow .slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.slideshow .slide.active {
  opacity: 1;
}

/* --- Contact --- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 56px;
}

.contact-card {
  background: var(--c-bg);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid #e5e7eb;
}

.contact-map-link { display: block; cursor: pointer; }

.contact-map {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  line-height: 0;
}

.contact-map img {
  width: 100%;
  height: auto;
  display: block;
}

.map-attribution {
  display: block;
  text-align: right;
  font-size: 0.55rem;
  color: #999;
  line-height: normal;
  margin-top: 2px;
  margin-bottom: 16px;
}

.map-attribution a { color: inherit; text-decoration: none; }
.map-attribution a:hover { color: #666; }

.contact-card h3 {
  font-size: 0.85rem;
  color: var(--c-primary);
  margin-bottom: 12px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.contact-address { font-size: 0.92rem; color: var(--c-text-light); margin-bottom: 14px; line-height: 1.6; }
.contact-address a { color: inherit; text-decoration: none; }
.contact-address a:hover { color: var(--c-primary); }

.contact-detail {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.contact-detail svg { color: var(--c-accent); flex-shrink: 0; }
.contact-detail a { color: var(--c-text); font-weight: 500; }
.contact-detail a:hover { color: var(--c-accent); }

/* --- Contact Form --- */
.contact-form-wrapper { max-width: 680px; margin: 0 auto; }

.instagram-cta {
  text-align: center;
  padding: 40px 24px;
  margin-top: 40px;
  border: 1px solid #dde2ea;
  border-radius: var(--radius);
  background: var(--c-surface);
}

.instagram-cta h3 {
  font-size: 1.2rem;
  color: var(--c-heading);
  margin-bottom: 4px;
  font-weight: 700;
}

.instagram-cta p {
  color: var(--c-text-light);
  font-size: 0.92rem;
  margin-bottom: 20px;
}

.instagram-cta .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.contact-form-wrapper h3 {
  text-align: center;
  font-size: 1.2rem;
  color: var(--c-heading);
  margin-bottom: 4px;
  font-weight: 700;
}

.contact-form-intro { text-align: center; color: var(--c-text-light); margin-bottom: 32px; font-size: 0.92rem; }

.form-honeypot { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

.form-status {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 0.92rem;
  font-weight: 500;
  display: none;
}

.form-status.success { display: block; background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.form-status.error { display: block; background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

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

.form-group { margin-bottom: 20px; }

/* Floating Labels */
.floating {
  position: relative;
}

.floating input,
.floating textarea {
  width: 100%;
  padding: 18px 14px 6px;
  font-size: 0.95rem;
  font-family: inherit;
  border: 1.5px solid #e5e7eb;
  border-radius: var(--radius-sm);
  background: var(--c-bg);
  transition: border-color 0.2s, box-shadow 0.2s;
  color: var(--c-heading);
}

.floating label {
  position: absolute;
  left: 14px;
  top: 13px;
  font-size: 0.92rem;
  color: var(--c-text-light);
  pointer-events: none;
  transition: all 0.2s;
  font-weight: 400;
}

.floating input:focus + label,
.floating input:not(:placeholder-shown) + label,
.floating textarea:focus + label,
.floating textarea:not(:placeholder-shown) + label {
  top: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--c-accent);
}

.floating input:focus,
.floating textarea:focus {
  outline: none;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(26, 57, 99, 0.08);
  background: #fff;
}

.floating textarea {
  resize: vertical;
  min-height: 120px;
  padding-top: 22px;
}

.required { color: #ef4444; }

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

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

.form-checkbox label {
  font-size: 0.83rem;
  color: var(--c-text-light);
}

.btn-submit {
  width: 100%;
  margin-top: 4px;
}

/* --- Certifications --- */
.certifications {
  padding: 48px 0;
  background: linear-gradient(160deg, #edf1f6, #e4e0da);
  border-top: 1px solid #dde2ea;
}

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

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

.cert-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 20px 16px;
  border: 1.5px solid #e5e7eb;
  border-radius: var(--radius-sm);
  background: var(--c-bg);
  transition: border-color 0.2s;
}

.cert-badge:hover {
  border-color: var(--c-accent);
}

.cert-badge-seal {
  flex-shrink: 0;
}

.cert-badge-seal svg {
  display: block;
  height: 48px;
  width: auto;
}

.cert-badge-logo {
  display: block;
  width: auto;
  height: 48px;
  object-fit: contain;
  margin: 0 auto;
  flex-shrink: 0;
  border-radius: 4px;
}

.cert-badge-text {
  font-size: 0.82rem;
  line-height: 1.3;
}

.cert-badge-title {
  display: block;
  font-weight: 700;
  color: var(--c-heading);
  letter-spacing: -0.01em;
}

.cert-badge-desc {
  display: block;
  color: var(--c-text-light);
  font-size: 0.75rem;
}

/* --- CTA Banner --- */
.cta {
  padding: 72px 0;
  background: linear-gradient(160deg, #1a3963, #1b4a50);
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.cta::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 128px;
  pointer-events: none;
}

.cta h2 {
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
  position: relative;
}

.cta p {
  font-size: 1rem;
  opacity: 0.8;
  margin-bottom: 28px;
  position: relative;
}

.btn-white {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 32px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  background: #fff;
  color: var(--c-primary);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  letter-spacing: -0.01em;
}

.btn-white:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  color: var(--c-primary);
}

/* --- Footer --- */
.footer {
  background: #0f1820;
  color: rgba(255, 255, 255, 0.4);
  padding: 24px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.35em;
}

.footer-logo img { height: 22px; width: auto; opacity: 0.5; }

.footer-logo-text {
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
}

.footer-links {
  display: flex;
  gap: 4px;
  align-items: center;
}

.footer-link {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.8rem;
  cursor: pointer;
  font-family: inherit;
  padding: 4px 10px;
  transition: color 0.2s;
}

.footer-link:hover { color: #fff; }

.footer-contact {
  display: flex;
  gap: 20px;
  font-size: 0.8rem;
}

.footer-contact a { color: rgba(255, 255, 255, 0.35); }
.footer-contact a:hover { color: #fff; }
.footer-social { display: flex; align-items: center; }

/* --- Modal --- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(6px);
}

.modal-overlay.open { display: flex; }

.modal {
  background: #fff;
  border-radius: var(--radius);
  max-width: 680px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 32px 28px;
  position: relative;
}

.modal-close {
  position: sticky;
  top: 0;
  float: right;
  background: var(--c-bg);
  border: none;
  font-size: 1.4rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  transition: background 0.2s;
}

.modal-close:hover { background: #e5e7eb; }

.modal-content h2 { font-size: 1.3rem; color: var(--c-heading); margin-bottom: 20px; letter-spacing: -0.02em; }
.modal-content h3 { font-size: 1rem; color: var(--c-heading); margin: 20px 0 8px; }
.modal-content p { margin-bottom: 10px; font-size: 0.88rem; line-height: 1.6; color: var(--c-text-light); }
.modal-content ul, .modal-content ol { margin: 10px 0; padding-left: 20px; }
.modal-content li { margin-bottom: 4px; font-size: 0.88rem; }

/* --- External Link Dialog --- */
.ext-dialog-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}

.ext-dialog-overlay.open {
  display: flex;
}

.ext-dialog {
  background: #fff;
  border-radius: var(--radius);
  padding: 32px;
  max-width: 380px;
  width: 90%;
  text-align: center;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
}

.ext-dialog p {
  font-size: 0.95rem;
  color: var(--c-text);
  margin-bottom: 24px;
  line-height: 1.5;
}

.ext-dialog-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.ext-dialog-actions .btn {
  font-size: 0.85rem;
  padding: 10px 20px;
}

/* --- Back to Top --- */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #1a3963, #2c6faa);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(26, 57, 99, 0.35);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s, transform 0.2s;
  z-index: 50;
}

.back-to-top:hover { transform: translateY(-2px); color: #fff; }
.back-to-top.visible { opacity: 1; visibility: visible; }

/* ============================================
   Tablet (>= 768px)
   ============================================ */
@media (min-width: 768px) {
  .header-inner { height: 72px; }
  .menu-toggle { display: none; }

  .nav {
    display: flex;
    position: static;
    background: transparent;
    flex-direction: row;
    align-items: center;
    gap: 0;
    overflow-y: visible;
    padding: 0;
  }

  .nav::before,
  .nav::after {
    display: none;
  }

  .nav-list { flex-direction: row; gap: 0; }
  .nav-link { font-size: 0.85rem; padding: 8px 14px; }
  .nav-social { margin-top: 0; margin-left: 16px; }
  .nav-phone { margin-top: 0; margin-left: 8px; }

  .stats-grid { grid-template-columns: repeat(5, 1fr); }
  .stats { padding: 56px 0; }
  .stat-number { font-size: 2.4rem; }
  .stat-label { font-size: 0.85rem; }

  .section { padding: 100px 0; }
  .form-row { grid-template-columns: 1fr 1fr; gap: 16px; }
  .contact-grid { grid-template-columns: 1fr 1fr; }
  .btn-submit { width: auto; }

  .bento-grid {
    grid-template-columns: 1fr 1fr;
  }

  .bento-large .bento-list { columns: 2; column-gap: 24px; }
  .cert-grid { grid-template-columns: repeat(4, 1fr); }

  .footer-inner { flex-direction: row; justify-content: space-between; }
}

/* ============================================
   Desktop (>= 1024px)
   ============================================ */
@media (min-width: 1024px) {
  .section { padding: 120px 0; }

  .about-content {
    flex-direction: row;
    align-items: center;
    gap: 72px;
  }

  .about-text { flex: 1; }
  .about-image { flex: 0 0 440px; }

  .bento-grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .bento-large {
    grid-column: span 3;
  }

  .bento-small {
    grid-column: span 2;
  }

  .timeline::before { left: 50%; transform: translateX(-50%); }

  .timeline-item {
    padding-left: 0;
    display: grid;
    grid-template-columns: 1fr 52px 1fr;
    gap: 0;
    align-items: start;
    padding-bottom: 72px;
  }

  .timeline-marker {
    position: static;
    grid-column: 2;
    grid-row: 1 / span 2;
    justify-self: center;
    width: 56px;
    height: 56px;
    box-shadow: 0 0 0 5px var(--c-bg);
  }

  .timeline-marker span { font-size: 0.75rem; }

  .timeline-item {
    grid-template-columns: 1fr 64px 1fr;
  }

  .timeline-content {
    grid-column: 1;
    text-align: right;
    padding-right: 32px;
  }

  .timeline-image {
    grid-column: 3;
    margin-top: 0;
    padding-left: 32px;
  }

  .timeline-item:nth-child(even) .timeline-content {
    grid-column: 3;
    text-align: left;
    padding-left: 32px;
    padding-right: 0;
  }

  .timeline-item:nth-child(even) .timeline-image {
    grid-column: 1;
    grid-row: 1 / span 2;
    padding-left: 0;
    padding-right: 32px;
  }
}
