/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

:target,
section[id] {
  scroll-margin-top: 5rem;
}

::selection {
  background: rgba(255, 255, 255, 0.2);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #6a6a6a;
  color: #f3ede4;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("../img/canvas-texture.webp");
  background-size: 200px 200px;
  background-repeat: repeat;
  opacity: 0.04;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 1;
}

body > * {
  position: relative;
  z-index: 2;
}

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

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

/* ===== Focus ===== */
:focus-visible {
  outline: 2px solid #d9c8b8;
  outline-offset: 3px;
}

/* ===== Skip Link ===== */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 1000;
  padding: 0.75rem 1.5rem;
  background: #efe5d8;
  color: #4b4b4b;
  border-radius: 0 0 0.5rem 0.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
}

/* ===== Header / Nav ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(106, 106, 106, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav__container {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  transition: opacity 0.25s ease;
  flex-shrink: 0;
}

.nav__logo img {
  height: 44px;
  width: auto;
  display: block;
}

.nav__logo:hover {
  opacity: 0.85;
}

/* Hamburger toggle (mobile) */
.nav__toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 22px;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  z-index: 110;
}

.nav__toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  background: #efe5d8;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform-origin: center;
}

.nav.is-open .nav__toggle-bar:nth-child(1) {
  transform: translateY(10px) rotate(45deg);
}
.nav.is-open .nav__toggle-bar:nth-child(2) {
  opacity: 0;
}
.nav.is-open .nav__toggle-bar:nth-child(3) {
  transform: translateY(-10px) rotate(-45deg);
}

.nav__list {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(20, 20, 20, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

.nav.is-open .nav__list {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav__list a {
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: rgba(246, 241, 234, 0.85);
  transition: color 0.25s ease;
}

.nav__list a:hover {
  color: #f3ede4;
}

/* ===== Shared ===== */
.label {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.35em;
  color: #d9c8b8;
}

.section-ornament {
  display: block;
  width: 240px;
  height: 24px;
  margin-bottom: 1.5rem;
  color: #d9c8b8;
  opacity: 0.85;
}

.hero__text .section-ornament,
.gallery__header .section-ornament,
.education__intro .section-ornament,
.achievements__header .section-ornament {
  margin-left: 0;
}

.contact__card .section-ornament {
  margin-left: auto;
  margin-right: auto;
}

.section-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3.25rem);
  margin-top: 1rem;
  line-height: 1.15;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn:hover {
  transform: scale(1.02);
}

.btn--primary {
  background: #efe5d8;
  color: #4b4b4b;
  border-color: rgba(239, 229, 216, 0.4);
}

.btn--primary:hover {
  background: #f6f1ea;
}

.btn--outline {
  background: transparent;
  color: #f6f1ea;
  border-color: rgba(255, 255, 255, 0.3);
}

.btn--outline:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  min-height: 100dvh;
}

.hero__container {
  max-width: 80rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 3rem;
  padding: 6rem 1.5rem 4rem;
  min-height: 100vh;
  min-height: 100dvh;
}

.hero__text {
  order: 2;
}

.hero__title {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 400;
  font-size: clamp(3.5rem, 10vw, 6rem);
  line-height: 0.9;
}

.hero__subtitle {
  margin-top: 1.25rem;
  max-width: 36rem;
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  line-height: 1.8;
  color: rgba(246, 241, 234, 0.85);
  font-weight: 300;
}

.hero__actions {
  margin-top: 2.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.hero__portrait {
  order: 1;
}

.portrait-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  max-width: 36rem;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.75rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(8px);
}

.portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 1.5rem;
}

.portrait-caption {
  position: absolute;
  left: 2rem;
  right: 2rem;
  bottom: 2rem;
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.portrait-caption__label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: #e4d5c7;
}

.portrait-caption__text {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.9);
}

.hero__glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.14), transparent 28%),
    radial-gradient(circle at bottom left, rgba(255, 255, 255, 0.08), transparent 30%);
}

/* ===== Gallery ===== */
.gallery {
  padding: 6rem 0;
}

