/* ────────────────────────────────────────────
   Teresita Castelli — Portfolio
   Palette derived from reference textile
   Piazzolla + Alegreya Sans · Argentine type
   ──────────────────────────────────────────── */

:root {
  /* Palette — textile chromatic hierarchy in OKLCH */
  --bg:           oklch(96.5% 0.012 75);   /* warm cream canvas */
  --bg-blush:     oklch(92% 0.022 10);     /* pale blush */
  --text:         oklch(30% 0.025 55);     /* warm dark */
  --text-muted:   oklch(48% 0.025 55);     /* muted warm */
  --rule:         oklch(87% 0.015 75);     /* subtle divider */

  --accent:       oklch(55% 0.13 45);      /* terracotta — primary accent */
  --accent-hover: oklch(45% 0.12 45);     /* terracotta dark */
  --sage:         oklch(50% 0.045 150);    /* sage — text-safe green */
  --sage-deep:    oklch(25% 0.035 150);    /* deep sage — section bg */
  --sage-rule:    oklch(35% 0.03 150);     /* sage divider on dark */
  --sage-light:   oklch(68% 0.05 150);     /* light sage — decorative */
  --carmine:      oklch(47% 0.17 25);      /* carmine red — punctual fire */
  --taupe:        oklch(60% 0.035 55);     /* warm neutral */

  /* Typography — Argentine type foundry */
  --font-display: 'Piazzolla', 'Georgia', serif;
  --font-body:    'Alegreya Sans', -apple-system, system-ui, sans-serif;

  /* Scale — 1.25 ratio (major third) */
  --text-hero:    clamp(3.5rem, 10vw, 9rem);
  --text-h2:      clamp(2rem, 5vw, 3.75rem);
  --text-h3:      clamp(1.25rem, 2vw, 1.625rem);
  --text-body:    1.0625rem;
  --text-sm:      0.8125rem;

  /* Space — varied rhythm */
  --space-section:    clamp(5rem, 12vw, 9rem);
  --space-section-lg: clamp(6.5rem, 14vw, 11rem);
  --space-section-sm: clamp(3.5rem, 8vw, 6rem);
  --container:    1240px;
  --radius:       6px;
  --radius-lg:    14px;

  --ease:         cubic-bezier(.2,.6,.2,1);
  --t-fast:       .25s var(--ease);
  --t:            .45s var(--ease);
  --t-slow:       .8s var(--ease);
}

/* ── Reset ── */
*,*::before,*::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img,video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; background: none; border: 0; cursor: pointer; color: inherit; }
ul { list-style: none; padding: 0; margin: 0; }
h1,h2,h3,h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.05; margin: 0; letter-spacing: -0.015em; }
h1 em, h2 em, h3 em, h4 em { font-style: italic; font-family: var(--font-display); }
.hero__title em { color: var(--accent); } /* terracotta */
.contact__title em { color: var(--carmine); }
p  { margin: 0 0 1em; }

/* Skip link — accessible bypass */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: oklch(98% 0.008 45);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0 0 var(--radius) var(--radius);
  z-index: 200;
  transition: top var(--t-fast);
}
.skip-link:focus {
  top: 0;
}

/* Focus — cobalt thread for keyboard users */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Subtle paper grain — below nav */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 50;
  opacity: .08;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 240 240' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.4 0 0 0 0 0.3 0 0 0 0 0.2 0 0 0 0.55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 clamp(1.25rem, 4vw, 2.5rem); }

