/* ─────────────────────────────────────────────
   PAVELA — Soft Architecture
   Tokens + layout + silk aperture
   ───────────────────────────────────────────── */

:root {
  --canvas: #f6f1ec;
  --ink: #1a1418;
  --iris: #6e5a78;
  --blush: #e9d8d2;
  --mist: #c9b8d4;
  --gold: #a89880;
  --white: #fdfbf9;

  --font-display: "Fraunces", "Times New Roman", serif;
  --font-ui: "Figtree", system-ui, sans-serif;

  --space: 8px;
  --pad: clamp(1.25rem, 4vw, 3rem);
  --header-h: 4.5rem;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);

  --veil-opacity: 1;
  --title-opacity: 0;
  --ui-opacity: 0;
  --displace: 0;
  --parallax-x: 0px;
  --parallax-y: 0px;
  --float-x: 0px;
  --float-y: 0px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

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

button,
input {
  font: inherit;
  color: inherit;
}

.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--iris);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--pad);
  z-index: 1000;
  padding: 0.75rem 1.25rem;
  background: var(--ink);
  color: var(--canvas);
  font-size: 0.875rem;
  border-radius: 2px;
}

.skip-link:focus {
  top: 1rem;
}

/* Film grain */
.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 90;
  opacity: 0.035;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px;
}

/* ─── Header ─── */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 80;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: var(--header-h);
  padding: 0 var(--pad);
  opacity: var(--ui-opacity);
  transition: opacity 0.9s var(--ease-out) 0.85s;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.35rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-optical-sizing: auto;
  justify-self: start;
}

.nav-desktop {
  display: none;
  gap: 2rem;
  justify-self: center;
}

.nav-desktop a {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.72;
  transition: opacity 0.3s var(--ease-soft), color 0.3s;
}

.nav-desktop a:hover {
  opacity: 1;
  color: var(--iris);
}

.header-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.bag-link {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.72;
  transition: opacity 0.3s, color 0.3s;
}

.bag-link:hover {
  opacity: 1;
  color: var(--iris);
}

.bag-link span {
  color: var(--gold);
}

.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 2.25rem;
  height: 2.25rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
}

.menu-toggle__line {
  display: block;
  height: 1px;
  width: 100%;
  background: var(--ink);
  transition: transform 0.35s var(--ease-out), opacity 0.25s;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__line:first-child {
  transform: translateY(3.5px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle__line:last-child {
  transform: translateY(-3.5px) rotate(-45deg);
}

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--canvas) 94%, var(--mist));
  backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s var(--ease-out), visibility 0.4s;
}

.mobile-menu.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.mobile-menu nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
}

.mobile-menu a {
  font-family: var(--font-display);
  font-size: clamp(2rem, 8vw, 3rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  transition: color 0.25s;
}

.mobile-menu a:hover {
  color: var(--iris);
}

/* ─── Hero ─── */

.hero {
  position: relative;
  min-height: 100svh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: calc(var(--header-h) + 1rem) var(--pad) clamp(2rem, 5vh, 3.5rem);
  overflow: hidden;
  isolation: isolate;
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--canvas);
  overflow: hidden;
}

.hero__photo {
  position: absolute;
  overflow: hidden;
  will-change: transform;
}

.hero__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.15);
  animation: breath 14s var(--ease-soft) infinite alternate;
}

.hero__photo--base {
  /* Oversized so parallax never reveals canvas edges */
  inset: -12%;
  width: auto;
  height: auto;
  transform: translate3d(var(--parallax-x), var(--parallax-y), 0);
}

.hero__photo--base::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--canvas) 55%, transparent) 0%,
      color-mix(in srgb, var(--canvas) 12%, transparent) 35%,
      color-mix(in srgb, var(--canvas) 25%, transparent) 60%,
      color-mix(in srgb, var(--canvas) 88%, transparent) 100%
    ),
    linear-gradient(
      90deg,
      color-mix(in srgb, var(--canvas) 40%, transparent) 0%,
      transparent 30%,
      transparent 70%,
      color-mix(in srgb, var(--mist) 20%, transparent) 100%
    );
}

.hero__photo--float {
  display: none;
  top: 18%;
  right: 6%;
  width: min(28vw, 340px);
  aspect-ratio: 3 / 4;
  border-radius: 2px;
  box-shadow:
    0 24px 60px color-mix(in srgb, var(--ink) 12%, transparent),
    0 0 0 1px color-mix(in srgb, var(--gold) 25%, transparent);
  transform: translate3d(var(--float-x), var(--float-y), 0);
  z-index: 1;
}

.hero__photo--float img {
  animation-duration: 18s;
  animation-delay: -3s;
}