.gallery__container {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.gallery__header {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.gallery__description {
  max-width: 40rem;
  font-size: 1rem;
  line-height: 1.75;
  color: rgba(246, 241, 234, 0.75);
  font-weight: 300;
}

.gallery__grid {
  columns: 1;
  column-gap: 1.5rem;
}

.painting-card {
  overflow: hidden;
  border-radius: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  break-inside: avoid;
  margin-bottom: 1.5rem;
  display: block;
}

.painting-card__image {
  position: relative;
  overflow: hidden;
  display: block;
  width: 100%;
  text-align: left;
  padding: 0;
}

.painting-card__image img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.7s ease;
}

.painting-card:hover .painting-card__image img {
  transform: scale(1.05);
}

.painting-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.1) 40%, transparent);
  opacity: 0.8;
  pointer-events: none;
}

.painting-card__info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.25rem;
}

.painting-card__title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 400;
}

.painting-card__meta {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.75);
}

/* ===== About ===== */
.about {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: #646464;
}

.about__container {
  max-width: 80rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  padding: 6rem 1.5rem;
}

.about__image {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.about__frame {
  overflow: hidden;
  border-radius: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.75rem;
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.2);
}

.about__frame--secondary {
  max-width: 75%;
  align-self: flex-end;
  margin-top: -3rem;
  position: relative;
  z-index: 2;
}

.about__frame img {
  aspect-ratio: 4 / 5;
  width: 100%;
  object-fit: cover;
  border-radius: 1.5rem;
}

.about__text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.about__body {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  font-size: 1.125rem;
  line-height: 1.8;
  color: rgba(246, 241, 234, 0.85);
  font-weight: 300;
}

.about__quote {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 1.35rem;
  line-height: 1.5;
  color: #e4d5c7;
  border-left: 2px solid rgba(217, 200, 184, 0.5);
  padding-left: 1.25rem;
}

/* ===== Education ===== */
.education {
  padding: 6rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top left, rgba(239, 229, 216, 0.08), transparent 28%),
    linear-gradient(180deg, #68635f 0%, #5f5a56 100%);
}

