
/* OMID WEBSITE - RESPONSIVE V2 */
/* Unified section width and responsive layout */

:root {
  --omid-content-width: 1220px;
  --omid-page-gutter: clamp(12px, 2vw, 24px);
  --omid-card-gap: clamp(14px, 1.7vw, 20px);
}

/* Unified page sections */

main > :is(
  .hero,
  .card-wide,
  .section,
  .contact-section,
  .omid-tech-stack-visual
) {
  box-sizing: border-box;
  width: min(
    var(--omid-content-width),
    calc(100% - 2 * var(--omid-page-gutter))
  ) !important;
  max-width: var(--omid-content-width) !important;
  margin-inline: auto !important;
  min-width: 0;
}

/* Consistent section spacing */

main > .section {
  padding-top: clamp(34px, 4vw, 54px);
  padding-bottom: 8px;
}

main > .card-wide {
  margin-block: clamp(20px, 2.8vw, 34px) 0;
}

.section-head {
  display: flex;
  align-items: flex-end;
  gap: 20px;
}

.section-head > * {
  min-width: 0;
}

.section-head :is(h2, h3) {
  font-size: clamp(25px, 2.5vw, 33px);
  line-height: 1.2;
}

/* Hero section */

main > .hero {
  grid-template-columns:
    minmax(0, 1.05fr)
    minmax(0, 0.95fr);
  gap: clamp(16px, 2.4vw, 34px);
}

.hero-copy,
.hero-visual {
  min-width: 0;
}

.hero h1 {
  font-size: clamp(48px, 6.1vw, 82px);
}

.hero h2 {
  font-size: clamp(21px, 2.35vw, 30px);
}

/* Service and project cards */

.grid.four {
  grid-template-columns:
    repeat(4, minmax(0, 1fr));
  gap: var(--omid-card-gap);
  align-items: stretch;
}

.grid.four > * {
  min-width: 0;
  height: 100%;
}

.service,
.project {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.service .tags {
  margin-top: auto;
}

.project > .project-body {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.project > .project-body > a:last-child {
  margin-top: auto;
}

/* Rechnung project */

.receipt-project-card .receipt-project-link {
  display: flex !important;
  flex: 1;
  flex-direction: column;
}

.receipt-project-card .receipt-project-content {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.receipt-project-card .receipt-project-cta {
  margin-top: auto;
}

.receipt-project-card .receipt-project-cover img {
  object-fit: contain !important;
  transform: none !important;
}

/* Other grids */

.domain-grid {
  grid-template-columns:
    repeat(3, minmax(0, 1fr));
  gap: var(--omid-card-gap);
}

.featured-project {
  grid-template-columns:
    minmax(0, 0.95fr)
    minmax(0, 1.55fr);
}

.contact-grid {
  grid-template-columns:
    minmax(0, 0.9fr)
    minmax(0, 1.1fr);
}

.domain-card,
.contact-card,
.contact-form {
  min-width: 0;
}

/* Images and text */

img,
video,
iframe {
  max-width: 100%;
}

.omid-tech-stack-visual :is(picture, img) {
  max-width: 100%;
  height: auto;
}

:is(
  .service,
  .project,
  .domain-card,
  .contact-card,
  .contact-form
) {
  overflow-wrap: anywhere;
}

/* Tablets and smaller laptops */

@media (max-width: 1100px) {
  main > .hero {
    grid-template-columns: 1fr;
  }

  .grid.four,
  .domain-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .featured-project,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    min-height: 450px;
  }
}

/* Mobile and portrait tablets */

@media (max-width: 760px) {
  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  main > .hero {
    padding-inline: 16px;
    padding-block: 34px 38px;
  }

  .hero h1 {
    font-size: clamp(42px, 11vw, 58px);
  }

  .hero h2 {
    font-size: clamp(19px, 5.2vw, 24px);
  }

  .hero-metrics {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .featured-project-copy {
    padding: 22px 18px;
  }

  .freelance,
  .form-row,
  .contact-info {
    grid-template-columns: 1fr;
  }
}

/* Small mobile screens */

@media (max-width: 640px) {
  .grid.four,
  .domain-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .service {
    padding: 18px;
  }

  .service .omid-help-photo {
    width: 100% !important;
    height: auto !important;
  }

  .hero-visual {
    min-height: 330px;
  }

  .portrait-frame {
    max-width: min(72%, 285px);
  }

  .section-head :is(h2, h3) {
    font-size: clamp(23px, 6.4vw, 29px);
  }

  .contact-card,
  .contact-form {
    padding: 17px;
  }
}

/* Very small phones */

@media (max-width: 375px) {
  .hero-visual {
    min-height: 295px;
  }

  .float-card {
    min-width: 0;
    max-width: 52%;
  }

  .freelance-actions {
    grid-template-columns: 1fr;
  }
}

/* Accessibility */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}
