/* ===================================================================
   FORTIN KAZANIETZ — styles
   Palette is STRICT: white, oxblood, black. No ivory / bone / beige.
   Warmth comes from the paper TEXTURE, never from colour.
   =================================================================== */

:root {
  --white:      #FFFFFF;
  /* Warm off-white sampled from the studio wordmark artwork. */
  --warm-white: #F2E8E7;
  /* Oxblood sampled from the studio texture artwork. */
  --oxblood:    #2E0A0E;
  --black:      #0E0E0E;

  --ink:        var(--black);
  --bg:         var(--white);

  --measure:    68ch;
  --gutter:     clamp(1.25rem, 4vw, 4rem);
  --header-h:   4.5rem;

  --ease:       cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter Tight", system-ui, -apple-system, Segoe UI, sans-serif;
  font-weight: 400;
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.0625rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: 0.02em;
  margin: 0;
}

p { margin: 0; }

a { color: inherit; }

/* ---- Paper texture ------------------------------------------------ *
   White surfaces carry a faint procedural noise — the #paper-noise SVG
   filter (held offscreen in .texture-source) applied via body::before.
   The oxblood surfaces (hero, contact) instead use the studio's real
   texture artwork as a background image — see .hero / .contact.        */
.texture-source {
  position: absolute;
  width: 0; height: 0;
  overflow: hidden;
}

/* A whisper of noise across the page — barely there on white. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  filter: url(#paper-noise);
  mix-blend-mode: multiply;
  opacity: 0.05;
}

/* ---- Header ------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0 var(--gutter);
  color: var(--ink);
  transition: color 0.4s var(--ease), background-color 0.4s var(--ease);
}
/* Past the hero the header becomes a solid white bar; content scrolls
   under it. While over the hero (.is-inverted) it stays transparent so
   the velvety artwork shows through. */
.site-header:not(.is-inverted) {
  background-color: var(--white);
}
/* Inverted state: white-on-oxblood while scrolled over the hero. */
.site-header.is-inverted {
  color: var(--white);
}

.wordmark {
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  /* Hidden while the hero logo is on screen — see the rule below. */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s var(--ease), color 0.4s var(--ease);
}
/* Once scrolled past the hero, the wordmark fades in (in oxblood, on
   the now-white header) so the studio name is never off-screen. */
.site-header:not(.is-inverted) .wordmark {
  opacity: 1;
  pointer-events: auto;
  color: var(--oxblood);
}

.site-nav {
  margin-left: auto;
  display: flex;
  gap: 1.75rem;
}
.site-nav a {
  text-decoration: none;
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s var(--ease);
}
.site-nav a:hover { border-color: currentColor; }

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: inherit;
  font: inherit;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  transition: opacity 0.25s var(--ease);
}
.lang-toggle:hover { opacity: 0.7; }
.lang-current { font-weight: 600; }
.lang-other   { opacity: 0.5; }
.lang-sep     { opacity: 0.4; }

/* ---- Hero --------------------------------------------------------- *
   The hero IS the studio's logo artwork — wordmark + texture baked into
   one image, set as the background. The .hero-caption holds the only
   live text (kicker + locations), kept low and out of the way.         */
.hero {
  position: relative;
  min-height: 100svh;
  /* Studio logo artwork; oxblood paints first as a fallback. */
  background-color: var(--oxblood);
  background-image: url("../assets/textures/hero-logo.webp");
  background-size: cover;
  background-position: center;
  color: var(--white);
  display: flex;
  align-items: flex-end;
  padding: var(--gutter);
  padding-bottom: clamp(3rem, 8vh, 6rem);
  overflow: hidden;
}
.hero-caption {
  position: relative;
  z-index: 2;
}
/* Kicker and location are one matched label pair: even letter-spacing,
   no word justification. The location is scaled down by main.js so its
   line renders to the exact same width as the kicker above it. */
.hero-kicker,
.hero-location {
  width: fit-content;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0.78;
}
.hero-kicker { margin-bottom: 0.5rem; }

/* Accessible-but-invisible: keeps the studio name in the DOM for SEO
   and screen readers while the wordmark lives in the hero image. */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---- Sections ----------------------------------------------------- */