/* Silk veil */
.hero__veil {
  position: absolute;
  inset: -5%;
  z-index: 2;
  pointer-events: none;
  opacity: var(--veil-opacity);
  filter: url(#silk-displace);
  transition: opacity 1.2s var(--ease-out);
}

.hero__veil-wash {
  width: 100%;
  height: 100%;
  background:
    radial-gradient(
      ellipse 80% 70% at 50% 40%,
      color-mix(in srgb, var(--mist) 55%, var(--white)) 0%,
      color-mix(in srgb, var(--blush) 70%, var(--canvas)) 45%,
      color-mix(in srgb, var(--canvas) 92%, var(--iris)) 100%
    ),
    linear-gradient(
      165deg,
      color-mix(in srgb, var(--mist) 40%, transparent),
      transparent 50%
    );
  mix-blend-mode: soft-light;
}

body.is-loaded .hero__veil {
  --veil-opacity: 0.28;
}

/* Content */
.hero__content {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: clamp(1.5rem, 4vh, 2.75rem);
  max-width: 56rem;
}

.hero__triad {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.65rem;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: var(--ui-opacity);
  transition: opacity 0.9s var(--ease-out) 0.7s;
}

.triad-word {
  transition: color 0.6s var(--ease-soft), opacity 0.6s;
  opacity: 0.45;
}

.triad-word.is-active {
  color: var(--iris);
  opacity: 1;
}

.triad-sep {
  opacity: 0.4;
}

/* Aperture title */
.hero__title-wrap {
  opacity: var(--title-opacity);
  transform: translateY(1.25rem);
  transition:
    opacity 1.1s var(--ease-out) 0.35s,
    transform 1.1s var(--ease-out) 0.35s;
}

body.is-loaded .hero__title-wrap {
  opacity: 1;
  transform: translateY(0);
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3.4rem, 12vw, 8.5rem);
  line-height: 0.92;
  letter-spacing: -0.03em;
  font-optical-sizing: auto;
  font-variation-settings: "SOFT" 50, "WONK" 0.4;
}

.hero__title-line {
  display: block;
}

.aperture {
  position: relative;
  color: transparent;
  background-image:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--ink) 8%, transparent),
      transparent 40%
    ),
    url("assets/hero-fashion.jpg");
  background-size: cover;
  background-position: center 28%;
  background-repeat: no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  /* soft ink edge + canvas bloom for legibility */
  filter:
    drop-shadow(0 0 1px color-mix(in srgb, var(--ink) 35%, transparent))
    drop-shadow(0 2px 24px color-mix(in srgb, var(--canvas) 80%, transparent))
    drop-shadow(0 0 48px color-mix(in srgb, var(--blush) 50%, transparent));
}

@supports not (background-clip: text) {
  .aperture {
    color: var(--ink);
    background: none;
    filter: none;
  }
}

.hero__sub {
  margin-top: 1.25rem;
  max-width: 22rem;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: color-mix(in srgb, var(--ink) 72%, transparent);
  opacity: var(--ui-opacity);
  transition: opacity 0.9s var(--ease-out) 0.95s;
}

.hero__footer {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.25rem;
  opacity: var(--ui-opacity);
  transition: opacity 0.9s var(--ease-out) 1.05s;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.95rem 1.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--ink);
  border-radius: 999px;
  position: relative;
  overflow: hidden;
  transition:
    background 0.4s var(--ease-soft),
    color 0.4s,
    transform 0.4s var(--ease-out);
}

.cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--iris);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--ease-out);
  z-index: 0;
}

.cta span {
  position: relative;
  z-index: 1;
}

.cta__arrow {
  transition: transform 0.35s var(--ease-out);
}

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

.cta:hover::before {
  transform: scaleX(1);
}

.cta:hover .cta__arrow {
  transform: translateX(4px);
}

.cta:active {
  transform: scale(0.98);
}

.hero__meta {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.hero__meta-sep {
  opacity: 0.5;
}

.scroll-hint {
  position: absolute;
  bottom: clamp(1.5rem, 4vh, 2.5rem);
  right: var(--pad);
  z-index: 5;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  opacity: var(--ui-opacity);
  transition: opacity 0.9s var(--ease-out) 1.2s;
}

.scroll-hint__line {
  width: 1px;
  height: 3rem;
  background: linear-gradient(to bottom, var(--gold), transparent);
  animation: scroll-pulse 2.4s var(--ease-soft) infinite;
}

.scroll-hint__label {
  font-size: 0.625rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  writing-mode: vertical-rl;
}

/* ─── Thesis strip ─── */

.thesis {
  padding: clamp(4rem, 10vw, 7rem) var(--pad);
  background: var(--canvas);
  border-top: 1px solid color-mix(in srgb, var(--gold) 28%, transparent);
}

.thesis__intro {
  max-width: 32rem;
  margin-bottom: clamp(2.5rem, 6vw, 4rem);
}

.label {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.85rem;
}

.thesis__heading {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.thesis__grid {
  display: grid;
  gap: clamp(2rem, 4vw, 2.5rem);
}

.thesis__card {
  display: grid;
  gap: 0.85rem;
}

.thesis__image {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 2px;
  background: var(--blush);
}

.thesis__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1s var(--ease-out);
}

.thesis__card:hover .thesis__image img {
  transform: scale(1.04);
}

.thesis__card h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.75rem;
  letter-spacing: -0.01em;
  color: var(--iris);
}

