/* caiorubini.com — v2 editorial index */
:root {
  --bg: #080808;
  --bg-elev: #101010;
  --fg: #f3f2ee;
  --muted: rgba(243, 242, 238, 0.58);
  --faint: rgba(243, 242, 238, 0.32);
  --line: rgba(243, 242, 238, 0.14);
  --line-strong: rgba(243, 242, 238, 0.28);
  --header-h: 5.25rem;
  --pad: clamp(1.1rem, 3.2vw, 3.25rem);
  --max: 92rem;
}

*, *::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;
  text-transform: lowercase;
}
.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-family: "Rajdhani", sans-serif;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: lowercase;
}
.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); }

/* ——— Layout ——— */
.wrap { padding: 0 var(--pad); }
main { padding-bottom: 4rem; }

/* ——— Kicker ——— */
.kicker {
  padding: clamp(3.5rem, 9vh, 7rem) var(--pad) clamp(3.25rem, 7vh, 5.25rem);
}
.kicker p {
  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;
}

/* ——— Index ——— */
.index { padding: 0 var(--pad) 5rem; }
.index-list { list-style: none; padding: 0; margin: 0; }
.work { border-top: 1px solid var(--line); }
.work.is-open { background: linear-gradient(180deg, rgba(255,255,255,0.025), transparent 8rem); }
.work:last-child { border-bottom: 1px solid var(--line); }

.work-toggle {
  display: grid;
  grid-template-columns: 3.1rem minmax(0, 1fr) minmax(0, 1.15fr);
  align-items: baseline;
  width: 100%;
  text-align: left;
  padding: 1.05rem 0 1rem;
  color: var(--muted);
  transition: color 0.2s ease;
}
.work-toggle:hover,
.work.is-open > .work-toggle,
.work-toggle:focus-visible { color: var(--fg); }

.num {
  font-family: "Outfit", sans-serif;
  font-weight: 200;
  font-size: clamp(0.8rem, 0.7rem + 0.4vw, 1rem);
  letter-spacing: 0.08em;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.work-toggle:hover .num,
.work.is-open .num { color: var(--muted); }

.client,
.name {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 500;
  font-size: clamp(1.55rem, 0.7rem + 2.7vw, 3.35rem);
  letter-spacing: -0.035em;
  line-height: 1.08;
}
.name { text-align: right; justify-self: end; }

/* Mobile still — hidden on hover-capable pointers */
.work-still {
  display: none;
  margin: 0.15rem 0 1.25rem;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
}
.work-still img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform 8s ease;
}
.work.is-inview .work-still img { transform: scale(1.08); }
.work.is-open .work-still { display: none !important; }

/* ——— Expanded panel ——— */
.work-panel-wrap { display: none; }
.work.is-open .work-panel-wrap { display: block; }
.work.is-open .work-panel {
  animation: openPanel 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes openPanel {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: none; }
}

.work-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(16rem, 0.9fr);
  gap: 1.5rem 2.25rem;
  padding: 0.35rem 0 2.6rem;
}
.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; }

/* ——— Cursor preview ——— */
.cursor-preview {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 40;
  width: min(30vw, 440px);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translate3d(-12px, -12px, 0);
  transition: opacity 0.18s ease, visibility 0.18s ease;
  will-change: transform, opacity;
}
.cursor-preview.is-on {
  opacity: 1;
  visibility: visible;
}
.cursor-preview .frame {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}
.cursor-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: ken 9s ease-in-out infinite alternate;
}
.cursor-preview .caption {
  margin-top: 0.45rem;
  font-family: "Rajdhani", sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}
@keyframes ken {
  from { transform: scale(1) translate(0, 0); }
  to { transform: scale(1.07) translate(-1.2%, -0.8%); }
}

/* ——— 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: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem 4rem;
  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; justify-self: start; }
.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 var(--line-strong); }
.page-404 a:hover { box-shadow: inset 0 -1px 0 var(--fg); }

/* ——— Responsive ——— */
@media (max-width: 860px) {
  .work-panel { grid-template-columns: 1fr; gap: 1.25rem; padding-bottom: 2.1rem; }
  .about-bios { grid-template-columns: 1fr; gap: 2rem; }
}
@media (max-width: 720px) {
  :root { --header-h: 4.6rem; }
  .work-toggle {
    grid-template-columns: 2.2rem 1fr;
    grid-template-rows: auto auto;
    column-gap: 0.7rem;
    padding: 0.95rem 0 0.9rem;
  }
  .num { grid-row: 1 / span 2; align-self: start; padding-top: 0.35rem; }
  .client, .name {
    font-size: clamp(1.45rem, 5.6vw, 2.15rem);
    text-align: left;
    justify-self: start;
  }
  .name { grid-column: 2; }
  .kicker { padding-top: 2.6rem; padding-bottom: 2rem; }
  .footer-links { font-size: 1.15rem; }
}
@media (hover: none) {
  .cursor-preview { display: none !important; }
  .work-still { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .work-still img,
  .cursor-preview img,
  .work.is-inview .work-still img { transform: none !important; }
  .work-panel-wrap { transition: none; }
}