.eyebrow {
  font-family: var(--font-body);
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--sage);
  margin: 0 0 1.25rem;
}
.section-title { font-size: var(--text-h2); }
.section-header { max-width: 720px; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-lede { color: var(--text-muted); font-size: 1.125rem; max-width: 58ch; }

/* ── Nav ── */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem clamp(1.25rem, 4vw, 2.5rem);
  transition: background var(--t), padding var(--t), border-color var(--t);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(0);
}
.nav--scrolled {
  background: oklch(96.5% 0.012 75 / 0.88);
  backdrop-filter: blur(10px);
  padding: .75rem clamp(1.25rem, 4vw, 2.5rem);
  border-bottom-color: var(--rule);
}
.nav__brand { display: flex; align-items: center; gap: .75rem; }
.nav__mark {
  width: 2.25rem; height: 2.25rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 1.5px solid var(--text);
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1;
  gap: 0;
}
.nav__mark-top {
  font-size: .65rem;
  letter-spacing: 0.04em;
  text-transform: lowercase;
}
.nav__mark-bot {
  font-size: .55rem;
  text-transform: lowercase;
  margin-top: -1px;
}
.nav__name { font-family: var(--font-display); font-size: 1rem; font-weight: 600; }
.nav__links { display: flex; gap: 2rem; align-items: center; font-size: .95rem; }
.nav__links a { position: relative; padding: .25rem 0; transition: color var(--t-fast); }
.nav__links a:hover { color: var(--accent); }
.nav__links a:not(.nav__cta)::after {
  content: ""; position: absolute; left: 0; bottom: -2px;
  width: 0; height: 1px; background: var(--accent);
  transition: width var(--t);
}
.nav__links a:hover::after { width: 100%; }
.nav__links a.is-active:not(.nav__cta) { color: var(--accent); }
.nav__links a.is-active:not(.nav__cta)::after { width: 100%; }
.nav__cta {
  padding: .625rem 1.25rem;
  border: 1.5px solid var(--text);
  border-radius: 999px;
  transition: background var(--t-fast), color var(--t-fast);
}
.nav__cta:hover { background: var(--text); color: var(--bg); }
.nav__cta--shop {
  background: var(--sage);
  border-color: var(--sage);
  color: oklch(96.5% 0.012 75);
}
.nav__cta--shop:hover {
  background: oklch(42% 0.04 150);
  border-color: oklch(42% 0.04 150);
  color: oklch(96.5% 0.012 75);
}

.lang-toggle {
  margin-left: auto;
  margin-right: 1rem;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  transition: color var(--t-fast), border-color var(--t-fast);
}
.lang-toggle:hover { color: var(--accent); border-color: var(--accent); }

.nav__toggle { display: none; width: 2rem; height: 2rem; flex-direction: column; justify-content: center; gap: 4px; }
.nav__toggle span { display: block; height: 1.5px; background: var(--text); transition: transform var(--t-fast), opacity var(--t-fast); }

@media (max-width: 820px) {
  .nav__toggle { display: flex; }
  .nav__links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 1.25rem;
    padding: 2rem;
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
    transform: translateY(-20px);
    opacity: 0; pointer-events: none;
    transition: opacity var(--t), transform var(--t);
  }
  .nav__links.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .nav__name { display: none; }
}

/* ── Hero ── */
.hero {
  position: relative;
  min-height: 100vh;
  padding: 9rem 0 5rem;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: center;
  gap: 3rem;
  overflow: hidden;
}
.hero__grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.hero__inner {
  position: relative;
  z-index: 1;
  padding-right: 2rem;
}
.hero__media { position: relative; z-index: 1; }
.hero__title {
  font-size: var(--text-hero);
  line-height: .96;
  margin-bottom: 1.75rem;
  letter-spacing: -0.028em;
}
.hero__lede {
  font-size: 1.1875rem;
  color: var(--text-muted);
  max-width: 42ch;
  margin-bottom: 2.25rem;
}
.hero__ctas { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; }

