/* caiorubini.com — v2 editorial, with images always visible */
:root {
  --bg: #080808;
  --fg: #f3f2ee;
  --muted: rgba(243, 242, 238, 0.58);
  --faint: rgba(243, 242, 238, 0.32);
  --line: rgba(243, 242, 238, 0.14);
  --header-h: 5.25rem;
  --pad: clamp(1.1rem, 3.2vw, 3.25rem);
  --still: 1088 / 456;
}

*, *::before, *::after { box-sizing: border-box; }
html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 0.5rem);
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Rajdhani", sans-serif;
  font-weight: 400;
  letter-spacing: 0.03em;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}
img { display: block; max-width: 100%; border: 0; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--fg); }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }
::selection { background: var(--fg); color: var(--bg); }

.skip {
  position: absolute;
  left: var(--pad);
  top: -4rem;
  z-index: 100;
  padding: 0.4rem 0.7rem;
  background: var(--fg);
  color: var(--bg);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
}
.skip:focus { top: 0.6rem; }

/* ——— Header ——— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: var(--header-h);
  padding: 1.1rem var(--pad) 0.95rem;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.brand { display: flex; flex-direction: column; gap: 0.05rem; line-height: 1; }
.brand-name {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: clamp(1.35rem, 1.1rem + 0.8vw, 1.7rem);
  letter-spacing: -0.02em;
}
.brand-role {
  font-family: "Outfit", sans-serif;
  font-weight: 200;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-top: 0.28rem;
}
.nav {
  display: flex;
  align-items: baseline;
  gap: 1.35rem;
  font-size: 1rem;
  letter-spacing: 0.08em;
}
.nav a { color: var(--muted); padding: 0.2rem 0; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--fg); }
.nav a[aria-current="page"] { box-shadow: inset 0 -1px 0 var(--fg); }
.header-end {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.lang {
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--faint);
}
.lang a { color: var(--faint); padding: 0.2rem 0; }
.lang a:hover { color: var(--fg); }
.lang a[aria-current="true"] { color: var(--muted); }
.lang-sep { color: var(--faint); user-select: none; }

/* ——— Kicker (compact: the films come first) ——— */
.kicker {
  padding: clamp(1.5rem, 3.5vh, 2.6rem) var(--pad) clamp(1.6rem, 3.8vh, 2.8rem);
}
.kicker p {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: clamp(1.25rem, 0.85rem + 1.8vw, 2.15rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
  max-width: 22ch;
}

/* ——— Index ——— */
.index {
  display: flex;
  flex-direction: column;
  gap: clamp(3.25rem, 7vw, 7.25rem);
  padding: 0 var(--pad) 6.5rem;
}
.work-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2.5rem, 5vw, 5.5rem) clamp(1.2rem, 2.4vw, 2.4rem);
  align-items: start;
}

.work-toggle {
  display: block;
  width: 100%;
  text-align: left;
  color: inherit;
}
.work-toggle:focus-visible { outline-offset: 4px; }

.work-frame {
  display: block;
  overflow: hidden;
  background: #111;
  aspect-ratio: var(--still);
}
.work-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.001);
  transition: transform 0.85s ease, filter 0.85s ease;
}
.work-frame:hover img {
  transform: scale(1.045);
  filter: brightness(1.06);
}

.work-extras {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.work-index {
  display: flex;
  align-items: baseline;
  gap: 0.65rem 1rem;
  padding-top: 0.75rem;
  flex-wrap: wrap;
}
.num {
  font-family: "Outfit", sans-serif;
  font-weight: 200;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  min-width: 1.6rem;
}
.titles {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.4em;
  align-items: baseline;
}
.client, .name {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--fg);
}

/* Feature: image almost full-bleed, large type beneath */
.work--feature .client,
.work--feature .name {
  font-size: clamp(1.85rem, 1rem + 3vw, 3.55rem);
}

/* Pair: two columns, slightly smaller type */
.work--pair .client,
.work--pair .name {
  font-size: clamp(1.2rem, 0.8rem + 1.2vw, 1.85rem);
}
.work--pair .work-index { padding-top: 0.6rem; }
.work--pair .work-extras { display: none; }

/* Asymmetric: still on one side, typography in the margin */
.work--shift-left,
.work--shift-right {
  display: grid;
  gap: clamp(1.1rem, 2.8vw, 3rem);
  align-items: end;
}
.work--shift-left {
  grid-template-columns: minmax(0, 1.35fr) minmax(14rem, 0.65fr);
}
.work--shift-right {
  grid-template-columns: minmax(14rem, 0.65fr) minmax(0, 1.35fr);
}
.work--shift .work-index {
  flex-direction: column;
  align-items: flex-start;
  padding-top: 0;
  padding-bottom: 0.15rem;
  gap: 0.55rem;
}
.work--shift .titles { flex-direction: column; gap: 0; }
.work--shift .client,
.work--shift .name {
  font-size: clamp(1.7rem, 0.9rem + 2.5vw, 3rem);
}
.work-toggle--index,
.work-toggle--still { display: block; width: 100%; text-align: left; color: inherit; }

