/* ==========================================================================
   Sofia Pucci — Portfolio  |  Museum-catalogue design system
   Paper #FAF8F4 · Ink #141210 · Oxblood #7D2027 · Gilt #D9A441
   Fraunces (display) + Montserrat (body)
   ========================================================================== */

:root {
  --paper: #faf8f4;
  --surface: #ffffff;
  --ink: #141210;
  --ink-text: #1a1816;
  --body: #2b2622;
  --secondary: #6b655c;
  --border: #e3dcd1;
  --border-dark: #d8d0c4;
  --oxblood: #7d2027;
  --gilt: #d9a441;
  --warm-grey: #b7ae9f;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Montserrat", -apple-system, sans-serif;

  --max-w: 1074px;
  --gutter: clamp(1.25rem, 5vw, 3.9rem);

  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--body);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

/* ---------- Typography ---------- */

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; color: var(--ink-text); margin: 0; }

.h1 { font-size: clamp(2.4rem, 6.5vw, 4.5rem); line-height: 1.05; letter-spacing: -0.01em; }
.h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); line-height: 1.15; }
.h3 { font-size: clamp(1.25rem, 2.5vw, 1.625rem); line-height: 1.25; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--oxblood);
  margin: 0 0 1rem;
}

.label {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--secondary);
  margin: 0 0 0.35rem;
}

.numeral {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 1.5rem;
  color: var(--oxblood);
  white-space: nowrap;
}

.caption {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.875rem;
  color: var(--secondary);
  margin-top: 0.75rem;
}

.note {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.875rem;
  color: var(--secondary);
}

a { color: var(--oxblood); text-decoration: none; }

.text-link {
  position: relative;
  font-weight: 600;
}
.text-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 100%; height: 1px;
  background: currentColor;
  opacity: 0;
  transition: opacity 0.15s var(--ease);
}
.text-link:hover::after, .text-link:focus-visible::after { opacity: 1; }

/* ---------- Layout primitives ---------- */

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

/* Global section rhythm — tablet/mobile: gap 24, pad 10/20; desktop overrides below */
main { display: flex; flex-direction: column; gap: 24px; padding-top: 24px; }
.section { padding-block: 10px 20px; }

.rule-head {
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.6rem;
  margin-bottom: 1.5rem;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  max-width: 1200px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1rem;
}
.logo { font-family: var(--font-display); font-weight: 600; font-size: 1.375rem; color: var(--ink-text); }
.site-nav { display: flex; gap: 1.75rem; }
.site-nav a { color: var(--ink-text); font-weight: 600; font-size: 0.9375rem; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 0.7rem 1.4rem;
  border-radius: 8px;
  border: 0;
  cursor: pointer;
  transition: background-color 0.15s var(--ease), transform 0.15s var(--ease);
}
.btn:hover, .btn:focus-visible { background: var(--oxblood); color: var(--paper); }
.btn:active { transform: scale(0.98); }

/* ---------- Case-study intro ---------- */

.case-intro { padding-top: 0; } /* main gap supplies header spacing */

.intro-grid {
  display: grid;
  gap: 2.5rem;
  margin-top: 2.5rem;
}
@media (min-width: 900px) {
  .intro-grid { grid-template-columns: 522fr 338fr; column-gap: clamp(3rem, 8vw, 13rem); }
}

.overview dl { margin: 0; }
.overview dt {
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--secondary);
  border-bottom: 1px solid var(--border); padding-bottom: 0.3rem; margin-bottom: 0.5rem;
}
.overview dd { margin: 0 0 1.4rem; }

/* ---------- Hero plate ---------- */

.plate {
  border: 1px solid var(--border-dark);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}
.plate img, .plate video { width: 100%; height: auto; }
/* Tall full-page captures: crop to a tidy plate instead of rendering at full height */
.plate img { max-height: 640px; object-fit: cover; object-position: top; }
.media-pair .plate img { max-height: 480px; }
.img-archival { filter: none; } /* covers ship pre-treated; content plates run raw as in Figma */