.section-head { margin-bottom: 2.5rem; }
.section-heading {
  font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.5rem);
  text-transform: uppercase;
  color: var(--oxblood);
}
/* On the dark contact panel the heading stays warm-white. */
.contact .section-heading { color: var(--warm-white); }
.section-intro {
  margin-top: 0.75rem;
  max-width: var(--measure);
  opacity: 0.7;
}

.work {
  position: relative;
  background: var(--white);
  padding: clamp(4rem, 10vh, 8rem) var(--gutter);
}

/* ---- Filters ------------------------------------------------------ */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
}
.filter {
  background: none;
  border: 1px solid rgba(14, 14, 14, 0.25);
  border-radius: 999px;
  color: var(--ink);
  font: inherit;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.4rem 0.95rem;
  cursor: pointer;
  transition: background-color 0.25s var(--ease),
              color 0.25s var(--ease),
              border-color 0.25s var(--ease);
}
.filter:hover { border-color: var(--oxblood); }
.filter.is-active {
  background: var(--oxblood);
  border-color: var(--oxblood);
  color: var(--white);
}

/* ---- Project grid ------------------------------------------------- */
.project-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1mm;
}
.project-card {
  position: relative;
  display: block;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
/* Filtered-out items collapse out of the grid. */
.project-card[hidden] { display: none; }

.project-thumb {
  display: block;
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--oxblood);
  overflow: hidden;
}
.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.project-card:hover .project-thumb img { transform: scale(1.03); }
.project-thumb img { transition: transform 0.5s var(--ease); }

/* Title + meta sit as an overlay on the image, revealed on hover/focus
   over a dark scrim so the text stays legible against any photo. */
.project-info {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.2rem;
  padding: clamp(0.85rem, 2vw, 1.35rem);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
  background: linear-gradient(
    to top,
    rgba(14, 5, 6, 0.9) 0%,
    rgba(14, 5, 6, 0.35) 48%,
    rgba(14, 5, 6, 0) 100%);
}
.project-card:hover .project-info,
.project-card:focus-visible .project-info { opacity: 1; }

.project-title {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--warm-white);
}
.project-meta {
  font-size: 0.8125rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--warm-white);
  opacity: 0.78;
}

/* ---- Project detail ---------------------------------------------- */
.project-detail {
  position: relative;
  background: var(--white);
  padding: clamp(4rem, 10vh, 8rem) var(--gutter);
  scroll-margin-top: var(--header-h);
}
.detail-back {
  background: none;
  border: none;
  font: inherit;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--oxblood);
  cursor: pointer;
  padding: 0;
  margin-bottom: 2rem;
}
.detail-back::before { content: "← "; }
.detail-head {
  border-bottom: 1px solid rgba(14, 14, 14, 0.15);
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
}
.detail-ref {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--oxblood);
  margin-bottom: 0.6rem;
}
.detail-title {
  font-size: clamp(1.75rem, 1.4rem + 1.8vw, 3rem);
  text-transform: uppercase;
  color: var(--oxblood);
}

/* Two columns: fact list beside the prose. Stacks on narrow screens. */
.detail-text {
  margin-top: clamp(1.5rem, 4vw, 3rem);
  display: grid;
  grid-template-columns: minmax(13rem, 17rem) 1fr;
  gap: clamp(1.75rem, 5vw, 4.5rem);
  align-items: start;
}

.detail-meta { margin: 0; }
.detail-meta div {
  padding: 0.85rem 0;
  border-top: 1px solid rgba(14, 14, 14, 0.15);
}
.detail-meta div:last-child { border-bottom: 1px solid rgba(14, 14, 14, 0.15); }
.detail-meta dt {
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.5;
  margin-bottom: 0.25rem;
}
.detail-meta dd { margin: 0; font-weight: 500; }

.detail-prose { max-width: var(--measure); }
.detail-body { font-size: 1.125rem; }
.detail-scope { margin-top: 2rem; }
.detail-sub {
  font-size: 0.8125rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--oxblood);
  margin-bottom: 0.6rem;
}