/* Entrance: only when JS is on, and never as the default (so a no-JS or full-page
   render still shows every film). */
@media (prefers-reduced-motion: no-preference) {
  html.js .work {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.7s ease, transform 0.7s ease;
  }
  html.js .work.is-inview,
  html.js .work.is-open { opacity: 1; transform: none; }
}

/* Closed vs open: stills swap for the Vimeo player in the same well. */
.work:not(.is-open) .players,
.work:not(.is-open) .work-panel { display: none; }
.work.is-open .work-toggle--still { display: none; }
.work.is-open .work-panel {
  display: block;
  animation: openPanel 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes openPanel {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}

/* Feature, open: player | credits, title underneath */
.work--feature.is-open {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(16rem, 0.9fr);
  column-gap: 2.25rem;
  row-gap: 0.85rem;
  align-items: start;
}
.work--feature.is-open .work-media { grid-column: 1; grid-row: 1; }
.work--feature.is-open .work-toggle--index { grid-column: 1 / -1; grid-row: 2; }
.work--feature.is-open .work-panel { grid-column: 2; grid-row: 1; padding-top: 0; }

/* Pair, open: player then credits under the title, still in the same column */
.work--pair.is-open .work-panel { padding-top: 1rem; }

/* Shift, open: player keeps the image column; credits drop under the title */
.work--shift-left.is-open,
.work--shift-right.is-open {
  align-items: start;
}
.work--shift-left .work-media { grid-column: 1; grid-row: 1 / span 2; }
.work--shift-left .work-toggle--index { grid-column: 2; grid-row: 1; }
.work--shift-left.is-open .work-panel { grid-column: 2; grid-row: 2; padding-top: 1rem; }
.work--shift-right .work-media { grid-column: 2; grid-row: 1 / span 2; }
.work--shift-right .work-toggle--index { grid-column: 1; grid-row: 1; }
.work--shift-right.is-open .work-panel { grid-column: 1; grid-row: 2; padding-top: 1rem; }

.work-panel { }
.players { display: flex; flex-direction: column; gap: 1.15rem; }
.player {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}
.player iframe,
.player .player-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.player iframe { z-index: 2; background: #000; }
.player-poster { object-fit: cover; z-index: 1; transition: opacity 0.4s ease; }
.player.is-ready .player-poster { opacity: 0; pointer-events: none; }
.player-caption {
  margin-top: 0.4rem;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: lowercase;
}

.credits .full-title {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: clamp(1.35rem, 0.9rem + 1.4vw, 2rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 1.15rem;
}
.credits-list { display: grid; gap: 0.55rem 0; font-size: 0.98rem; letter-spacing: 0.04em; line-height: 1.3; }
.credits-list div { display: grid; gap: 0.05rem; }
.credits-list dt {
  font-weight: 500;
  color: var(--faint);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.credits-list dd { color: var(--fg); }
.credits details { margin-top: 1.25rem; }
.credits summary {
  list-style: none;
  cursor: pointer;
  color: var(--muted);
  letter-spacing: 0.1em;
  font-size: 0.82rem;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.credits summary::-webkit-details-marker { display: none; }
.credits summary::before {
  content: "";
  width: 0.7rem;
  height: 0.7rem;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 2v16M2 10h16' stroke='%23000' stroke-width='1.6' fill='none'/%3E%3C/svg%3E") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 2v16M2 10h16' stroke='%23000' stroke-width='1.6' fill='none'/%3E%3C/svg%3E") center / contain no-repeat;
}
.credits details[open] summary::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M4 4l12 12M16 4L4 16' stroke='%23000' stroke-width='1.6' fill='none'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M4 4l12 12M16 4L4 16' stroke='%23000' stroke-width='1.6' fill='none'/%3E%3C/svg%3E");
}
.credits summary:hover { color: var(--fg); }
.credits-full {
  margin-top: 0.9rem;
  max-height: min(50vh, 28rem);
  overflow: auto;
  padding-right: 0.6rem;
  font-size: 0.92rem;
  line-height: 1.55;
  letter-spacing: 0.03em;
  color: var(--muted);
}
.credits-full b, .credits-full strong { color: var(--fg); font-weight: 600; }

/* ——— Footer ——— */
.site-footer {
  padding: 2.5rem var(--pad) 2.75rem;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 1.25rem;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.4rem;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 500;
  font-size: clamp(1.05rem, 0.8rem + 0.8vw, 1.45rem);
  letter-spacing: -0.02em;
}
.footer-links a { color: var(--fg); }
.footer-links a:hover { color: var(--muted); }
.footer-copy {
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: rgba(243, 242, 238, 0.45);
}

/* ——— About ——— */
.page-about { padding: 0 0 5rem; }
.about-hero { padding: clamp(3.5rem, 9vh, 7rem) var(--pad) clamp(2.5rem, 5vh, 3.5rem); }
.about-hero h1 {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: clamp(1.85rem, 1.1rem + 3.6vw, 4.35rem);
  letter-spacing: -0.035em;
  line-height: 1.02;
  max-width: 18ch;
}
.about-bios {
  display: block;
  padding: 0 var(--pad) 4.5rem;
  max-width: 86rem;
}
.bio-label {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 0.7rem;
}
.bio-text {
  font-size: clamp(1.05rem, 0.95rem + 0.3vw, 1.2rem);
  line-height: 1.5;
  letter-spacing: 0.03em;
  color: rgba(243, 242, 238, 0.82);
  max-width: 42em;
}
.awards { padding: 0 var(--pad) 4rem; }
.awards h2, .about-contact h2 {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  margin-bottom: 1.25rem;
}
.awards-list { list-style: none; padding: 0; margin: 0; max-width: 46rem; border-top: 1px solid var(--line); }
.awards-list li {
  display: grid;
  grid-template-columns: 3.2rem 1fr;
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
  font-family: "Space Grotesk", sans-serif;
}
.awards-list .n { font-weight: 700; font-size: 1.35rem; letter-spacing: -0.03em; }
.awards-list .name { font-size: 1.15rem; letter-spacing: -0.02em; text-align: left; }
.awards-list .note {
  display: block;
  font-family: "Rajdhani", sans-serif;
  font-size: 0.88rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-top: 0.15rem;
}
.about-contact { padding: 0 var(--pad) 2rem; }
.about-contact .contact-mail {
  display: inline-block;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 500;
  font-size: clamp(1.4rem, 1rem + 1.4vw, 2rem);
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

/* ——— 404 ——— */
.page-404 {
  min-height: calc(100vh - var(--header-h) - 8rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem var(--pad) 6rem;
}
.page-404 h1 {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: clamp(2.4rem, 1.2rem + 5vw, 5.5rem);
  letter-spacing: -0.04em;
  line-height: 0.95;
  margin-bottom: 1.5rem;
}
.page-404 p { color: var(--muted); font-size: 1.15rem; }
.page-404 a { color: var(--fg); box-shadow: inset 0 -1px 0 rgba(243,242,238,0.28); }
.page-404 a:hover { box-shadow: inset 0 -1px 0 var(--fg); }

/* ——— Responsive ——— */
@media (max-width: 900px) {
  .work-panel { grid-template-columns: 1fr; gap: 1.25rem; }
  .about-bios { grid-template-columns: 1fr; gap: 2rem; }
  .work--shift-left,
  .work--shift-right,
  .work--feature.is-open {
    display: block;
  }
  .work--shift-left .work-media,
  .work--shift-left .work-toggle--index,
  .work--shift-left .work-panel,
  .work--shift-right .work-media,
  .work--shift-right .work-toggle--index,
  .work--shift-right .work-panel { grid-column: auto; grid-row: auto; }
  .work--shift .work-index {
    flex-direction: row;
    flex-wrap: wrap;
    padding-top: 0.7rem;
    align-items: baseline;
  }
  .work--shift .titles { flex-direction: row; flex-wrap: wrap; gap: 0 0.4em; }
  .work--shift .client,
  .work--shift .name { font-size: clamp(1.45rem, 5.4vw, 2.1rem); }
}
@media (max-width: 720px) {
  :root { --header-h: 4.6rem; }
  .header-end { gap: 1rem; flex-wrap: nowrap; }
  .work-row { grid-template-columns: 1fr; gap: clamp(2.5rem, 8vw, 3.5rem); }
  .work--feature .client,
  .work--feature .name,
  .work--pair .client,
  .work--pair .name {
    font-size: clamp(1.4rem, 5.6vw, 2.05rem);
  }
  .kicker { padding-top: 1.3rem; padding-bottom: 1.5rem; }
  .index { gap: clamp(2.5rem, 8vw, 3.5rem); padding-bottom: 4.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .work { opacity: 1; transform: none; }
  .work-frame img,
  .work-frame:hover img { transform: none; filter: none; }
}
