/* ==========================================================================
   Home Page Styles
   Extends base.css with home-page-specific components and overrides.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Section Header Override
   Extends base .section-header with gradient text and underline decoration.
   -------------------------------------------------------------------------- */

.section-header h2 {
  font-size: 2.75rem;
  position: relative;
  display: inline-block;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-header h2::after {
  content: "";
  position: absolute;
  width: 100px;
  height: 4px;
  background: var(--accent-gradient);
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 2px;
}

.section-header p {
  max-width: 700px;
  margin: 1.5rem auto 0;
  font-size: 1.1rem;
  line-height: 1.7;
}

/* --------------------------------------------------------------------------
   2. Hero
   -------------------------------------------------------------------------- */

.hero {
  padding: 6rem 0 8rem;
  background: var(--card-bg);
  position: relative;
  overflow: hidden;
  clip-path: polygon(0 0, 100% 0, 100% 95%, 0 100%);
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  background: var(--accent-gradient);
  opacity: 0.03;
  border-radius: 0 0 0 100%;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 4rem;
  align-items: center;
  position: relative;
}

.hero-text {
  z-index: 1;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  color: var(--primary-color);
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.2rem;
  color: var(--muted-color);
  margin-bottom: 2rem;
  max-width: 600px;
  line-height: 1.7;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  background: var(--accent-gradient);
  color: white;
  font-weight: 600;
  font-size: 1.05rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(200, 40, 41, 0.25);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.hero-cta::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.hero-cta:hover::before {
  left: 100%;
}

.hero-cta:hover {
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(200, 40, 41, 0.35);
}

/* --------------------------------------------------------------------------
   3. Photo
   -------------------------------------------------------------------------- */

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.photo-container {
  width: 280px;
  height: 280px;
  position: relative;
  z-index: 1;
}

.photo-container::before {
  content: "";
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  background: var(--accent-gradient);
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  animation: morph 8s ease-in-out infinite;
  z-index: -1;
  opacity: 0.5;
}

@keyframes morph {
  0%, 100% {
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    transform: rotate(0deg);
  }
  25% {
    border-radius: 58% 42% 75% 25% / 76% 46% 54% 24%;
  }
  50% {
    border-radius: 50% 50% 33% 67% / 55% 27% 73% 45%;
    transform: rotate(45deg);
  }
  75% {
    border-radius: 33% 67% 58% 42% / 63% 68% 32% 37%;
  }
}

.profile-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  display: block;
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.15);
  transform: scale(1.08);
  transition: transform 0.3s ease;
}

.profile-photo:hover {
  transform: scale(1.1);
}

/* --------------------------------------------------------------------------
   4. Services Section
   -------------------------------------------------------------------------- */

.services {
  padding: 5rem 0;
}

/* --------------------------------------------------------------------------
   5. Expertise Grid
   -------------------------------------------------------------------------- */

.expertise-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

.expertise-item {
  background-color: var(--card-bg);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border-color);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(30px);
}

.expertise-item.reveal {
  opacity: 1;
  transform: translateY(0);
}

.expertise-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent-gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.expertise-item:hover::before {
  transform: scaleX(1);
}

.expertise-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.1);
  border-color: var(--accent-color);
}

/* Grid column spans — alternating 2/3 pattern */
.expertise-item:nth-child(1) { grid-column: span 2; }
.expertise-item:nth-child(2) { grid-column: span 3; }
.expertise-item:nth-child(3) { grid-column: span 3; }
.expertise-item:nth-child(4) { grid-column: span 2; }
.expertise-item:nth-child(5) { grid-column: span 2; }
.expertise-item:nth-child(6) { grid-column: span 3; }
.expertise-item:nth-child(7) { grid-column: span 3; }
.expertise-item:nth-child(8) { grid-column: span 2; }

/* Odd items: icon left, content right */
.expertise-item:nth-child(1),
.expertise-item:nth-child(3),
.expertise-item:nth-child(5),
.expertise-item:nth-child(7) {
  display: flex;
  flex-direction: row;
  gap: 1.5rem;
  align-items: flex-start;
}