.detail-gallery {
  margin-top: clamp(1rem, 2.5vw, 2rem);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1rem, 2.5vw, 2rem);
}
#detail-cover { margin-top: clamp(1.5rem, 4vw, 3rem); }
.image-slot {
  margin: 0;
  aspect-ratio: 4 / 3;
  background: var(--oxblood);
  overflow: hidden;
}
.image-slot--wide { aspect-ratio: 16 / 7; }
.image-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---- Studio ------------------------------------------------------- */
.studio {
  position: relative;
  background: var(--white);
  padding: clamp(4rem, 10vh, 8rem) var(--gutter);
  border-top: 1px solid rgba(14, 14, 14, 0.12);
}
.studio-sub {
  font-size: 0.8125rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 2.5rem;
  margin-bottom: 1.25rem;
  color: var(--oxblood);
}

/* Principals are the About content: photo, name, location, bio.
   Stacked vertically; each is a two-column layout (photo / text). */
.principals {
  list-style: none;
  margin: 3rem 0 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(3rem, 7vw, 5.5rem);
}
.principal {
  display: grid;
  grid-template-columns: minmax(0, 18rem) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
  padding-top: 2rem;
  border-top: 1px solid rgba(14, 14, 14, 0.18);
}
.principal-photo {
  margin: 0;
  aspect-ratio: 4 / 5;
  background: var(--oxblood);
  overflow: hidden;
}
.principal-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.principal-text {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.principal-name {
  font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--oxblood);
  text-transform: uppercase;
}
.principal-city {
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.55;
}
.principal-bio {
  margin-top: 1.25rem;
  max-width: var(--measure);
  line-height: 1.65;
}

/* ---- Contact ------------------------------------------------------ */
.contact {
  position: relative;
  background-color: var(--oxblood);
  background-image: url("../assets/textures/oxblood-texture.webp");
  background-size: cover;
  background-position: center;
  color: var(--white);
  padding: clamp(4rem, 12vh, 9rem) var(--gutter);
  overflow: hidden;
}
.contact-inner { position: relative; z-index: 2; max-width: var(--measure); }
.contact-body {
  margin-top: 1rem;
  font-size: 1.125rem;
  opacity: 0.85;
}
.contact-cta {
  display: inline-block;
  margin-top: 2rem;
  padding: 0.85rem 1.75rem;
  border: 1px solid var(--white);
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}
.contact-cta:hover { background: var(--white); color: var(--oxblood); }
.contact-details {
  margin-top: 2.5rem;
  font-size: 0.875rem;
  opacity: 0.7;
}
.contact-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-right: 0.5rem;
}

/* ---- Footer ------------------------------------------------------- */
.site-footer {
  background: var(--black);
  color: var(--white);
  padding: 2rem var(--gutter);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
}
.footer-mark { text-transform: uppercase; font-weight: 600; }
.footer-rights { opacity: 0.6; }

/* ---- Motion: staggered hero reveal -------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(1.25rem);
}
.is-ready .reveal {
  animation: reveal-in 0.9s var(--ease) forwards;
}
.is-ready .reveal:nth-child(1) { animation-delay: 0.05s; }
.is-ready .reveal:nth-child(2) { animation-delay: 0.18s; }
.is-ready .reveal:nth-child(3) { animation-delay: 0.31s; }
.is-ready .reveal:nth-child(4) { animation-delay: 0.44s; }

@keyframes reveal-in {
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  .is-ready .reveal { animation: none; }
  * { transition-duration: 0.01ms !important; }
}

/* ---- Responsive --------------------------------------------------- */
@media (max-width: 52rem) {
  .detail-text { grid-template-columns: 1fr; }
  .project-grid { grid-template-columns: repeat(2, 1fr); }
  .principal { grid-template-columns: 1fr; }
  .principal-photo { max-width: 22rem; aspect-ratio: 4 / 5; }
}
@media (max-width: 38rem) {
  .site-nav { gap: 1rem; }
  .site-nav a { font-size: 0.75rem; }
  .detail-gallery { grid-template-columns: 1fr; }
  .image-slot--wide { aspect-ratio: 4 / 3; }
  .project-grid { grid-template-columns: 1fr; }
}
