/* ─────────────────────────────────────────────────────────────────
   Simple dark portfolio — Prata
   ───────────────────────────────────────────────────────────────── */

:root {
  --bg: #0d0d0d;
  --bg-elevated: #161616;
  --fg: #e8e6e3;
  --fg-muted: #8b8685;
  --accent: #fa9e65;
  --border: rgba(255, 255, 255, 0.06);
  --font-body: "Instrument Sans", sans-serif;
  --font-display: "Prata", serif;
  /* Dark pastel section palette */
  --section-hero: #1a1b24;
  --section-about: #24222a;
  --section-experience: #20232b;
  --section-projects: #1e2424;
  --section-contact: #2a2524;
}

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

html {
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  font-family: var(--font-body);
  background: var(--section-hero);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  min-height: 100%;
}

body.menu-open {
  overflow: hidden;
}

h1, h2, h3, .nav-logo {
  font-family: var(--font-display);
}

/* Hide scrollbar on html (the document scroll container) */
html {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar {
  display: none;
}

/* ─── Navigation ─── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  background: var(--section-hero);
  transition: background 0.25s ease;
}

.nav[data-section="home"] {
  background: var(--section-hero);
}

.nav[data-section="about"] {
  background: var(--section-about);
}

.nav[data-section="experience"] {
  background: var(--section-experience);
}

.nav[data-section="projects"] {
  background: var(--section-projects);
}

.nav[data-section="project"] {
  background: var(--section-projects);
}

.nav[data-section="contact"] {
  background: var(--section-contact);
}

.nav-logo {
  position: relative;
  z-index: 101;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--fg);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-toggle {
  display: none;
  position: relative;
  z-index: 101;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 1.4rem;
  height: 1px;
  margin: 0.28rem auto;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-links a {
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--fg);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

@media (max-width: 640px) {
  .nav {
    padding: clamp(0.9rem, 2.8vw, 1.1rem);
  }

  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: clamp(1rem, 2.2svh, 1.5rem);
    padding: clamp(5.75rem, 11svh, 7rem) 1.5rem 2rem;
    background: inherit;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
  }

  .nav-links a {
    font-size: 1.4rem;
    letter-spacing: 0.04em;
  }

  .nav.nav-open .nav-links {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .nav.nav-open .nav-toggle span:nth-child(1) {
    transform: translateY(0.38rem) rotate(45deg);
  }

  .nav.nav-open .nav-toggle span:nth-child(2) {
    opacity: 0;
  }

  .nav.nav-open .nav-toggle span:nth-child(3) {
    transform: translateY(-0.38rem) rotate(-45deg);
  }
}

/* ─── Scroll container (snap sections) ─── */
/* Removed scroll-snap and custom container */
.scroll-container {
  /* Let body scroll naturally */
}

.section {
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 100vh;
  padding: 6rem 2rem 4rem;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 3rem;
  align-items: center;
  max-width: 100%;
  margin: 0 auto;
  overflow: hidden;
  isolation: isolate;
  /* Ensure backgrounds cover previous sections */
  background: inherit;
  
  /* Scroll Snap */
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

/* Full-width section backgrounds (no black on sides) */
.section::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.section-hero {
  z-index: 1;
  align-items: center;
  background: var(--section-hero);
}

.section-hero::before {
  background: var(--section-hero);
}

.section#about {
  z-index: 2;
  background: var(--section-about);
}

.section#about::before {
  background: var(--section-about);
}

.section#experience {
  z-index: 3;
  background: var(--section-experience);
}

.section#experience::before {
  background: var(--section-experience);
}

.section#projects {
  z-index: 4;
  background: var(--section-projects);
}

.section#projects::before {
  background: var(--section-projects);
}

.section#contact {
  z-index: 5;
  background: var(--section-contact);
}

.section#contact::before {
  background: var(--section-contact);
}

.section-side {
  /* No longer sticky inside section, section itself is sticky */
  padding-right: 2rem;
}