.expertise-item:nth-child(1) .expertise-icon,
.expertise-item:nth-child(3) .expertise-icon,
.expertise-item:nth-child(5) .expertise-icon,
.expertise-item:nth-child(7) .expertise-icon {
  margin-bottom: 0;
  flex-shrink: 0;
}

/* Even items: icon right, content left */
.expertise-item:nth-child(2),
.expertise-item:nth-child(4),
.expertise-item:nth-child(6),
.expertise-item:nth-child(8) {
  display: flex;
  flex-direction: row-reverse;
  gap: 1.5rem;
  align-items: flex-start;
}

.expertise-item:nth-child(2) .expertise-icon,
.expertise-item:nth-child(4) .expertise-icon,
.expertise-item:nth-child(6) .expertise-icon,
.expertise-item:nth-child(8) .expertise-icon {
  margin-bottom: 0;
  flex-shrink: 0;
}

.expertise-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, rgba(74, 109, 167, 0.1) 0%, rgba(200, 40, 41, 0.05) 100%);
  border-radius: 16px;
  margin-bottom: 1.5rem;
  position: relative;
}

.expertise-content {
  flex: 1;
  min-width: 0;
}

.expertise-icon svg {
  width: 32px;
  height: 32px;
  stroke: var(--accent-color-icons);
  stroke-width: 2;
  fill: none;
  transition: all 0.3s ease;
}

.expertise-item:hover .expertise-icon svg {
  stroke: var(--accent-color);
  transform: scale(1.1);
}

.expertise-item h3 {
  font-family: var(--font-display);
  color: var(--primary-color);
  margin-bottom: 0.75rem;
  font-size: 1.35rem;
  font-weight: 600;
}

.expertise-item p {
  color: var(--muted-color);
  font-size: 1rem;
  line-height: 1.6;
}

.expertise-item p a {
  color: var(--accent-color);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.expertise-item p a:hover {
  text-decoration-thickness: 2px;
}

/* Scroll-reveal animation classes */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-on-scroll.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   5b. Projects Section
   -------------------------------------------------------------------------- */

.projects {
  padding: 5rem 0;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.project-tile {
  display: block;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2rem;
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.project-tile::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.project-tile:hover::before {
  transform: scaleX(1);
}

.project-tile:hover {
  color: inherit;
  transform: translateY(-6px);
  box-shadow: 0 16px 32px -8px rgba(0, 0, 0, 0.1);
  border-color: var(--accent-color);
}

.project-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, rgba(74, 109, 167, 0.1) 0%, rgba(200, 40, 41, 0.05) 100%);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.project-icon svg {
  width: 28px;
  height: 28px;
  stroke: var(--accent-color-icons);
  stroke-width: 2;
  fill: none;
  transition: all 0.3s ease;
}

.project-tile:hover .project-icon svg {
  stroke: var(--accent-color);
  transform: scale(1.1);
}

.project-tile h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.project-tile p {
  color: var(--muted-color);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   5c. Corner Ribbon — "Standing on the Shoulders of Giants"
   -------------------------------------------------------------------------- */

.corner-ribbon {
  position: fixed;
  top: 36px;
  right: -68px;
  z-index: 1000;
  transform: rotate(45deg);
  width: 270px;
  text-align: center;
  padding: 7px 0;
  background: var(--accent-gradient);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: opacity 0.3s ease;
}

.corner-ribbon:hover {
  opacity: 0.85;
}

@media (max-width: 768px) {
  .corner-ribbon {
    top: 28px;
    right: -74px;
    font-size: 0.55rem;
    padding: 5px 0;
  }
}

/* --------------------------------------------------------------------------
   6. Contact Section
   -------------------------------------------------------------------------- */

.contact {
  padding: 6rem 0;
  background-color: var(--card-bg);
  position: relative;
  clip-path: polygon(0 5%, 100% 0, 100% 100%, 0 100%);
  margin-top: -2rem;
}

.contact-content {
  max-width: 900px;
  margin: 0 auto;
}

.contact-row {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 4rem;
  align-items: center;
}

.contact-column {
  flex: 1;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--light-bg);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.contact-item:hover {
  transform: translateX(8px);
  border-color: var(--accent-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.contact-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-icon svg {
  width: 24px;
  height: 24px;
  stroke: white;
  stroke-width: 2;
  fill: none;
}

.contact-text h3 {
  font-family: var(--font-display);
  color: var(--primary-color);
  margin-bottom: 0.35rem;
  font-size: 1.15rem;
  font-weight: 600;
}

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

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

/* --------------------------------------------------------------------------
   7. Imprint Section
   -------------------------------------------------------------------------- */

.imprint {
  padding: 5rem 0;
  border-top: 1px solid var(--border-color);
}

.imprint-content {
  background-color: var(--card-bg);
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border-color);
}

.imprint-details {
  margin-top: 1.5rem;
  color: var(--muted-color);
}

.detail-group {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
}

.detail-group:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
}

/* --------------------------------------------------------------------------
   8. Footer Override
   Overrides base.css product-page footer for home page 3-column grid.
   -------------------------------------------------------------------------- */

footer {
  position: relative;
}

footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 2rem;
}

.footer-about h3,
.footer-links h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: white;
}

.footer-about p {
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.footer-links ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.95);
  transition: all 0.3s ease;
  display: inline-block;
}