.thesis__tag {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}

.thesis__card > p:last-child {
  max-width: 28ch;
  color: color-mix(in srgb, var(--ink) 70%, transparent);
  font-size: 0.9375rem;
}

/* ─── About band ─── */

.about-band {
  padding: clamp(3.5rem, 8vw, 6rem) var(--pad);
  background: color-mix(in srgb, var(--blush) 55%, var(--canvas));
  text-align: center;
}

.about-band__text {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.5vw, 2.35rem);
  font-weight: 400;
  line-height: 1.35;
  max-width: 22ch;
  margin: 0 auto;
  letter-spacing: -0.02em;
  color: var(--ink);
}

/* ─── Footer ─── */

.site-footer {
  padding: clamp(3rem, 6vw, 4.5rem) var(--pad) 2.5rem;
  display: grid;
  gap: 2rem;
  border-top: 1px solid color-mix(in srgb, var(--gold) 28%, transparent);
  background: var(--canvas);
}

.wordmark--footer {
  display: block;
  margin-bottom: 0.5rem;
}

.footer__brand p {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.footer__form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-width: 28rem;
}

.footer__form input {
  flex: 1 1 12rem;
  min-width: 0;
  padding: 0.85rem 1rem;
  border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent);
  background: var(--white);
  border-radius: 2px;
  transition: border-color 0.25s;
}

.footer__form input::placeholder {
  color: color-mix(in srgb, var(--ink) 40%, transparent);
}

.footer__form input:focus {
  border-color: var(--iris);
}

.footer__form button {
  padding: 0.85rem 1.35rem;
  background: var(--ink);
  color: var(--white);
  border: none;
  border-radius: 2px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.3s;
}

.footer__form button:hover {
  background: var(--iris);
}

.footer__copy {
  font-size: 0.75rem;
  color: var(--gold);
}

/* ─── Loaded state ─── */

body.is-loaded {
  --title-opacity: 1;
  --ui-opacity: 1;
}

body.is-loaded .site-header,
body.is-loaded .hero__triad,
body.is-loaded .hero__sub,
body.is-loaded .hero__footer,
body.is-loaded .scroll-hint {
  opacity: 1;
}

/* ─── Animations ─── */

@keyframes breath {
  from {
    transform: scale(1.15);
  }
  to {
    transform: scale(1.22);
  }
}

@keyframes scroll-pulse {
  0%,
  100% {
    opacity: 0.35;
    transform: scaleY(1);
  }
  50% {
    opacity: 1;
    transform: scaleY(0.85);
  }
}

/* ─── Desktop ─── */

@media (min-width: 768px) {
  .nav-desktop {
    display: flex;
  }

  .menu-toggle {
    display: none;
  }

  .hero {
    justify-content: center;
    padding-top: var(--header-h);
  }

  .hero__content {
    gap: clamp(1.75rem, 3.5vh, 2.5rem);
  }

  .hero__footer {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: min(100%, 52rem);
  }

  .scroll-hint {
    display: flex;
  }

  .hero__photo--float {
    display: block;
  }

  .thesis__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(1.5rem, 3vw, 2.5rem);
  }

  .site-footer {
    grid-template-columns: 1fr 1.2fr;
    grid-template-rows: auto auto;
    align-items: end;
  }

  .footer__form {
    justify-self: end;
  }

  .footer__copy {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1100px) {
  .hero__title {
    font-size: clamp(5.5rem, 9.5vw, 9rem);
  }

  .hero__photo--float {
    right: 8%;
    width: min(26vw, 360px);
  }
}

/* ─── Reduced motion ─── */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .hero__photo img {
    animation: none;
    transform: scale(1.12);
  }

  body {
    --title-opacity: 1;
    --ui-opacity: 1;
    --veil-opacity: 0.2;
  }

  .hero__title-wrap {
    transform: none;
    opacity: 1;
  }

  .site-header,
  .hero__triad,
  .hero__sub,
  .hero__footer,
  .scroll-hint {
    opacity: 1;
    transition: none;
  }
}