.hero__text-link {
  font-size: .9375rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 2px;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.hero__text-link:hover {
  color: var(--text);
  border-color: var(--text);
}

/* Hero image — bleeds to viewport edge */
.hero__media {
  position: relative;
  margin: 0;
  aspect-ratio: 4/5;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  overflow: hidden;
  box-shadow: -20px 40px 80px -40px oklch(30% 0.025 55 / 0.4);
}
.hero__media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 60%, oklch(30% 0.02 55 / 0.10));
  pointer-events: none;
}
.hero__media video,
.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 7rem; gap: 2.5rem; align-items: start; }
  .hero__media { transform: none; margin: 0; aspect-ratio: 4/3; border-radius: var(--radius-lg); }
  .hero__inner { padding-top: 0; }
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: 1rem 1.75rem;
  font-size: .9375rem; font-weight: 500;
  border-radius: 999px;
  border: 1.5px solid var(--text);
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: oklch(98% 0.008 45);
}
.btn--primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.btn--ghost:hover { background: var(--text); color: var(--bg); }

/* ── Work ── */
.work { padding: var(--space-section-lg) 0; }
.work__filters {
  display: flex; flex-wrap: wrap; gap: .5rem;
  margin-bottom: 2.5rem;
}
.filter-btn {
  padding: .625rem 1.25rem;
  font-size: .85rem; font-weight: 500;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--text-muted);
  transition: all var(--t-fast);
}
.filter-btn:hover { color: var(--text); border-color: var(--text); }
.filter-btn.is-active { background: var(--sage); color: var(--bg); border-color: var(--sage); }

.work__grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem;
}
.project-card {
  position: relative;
  grid-column: span 6;
  transition: opacity var(--t), transform var(--t);
}
.project-card:nth-child(3n+1) { grid-column: span 7; }
.project-card:nth-child(3n+2) { grid-column: span 5; }
.project-card:nth-child(3n+3) { grid-column: span 12; }
.project-card:nth-child(3n+3) .project-card__image { aspect-ratio: 21/9; }
.project-card.is-hidden { display: none; }

@media (max-width: 900px) {
  .project-card,
  .project-card:nth-child(3n+1),
  .project-card:nth-child(3n+2),
  .project-card:nth-child(3n+3) { grid-column: span 12; }
  .project-card:nth-child(3n+3) .project-card__image { aspect-ratio: 4/3; }
}

.project-card__image {
  position: relative;
  aspect-ratio: 4/5;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--bg-blush);
}
.project-card__image img,
.project-card__image video {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform var(--t-slow);
}
.project-card:hover .project-card__image img,
.project-card:focus-within .project-card__image img { transform: scale(1.04); }

.project-card__overlay {
  position: absolute; inset: 0;
  padding: 2rem;
  display: flex; flex-direction: column; justify-content: flex-end;
  background: linear-gradient(180deg, transparent 40%, oklch(25% 0.02 55 / 0.85) 100%);
  color: var(--bg);
  opacity: 0;
  transition: opacity var(--t);
}
.project-card:hover .project-card__overlay,
.project-card:focus-within .project-card__overlay { opacity: 1; }

.project-card__type {
  display: inline-block;
  font-size: .7rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: oklch(75% 0.08 45);
  margin-bottom: .5rem;
}
.project-card__overlay .project-card__title {
  font-size: 2rem;
  margin-bottom: .5rem;
}
.project-card__desc { font-size: .95rem; opacity: .9; margin-bottom: 1rem; }
.project-card__links { display: flex; gap: 1rem; }
.project-link {
  font-size: .85rem; font-weight: 500;
  padding-bottom: 2px;
  border-bottom: 1px solid oklch(96.5% 0.012 75 / 0.5);
  transition: border-color var(--t-fast);
}
.project-link:hover { border-color: var(--bg); }

.project-card__meta { padding: 1rem .25rem 0; }
.project-card__name { font-size: var(--text-h3); margin-bottom: .25rem; }
.project-card__tags { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .8125rem; color: var(--text-muted); margin: 0; }

/* Mobile: show inquire link below card */
.project-card__inquire {
  display: none;
  margin-top: 0.5rem;
  font-size: .85rem;
  font-weight: 500;
  color: var(--accent);
}
.project-card__inquire:hover {
  color: var(--accent-hover);
}