.footer-links a:hover {
  color: white;
  transform: translateX(4px);
}

.footer-links .blog-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  background: var(--accent-gradient);
  border-radius: 6px;
  color: white;
  font-weight: 500;
  transition: all 0.3s ease;
}

.footer-links .blog-link:hover {
  transform: translateX(4px) scale(1.02);
  box-shadow: 0 4px 12px rgba(200, 40, 41, 0.4);
}

.footer-links .blog-link svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.copyright {
  color: rgba(255, 255, 255, 0.85);
}

/* --------------------------------------------------------------------------
   9. Responsive — Home-specific overrides only
   -------------------------------------------------------------------------- */

@media (max-width: 992px) {
  .hero h1 {
    font-size: 2.5rem;
  }

  .hero-content {
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;
  }

  .hero-visual {
    order: -1;
  }

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

  .expertise-item {
    grid-column: span 2 !important;
  }

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

  .expertise-item:nth-child(1),
  .expertise-item:nth-child(2),
  .expertise-item:nth-child(3),
  .expertise-item:nth-child(4),
  .expertise-item:nth-child(5),
  .expertise-item:nth-child(6),
  .expertise-item:nth-child(7),
  .expertise-item:nth-child(8) {
    flex-direction: column !important;
    gap: 0 !important;
  }

  .expertise-item:nth-child(1) .expertise-icon,
  .expertise-item:nth-child(2) .expertise-icon,
  .expertise-item:nth-child(3) .expertise-icon,
  .expertise-item:nth-child(4) .expertise-icon,
  .expertise-item:nth-child(5) .expertise-icon,
  .expertise-item:nth-child(6) .expertise-icon,
  .expertise-item:nth-child(7) .expertise-icon,
  .expertise-item:nth-child(8) .expertise-icon {
    margin-bottom: 1.5rem !important;
  }

  .contact-row {
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;
  }

  .photo-container {
    margin: 0 auto;
  }

  .contact-item:hover {
    transform: translateY(-4px);
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }

  .footer-links ul {
    align-items: center;
  }
}

@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }

  .section-header h2 {
    font-size: 2rem;
  }

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

  .expertise-item {
    grid-column: span 1 !important;
  }

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

  .expertise-item:nth-child(1),
  .expertise-item:nth-child(2),
  .expertise-item:nth-child(3),
  .expertise-item:nth-child(4),
  .expertise-item:nth-child(5),
  .expertise-item:nth-child(6),
  .expertise-item:nth-child(7),
  .expertise-item:nth-child(8) {
    flex-direction: column !important;
    gap: 0 !important;
  }

  .expertise-item:nth-child(1) .expertise-icon,
  .expertise-item:nth-child(2) .expertise-icon,
  .expertise-item:nth-child(3) .expertise-icon,
  .expertise-item:nth-child(4) .expertise-icon,
  .expertise-item:nth-child(5) .expertise-icon,
  .expertise-item:nth-child(6) .expertise-icon,
  .expertise-item:nth-child(7) .expertise-icon,
  .expertise-item:nth-child(8) .expertise-icon {
    margin-bottom: 1.5rem !important;
  }
}
