/* ════════════════════════════════════════════════════════════
   Ruby Christiansen — site-wide design system
   Derived from the "Ruby Portfolio" Figma Sites design.
   Palette, type scale, and components match the Figma file.
   ════════════════════════════════════════════════════════════ */

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  --pink:        #ffa4d4;
  --pink-light:  #ffd2ea;
  --peach:       #ffcc99;
  --yellow:      #ffe98a;
  --green:       #79e8b3;
  --blue:        #80b1ff;
  --lavender:    #a4a4f4;
  --cream:       #fcecd6;
  --paper:       #fbf9ea;
  --brown:       #422307;
  --ink:         #000000;
  --divider:     #ebebeb;

  --font-display: 'Bricolage Grotesque', 'Arial Black', sans-serif;
  --font-body:    'Archivo Narrow', 'Arial Narrow', sans-serif;
  --font-accent:  'Lisu Bosa', Georgia, serif;

  --max-width: 1280px;

  /* 200px at the 1280 design width */
  --display-1: clamp(3.25rem, 15.6vw, 12.5rem);
  /* 120px at the 1280 design width (mega button / big headlines) */
  --display-2: clamp(2.25rem, 9.4vw, 7.5rem);
  /* 80px at the 1280 design width (section headlines) */
  --display-3: clamp(2rem, 6.25vw, 5rem);
}

/* ── Reset & base ───────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.3;
  color: var(--ink);
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
button { font: inherit; background: none; border: none; cursor: pointer; }

.display {
  font-family: var(--font-display);
  font-weight: 800;
  font-stretch: 88%;
  font-variation-settings: 'opsz' 96;
  letter-spacing: -0.01em;
  line-height: 0.8;
}

.label {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
}

/* ── Top bar: pill navigation ───────────────────────────── */
.topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 20px;
}

.pill-nav {
  display: flex;
}

.pill {
  width: 72px;
  height: 72px;
  margin-left: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream);
  color: var(--brown);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 15px;
  transition: background 0.25s, transform 0.25s;
}

.pill:hover {
  background: var(--pink-light);
  transform: scale(1.06);
}

.pill.is-active {
  background: var(--yellow);
}

/* ── Page band (sub-page headers) ───────────────────────── */
.page-band {
  --band: var(--blue);
  --band-ink: var(--pink-light);
  background: var(--band);
  min-height: clamp(300px, 40vw, 520px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 120px 20px 8px;
  position: relative;
}

.page-band .band-inner {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
}

.band-title {
  font-size: var(--display-1);
  color: var(--band-ink);
  overflow-wrap: anywhere;
}

.band-back {
  position: absolute;
  top: 104px;
  left: 0;
  right: 0;
  margin: 0 auto;
  max-width: var(--max-width);
  padding: 0 20px;
}

/* ── Text link (arrow link) ─────────────────────────────── */
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 16px;
  color: var(--lavender);
}

.text-link .arrow {
  transition: transform 0.25s;
}

.text-link:hover .arrow { transform: translateX(4px); }
.text-link.link-back:hover .arrow { transform: translateX(-4px); }
.text-link:hover { text-decoration: underline; }

.page-band .text-link { color: var(--band-ink); }

/* ── Hero (home) ────────────────────────────────────────── */
.hero {
  padding-top: 240px;
  background: #fff;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.hero-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
}

.hero-tag {
  padding-bottom: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.hero-title {
  font-size: var(--display-1);
  color: var(--pink);
}

.hero-title .star {
  display: inline-block;
  width: 0.55em;
  height: 0.55em;
  margin-left: 0.12em;
  vertical-align: baseline;
  animation: spin 14s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.hero-media {
  margin-top: -4px;
  position: relative;
}

/* "that's me" annotation overlaid on the hero photo */
.hero-media .hero-annotation {
  position: absolute;
  left: 52%;
  top: 72%;
  width: 22%;
  height: auto;
  aspect-ratio: auto;
  object-fit: fill;
  pointer-events: none;
  /* build-on reveal (left-to-right) when scrolled into view */
  opacity: 0;
  clip-path: inset(0 100% 0 0);
  transition: opacity 0.4s ease, clip-path 1.1s cubic-bezier(0.6, 0, 0.2, 1);
}

.hero-media .hero-annotation.visible {
  opacity: 1;
  clip-path: inset(0 0 0 0);
}

@media (prefers-reduced-motion: reduce) {
  .hero-media .hero-annotation {
    transition: opacity 0.3s ease;
    clip-path: none;
  }
}

.hero-media img,
.hero-media video {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

/* ── Section headline ───────────────────────────────────── */
.section-head {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: clamp(64px, 9vw, 140px) 20px 28px;
}

.section-head h2 {
  font-size: var(--display-3);
  color: var(--ink);
}

/* Home: Art Direction & Design section headers */
#art-direction .section-head {
  padding-top: 55px;
  padding-bottom: 20px;
}

#design .section-head {
  padding-top: 40px;
  padding-bottom: 20px;
}

#art-direction .section-head h2,
#design .section-head h2 {
  font-size: clamp(2.75rem, 13vw, 128px);
  color: var(--peach);
}

