:root {
  --bg: #f5f5f0;
  --text: #0f0f0f;
  --muted: #6f6f6f;
  --accent: #fc5c65;
  --accent-dark: #d94848;
  --card: #fffefa;
  --border: #e2e0d5;
  --shadow: 0 30px 60px rgba(15, 15, 15, 0.12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Space Grotesk', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

img {
  max-width: 100%;
  display: block;
  border-radius: 1rem;
}

.container {
  width: min(1200px, 90vw);
  margin: 0 auto;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.lede {
  font-size: 1.1rem;
  color: var(--muted);
}

.subhead {
  color: var(--muted);
  font-size: 0.9rem;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  line-height: 1.1;
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
}

button,
.main-nav a,
.footer-links a,
.hero .cta-group button {
  font: inherit;
}

.site-header {
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  background: rgba(245, 245, 240, 0.9);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  gap: 1rem;
}

.branding {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.branding-link {
  text-decoration: none;
  color: inherit;
}

.branding-link:hover {
  opacity: 0.8;
}

.logo-name {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.logo-image {
  width: 84px;
  height: 84px;
  object-fit: contain;
  border-radius: 0;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.18));
}

.tagline {
  font-size: 0.75rem;
  color: var(--muted);
}

.main-nav {
  display: flex;
  gap: 1.5rem;
  margin-left: auto;
  margin-right: 2rem;
}

.main-nav a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
}

.cta-group {
  display: flex;
  gap: 0.75rem;
}

.hero .cta-group {
  margin: 3rem 0;
  gap: 1.25rem;
}

.hero .cta-group button,
.hero .cta-group a {
  padding: 1.15rem 2.25rem;
  font-size: 1.1rem;
}

button.primary {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.85rem 1.75rem;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: var(--shadow);
}

button.primary:hover {
  transform: translateY(-1px);
  background: var(--accent-dark);
}

button.ghost,
a.ghost {
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 0.85rem 1.5rem;
  background: transparent;
  cursor: pointer;
  display: inline-block;
  text-decoration: none;
  color: inherit;
  font: inherit;
  text-align: center;
  transition: all 0.2s ease;
}

a.ghost:hover {
  background: var(--card);
}

.primary.full-width {
  width: 100%;
  text-align: center;
}

.hero {
  position: relative;
  padding: 6rem 0 5rem;
  overflow: hidden;
  min-height: 80vh;
  display: flex;
  align-items: center;
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr;
  z-index: 0;
}

.hero-bg-image {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.hero-bg-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.5;
  filter: none;
  transition: opacity 0.3s ease;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(245, 245, 240, 0.2) 0%, rgba(245, 245, 240, 0.3) 100%);
  z-index: 1;
}

.hero .container {
  position: relative;
  z-index: 2;
}

.hero-copy {
  max-width: 800px;
}

.hero-copy h1 {
  font-size: clamp(3.5rem, 8vw, 7rem);
  line-height: 1;
  margin-bottom: 2.5rem;
  letter-spacing: -0.02em;
  font-weight: 700;
}


.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}

.metric {
  font-size: 2.5rem;
  font-weight: 700;
}


.services {
  padding: 4rem 0;
}

.service-list {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  margin-top: 3rem;
}

.service-item {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

/* Normal layout: content left, image right */
.service-content {
  order: 1;
}

.service-image {
  order: 2;
}

/* Reverse layout: image left, content right */
.service-item-reverse .service-image {
  order: 1;
}

.service-item-reverse .service-content {
  order: 2;
}

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

.service-content h3 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.service-content ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.service-content li {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.service-image {
  width: 100%;
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateX(80px);
  transition: opacity 1s ease-out, transform 1s ease-out;
}

/* For reverse layout (image on left), slide from left */
.service-item-reverse .service-image {
  transform: translateX(-80px);
}

.service-image.slide-in {
  opacity: 1;
  transform: translateX(0);
}

.service-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  aspect-ratio: 4 / 3;
}

.pillars {
  padding: 3rem 0;
}

.pillars .container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.pillar-card {
  padding: 1.5rem;
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: #fefefe;
}

.about-block {
  padding: 4rem 0;
}

.about-card {
  background: var(--text);
  color: var(--bg);
  padding: 3rem;
  border-radius: 2rem;
  box-shadow: var(--shadow);
}

.about-card h2 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1.1;
  text-transform: uppercase;
  margin-bottom: 2rem;
}

.about-copy {
  max-width: 720px;
  font-size: 1.05rem;
  line-height: 1.8;
}

.about-copy p + p {
  margin-top: 1rem;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 2rem 1rem;
  box-sizing: border-box;
}

.modal[aria-hidden="false"] {
  display: flex;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.modal-content {
  position: relative;
  background: #fffefa;
  padding: 2rem;
  border-radius: 1.5rem;
  width: min(560px, 92vw);
  max-height: calc(100vh - 4rem);
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.2);
  z-index: 1;
  color: #0f0f0f;
  overflow-y: auto;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #0f0f0f;
}

