/* ============================================
   Maison Étoffe — Style Sheet
   Art. Textile. Soul.
   ============================================ */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

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

ul {
  list-style: none;
}

/* --- Variables --- */
:root {
  --color-bg: #FAF7F2;
  --color-text: #2C2416;
  --color-accent: #C4956A;
  --color-accent-dark: #A07850;
  --color-light: #F0E8DC;
  --color-border: rgba(44, 36, 22, 0.1);
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --max-width: 1200px;
  --header-height: 72px;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;
}

/* --- Container --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-sm);
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 0.85rem 2rem;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease;
}

.btn--primary {
  background: var(--color-accent);
  color: #fff;
}

.btn--primary:hover,
.btn--primary:focus-visible {
  background: var(--color-accent-dark);
}

.btn--secondary {
  background: transparent;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
}

.btn--secondary:hover,
.btn--secondary:focus-visible {
  background: var(--color-accent);
  color: #fff;
}

.btn--submit {
  width: 100%;
}

/* --- Header / Nav --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background: rgba(250, 247, 242, 0.95);
  backdrop-filter: blur(8px);
  z-index: 100;
  border-bottom: 1px solid var(--color-border);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.header__logo img {
  width: 48px;
  height: 48px;
}

/* Nav */
.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  transition: transform 0.3s ease;
}

.nav__list {
  display: flex;
  gap: var(--space-md);
}

.nav__link {
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text);
  opacity: 0.7;
  transition: opacity 0.3s ease;
  position: relative;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--color-accent);
  transition: width 0.3s ease;
}

.nav__link:hover,
.nav__link:focus-visible {
  opacity: 1;
}

.nav__link--active {
  opacity: 1;
}

.nav__link--active::after {
  width: 100%;
}

/* --- Hero --- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-xl) var(--space-sm);
  background: linear-gradient(180deg, var(--color-bg) 0%, var(--color-light) 100%);
}

.hero__title {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.1;
  margin-bottom: var(--space-sm);
}

.hero__tagline {
  font-family: var(--font-heading);
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  font-style: italic;
  color: var(--color-accent);
  margin-bottom: var(--space-md);
}

.hero__intro {
  max-width: 680px;
  margin: 0 auto var(--space-lg);
  font-size: 1.05rem;
  font-weight: 300;
  line-height: 1.8;
  opacity: 0.85;
}

.hero__content .btn + .btn {
  margin-left: var(--space-sm);
}

/* --- Section Shared --- */
.section__title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 600;
  text-align: center;
  margin-bottom: var(--space-sm);
}

.section__subtitle {
  text-align: center;
  max-width: 640px;
  margin: 0 auto var(--space-xl);
  font-size: 1rem;
  opacity: 0.75;
  line-height: 1.8;
}

/* --- Collections --- */
.collections {
  padding: var(--space-xl) 0;
}

.collection {
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--color-border);
}

.collection:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

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

.collection__title {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 600;
  margin-bottom: var(--space-xs);
  color: var(--color-text);
}

.collection__desc {
  font-size: 0.95rem;
  line-height: 1.8;
  opacity: 0.8;
  max-width: 600px;
}

.collection__desc--accent {
  color: var(--color-accent-dark);
  font-weight: 400;
}

.collection__note {
  margin-top: var(--space-sm);
  font-size: 0.9rem;
  font-style: italic;
  opacity: 0.7;
  max-width: 600px;
}

/* --- Gallery --- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-sm);
}

.gallery__item {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.gallery__item:hover img,
.gallery__item:focus-visible img {
  transform: scale(1.05);
}

.gallery__item:hover,
.gallery__item:focus-visible {
  box-shadow: 0 8px 24px rgba(44, 36, 22, 0.15);
}

.gallery__item--broken {
  background: var(--color-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.gallery__item--broken img {
  display: none;
}

/* --- Essence --- */
.essence {
  padding: var(--space-xl) 0;
  background: var(--color-light);
}

.essence__content {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
}

.essence__content p {
  font-size: 1.05rem;
  line-height: 2;
  margin-bottom: var(--space-md);
  opacity: 0.85;
}

.essence__signoff {
  font-family: var(--font-heading);
  font-style: italic;
  color: var(--color-accent);
  font-size: 1.2rem !important;
  margin-top: var(--space-lg);
  opacity: 1 !important;
}

/* --- Contact --- */
.contact {
  padding: var(--space-xl) 0;
}

.contact__form {
  max-width: 520px;
  margin: 0 auto var(--space-lg);
}

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

.form__label {
  display: block;
  font-size: 0.85rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-xs);
  opacity: 0.7;
}

.form__input {
  width: 100%;
  padding: 0.85rem 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 300;
  background: var(--color-light);
  border: 1px solid transparent;
  border-radius: 0;
  color: var(--color-text);
  transition: border-color 0.3s ease, background 0.3s ease;
}

.form__input:focus {
  outline: none;
  border-color: var(--color-accent);
  background: #fff;
}

.form__input--error {
  border-color: #c0392b;
}

.form__textarea {
  resize: vertical;
  min-height: 120px;
}

.form__error {
  display: block;
  font-size: 0.8rem;
  color: #c0392b;
  margin-top: 4px;
  min-height: 1.2em;
}

.form__feedback {
  margin-top: var(--space-sm);
  text-align: center;
  font-size: 0.95rem;
  min-height: 2em;
}

.form__feedback--success {
  color: #27ae60;
}

.form__feedback--error {
  color: #c0392b;
}

/* Social */
.contact__social {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
}

.social__link {
  font-size: 0.85rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
  padding: 0.6rem 1.5rem;
  transition: background 0.3s ease, color 0.3s ease;
}

.social__link:hover,
.social__link:focus-visible {
  background: var(--color-accent);
  color: #fff;
}

/* --- Footer --- */
.footer {
  padding: var(--space-md) 0;
  border-top: 1px solid var(--color-border);
  text-align: center;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
}

.footer p {
  font-size: 0.8rem;
  opacity: 0.6;
}

.footer__tagline {
  font-family: var(--font-heading);
  font-style: italic;
  color: var(--color-accent);
  opacity: 0.8 !important;
}

/* --- Lightbox --- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: var(--space-md);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox[hidden] {
  display: none;
}

.lightbox--open {
  opacity: 1;
}

.lightbox__image {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  cursor: default;
}

.lightbox__close {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-md);
  background: none;
  border: none;
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.lightbox__close:hover {
  opacity: 1;
}

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

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

/* --- Mobile --- */
@media (max-width: 767px) {
  .nav__toggle {
    display: flex;
  }

  .nav__list {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    flex-direction: column;
    background: rgba(250, 247, 242, 0.98);
    backdrop-filter: blur(8px);
    padding: var(--space-md);
    gap: var(--space-sm);
    transform: translateY(-120%);
    transition: transform 0.3s ease;
    border-bottom: 1px solid var(--color-border);
  }

  .nav__list--open {
    transform: translateY(0);
  }

  .gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
}

/* --- Tablet+ --- */
@media (min-width: 768px) {
  .gallery {
    grid-template-columns: repeat(3, 1fr);
  }

  .btn--submit {
    width: auto;
  }
}

@media (min-width: 1024px) {
  .gallery {
    grid-template-columns: repeat(3, 1fr);
  }

  .collection {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: var(--space-lg);
    align-items: start;
  }

  .collection__info {
    position: sticky;
    top: calc(var(--header-height) + var(--space-md));
    margin-bottom: 0;
  }
}