@media (hover: none) {
  .project-card__inquire {
    display: inline-block;
  }
}

/* ── Process ── */
.process {
  padding: var(--space-section-sm) 0;
  background: var(--sage-deep);
  color: var(--bg);
  border: none;
}
.process__header {
  margin-bottom: clamp(2rem, 4vw, 3rem);
}
.process .eyebrow { color: var(--sage-light); }
.process__header p { color: oklch(82% 0.01 150); max-width: 68ch; }
.process__header .section-title { margin-bottom: 1.5rem; color: var(--bg); }

.process__moments {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: clamp(2.5rem, 5vw, 4rem);
}
.process__moment:nth-child(1) { grid-column: span 2; }
.process__moment:nth-child(1) .process__moment-media { aspect-ratio: 5/4; }
.process__moment:nth-child(4) { grid-column: span 2; }
.process__moment:nth-child(4) .process__moment-media { aspect-ratio: 5/4; }
.process__moment-media {
  aspect-ratio: 3/4;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--sage-rule);
}
.process__moment-media img,
.process__moment-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--t-slow);
}
.process__moment:hover .process__moment-media img,
.process__moment:hover .process__moment-media video {
  transform: scale(1.04);
}
.process__moment-label {
  margin-top: .75rem;
  font-family: var(--font-body);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: oklch(90% 0.015 75);
  display: flex;
  align-items: center;
  gap: .5rem;
}
.process__moment-label span {
  color: oklch(82% 0.025 75);
  font-size: .7rem;
  letter-spacing: .12em;
}
@media (max-width: 700px) {
  .process__moments {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  .process__moment:nth-child(1) { grid-column: span 2; }
  .process__moment:nth-child(1) .process__moment-media { aspect-ratio: 16/9; }
  .process__moment:nth-child(4) { grid-column: span 1; }
  .process__moment:nth-child(4) .process__moment-media { aspect-ratio: 3/4; }
}

/* ── Statement (formerly About) ── */
.statement { padding: var(--space-section-lg) 0; }
.statement__grid {
  display: grid;
  grid-template-columns: 5fr 6fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}
.statement__photo {
  margin: 0;
  aspect-ratio: 3/4;
  border-radius: var(--radius-lg);
  overflow: hidden;
  transform: rotate(-2.5deg);
  box-shadow: 0 40px 80px -30px oklch(30% 0.025 55 / 0.45);
}
.statement__photo img { width: 100%; height: 100%; object-fit: cover; }
.statement__text p { color: var(--text-muted); max-width: 56ch; }
.statement__opening {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 400;
  font-style: italic;
  line-height: 1.3;
  color: var(--text);
  max-width: 48ch;
  margin-bottom: 1.5rem;
}
.statement__text .section-title { margin-bottom: 1.25rem; }
.statement__text .btn { margin-top: 1rem; }
@media (max-width: 900px) {
  .statement__grid { grid-template-columns: 1fr; }
  .statement__photo { transform: none; max-width: 420px; aspect-ratio: 4/3; }
}

/* ── Commissions ── */
.commissions {
  padding: var(--space-section) 0;
  background: var(--bg-blush);
  border-top: 1px solid var(--rule);
}
.commissions .section-header { max-width: 640px; }
.commissions .eyebrow { color: var(--carmine); }

.commissions__stories {
  max-width: 640px;
  margin-top: 3rem;
}
.commission-story + .commission-story {
  margin-top: 2.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--rule);
}
.commission-story .eyebrow {
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.commission-story h3 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  line-height: 1.15;
  margin-bottom: 0.75rem;
}
.commission-story p:last-child {
  color: var(--text-muted);
  margin-bottom: 0;
}

.commissions__cta {
  margin-top: 3rem;
}