/* Bare figure: image sits directly on the paper background (no plate card) */
.figure-bare { margin: 2rem 0 0; }
.figure-bare img { width: 100%; max-height: 640px; object-fit: contain; object-position: left top; }

.hero-plate { margin-top: clamp(2rem, 5vw, 3.5rem); }

/* ---------- Cards ---------- */

.card-grid { display: grid; gap: 1.25rem; margin-top: 2rem; }
@media (min-width: 640px)  { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px)  { .card-grid { grid-template-columns: repeat(3, 1fr); }
                             .card-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
                             .card-grid.cols-2 { grid-template-columns: repeat(2, 1fr); } }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
}
.card-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 0.75rem; margin-bottom: 0.75rem; /* Figma: 12px inside insight/metric cards */
}
.card-grid.tight .card-head { margin-bottom: 0.5rem; } /* Figma: 8px inside challenge cards */
.card-head h3 { font-family: var(--font-body); font-size: 1.0625rem; font-weight: 600; }
.card p { font-size: 0.9375rem; }
.card h3.metric { color: var(--oxblood); }

/* ---------- Project cards (home + other projects) ---------- */

.project-grid { display: grid; gap: 1.5rem; margin-top: 2rem; }
@media (min-width: 700px) { .project-grid { grid-template-columns: repeat(2, 1fr); } }
.project-grid.three { gap: 1.25rem; }
@media (min-width: 900px) { .project-grid.three { grid-template-columns: repeat(3, 1fr); } }

.project-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  color: inherit;
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease);
}
.project-card .cover {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--ink);
}
.project-card .cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.2s var(--ease);
}
.project-card .meta { padding: 1rem 1.25rem; } /* Figma: 16px 20px */
.project-card .meta .eyebrow { margin-bottom: 0.35rem; font-size: 0.6875rem; }
.project-card h3 { font-family: var(--font-display); font-size: 1.375rem; margin-bottom: 0.25rem; }
.project-card p { font-size: 0.9375rem; color: var(--body); margin: 0; }

.project-card:hover, .project-card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--border-dark);
}
.project-card:hover .cover img { transform: scale(1.02); }

/* ---------- Ink band (pull quotes) ---------- */

.band {
  background: var(--ink);
  color: var(--paper);
  padding-block: clamp(2.5rem, 6vw, 4rem);
}
.band .quote {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.375rem, 3.2vw, 2.125rem);
  line-height: 1.4;
  color: var(--paper);
  max-width: 60ch;
}
.band .quote em, .band .quote strong {
  font-style: italic; font-weight: 400; color: var(--gilt);
}

/* ---------- Process / media ---------- */

.media-pair { display: grid; gap: 1.5rem; margin-block: 1.5rem; }
@media (min-width: 700px) { .media-pair { grid-template-columns: 1fr 1fr; } }

.figure { margin: 0; }
.figure .concept-label {
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--secondary); margin-bottom: 0.6rem;
}

.video-plate { position: relative; cursor: pointer; }
.video-plate .play-badge {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: rgba(20, 18, 16, 0.25);
  transition: opacity 0.2s var(--ease);
}
.video-plate .play-badge span {
  display: grid; place-items: center;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  font-size: 1.2rem;
  padding-left: 4px;
}
.video-plate.playing .play-badge { opacity: 0; pointer-events: none; }

/* ---------- Footer ---------- */