.education__container,
.achievements__container {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.education__container {
  display: grid;
  gap: 2rem;
}

.education__intro,
.achievements__header {
  max-width: 46rem;
}

.education__lead,
.achievements__lead {
  margin-top: 1.5rem;
  font-size: 1.05rem;
  line-height: 1.8;
  color: rgba(246, 241, 234, 0.8);
  font-weight: 300;
}

.education__timeline {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.timeline-card,
.achievement-card,
.contact-link {
  border-radius: 1.75rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.35);
}

.timeline-card {
  padding: 1.5rem;
}

.timeline-card__period,
.achievement-card__year,
.contact-link__label {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: #d9c8b8;
}

.timeline-card__title {
  margin-top: 0.9rem;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5rem;
  line-height: 1.2;
  font-weight: 400;
}

.timeline-card__meta {
  margin-top: 0.75rem;
  font-size: 0.98rem;
  line-height: 1.7;
  color: rgba(246, 241, 234, 0.78);
}

/* ===== Achievements ===== */
.achievements {
  padding: 6rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.achievements__grid {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.achievement-card {
  padding: 1.5rem;
}

.achievement-card__text {
  margin-top: 0.9rem;
  font-size: 1rem;
  line-height: 1.75;
  color: rgba(246, 241, 234, 0.84);
}

.achievement-card__list {
  margin: 0.9rem 0 0;
  padding-left: 1.1rem;
  list-style: disc;
  display: grid;
  gap: 0.55rem;
}

.achievement-card__list li {
  font-size: 0.95rem;
  line-height: 1.65;
  color: rgba(246, 241, 234, 0.84);
}

.achievement-card__list li::marker {
  color: rgba(217, 200, 184, 0.55);
}

.achievement-card__link {
  color: #efe5d8;
  border-bottom: 1px solid rgba(217, 200, 184, 0.4);
  transition: border-color 0.25s ease, color 0.25s ease;
}

.achievement-card__link:hover {
  color: #fff;
  border-bottom-color: rgba(243, 237, 228, 0.8);
}

/* ===== Contact ===== */
.contact {
  padding: 6rem 0;
}

.contact__container {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.contact__card {
  border-radius: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  padding: 3rem 2rem;
  text-align: center;
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.contact__description {
  margin: 1.5rem auto 0;
  max-width: 40rem;
  font-size: 1.125rem;
  line-height: 1.8;
  color: rgba(246, 241, 234, 0.8);
  font-weight: 300;
}

.contact__grid {
  margin-top: 2.5rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.contact-link {
  display: block;
  padding: 1.4rem 1.5rem;
  text-align: left;
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.contact-link:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

.contact-link__value {
  display: block;
  margin-top: 0.85rem;
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(246, 241, 234, 0.92);
  word-break: break-word;
}

/* ===== Lightbox ===== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.lightbox[hidden] {
  display: none;
}

.lightbox.active {
  opacity: 1;
}

.lightbox__close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  padding: 0.5rem;
  color: rgba(255, 255, 255, 0.8);
  transition: color 0.2s;
  z-index: 10;
}

.lightbox__close:hover {
  color: #fff;
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  padding: 1rem;
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.2s;
  z-index: 10;
}

.lightbox__nav:hover {
  color: #fff;
}

.lightbox__nav--prev {
  left: 1rem;
}

.lightbox__nav--next {
  right: 1rem;
}

.lightbox__content {
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox__img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 0.5rem;
  transition: opacity 0.3s ease;
}

.lightbox__caption {
  margin-top: 1rem;
  text-align: center;
}

.lightbox__title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5rem;
}

.lightbox__meta {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.6);
}

.lightbox__cta {
  display: inline-block;
  margin-top: 1.25rem;
  padding: 0.7rem 1.5rem;
  border: 1px solid rgba(239, 229, 216, 0.5);
  border-radius: 9999px;
  color: #efe5d8;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.lightbox__cta:hover {
  background: rgba(239, 229, 216, 0.12);
  border-color: #efe5d8;
}

/* ===== Footer ===== */
.footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2rem 0;
}

.footer__container {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: rgba(246, 241, 234, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.footer__credit {
  font-size: 0.75rem;
  color: rgba(246, 241, 234, 0.4);
}

.footer__credit-link {
  color: #d9c8b8;
  border-bottom: 1px solid rgba(217, 200, 184, 0.3);
  transition: color 0.25s ease, border-color 0.25s ease;
}

.footer__credit-link:hover {
  color: #f3ede4;
  border-bottom-color: rgba(243, 237, 228, 0.7);
}

/* ===== Animations ===== */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .painting-card__image img {
    transition: none;
  }

  .painting-card:hover .painting-card__image img {
    transform: none;
  }

  .btn {
    transition: none;
  }

  .btn:hover {
    transform: none;
  }

  .contact-link {
    transition: none;
  }

  .contact-link:hover {
    transform: none;
  }

  .lightbox {
    transition: none;
  }

  .lightbox__img {
    transition: none;
  }
}

/* ===== Responsive ===== */
@media (min-width: 640px) {
  .gallery__grid {
    columns: 2;
  }
}

@media (min-width: 768px) {
  .nav__toggle {
    display: none;
  }

  .nav__logo img {
    height: 56px;
  }

  .nav__list {
    position: static;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    flex-direction: row;
    gap: 2rem;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: none;
  }

  .nav__list a {
    font-size: 0.8rem;
    letter-spacing: 0.2em;
  }

  .hero__container {
    padding: 6rem 2.5rem 4rem;
  }

  .gallery__container,
  .education__container,
  .achievements__container,
  .about__container,
  .contact__container {
    padding-left: 2.5rem;
    padding-right: 2.5rem;
  }

  .gallery__header {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }

  .contact__card {
    padding: 3rem;
  }

  .education__timeline,
  .achievements__grid,
  .contact__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .hero__container {
    grid-template-columns: 0.85fr 1.15fr;
    padding: 6rem 3rem 4rem;
  }

  .hero__text {
    order: 1;
  }

  .hero__portrait {
    order: 2;
  }

  .hero__title {
    font-size: clamp(4.5rem, 8vw, 6rem);
  }

  .about__container {
    grid-template-columns: 0.9fr 1.1fr;
    padding-left: 3rem;
    padding-right: 3rem;
  }

  .gallery__container,
  .education__container,
  .achievements__container,
  .contact__container {
    padding-left: 3rem;
    padding-right: 3rem;
  }

  .education__container {
    grid-template-columns: 0.8fr 1.2fr;
    align-items: start;
    gap: 2.5rem;
  }

  .achievements__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
  }

  .contact__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) {
  .gallery__grid {
    columns: 3;
  }
}