.section-content {
  padding-top: 0.5rem;
  padding-bottom: 0;
  /* Allow scrolling inside content if needed */
  max-height: 80vh;
  overflow-y: auto;
  /* Hide scrollbar */
  scrollbar-width: none;
}

.section-content::-webkit-scrollbar {
  display: none;
}

@media (max-width: 900px) {
  .section {
    grid-template-columns: 1fr;
    min-height: 100vh;
    align-content: start;
    align-items: start;
    gap: 1.75rem;
  }
  .section-side {
    position: static;
    padding-right: 0;
  }

  .section-content {
    max-height: none;
    overflow: visible;
    padding-top: 0;
  }
}

@media (max-width: 640px) {
  .section {
    position: relative;
    top: auto;
    height: auto;
    min-height: 100svh;
    overflow: visible;
    padding: clamp(5.35rem, 11svh, 6.75rem) 1rem clamp(1.7rem, 4.5svh, 2.7rem);
    gap: clamp(0.85rem, 2svh, 1.35rem);
  }

  .section-side {
    padding-top: clamp(0.2rem, 0.7svh, 0.55rem);
  }

  .section-content {
    padding-bottom: 0;
  }
}

/* ─── Hero ─── */
.section-hero .section-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-bottom: 0;
}

.hero-label {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #ffffff;
  margin-bottom: 1rem;
}

.hero-title {
  color: #ffffff;
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: 1.35rem;
  line-height: 1.6;
  color: #ffffff;
  max-width: 32rem;
  margin-bottom: 2rem;
}

.hero-cta {
  display: inline-block;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 0.2rem;
  transition: opacity 0.2s ease;
}

.hero-cta:hover {
  opacity: 0.8;
}

/* ─── Section titles ─── */
.section-title {
  font-size: clamp(3rem, 10vw, 8rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  color: #ffffff;
  line-height: 0.9;
}

/* ─── About ─── */
.about-content p {
  font-size: 1.35rem;
  line-height: 1.7;
  color: var(--fg);
  margin-bottom: 1.25rem;
}

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

/* ─── Experience ─── */
.experience-list {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.experience-item {
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
}

.experience-item:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.experience-item h3 {
  font-size: 1.55rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.experience-item p {
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--fg);
  margin-bottom: 0.35rem;
}

.experience-period {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.experience-note {
  margin-top: 1.5rem;
  font-size: 1rem;
  color: var(--fg-muted);
}

.experience-note a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

/* ─── Projects ─── */
.work-list {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.work-item {
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}

.work-link {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.work-link:hover {
  opacity: 0.92;
  transform: translateY(-2px);
}

.work-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.work-item h3 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.work-item p {
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--fg-muted);
  margin-bottom: 0.5rem;
}

.work-tags {
  display: block;
  margin-top: 0.8rem;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  opacity: 0.8;
}

.work-cta {
  display: inline-block;
  margin-top: 0.2rem;
  margin-bottom: 0;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.2rem;
}

/* ─── Contact ─── */
.section-contact {
  min-height: 100vh;
}

.contact-intro {
  font-size: 1.2rem;
  color: var(--fg-muted);
  margin-bottom: 1.5rem;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.contact-links a {
  font-size: 1.25rem;
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
  width: fit-content;
}

.contact-links a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.footer {
  margin-top: 4rem;
  padding-top: 2rem;
  font-size: 0.9rem;
  color: var(--fg-muted);
  letter-spacing: 0.05em;
}

/* ─── Scroll progress bar ─── */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: var(--accent);
  z-index: 101;
  transform-origin: left;
  width: 0%;
}

/* ─── Project page ─── */
.page-project {
  background: var(--section-projects);
}

.project-page {
  min-height: 100vh;
  padding: 8rem 2rem 4rem;
  background: var(--section-projects);
}

.project-hero,
.project-section,
.project-footer,
.project-showcase {
  max-width: 1200px;
  margin: 0 auto;
}

.project-hero {
  padding: 4rem 0 3rem;
  border-bottom: 1px solid var(--border);
}

.project-subtitle {
  max-width: 42rem;
  font-size: 1.3rem;
  line-height: 1.7;
  color: var(--fg-muted);
  margin-top: 1.5rem;
}

.project-showcase {
  padding: 3rem 0 0;
}

.project-shot {
  margin: 0;
}

.project-shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 1.25rem;
  border: 1px solid var(--border);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.28);
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2rem;
}

.project-meta span {
  padding: 0.7rem 1rem;
  border: 1px solid var(--border);
  color: var(--fg);
  background: rgba(255, 255, 255, 0.03);
}

.project-meta-bottom {
  margin-top: 0;
}

.project-section {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2rem;
  padding: 3rem 0;
  border-bottom: 1px solid var(--border);
}

.project-section-single {
  grid-template-columns: 1fr;
}

.project-heading {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  margin-bottom: 1rem;
}

.project-copy p {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--fg-muted);
  margin-bottom: 1rem;
  max-width: 40rem;
}

.project-copy p:last-child {
  margin-bottom: 0;
}

.project-downloads {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 0;
  border-bottom: 1px solid var(--border);
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 4rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--accent);
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.download-button:hover {
  background: var(--accent);
  color: #161616;
}

.project-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 2rem;
  color: var(--fg-muted);
}