.site-footer { background: var(--ink); color: var(--paper); margin-top: 24px; }
.site-footer .wrap {
  max-width: 1200px;
  display: grid; gap: 2.5rem;
  padding-block: clamp(2.5rem, 6vw, 4rem);
}
@media (min-width: 800px) {
  .site-footer .wrap { grid-template-columns: 1fr 340px; align-items: center; }
}
.footer-kicker { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.5rem, 3vw, 2.25rem); color: var(--warm-grey); margin: 0 0 0.5rem; }
.footer-email { font-size: clamp(1.125rem, 2.6vw, 1.75rem); font-weight: 600; color: var(--paper); text-decoration: underline; text-underline-offset: 4px; }
.footer-links { display: grid; gap: 0.4rem; }
.footer-links a {
  display: flex; justify-content: space-between; align-items: center;
  color: var(--paper); font-weight: 600; font-size: 1.0625rem;
  border-bottom: 1px solid rgba(250, 248, 244, 0.25);
  padding-block: 0.6rem;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.footer-links a:hover { color: var(--gilt); border-color: var(--gilt); }

/* ---------- Home hero ---------- */

.home-hero { padding-block: 20px 0; } /* QA: 20px top (plus the container's 24/32px gap), no bottom padding */

/* Animated multilingual greeting — matches the h1 type; reserves one line so the hero never shifts */
.home-hero .greeting {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink-text);
  font-size: clamp(2.6rem, 7vw, 4rem);
  line-height: 1.05;
  min-height: 1.05em;
}
.home-hero .greeting__text {
  display: inline-block;
  animation: greeting-cycle 2s ease-in-out infinite;
  will-change: opacity;
}
@keyframes greeting-cycle {
  0%, 100% { opacity: 0; }
  15%, 85% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .home-hero .greeting__text { animation: none; opacity: 1; }
}

.home-hero h1 { font-size: clamp(2.6rem, 7vw, 4rem); line-height: 1.05; }
.home-hero h1 .accent { color: var(--oxblood); }
.home-hero .sub { max-width: 36rem; margin-top: 1.25rem; font-size: clamp(1rem, 2vw, 1.125rem); line-height: 1.55; }

/* ---------- Contact ---------- */

.contact-grid { display: grid; gap: 2.5rem; align-items: start; }
@media (min-width: 800px) { .contact-grid { grid-template-columns: 420px 1fr; } }
.contact-list { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: 0.6rem; }

/* ---------- Entrance animation ---------- */

.reveal { opacity: 0; transform: translateY(12px); transition: opacity 0.4s var(--ease), transform 0.4s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .project-card, .project-card .cover img, .btn { transition: none; }
}

/* ---------- Desktop spacing per current Figma (source of truth) ---------- */

@media (min-width: 960px) {
  .site-header .wrap { padding-block: 2rem; }            /* 32px */
  main { gap: 32px; padding-top: 32px; }                 /* section gap 32 */
  .section { padding-block: 20px 40px; }                 /* top 20 / bottom 40 */
  .site-footer { margin-top: 32px; }
  .intro-grid { margin-top: 2rem; }                      /* 32px */
  .band { padding-block: 2.5rem; }                       /* 40px */
  .card-grid { gap: 1.875rem; margin-top: 1.5rem; }      /* 30px / 24px */
  .media-pair { gap: 1.875rem; }                         /* 30px */
  .project-grid, .project-grid.three { gap: 1.875rem; }  /* 30px */
  .figure-bare { margin-top: 2rem; }
  .site-footer .wrap { padding-block: 2.5rem; }          /* 40px */
}

/* Full-height plates (no vertical crop) — QA: What's On MVP / Phase 2 */
.plate--full img { max-height: none !important; object-fit: initial; }

/* Contact photo — Figma: portrait 430×573 (~3:4) crop in the rounded plate */
.contact-photo { aspect-ratio: 430 / 573; }
.contact-photo img { width: 100%; height: 100%; max-height: none; object-fit: cover; object-position: 50% 50%; }

/* ---------- Utilities ---------- */

.mt-0 { margin-top: 0; }
.stack > * + * { margin-top: 1rem; }
.two-col-text { display: grid; gap: 1.5rem; }
@media (min-width: 800px) { .two-col-text { grid-template-columns: 1fr 1fr; gap: 3rem; } }
