/* ==========================================================
   AMY AQUILINA — Portfolio
   Single stylesheet. Mobile-first.
   ========================================================== */

/* --- 01. Custom Properties --- */

:root {
  /* Colors */
  --white: #ffffff;
  --off-white: #f7f7f5;
  --light-grey: #ebebeb;
  --mid-grey: #b0b0b0;
  --dark-grey: #3a3a3a;
  --black: #1a1a1a;

  /* Typography */
  --font-serif: 'Cormorant Garamond', 'Georgia', serif;
  --font-sans: 'Inter', 'Helvetica Neue', sans-serif;
  --font-size-base: 1rem;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-lg: 1.25rem;
  --font-size-xl: 2rem;
  --font-size-hero: clamp(2.5rem, 6vw, 4.5rem);
  --line-height-body: 1.65;
  --line-height-heading: 1.1;
  --letter-spacing-wide: 0.12em;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 8rem;
  --space-section: clamp(4rem, 10vw, 10rem);

  /* Layout */
  --max-width: 1200px;
  --gutter: clamp(1rem, 4vw, 3rem);

  /* Transitions */
  --ease-soft: cubic-bezier(0.25, 0.1, 0.25, 1);
  --duration: 0.4s;
}


/* --- 02. Reset & Base --- */

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

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

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-body);
  color: var(--black);
  background-color: var(--off-white);
}

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

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

::selection {
  background-color: var(--light-grey);
  color: var(--black);
}


/* --- 03. Typography --- */

.heading-serif {
  font-family: var(--font-serif);
  font-weight: 300;
  line-height: var(--line-height-heading);
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
}


/* --- 04. Layout Utilities --- */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}


/* --- 05. Navigation --- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--gutter);
  color: var(--black);
  pointer-events: none;
  background: rgba(247, 247, 245, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* On homepage: transparent over hero image, blend mode for contrast */
.page-home .site-header {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  mix-blend-mode: difference;
  color: var(--white);
}

.site-header a {
  pointer-events: auto;
}

.site-name {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: var(--font-size-lg);
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs) var(--space-sm);
}

.site-nav a {
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: opacity var(--duration) var(--ease-soft);
}

.site-nav a:hover {
  opacity: 0.6;
}

@media (min-width: 640px) {
  .site-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--gutter);
  }

  .site-nav {
    gap: var(--space-md);
  }
}


/* --- 06. Hero (index.html) --- */

/* Mobile: image top, name below */
.hero {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.hero-image {
  height: 70vh;
  height: 70dvh;
  overflow: hidden;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  filter: contrast(0.95) brightness(1.02);
}

.hero-content {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--off-white);
  padding: var(--space-md) var(--gutter);
}

.hero-name {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: var(--font-size-hero);
  line-height: var(--line-height-heading);
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
  color: var(--black);
}

/* Desktop: centered portrait image, off-white sides, gradient into name */
@media (min-width: 1024px) {
  .hero {
    position: relative;
    height: 100vh;
    height: 100dvh;
    flex-direction: column;
    align-items: center;
    background: var(--off-white);
  }

  .hero-image {
    position: relative;
    height: 100%;
    width: auto;
    max-width: 55vw;
    flex: none;
  }

  .hero-img {
    object-fit: contain;
    object-position: center top;
  }

  .hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    flex: none;
    text-align: center;
    background: linear-gradient(to top, rgba(247, 247, 245, 1) 0%, rgba(247, 247, 245, 0.9) 50%, transparent 100%);
    padding: var(--space-md) var(--gutter) var(--space-lg);
  }
}


/* --- 07. Portfolio Gallery (portfolio.html) --- */

.portfolio-section {
  padding-bottom: var(--space-section);
}

.category-label {
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mid-grey);
  padding: 6rem var(--gutter) var(--space-md);
  max-width: 1400px;
  margin: 0 auto;
}

.gallery {
  column-count: 1;
  column-gap: var(--space-sm);
  padding: 0 var(--gutter);
  max-width: 1400px;
  margin: 0 auto;
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: var(--space-sm);
  position: relative;
  overflow: hidden;
}

/* Sub-category label — subtle top-right tag */
.gallery-item[data-label]::after {
  content: attr(data-label);
  position: absolute;
  top: var(--space-xs);
  right: var(--space-xs);
  font-family: var(--font-sans);
  font-size: 0.5625rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--white);
  background: rgba(26, 26, 26, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 0.2em 0.6em;
  opacity: 0;
  transform: translateY(-4px);
  transition:
    opacity 0.3s var(--ease-soft),
    transform 0.3s var(--ease-soft);
  pointer-events: none;
  z-index: 2;
}

.gallery-item:hover::after {
  opacity: 1;
  transform: translateY(0);
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  filter: contrast(0.97) brightness(1.01);
  transition: opacity var(--duration) var(--ease-soft);
}

.gallery-item img:hover {
  opacity: 0.88;
}

/* Placeholder aspect-ratio boxes */
.placeholder-img {
  width: 100%;
  aspect-ratio: 4 / 5;
  background-color: var(--light-grey);
  display: block;
}

.placeholder-img--landscape {
  aspect-ratio: 3 / 2;
}

.placeholder-img--square {
  aspect-ratio: 1 / 1;
}

.placeholder-img--wide {
  aspect-ratio: 16 / 9;
}

@media (min-width: 640px) {
  .gallery {
    column-count: 2;
  }
}

@media (min-width: 1024px) {
  .gallery {
    column-count: 3;
    column-gap: var(--space-md);
  }

  .gallery-item {
    margin-bottom: var(--space-md);
  }
}


