/*
 * File: styles.css
 * Description: Global styles for the Modern Minimalist Fashion Archive.
 * This file defines the visual identity, including typography, color palette,
 * layout, and responsive behavior for the website.
 */

/* --- Font Import --- */
@import url('https://fonts.loli.net/css2?family=Noto+Serif+SC:wght@300;400&display=swap');

/* --- CSS Variables / Design Tokens --- */
:root {
  --color-background-start: #F5F5F5;
  --color-background-end: #FFFFFF;
  --color-text-primary: #333333;
  --color-text-secondary: #777777;
  --color-terracotta-red: #B76E79;
  --color-withered-rose: #D4C4C8;
  --color-antique-white: #FAF0E6;
  --color-divider: #E0E0E0;

  --font-title: 'Noto Serif SC', 'Source Han Serif SC', serif;
  --font-body: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
  
  --spacing-unit: 1rem;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  color: var(--color-text-primary);
  background-image: linear-gradient(to bottom, var(--color-background-start), var(--color-background-end));
  background-attachment: fixed;
  margin: 0;
  padding: 0;
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  animation: fadeIn 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: calc(6rem + var(--spacing-unit) * 2) calc(var(--spacing-unit) * 2);
}

/* --- Navigation --- */
.global-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: rgba(245, 245, 245, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 0.5pt solid transparent;
  transition: border-color 0.3s ease;
}

.global-nav nav {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: var(--spacing-unit) 0;
}

.global-nav a {
  font-family: var(--font-title);
  font-weight: 300;
  text-decoration: none;
  color: var(--color-text-primary);
  margin: 0 calc(var(--spacing-unit) * 2);
  padding: 0.5rem 0;
  letter-spacing: 0.1em;
  position: relative;
  transition: color 0.3s ease;
}

.global-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0.5pt;
  background-color: var(--color-text-primary);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.global-nav a:hover,
.global-nav a.active {
  color: var(--color-text-primary);
}

.global-nav a.active::after {
  transform: scaleX(1);
}

/* --- Typography --- */
h1, h2, h3 {
  font-family: var(--font-title);
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-unit);
}

h1 { font-size: 2.5rem; line-height: 1.2; text-align: center; }
h2 { font-size: 1.8rem; }
p { 
  letter-spacing: -0.01em;
  color: var(--color-text-secondary);
  max-width: 65ch;
}

/* --- Layout Sections & Containers --- */
.section {
  margin: calc(var(--spacing-unit) * 6) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.text-center {
  text-align: center;
}

.divider {
  border: 0;
  height: 0.5pt;
  background-color: var(--color-divider);
  margin: calc(var(--spacing-unit) * 5) auto;
  width: 100%;
}

/* --- Image Styles & Effects --- */
.img-container {
  overflow: hidden;
  position: relative;
  background-color: var(--color-antique-white);
}

.img-container img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
  filter: sepia(15%) contrast(0.95) brightness(1.05);
}

.img-container::after {
  content: "";
  position: absolute;
  top: -50%; left: -50%; width: 200%; height: 200%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.02;
  pointer-events: none;
  animation: grain 8s steps(10, end) infinite;
}

@keyframes grain {
  to { transform: translate(-50%, -50%); }
}

.img-container:hover img {
  transform: scale(1.03);
}

.img-container:hover {
  outline: 0.25pt solid var(--color-terracotta-red);
  outline-offset: -0.25pt;
}

/* Specific Layouts */
.three-col-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: calc(var(--spacing-unit) * 3);
  width: 100%;
}

.two-col-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(var(--spacing-unit) * 3);
  width: 100%;
  align-items: center;
}

.full-bleed {
  width: 100vw;
  max-width: 1600px;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  margin-top: calc(var(--spacing-unit) * 4);
  margin-bottom: calc(var(--spacing-unit) * 4);
}

.parallax-bg {
  min-height: 80vh;
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

/* --- Footer --- */
footer {
  text-align: center;
  padding: calc(var(--spacing-unit) * 4) 0 calc(var(--spacing-unit) * 2);
  margin-top: calc(var(--spacing-unit) * 4);
}

.footer-link {
  font-family: var(--font-body);
  color: var(--color-text-secondary);
  text-decoration: none;
  letter-spacing: 0.05em;
  transition: color 0.3s ease;
}

.footer-link:hover {
  color: var(--color-text-primary);
}


/* --- Responsive Design --- */
@media (max-width: 1024px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  main {
    padding-left: var(--spacing-unit);
    padding-right: var(--spacing-unit);
  }
  .two-col-grid {
      grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  html { font-size: 15px; }
  
  main {
    padding: calc(5rem + var(--spacing-unit) * 2) var(--spacing-unit);
  }

  .global-nav a {
    margin: 0 var(--spacing-unit);
  }

  .three-col-grid {
    grid-template-columns: 1fr;
  }
  
  .section {
    margin: calc(var(--spacing-unit) * 4) 0;
  }

  .img-container.mobile-height-limit {
    height: 60vh;
    max-height: 60vh;
  }
}