/* Work page: right-aligned section headings */
.work-head {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: clamp(48px, 8vw, 120px) 20px 24px;
  text-align: right;
}

.work-head h2 {
  font-size: clamp(2.75rem, 13vw, 128px);
  color: var(--peach);
}

/* ── Project card grid ──────────────────────────────────── */
.card-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}

.card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--divider);
  margin: -1px 0 0 -1px; /* collapse shared hairlines */
}

.card-media {
  overflow: hidden;
}

.card-media img,
.card-media video {
  width: 100%;
  aspect-ratio: 640 / 528;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.card:hover .card-media img,
.card:hover .card-media video {
  transform: scale(1.04);
}

.card-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
  min-height: 84px;
  background: #fff;
}

.card-info .label { font-size: 10px; }

.card-title {
  font-family: var(--font-accent);
  font-weight: 200;
  font-size: 20px;
  letter-spacing: -0.02em;
  text-align: right;
}

/* ── Mega button ────────────────────────────────────────── */
.mega-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: clamp(40px, 6vw, 80px) 32px;
  border-radius: 50px;
  background: var(--blue);
  font-family: var(--font-display);
  font-weight: 800;
  font-stretch: 88%;
  font-variation-settings: 'opsz' 96;
  letter-spacing: -0.01em;
  line-height: 0.8;
  font-size: var(--display-2);
  color: var(--pink-light);
  text-decoration: none;
  transition: background 0.3s, color 0.3s;
}

.mega-button:hover {
  background: var(--green);
  color: var(--cream);
}

.mega-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: clamp(32px, 4vw, 48px) 0 0;
}

/* ── Fun fact / about teaser ────────────────────────────── */
.teaser {
  display: flex;
  justify-content: center;
  padding: clamp(56px, 9vw, 110px) 20px;
  background: #fff;
}

.teaser-content {
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.teaser-content p {
  font-size: clamp(1.125rem, 1.9vw, 1.5rem);
  line-height: 1.2;
}

/* ── Intro section (case studies / about) ───────────────── */
.intro {
  background: var(--paper);
  padding: clamp(56px, 9vw, 120px) 20px;
}

.intro-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: clamp(40px, 9vw, 120px);
  align-items: start;
}

.meta {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.meta-item .label { font-size: 10px; color: var(--brown); }

.meta-value {
  font-family: var(--font-accent);
  font-weight: 200;
  font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--brown);
}

.intro-text {
  font-weight: 500;
  font-size: clamp(1.375rem, 2.5vw, 2rem);
  line-height: 1.2;
}

/* ── Media stack (case study bodies) ────────────────────── */
.media-stack {
  max-width: var(--max-width);
  margin: 0 auto;
}

.media-stack > * {
  width: 100%;
}

.media-stack img {
  width: 100%;
  height: auto;
}

.embed {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--ink);
}

.embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Click-to-play video thumbnail (facade) */
.video-facade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  margin: 0;
  cursor: pointer;
  background: var(--ink);
  overflow: hidden;
  display: block;
}

.video-facade img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease, opacity 0.3s ease;
}

.video-facade:hover img,
.video-facade:focus-visible img {
  transform: scale(1.04);
  opacity: 0.85;
}

.video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(64px, 9vw, 96px);
  height: clamp(64px, 9vw, 96px);
  border-radius: 50%;
  background: var(--pink);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s ease, transform 0.25s ease;
}

.video-facade:hover .video-play,
.video-facade:focus-visible .video-play {
  background: var(--lavender);
  transform: translate(-50%, -50%) scale(1.08);
}

.video-play::before {
  content: "";
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 14px 0 14px 24px;
  border-color: transparent transparent transparent #fff;
  margin-left: 6px;
}

/* ── Project hero rows (work index pages) ───────────────── */
.project-rows {
  max-width: var(--max-width);
  margin: 0 auto;
}

.project-row {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: clamp(420px, 47vw, 600px);
  border-bottom: 1px solid var(--divider);
}

.row-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  padding: 20px;
  background: #fff;
  border-right: 1px solid var(--divider);
}

.row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.row-title {
  font-family: var(--font-accent);
  font-weight: 200;
  font-size: 18px;
  letter-spacing: -0.02em;
  text-align: right;
}

.row-bottom {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.row-bottom p {
  font-weight: 500;
  font-size: 16px;
  line-height: 1.3;
}

.row-media {
  overflow: hidden;
}

.row-media img,
.row-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.project-row:hover .row-media img,
.project-row:hover .row-media video {
  transform: scale(1.03);
}

/* ── About page ─────────────────────────────────────────── */
.bio-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(40px, 7vw, 100px);
  align-items: start;
}