/* --- 08. About (about.html) --- */

.about {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: 6rem;
}

.about-image {
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.about-image img {
  width: 100%;
  height: auto;
  filter: contrast(0.97) brightness(1.01);
}

.about-placeholder {
  width: 100%;
  aspect-ratio: 3 / 4;
  background-color: var(--light-grey);
}

.about-text {
  max-width: 28rem;
  margin: var(--space-lg) auto;
  padding: 0 var(--gutter);
  font-family: var(--font-serif);
  font-weight: 300;
  font-style: italic;
  font-size: var(--font-size-lg);
  line-height: 1.8;
  color: var(--dark-grey);
}

.about-text p {
  margin-bottom: var(--space-sm);
}

@media (min-width: 1024px) {
  .about {
    flex-direction: row;
    align-items: center;
    gap: var(--space-lg);
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-xl) var(--gutter);
    padding-top: var(--space-xl);
  }

  .about-image {
    flex: 1;
    max-width: 45%;
    padding: 0;
  }

  .about-text {
    flex: 1;
    margin: 0;
    padding: 0;
  }
}


/* --- 09. Contact (contact.html) --- */

.contact {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: var(--gutter);
}

.contact-label {
  font-family: var(--font-sans);
  font-size: var(--font-size-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mid-grey);
  margin-bottom: var(--space-sm);
}

.contact-email {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(1.25rem, 3vw, 2rem);
  letter-spacing: 0.04em;
  color: var(--black);
  border-bottom: 1px solid var(--light-grey);
  padding-bottom: 2px;
  transition: border-color var(--duration) var(--ease-soft);
}

.contact-email:hover {
  border-color: var(--black);
}


/* --- 10. Footer --- */

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) var(--gutter);
  font-family: var(--font-sans);
  font-size: var(--font-size-xs);
  letter-spacing: 0.08em;
  color: var(--mid-grey);
  border-top: 1px solid var(--light-grey);
}

.footer-links {
  display: flex;
  gap: var(--space-sm);
}

.site-footer a {
  transition: color var(--duration) var(--ease-soft);
}

.site-footer a:hover {
  color: var(--black);
}


/* --- 11. Animations --- */

/* Hero entrance */
@keyframes hero-fade-in {
  from {
    opacity: 0;
    transform: translateY(2rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes hero-image-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.hero-name {
  animation: hero-fade-in 1.2s var(--ease-soft) 0.2s both;
}

.hero-image {
  animation: hero-image-in 1s var(--ease-soft) both;
}

/* Header entrance */
@keyframes header-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.site-header {
  animation: header-fade 1s var(--ease-soft) 0.6s both;
}

/* Reveal on scroll — base state */
.reveal {
  opacity: 0;
  transform: translateY(1.5rem);
  transition:
    opacity 0.8s var(--ease-soft),
    transform 0.8s var(--ease-soft);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Gallery items — staggered reveal */
.gallery-item {
  opacity: 0;
  transform: translateY(1.2rem);
  transition:
    opacity 0.7s var(--ease-soft),
    transform 0.7s var(--ease-soft);
}

.gallery-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Gallery hover lift */
.gallery-item img,
.placeholder-img {
  transition:
    opacity var(--duration) var(--ease-soft),
    transform var(--duration) var(--ease-soft);
}

.gallery-item:hover img,
.gallery-item:hover .placeholder-img {
  transform: translateY(-3px);
  opacity: 0.92;
}

/* Nav link underline slide */
.site-nav a {
  position: relative;
}

.site-nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: currentColor;
  transition: width 0.35s var(--ease-soft);
}

.site-nav a:hover::after {
  width: 100%;
}

/* About page reveals */
.about-image {
  opacity: 0;
  transform: translateX(-2rem);
  transition:
    opacity 1s var(--ease-soft),
    transform 1s var(--ease-soft);
}

.about-image.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.about-text {
  opacity: 0;
  transform: translateX(2rem);
  transition:
    opacity 1s var(--ease-soft) 0.2s,
    transform 1s var(--ease-soft) 0.2s;
}

.about-text.is-visible {
  opacity: 1;
  transform: translateX(0);
}

/* Contact page entrance */
@keyframes contact-fade-up {
  from {
    opacity: 0;
    transform: translateY(1.5rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.contact-label {
  animation: contact-fade-up 0.8s var(--ease-soft) 0.3s both;
}

.contact-email {
  animation: contact-fade-up 0.8s var(--ease-soft) 0.5s both;
}

/* Footer reveal */
.site-footer {
  opacity: 0;
  transform: translateY(1rem);
  transition:
    opacity 0.6s var(--ease-soft),
    transform 0.6s var(--ease-soft);
}

.site-footer.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Page transitions */
@keyframes page-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

body {
  animation: page-fade-in 0.4s var(--ease-soft) both;
}

/* --- 12. Lightbox --- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(26, 26, 26, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s var(--ease-soft),
    visibility 0.3s;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
  transform: scale(0.95);
  transition: transform 0.3s var(--ease-soft);
}

.lightbox.is-open img {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  font-family: var(--font-sans);
  font-size: var(--font-size-sm);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mid-grey);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.3s var(--ease-soft);
}

.lightbox-close:hover {
  color: var(--white);
}

.gallery-item {
  cursor: zoom-in;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal,
  .gallery-item,
  .about-image,
  .about-text,
  .site-footer {
    opacity: 1;
    transform: none;
  }
}
