@import url("https://fonts.googleapis.com/css2?family=Barlow:wght@400;600&family=Open+Sans:wght@400;600&display=swap");

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

:root {
  --page-gutter: 20px;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.857;
  color: #5a5a5a;
  background: #fff;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.08);
}

button {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

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

h1, h2, h3, h4, h5, h6 {
  font-family: Barlow, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 600;
  color: #1a1a1a;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Header */
.site-header {
  position: relative;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
}

body.home .site-header {
  border-bottom: 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 100%;
  padding: 2px 35px;
  min-height: 68px;
  position: relative;
}

.logo img {
  max-height: 38px;
  width: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.site-nav a {
  font-size: 16px;
  line-height: 52px;
  color: #1a1a1a;
  padding: 0 16px;
}

.site-nav a:hover,
.site-nav a.active {
  color: #1a1a1a;
}

.nav-email {
  white-space: nowrap;
}

.menu-toggle {
  display: none;
  border: 0;
  background: transparent;
  color: #000;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 8px;
}

/* Homepage hero banner */
.hero-banner {
  position: relative;
  background: 38% 0% / cover no-repeat;
  background-attachment: fixed;
  padding: clamp(120px, 13.54vw, 260px) 0 clamp(104px, 12.5vw, 240px);
}

/* Homepage intro text block */
.intro-block {
  padding: 5% 0 0;
  margin-bottom: 36px;
}

.intro-block-inner {
  padding: 0 var(--page-gutter);
  text-align: center;
}

.intro-block h1 {
  margin: 0 0 42px;
  font-size: clamp(11px, 2.75vw, 72px);
  line-height: 1.15;
  font-weight: 700;
  color: #1a1a1a;
  white-space: nowrap;
  text-transform: capitalize;
}

.intro-block .subtitle {
  margin: 0;
  font-size: clamp(10px, 1.24vw, 32px);
  line-height: 1.45;
  color: #5a5a5a;
  font-family: "Open Sans", sans-serif;
  font-weight: 600;
  white-space: nowrap;
}

.divider {
  border: 0;
  border-top: 1px solid #5a5a5a;
  margin: 0;
  width: 100%;
}

.section-title {
  margin: 0;
  padding: 10px 0 20px var(--page-gutter);
  font-size: 40px;
  line-height: 52px;
  font-weight: 600;
  color: #1a1a1a;
  text-align: left;
}

.page-projects .section-title {
  padding-top: 20px;
  font-size: 24px;
  line-height: 1.2;
}

/* Homepage scroll reveal */
.reveal-on-scroll {
  opacity: 0;
  -webkit-transform: translateY(32px);
  transform: translateY(32px);
  -webkit-transition: opacity 0.75s ease, -webkit-transform 0.75s ease;
  transition: opacity 0.75s ease, transform 0.75s ease;
}

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

.project-item.reveal-on-scroll:nth-child(1) { transition-delay: 0s; }
.project-item.reveal-on-scroll:nth-child(2) { transition-delay: 0.08s; }
.project-item.reveal-on-scroll:nth-child(3) { transition-delay: 0.16s; }
.project-item.reveal-on-scroll:nth-child(4) { transition-delay: 0.24s; }
.project-item.reveal-on-scroll:nth-child(5) { transition-delay: 0.32s; }
.project-item.reveal-on-scroll:nth-child(6) { transition-delay: 0.4s; }

@media (prefers-reduced-motion: reduce) {
  .hero-banner {
    background-attachment: scroll;
  }

  .reveal-on-scroll {
    opacity: 1;
    -webkit-transform: none;
    transform: none;
    -webkit-transition: none;
    transition: none;
  }
}

/* Projects grid */
.projects-section {
  padding-bottom: 48px;
}

.projects-grid {
  display: flex;
  flex-wrap: wrap;
  row-gap: 15px;
  justify-content: flex-start;
  align-content: flex-start;
}

.project-item {
  width: calc(50% - 30px);
  flex: 0 0 calc(50% - 30px);
  max-width: calc(50% - 30px);
}

.project-item:nth-child(odd) {
  margin-left: var(--page-gutter);
  margin-right: 10px;
}

.project-item:nth-child(even) {
  margin-left: 10px;
  margin-right: var(--page-gutter);
}

.project-item img {
  width: 100%;
  height: auto;
}

.project-link {
  display: block;
}

.project-link:hover {
  opacity: 0.92;
}

.project-item h4 {
  margin: 0;
  padding: 0;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 600;
  color: #1a1a1a;
}

/* Projects page */
.page-header {
  padding: 0;
}

/* Practice page */
.practice-layout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 40px 35px 60px;
  gap: 20px;
}

.practice-image {
  flex: 1 1 52%;
  max-width: 56%;
}

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

.practice-text {
  flex: 1 1 40%;
  max-width: 44%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 0 32px 0 16px;
}

.practice-text p {
  margin: 0 0 18px;
  font-size: 18px;
  line-height: 30px;
  text-align: left;
  color: #5a5a5a;
}

.practice-text p:last-child {
  margin-bottom: 0;
}

/* Contact */
.contact-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 30px 40px;
}

.contact-section h3 {
  margin: 0 0 40px;
  font-size: 32px;
  line-height: 1.2;
  font-weight: 600;
  color: #1a1a1a;
}

.contact-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px 48px;
}