.contact-form {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.contact-form label {
  display: grid;
  gap: 0.35rem;
  font-weight: 500;
}

.contact-form input[type='text'],
.contact-form input[type='email'] {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  font: inherit;
}

.contact-form textarea {
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 0.85rem 1rem;
  min-height: 120px;
  font: inherit;
  resize: vertical;
}

.contact-form fieldset {
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1rem;
  display: grid;
  gap: 0.75rem;
}

.form-helper {
  font-size: 0.85rem;
  color: var(--muted);
}

.contact-form legend {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.contact-form fieldset label {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-weight: 500;
}

.thankyou-modal {
  max-width: 520px;
  text-align: center;
}

.thankyou-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.thankyou-body h3 {
  font-size: 1.8rem;
  max-width: 32rem;
  margin: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.faq {
  padding: 4rem 0 5rem;
}

.faq .container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.faq-item {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  background: white;
  margin-bottom: 1rem;
  display: grid;
  gap: 0.5rem;
  font-weight: 500;
}

.faq-item p {
  display: none;
  color: var(--muted);
  font-weight: 400;
}

.faq-item[aria-expanded="true"] p {
  display: block;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.footer-links {
  display: flex;
  gap: 1rem;
}

.footer-links a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
}

.portfolio-section {
  padding: 4rem 0;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.portfolio-grid figure {
  background: var(--card);
  padding: 1rem;
  border-radius: 1.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.portfolio-grid .media-container {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 1rem;
  background: var(--border);
}

.portfolio-grid .media-container img,
.portfolio-grid .media-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 1rem;
}

.portfolio-grid figcaption {
  margin-top: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
}

@media (max-width: 720px) {
  .site-header .container,
  .cta-group {
    flex-wrap: wrap;
  }

  .hero-metrics {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

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

  .hero-background {
    grid-template-columns: 1fr;
  }

  .service-item {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .service-item-reverse {
    direction: ltr;
  }

  .service-image img {
    aspect-ratio: 16 / 9;
  }

  .hero-bg-image {
    display: none;
  }

  .hero-background .hero-bg-image:first-child {
    display: block;
  }
}

/* Case Modal Styles */
.case-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.case-modal[aria-hidden="false"] {
  display: flex;
}

.case-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
}

.case-modal-content {
  position: relative;
  background: #fffefa;
  border-radius: 1.5rem;
  width: min(1200px, 95vw);
  height: min(90vh, 800px);
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.3);
  z-index: 1;
  color: #0f0f0f;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.case-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: #0f0f0f;
  z-index: 10;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s ease;
}

.case-modal-close:hover {
  background: rgba(0, 0, 0, 0.1);
}

.case-modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 100%;
  gap: 2rem;
  padding: 2rem;
  overflow: hidden;
}

.case-media-viewer {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  border-radius: 1rem;
  overflow: hidden;
  min-height: 0;
}

.media-container-wrapper {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
}

.media-slider {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.3s ease;
}

.media-item {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-item img,
.media-item video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0.5rem;
}

.media-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.9);
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
  color: var(--text);
}

.media-nav:hover {
  background: rgba(255, 255, 255, 1);
  transform: translateY(-50%) scale(1.1);
}

.media-nav-prev {
  left: 1rem;
}

.media-nav-next {
  right: 1rem;
}

.media-indicator {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  z-index: 5;
}

.case-description {
  overflow-y: auto;
  padding-right: 0.5rem;
}

.case-description h3 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.case-description h4 {
  font-size: 1.25rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.case-description p {
  margin-bottom: 1rem;
  line-height: 1.7;
  color: var(--muted);
}

.case-description ul {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.case-description li {
  margin-bottom: 0.5rem;
  color: var(--muted);
  line-height: 1.6;
}

.portfolio-item {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.portfolio-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* iPhone viewer styles - iPhone 17 design */
.iphone-viewer {
  background: linear-gradient(145deg, #2a2a2a 0%, #1a1a1a 100%);
  border-radius: 3.5rem;
  padding: 0.5rem;
  box-shadow: 
    0 0 0 3px rgba(255, 255, 255, 0.1),
    0 0 0 1px rgba(0, 0, 0, 0.3),
    0 30px 80px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  max-width: 320px;
  width: 100%;
  margin: 0 auto;
  aspect-ratio: 9 / 19.5;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.iphone-viewer::before {
  display: none;
}

.iphone-viewer::after {
  content: '';
  position: absolute;
  bottom: 0.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 130px;
  height: 4px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  z-index: 2;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

.iphone-viewer .media-container-wrapper {
  border-radius: 2.75rem;
  overflow: hidden;
  background: #ffffff;
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 0.5rem;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.iphone-viewer .media-item {
  background: #ffffff;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.iphone-viewer .iphone-screen-image {
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 16;
  object-fit: contain;
  border-radius: 0;
  display: block;
}

.iphone-viewer .media-nav {
  background: transparent;
  color: rgba(255, 255, 255, 0);
  border: 1px solid transparent;
  backdrop-filter: blur(0px);
  box-shadow: none;
  opacity: 0;
  transition: opacity 0.3s ease, background 0.3s ease, color 0.3s ease, border 0.3s ease, backdrop-filter 0.3s ease, box-shadow 0.3s ease;
}

.iphone-viewer:hover .media-nav {
  opacity: 1;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.iphone-viewer .media-nav:hover {
  background: rgba(0, 0, 0, 0.85);
  transform: translateY(-50%) scale(1.05);
}

.iphone-viewer .media-indicator {
  background: transparent;
  border: 1px solid transparent;
  backdrop-filter: blur(0px);
  box-shadow: none;
  color: rgba(255, 255, 255, 0);
  opacity: 0;
  transition: opacity 0.3s ease, background 0.3s ease, border 0.3s ease, backdrop-filter 0.3s ease, box-shadow 0.3s ease, color 0.3s ease;
}

.iphone-viewer:hover .media-indicator {
  opacity: 1;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  color: white;
}

@media (max-width: 960px) {
  .case-modal-body {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem;
  }

  .case-media-viewer {
    min-height: 300px;
  }

  .case-description {
    max-height: 300px;
  }

  .iphone-viewer {
    max-width: 280px;
    max-height: 70vh;
  }
}
