:root {
  --bg-main: #f4f4f4;
  --bg-soft: #e7e7e7;
  --text-main: #101010;
  --text-muted: #5b5b5b;
  --accent: #c7b8a2;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
}

/* Accessible focus */
a:focus-visible {
  outline: 2px solid rgba(199, 184, 162, 0.65);
  outline-offset: 3px;
}

/* =========================
   HEADER
   ========================= */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  transition: background-color 0.25s ease, box-shadow 0.25s ease, color 0.25s ease;
  background: transparent;
}

.site-header__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.1rem 1.5rem 0.7rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 0.95rem;
  text-decoration: none;
  color: #ffffff;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.35);
}

.nav {
  display: flex;
  align-items: center;
}

.nav a {
  margin-left: 1.6rem;
  font-size: 0.85rem;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.35);
  transition: color 0.2s ease, opacity 0.2s ease;
}

.nav a:hover {
  opacity: 0.85;
}

/* Header when scrolled */
.site-header.scrolled {
  background-color: rgba(247, 247, 247, 0.97);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.05);
}

.site-header.scrolled .logo {
  color: var(--text-main);
  text-shadow: none;
}

.site-header.scrolled .nav a {
  color: var(--text-muted);
  text-shadow: none;
}

.site-header.scrolled .nav a:hover {
  color: var(--text-main);
  opacity: 1;
}

/* =========================
   HOME HERO
   ========================= */

.hero {
  height: 100vh;
  width: 100%;
  background-image: url("images/hero.webp");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: 65% center; /* desktop framing */
  background-attachment: scroll;   /* default: safe on mobile */
  position: relative;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.55),
    rgba(0, 0, 0, 0.25),
    rgba(0, 0, 0, 0.05)
  );
  display: flex;
  align-items: flex-end;
}

.hero-caption {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

.hero-caption p {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.6rem;
  line-height: 1.6;
  color: #ffffff;
  max-width: 600px;
}

/* Desktop only: allow parallax/fixed background */
@media (min-width: 901px) and (pointer: fine) {
  .hero {
    background-attachment: fixed;
  }
}

/* =========================
   PAGE WRAPPER
   ========================= */

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3.2rem 1.5rem 4rem;
  background-color: var(--bg-main);
}

/* =========================
   SECTION HEADINGS
   ========================= */

.section-heading {
  margin-bottom: 1.5rem;
}

.section-heading h2 {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* =========================
   PROJECTS SECTION (Home)
   ========================= */

.projects-section {
  margin-bottom: 4rem;
  border-top: 1px solid var(--bg-soft);
  padding-top: 2.5rem;
}

.project-preview {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.2fr);
  gap: 2.5rem;
  align-items: center;
  padding: 2.5rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.project-preview:nth-child(odd) .project-preview-image { order: 1; }
.project-preview:nth-child(odd) .project-preview-text  { order: 2; }
.project-preview:nth-child(even) .project-preview-image { order: 2; }
.project-preview:nth-child(even) .project-preview-text  { order: 1; }

.project-preview-image img {
  width: 100%;
  height: auto;
  display: block;
}

.project-preview-text h3 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.9rem;
  margin: 0 0 0.4rem;
}

.project-meta {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-bottom: 0.7rem;
}

.project-description {
  font-size: 0.96rem;
  line-height: 1.7;
  margin-bottom: 0.8rem;
}

.project-link {
  font-size: 0.85rem;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 0.1rem;
  color: var(--text-main);
}

.project-link:hover {
  opacity: 0.8;
}

/* =========================
   ABOUT
   ========================= */

.about-section {
  margin-bottom: 4rem;
  border-top: 1px solid var(--bg-soft);
  padding-top: 2.5rem;
}

.about-body {
  max-width: 620px;
  font-size: 0.98rem;
  line-height: 1.7;
}

.about-body p + p {
  margin-top: 1rem;
}

/* =========================
   CONTACT
   ========================= */

.contact-section {
  margin-bottom: 3rem;
  border-top: 1px solid var(--bg-soft);
  padding-top: 2.5rem;
}

.contact-body {
  font-size: 0.95rem;
  line-height: 1.7;
}

.contact-link {
  color: var(--text-main);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
}

.contact-link:hover {
  opacity: 0.8;
}

.contact-socials {
  margin-top: 0.5rem;
}

.contact-socials a {
  text-decoration: none;
  color: var(--text-muted);
}

.contact-socials a:hover {
  color: var(--text-main);
}

/* =========================
   FOOTER
   ========================= */

.site-footer {
  width: 100%;
  padding: 3rem 0;
  border-top: 1px solid rgba(0,0,0,0.08);
  margin-top: 4rem;
}

.site-footer__inner {
  max-width: 100%;
  text-align: center;
  font-family: "Inter", sans-serif;
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.site-footer__inner p {
  margin: 0;
}

/* =========================
   RESPONSIVE (Mobile portrait)
   - keeps your centered mobile header
   - keeps hero framed on the person
   - keeps projects stacked cleanly
   ========================= */

@media (max-width: 780px) {
  /* Header: center logo + nav */
  .site-header__inner {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.1rem 0.6rem;
  }

  .logo {
    width: 100%;
    text-align: center;
    font-size: 1rem;
  }

  .nav {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.35rem 1.1rem;
  }

  .nav a {
    margin-left: 0;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    line-height: 1.2;
  }

  /* Hero: show the person (your preferred framing) */
  .hero {
    background-position: 90% center;
    height: 88vh;
    min-height: 560px;
  }

  .hero-caption {
    padding: 0 1.1rem 3.2rem;
  }

  .hero-caption p {
    font-size: 1.25rem;
    line-height: 1.5;
    max-width: 32ch;
  }

  .page {
    padding: 2.4rem 1.1rem 3.2rem;
  }

  .project-preview {
    grid-template-columns: 1fr;
    gap: 1.2rem;
    padding: 2rem 0;
  }

  .project-preview-image,
  .project-preview-text {
    order: unset !important;
  }

  .project-preview-text h3 {
    font-size: 1.45rem;
  }

  .projects-section,
  .about-section,
  .contact-section {
    padding-top: 2.1rem;
    margin-bottom: 3.2rem;
  }

  .site-footer {
    margin-top: 3rem;
    padding: 2.4rem 0;
  }
}

@media (max-width: 520px) {
  .hero {
    height: 84vh;
    min-height: 520px;
    background-position: 90% center;
  }

  .hero-caption p {
    font-size: 1.18rem;
    max-width: 30ch;
  }

  .section-heading h2 {
    font-size: 0.95rem;
    letter-spacing: 0.14em;
  }

  .project-link {
    font-size: 0.8rem;
  }
}

/* =========================
   HERO SAFETY (Project/About pages)
   - prevents landscape seam/tiling glitches without forcing crops
   - does NOT override your per-page background-position choices
   ========================= */

.hero,
.project-hero-banner,
.about-hero-banner {
  background-repeat: no-repeat;
  background-size: cover;
}

/* Default safe behavior for mobile/tablet: scroll */
.project-hero-banner,
.about-hero-banner {
  background-attachment: scroll;
}

/* Desktop-only parallax for project/about heroes */
@media (min-width: 901px) and (pointer: fine) {
  .project-hero-banner,
  .about-hero-banner {
    background-attachment: fixed;
  }
}

/* Very short landscape screens: prevent weird “seam” renders */
@media (max-height: 450px) and (orientation: landscape) {
  .project-hero-banner,
  .about-hero-banner,
  .hero {
    height: 100vh !important;
    min-height: 0 !important;
  }
}