.contact-info-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

a.contact-info-link {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  color: inherit;
  text-decoration: none;
}

a.contact-info-link:hover p {
  text-decoration: underline;
}

.contact-icon {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ff5e14;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.contact-info-item h5 {
  margin: 0 0 4px;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 600;
  color: #1a1a1a;
}

.contact-info-item p {
  margin: 0;
  font-size: 16px;
  line-height: 1.857;
  color: #5a5a5a;
}

a.contact-accent {
  color: #ff5e14;
}

a.contact-accent:hover {
  text-decoration: underline;
}

/* Project detail pages */
.project-detail {
  width: 100%;
  margin: 0;
  line-height: 0;
}

.project-detail img {
  width: 100%;
  height: auto;
  display: block;
}

.contact-map {
  width: 100%;
  margin: 0;
  min-height: 320px;
  background: #e8e8e8;
}

.contact-map-iframe {
  display: block;
  width: 100%;
  height: 480px;
  min-height: 320px;
  border: 0;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.contact-map-fallback {
  display: none;
  margin: 0;
  padding: 16px;
  text-align: center;
  background: #e8e8e8;
}

.contact-map-fallback a {
  color: #ff5e14;
  font-weight: 600;
}

.contact-map-fallback a:hover {
  text-decoration: underline;
}

/* Footer */
.site-footer-primary {
  background: #f1f1f1;
  padding: 32px 30px 16px;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-brand img {
  max-width: 200px;
  margin-bottom: 12px;
}

.footer-brand p {
  margin: 0;
  font-size: 16px;
  line-height: 1.857;
  color: #5a5a5a;
}

.footer-contact h2 {
  margin: 0 0 12px;
  font-size: 20px;
  line-height: 1.3;
  font-weight: 600;
  color: #1a1a1a;
}

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

.footer-contact li {
  margin: 0 0 8px;
  font-size: 16px;
  line-height: 1.857;
  color: #000;
}

.footer-contact a:hover {
  text-decoration: underline;
}

.site-footer-copyright {
  background: #f1f1f1;
  padding: 32px 30px;
}

.site-footer-copyright p {
  margin: 0;
  font-size: 16px;
  line-height: 1.857;
  color: #5a5a5a;
  text-align: left;
  max-width: 1200px;
}

/* Tablet: 768px – 976px */
@media (max-width: 976px) and (min-width: 768px) {
  .intro-block h1 {
    white-space: normal;
    font-size: clamp(22px, 3.5vw, 48px);
  }

  .intro-block .subtitle {
    font-size: clamp(14px, 1.8vw, 24px);
  }

  .contact-section {
    padding: 48px 24px 64px;
  }

  .contact-map-iframe {
    height: 400px;
    min-height: 400px;
  }
}

@media (max-width: 976px) {
  .practice-layout {
    flex-direction: column;
    align-items: stretch;
    gap: 24px;
  }

  .practice-image,
  .practice-text {
    max-width: 100%;
    flex: 1 1 100%;
  }

  .practice-image img {
    max-height: none;
    width: 100%;
  }

  .practice-text {
    padding: 0 24px 40px;
  }

  .practice-text p {
    font-size: clamp(16px, 2.4vw + 0.3rem, 18px);
    line-height: 1.65;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 921px) {
  .header-inner {
    padding: 4px 24px;
    min-height: 60px;
  }

  .logo img {
    max-height: 32px;
  }

  .menu-toggle {
    display: block;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
    padding: 8px 0 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav a {
    line-height: 1.4;
    padding: 12px 24px;
    width: 100%;
  }

  .site-header {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    background: #fff;
  }
}

/* Mobile: max 767px */
@media (max-width: 767px) {
  body.home .hero-banner {
    height: 210px;
    min-height: 210px;
    max-height: 210px;
    padding: 0;
    background-attachment: scroll;
    background-position: center top;
    background-size: cover;
  }

  body.home .intro-block {
    display: flex;
    flex-direction: column;
    padding: 0 0 16px;
    margin-bottom: 12px;
  }

  body.home .intro-block-inner {
    padding: 18px var(--page-gutter) 12px;
    text-align: center;
    overflow: visible;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  body.home .intro-block h1 {
    margin: 0;
    padding: 0;
    white-space: normal;
    font-weight: 700;
    font-size: clamp(30px, 7.2vw, 42px);
    line-height: 1.28;
    text-align: center;
    color: #1a1a1a;
  }

  body.home .intro-block .subtitle {
    margin: 0;
    padding: 0;
    white-space: normal;
    font-family: Barlow, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-weight: 600;
    font-size: clamp(17px, 4.4vw, 19px);
    line-height: 1.4;
    text-align: center;
    color: #5a5a5a;
  }

  body.home .intro-block .divider {
    width: calc(100% - 2 * var(--page-gutter));
    margin: 14px auto 0;
    flex-shrink: 0;
  }

  .hero-banner {
    background-attachment: scroll;
    background-position: 51% 2%;
    padding: 160px 24px 104px;
  }

  .intro-block {
    padding: 28px 0 0;
  }

  .intro-block-inner {
    padding: 0;
    text-align: left;
    overflow: visible;
  }

  .intro-block h1 {
    margin: 0 0 18px;
    padding: 0 var(--page-gutter);
    white-space: normal;
    font-weight: 700;
    font-size: clamp(24px, 5vw, 40px);
    line-height: 1.45;
    text-align: left;
    color: #1a1a1a;
  }

  .intro-block .subtitle {
    margin: 0;
    padding: 0 var(--page-gutter);
    white-space: normal;
    font-family: Barlow, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-weight: 600;
    font-size: clamp(16px, 3.8vw, 20px);
    line-height: 1.55;
    text-align: left;
    color: #5a5a5a;
  }

  .projects-grid {
    flex-direction: column;
    row-gap: 15px;
  }

  .project-item,
  .project-item:nth-child(odd),
  .project-item:nth-child(even) {
    width: calc(100% - 2 * var(--page-gutter));
    max-width: calc(100% - 2 * var(--page-gutter));
    flex: 0 0 auto;
    margin-left: var(--page-gutter);
    margin-right: var(--page-gutter);
  }

  .section-title {
    padding: 10px 0 20px var(--page-gutter);
    font-size: clamp(24px, 5vw, 40px);
    line-height: 1.3;
  }

  .page-projects .section-title {
    padding-top: 20px;
    font-size: 24px;
    line-height: 1.2;
  }

  .project-item h4 {
    font-size: clamp(18px, 4vw, 24px);
  }

  .practice-text {
    padding: 0 16px 32px;
  }

  .practice-text p {
    font-size: clamp(15px, 4.2vw, 18px);
    line-height: 1.58;
  }

  .site-footer-primary {
    padding: 32px 24px 16px;
  }

  .footer-inner {
    text-align: center;
  }

  .footer-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .footer-brand p {
    font-size: clamp(17px, 4.2vw, 20px);
  }

  .footer-contact li {
    font-size: clamp(17px, 4.2vw, 20px);
  }

  .site-footer-copyright {
    padding: 24px;
  }

  .site-footer-copyright p {
    font-size: clamp(12px, 3.2vw, 14px);
    text-align: center;
  }

  .contact-section {
    padding: 40px 20px 56px;
  }

  .contact-section h3 {
    margin-bottom: 28px;
    font-size: clamp(24px, 6vw, 32px);
  }

  .contact-info-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .contact-map-iframe {
    height: 320px;
    min-height: 320px;
  }

  .contact-map-fallback {
    display: block;
  }
}

/* Desktop: practice image height & text */
@media (min-width: 977px) {
  .practice-image img {
    max-height: clamp(520px, calc(58vh + 60px), 680px);
  }

  .practice-text p {
    font-size: 20px;
    line-height: 1.65;
  }
}

/* Desktop: full-width projects like WP */
@media (min-width: 768px) {
  .projects-section .projects-grid {
    max-width: 100%;
  }
}

/* Safari / iOS compatibility */
@supports (height: 100dvh) {
  @media (min-width: 977px) {
    .practice-image img {
      max-height: clamp(520px, calc(58dvh + 60px), 680px);
    }
  }
}

@supports (-webkit-touch-callout: none) {
  .hero-banner {
    background-attachment: scroll;
  }

  .contact-map {
    -webkit-overflow-scrolling: touch;
  }

  .contact-map-fallback {
    display: block;
  }
}

@supports (padding: env(safe-area-inset-left)) {
  .header-inner {
    padding-left: max(35px, env(safe-area-inset-left));
    padding-right: max(35px, env(safe-area-inset-right));
  }

  .site-footer-primary,
  .site-footer-copyright {
    padding-left: max(30px, env(safe-area-inset-left));
    padding-right: max(30px, env(safe-area-inset-right));
  }

  @media (max-width: 921px) {
    .header-inner {
      padding-left: max(24px, env(safe-area-inset-left));
      padding-right: max(24px, env(safe-area-inset-right));
    }
  }

  @media (max-width: 767px) {
    .site-footer-primary,
    .site-footer-copyright {
      padding-left: max(24px, env(safe-area-inset-left));
      padding-right: max(24px, env(safe-area-inset-right));
    }
  }
}
