/* ----- Variables (reference style) ----- */
:root {
  --bg: #f5f0ed;
  --text: #363231;
  --text-muted: #5c5655;
  --accent: #a46960;
  --accent-border: #363231;
  --serif: "Lora", Georgia, serif;
  --sans: "Source Sans 3", -apple-system, BlinkMacSystemFont, sans-serif;
  --radius: 1.25rem;
  --radius-sm: 0.75rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

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

/* ----- Header ----- */
.site-header {
  padding: 1.5rem 2rem;
}

.nav {
  max-width: 72rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.25rem;
}

.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-weight: 500;
  color: var(--text-muted);
}

.nav-links a:hover {
  color: var(--text);
}

/* ----- Hero ----- */
.hero {
  max-width: 72rem;
  margin: 0 auto;
  padding: 3rem 2rem 3rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.hero-headline {
  font-family: var(--serif);
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 1rem;
  color: var(--text);
}

.hero-tagline {
  font-size: 1.125rem;
  color: var(--text);
  margin: 0;
  max-width: 42ch;
}

.hero-tagline p {
  margin: 0 0 1rem;
}

.hero-tagline p:last-child {
  margin-bottom: 0;
}

/* Button (reference: rounded, terracotta, thin dark border) */
.btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid var(--accent-border);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(164, 105, 96, 0.35);
}

/* Hero image: rounded frame */
.hero-image-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-image-frame {
  width: 100%;
  max-width: 22rem;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  overflow: hidden;
  background: #e8d5cf;
}

.hero-image-frame--circle {
  aspect-ratio: 1;
  border-radius: 50%;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ----- Sections ----- */
.section {
  max-width: 72rem;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.section-title {
  font-family: var(--serif);
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.section-intro {
  color: var(--text-muted);
  margin: 0 0 2.5rem;
  white-space: nowrap;
}

/* ----- Work grid ----- */
.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: 2rem;
}

.work-card {
  background: #e8d5cf;
  border-radius: var(--radius-sm);
  overflow: hidden;
  padding: 1.5rem 1rem 1.5rem;
  transition: transform 0.2s ease;
}

.work-card:hover {
  transform: translateY(-2px);
}

.work-card[data-modal] {
  cursor: pointer;
}

.work-card-media {
  aspect-ratio: 16 / 10;
  background: #e8d5cf;
  margin-bottom: 1rem;
  overflow: hidden;
}

.work-card-media img,
.work-card-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.work-media-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.work-card-title {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
}

.work-card-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}

.work-card-desc {
  font-size: 0.95rem;
  color: var(--text);
  margin: 0 0 0.75rem;
  line-height: 1.5;
}

.work-card-link {
  margin: 0;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--accent);
}

.work-card-link:hover {
  text-decoration: underline;
}

/* ----- About ----- */
.about-content {
  max-width: 42ch;
}

.about-text {
  margin: 0 0 1rem;
  color: var(--text);
}

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

/* ----- Contact ----- */
.contact-text {
  margin: 0 0 0.5rem;
  color: var(--text-muted);
}

.link-email {
  font-weight: 600;
  color: var(--accent);
}

.link-email:hover {
  text-decoration: underline;
}

/* ----- Modals ----- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal--open {
  opacity: 1;
  visibility: visible;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(54, 50, 49, 0.4);
  cursor: pointer;
}

.modal-box {
  position: relative;
  width: 100%;
  max-width: 36rem;
  max-height: 90vh;
  overflow: auto;
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(54, 50, 49, 0.2);
  padding: 2rem 2rem 2.5rem;
}

.modal-box--compact {
  max-width: 24rem;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 1.75rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.modal-close:hover {
  color: var(--text);
  background: rgba(0, 0, 0, 0.06);
}

.modal-title {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 2.5rem 1.25rem 0;
  color: var(--text);
}

.modal-media {
  aspect-ratio: 16 / 10;
  background: #e8d5cf;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.modal-media img,
.modal-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-media-wrapper {
  margin-bottom: 1.5rem;
}

.modal-media-wrapper .modal-media {
  margin-bottom: 0.5rem;
}

.modal-media-link {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 10rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.modal-media-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(54, 50, 49, 0.15);
}

.modal-media-link img {
  width: 100%;
  height: 100%;
  min-height: 10rem;
  object-fit: cover;
}

.modal-media-cta {
  display: inline-block;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--accent);
}

.modal-media-cta:hover {
  text-decoration: underline;
}

.modal-media-placeholder {
  width: 100%;
  height: 100%;
  min-height: 10rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

.modal-body {
  font-size: 1rem;
  color: var(--text);
}

.modal-body p,
.modal-body ul {
  margin: 0 0 1rem;
}

.modal-body ul {
  padding-left: 1.25rem;
}

.modal-body li {
  margin-bottom: 0.5rem;
}

.case-label {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 1.5rem 0 0.35rem;
}

.case-label:first-child {
  margin-top: 0;
}

.case-skills {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(54, 50, 49, 0.12);
  font-size: 0.95rem;
  color: var(--text-muted);
}

.modal-coming-soon {
  margin: 0;
  color: var(--text-muted);
}

/* ----- Footer ----- */
.site-footer {
  padding: 2rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.site-footer p {
  margin: 0;
}

/* ----- Responsive ----- */
@media (max-width: 768px) {
  .section-intro {
    white-space: normal;
  }

  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    min-height: auto;
    padding-bottom: 4rem;
  }

  .hero-tagline {
    max-width: none;
    margin-left: auto;
    margin-right: auto;
  }

  .hero-image-wrap {
    order: -1;
  }

  .hero-image-frame {
    max-width: 18rem;
    margin: 0 auto;
  }

  .nav-links {
    gap: 1.25rem;
  }

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

  .modal {
    padding: 1rem;
  }

  .modal-box {
    max-height: 85vh;
    padding: 1.5rem 1.5rem 2rem;
  }

  .modal-title {
    font-size: 1.25rem;
    margin-right: 2.25rem;
  }
}