.project-footer a {
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.project-footer a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

@media (max-width: 900px) {
  .project-section {
    grid-template-columns: 1fr;
  }

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

  .project-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .project-page {
    padding: 6rem 1.25rem 3rem;
  }

  .project-hero {
    padding-top: 2rem;
  }

  .project-subtitle {
    font-size: 1.15rem;
  }
}

@media (max-width: 640px) {
  .hero-label {
    font-size: clamp(0.72rem, 2vw, 0.8rem);
    margin-bottom: clamp(0.55rem, 1.4svh, 0.8rem);
  }

  .hero-title {
    font-size: clamp(2.15rem, 8.6vw, 2.65rem);
    line-height: 1.05;
  }

  .hero-subtitle {
    font-size: clamp(1.04rem, 4.2vw, 1.22rem);
    line-height: 1.5;
    margin-bottom: clamp(1.1rem, 2.8svh, 1.7rem);
  }

  .hero-cta {
    font-size: clamp(0.9rem, 3vw, 1rem);
  }

  .section-title {
    font-size: clamp(2.4rem, 9.4vw, 3.1rem);
    line-height: 0.95;
  }

  .about-content p {
    font-size: clamp(1.03rem, 3.9vw, 1.12rem);
    line-height: 1.55;
    margin-bottom: clamp(0.7rem, 1.7svh, 1rem);
  }

  .experience-list {
    gap: clamp(0.45rem, 1.2svh, 0.9rem);
  }

  .experience-item {
    padding-bottom: clamp(0.55rem, 1.35svh, 1rem);
  }

  .experience-item h3 {
    font-size: clamp(1.12rem, 4.2vw, 1.26rem);
  }

  .work-item h3 {
    font-size: clamp(1.08rem, 4vw, 1.2rem);
  }

  .experience-item p,
  .work-item p,
  .contact-intro {
    font-size: clamp(0.98rem, 3.7vw, 1.05rem);
    line-height: 1.45;
  }

  .section-content {
    padding-bottom: 0;
  }

  .experience-period,
  .work-tags,
  .experience-note,
  .footer {
    font-size: clamp(0.8rem, 2.8vw, 0.88rem);
  }

  .contact-links a {
    font-size: clamp(1.03rem, 3.9vw, 1.16rem);
  }
}

@media (max-width: 640px) {
  .nav,
  .nav[data-section="home"],
  .nav[data-section="about"],
  .nav[data-section="experience"],
  .nav[data-section="projects"],
  .nav[data-section="project"],
  .nav[data-section="contact"],
  .section,
  .section::before,
  .section-hero,
  .section-hero::before,
  .section#about,
  .section#about::before,
  .section#experience,
  .section#experience::before,
  .section#projects,
  .section#projects::before,
  .section#contact,
  .section#contact::before,
  .page-project,
  .project-page {
    background: var(--section-hero);
  }
}