/* ── Contact ── */
.contact { padding: var(--space-section-lg) 0; }
.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
}
.contact__video {
  margin: 0;
  aspect-ratio: 3/4;
  border-radius: var(--radius-lg);
  overflow: hidden;
  max-height: 72vh;
  box-shadow: 0 30px 60px -30px oklch(30% 0.025 55 / 0.3);
}
.contact__video video { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 900px) {
  .contact__grid { grid-template-columns: 1fr; }
  .contact__video { aspect-ratio: 4/3; max-height: 45vh; }
}
.contact__inner { max-width: 880px; }
.contact__title {
  font-size: clamp(2.75rem, 8vw, 6.5rem);
  line-height: 1;
  margin: 0 0 2rem;
}
.contact__lede { font-size: 1.1875rem; color: var(--text-muted); max-width: 52ch; margin-bottom: 2.5rem; }
.contact__email {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
  padding-bottom: .25rem;
  margin-bottom: 2.5rem;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.contact__email:hover { color: var(--accent-hover); border-bottom-color: var(--accent-hover); }
.contact__links { display: flex; flex-wrap: wrap; gap: 2rem; font-size: .95rem; }
.contact__links a { border-bottom: 1px solid var(--rule); padding-bottom: 2px; transition: border-color var(--t-fast), color var(--t-fast); }
.contact__links a:hover { border-bottom-color: var(--carmine); color: var(--carmine); }

/* ── Footer ── */
.footer {
  padding: 2.5rem 0;
  background: var(--sage-deep);
  border-top: none;
  font-size: .8125rem;
  color: oklch(75% 0.01 150);
}
.footer__inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.footer__sig { font-family: var(--font-display); font-style: italic; font-size: 1.125rem; color: var(--bg); }

/* ── Hero entrance choreography ── */
@keyframes hero-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero__inner > * {
  opacity: 0;
  animation: hero-in .8s var(--ease) forwards;
}
.hero__inner > *:nth-child(1) { animation-delay: .1s; }
.hero__inner > *:nth-child(2) { animation-delay: .25s; }
.hero__inner > *:nth-child(3) { animation-delay: .45s; }
.hero__inner > *:nth-child(4) { animation-delay: .6s; }

.hero__media {
  opacity: 0;
  animation: hero-in 1s var(--ease) forwards;
  animation-delay: .3s;
}

/* ── Scroll animations — gentle opacity only ── */
.animate-on-scroll { opacity: 0; transform: translateY(8px); transition: opacity var(--t-slow), transform var(--t-slow); }
.animate-on-scroll.is-visible { opacity: 1; transform: translateY(0); }
.project-card { transition-delay: calc(var(--i, 0) * 0.05s); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .animate-on-scroll { opacity: 1; transform: none; }
  .hero__inner > *, .hero__media { opacity: 1; animation: none; }
}

/* ── Small screen polish (≤ 600px) ── */
@media (max-width: 600px) {
  .hero {
    padding-top: 6rem;
    padding-bottom: 2.5rem;
    gap: 2rem;
  }
  .hero__media { aspect-ratio: 4/5; }
  .hero__ctas { flex-wrap: nowrap; }
  .hero__ctas .btn { padding: .75rem 1.1rem; font-size: .85rem; white-space: nowrap; }
  .hero__text-link { font-size: .85rem; }

  .section-lede { font-size: 1rem; }
  .hero__lede { font-size: 1rem; }
  .statement__photo { aspect-ratio: 1/1; }
  .filter-btn { padding: .5rem .9rem; font-size: .8rem; }
  .process__moments { gap: .75rem; }
  .process__moment-label { font-size: .72rem; }

  .contact__email {
    display: block;
    overflow-wrap: break-word;
    word-break: break-word;
    font-size: clamp(1.1rem, 5vw, 1.75rem);
  }
  .contact__links { gap: 1.25rem; }
  .footer__inner { flex-direction: column; gap: .5rem; }
}