.bio-text {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.bio-text .lede {
  font-size: clamp(1.375rem, 2.2vw, 1.75rem);
  line-height: 1.25;
  color: var(--brown);
}

.bio-text p {
  font-size: clamp(1.375rem, 2.2vw, 1.75rem);
  line-height: 1.25;
}

.bio-photo img {
  width: 100%;
  height: auto;
}

.bio-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
  margin-top: 48px;
}

.bio-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bio-col .label { color: var(--brown); }

.bio-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 16px;
  font-weight: 500;
}

.bio-col a:hover { text-decoration: underline; }

/* ── Experience table (about page) ──────────────────────── */
.experience {
  background: #fff;
  padding: clamp(56px, 9vw, 120px) 20px;
}

.exp-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.exp-title {
  font-size: clamp(2.75rem, 13vw, 128px);
  color: var(--blue);
  margin-bottom: clamp(32px, 5vw, 64px);
}

.exp-table {
  max-width: 940px;
}

.exp-head,
.exp-row {
  display: grid;
  grid-template-columns: 1fr 1.7fr 1fr;
  gap: 16px;
  align-items: center;
}

.exp-head {
  background: var(--blue);
  border-radius: 999px;
  padding: 16px 24px;
}

.exp-head span {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--paper);
}

.exp-row {
  padding: 20px 24px;
  border-bottom: 1px dashed var(--brown);
}

.exp-row span {
  font-family: var(--font-body);
  font-size: clamp(1.125rem, 1.7vw, 1.5rem);
  color: var(--brown);
}

.exp-years {
  text-align: right;
}

@media (max-width: 640px) {
  .exp-head,
  .exp-row {
    padding-left: 12px;
    padding-right: 12px;
    gap: 10px;
  }

  .exp-row span {
    font-size: 0.95rem;
  }
}

/* ── Contact banner ("Let's work together") ─────────────── */
.contact-banner {
  position: relative;
  background: var(--pink);
  padding: clamp(56px, 9vw, 120px) 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.contact-banner .rpattern {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.contact-box {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  background: var(--pink-light);
  padding: clamp(40px, 8vw, 110px) clamp(24px, 6vw, 80px);
  width: min(1038px, 92%);
  text-align: center;
}

.contact-box .contact-title {
  font-size: var(--display-2);
  color: var(--lavender);
  transition: color 0.3s;
}

.contact-box a.contact-title:hover {
  color: var(--blue);
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 999px;
  background: #fff;
  color: var(--brown);
  font-weight: 600;
  font-size: 15px;
  transition: background 0.25s, transform 0.25s;
}

.contact-btn:hover {
  background: var(--yellow);
  transform: translateY(-2px);
}

.contact-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* ── Footer ─────────────────────────────────────────────── */
.site-footer {
  padding-top: clamp(96px, 14vw, 200px);
  background: #fff;
}

.footer-row {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 20px 20px;
  font-weight: 500;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
}

.footer-links a:hover { text-decoration: underline; }

.footer-links .bullet {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--brown);
}

.footer-band {
  height: clamp(110px, 17vw, 217px);
  background: var(--lavender);
}

/* ── "View" cursor follower ─────────────────────────────── */
.cursor-view {
  position: fixed;
  top: 0;
  left: 0;
  width: 122px;
  height: 120px;
  pointer-events: none;
  z-index: 200;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.5);
  transition: opacity 0.2s, transform 0.2s;
}

.cursor-view.is-on {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.cursor-view svg {
  width: 100%;
  height: 100%;
}

.cursor-view span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-stretch: 88%;
  font-size: 24px;
  color: var(--pink-light);
}

@media (hover: none), (pointer: coarse) {
  .cursor-view { display: none; }
}

/* ── Fade-up animation ──────────────────────────────────── */
.fade-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .project-row {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .row-panel {
    order: 2;
    border-right: 0;
    border-top: 1px solid var(--divider);
    gap: 20px;
  }

  .row-media {
    order: 1;
  }

  .row-media img,
  .row-media video {
    aspect-ratio: 16 / 10;
  }

  .intro-grid {
    grid-template-columns: 1fr;
  }

  .meta {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 32px;
  }

  .bio-grid {
    grid-template-columns: 1fr;
  }

  .bio-photo {
    max-width: 420px;
  }
}

@media (max-width: 640px) {
  .brand img { height: 48px; }

  .pill {
    width: 58px;
    height: 58px;
    font-size: 13px;
    margin-left: 4px;
  }

  .card-grid { grid-template-columns: 1fr; }

  .card-info { min-height: 68px; }

  .hero { padding-top: 150px; }

  .hero-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .hero-tag {
    padding-bottom: 0;
  }

  .hero-media {
    margin-top: 8px;
  }

  .page-band {
    min-height: 0;
    padding-top: 170px;
  }

  .band-back { top: 150px; }

  .footer-row {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  .mega-button { border-radius: 32px; }

  .bio-columns { grid-template-columns: 1fr; }
}
