/* Random Tree Productions — site styles
   Colors and sizes are set as variables at the top so they are easy to change. */

:root {
  --bg: #000;
  --text: #fff;
  --overlay: rgba(0, 0, 0, 0.74); /* darkness over the home page background photo */
  --gutter: max(16px, 3vw);       /* left/right page padding */
  --gap: 11px;                    /* space between videos in the grid */
  --font: Arial, Helvetica, sans-serif;
  --fs-body: clamp(16px, 1.23vw, 18px);
  --fs-h2: clamp(30px, 3vw, 44px);
  --fs-h1: clamp(36px, 4.7vw, 68px);
  --header-h: 128px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.8;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

h1, h2 { font-weight: 700; margin: 0; line-height: 1.3; }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }

p { margin: 0 0 1em; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: #fff; color: #000; padding: 8px 12px; z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ---------- Header ---------- */
.site-header {
  position: relative;
  z-index: 20;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gutter);
  background: var(--bg);
}

.logo img { height: 100px; width: auto; }

.site-nav { display: flex; gap: 36px; }
.site-nav a {
  text-decoration: none;
  letter-spacing: 0.15em;
  font-size: var(--fs-body);
  padding: 4px 0;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; }

.menu-toggle {
  display: none;
  background: none; border: 0; padding: 12px 0; cursor: pointer;
  width: 40px;
}
.menu-toggle span {
  display: block; height: 1px; background: var(--text);
  margin: 10px 0; transition: transform .25s ease;
}
.menu-open .menu-toggle span:first-child { transform: translateY(5.5px) rotate(45deg); }
.menu-open .menu-toggle span:last-child  { transform: translateY(-5.5px) rotate(-45deg); }

/* ---------- Home: hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  padding: 96px var(--gutter) 120px;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  background: url("../assets/img/bg-hero.jpg") center 25% / cover no-repeat;
  z-index: -2;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: var(--overlay);
  z-index: -1;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 4vw;
  align-items: start;
  max-width: 1360px;
  margin: 0 auto;
}
.hero h1 { font-size: var(--fs-h2); text-align: center; grid-column: 1; margin-bottom: 12px; }
.hero .reel { grid-column: 1; }
.hero .bio {
  grid-column: 2; grid-row: 1 / span 2; align-self: center;
  font-weight: 700; max-width: 460px;
}

/* ---------- Video (thumbnail -> player on click) ---------- */
.video {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #111;
  overflow: hidden;
}
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-poster {
  all: unset; cursor: pointer; position: absolute; inset: 0; display: block;
}
.video-poster img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease, opacity .3s; }
.video-poster:hover img { transform: scale(1.03); }
.video-poster:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.play {
  position: absolute; left: 50%; top: 50%;
  width: 64px; height: 64px; margin: -32px 0 0 -32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  transition: background .2s;
}
.play::after {
  content: ""; position: absolute; left: 26px; top: 20px;
  border-style: solid; border-width: 12px 0 12px 20px;
  border-color: transparent transparent transparent #fff;
}
.video-poster:hover .play { background: rgba(0, 0, 0, 0.8); }
.reel .play { width: 84px; height: 84px; margin: -42px 0 0 -42px; }
.reel .play::after { left: 33px; top: 26px; border-width: 16px 0 16px 26px; }
.video-fallback { position: absolute; inset: 0; display: grid; place-items: center; }

/* ---------- Home: selected work ---------- */
.work { padding: 72px var(--gutter) 64px; }
.work h2 { text-align: center; margin-bottom: 24px; }
.work-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px var(--gap);
}
.work-item { margin: 0; }
.work-title { font-size: inherit; font-weight: 700; margin: 10px 0 0; line-height: 1.8; }
.work-title a { text-decoration: none; }
.work-title a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Project pages ---------- */
.project { padding: 40px var(--gutter) 80px; max-width: 1180px; margin: 0 auto; }
.back-link { display: inline-block; margin-bottom: 24px; text-decoration: none; letter-spacing: .05em; }
.back-link:hover { text-decoration: underline; }
.project h1 { font-size: var(--fs-h2); margin-bottom: 6px; }
.project-client { opacity: .75; margin-bottom: 28px; }
.project > .video { margin-bottom: 36px; }
.project-body { display: grid; grid-template-columns: 1fr 2fr; gap: 4vw; }
.project-body h2 { font-size: var(--fs-body); text-transform: uppercase; letter-spacing: .12em; margin-bottom: 10px; }
.roles { list-style: none; padding: 0; margin: 0 0 24px; font-weight: 700; }
.project-cta { margin-top: 56px; font-weight: 700; }
.more-work { margin-top: 72px; }
.more-work h2 { text-align: left; margin-bottom: 20px; }
.more-work .work-grid { grid-template-columns: repeat(3, 1fr); }

/* ---------- Services (About page) ---------- */
.services { padding: 0 var(--gutter) 40px; }
.services h2 { margin-bottom: 20px; }
.services ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 4vw; font-weight: 700; }

/* ---------- About ---------- */
.about-intro { padding: 40px var(--gutter) 80px; }
.about-intro h1 { text-align: center; margin-bottom: 36px; }
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 4vw;
  align-items: start;
  max-width: 1360px;
  margin: 0 auto;
}
.about-photo { justify-self: center; width: min(390px, 100%); margin-top: 78px; }
.about-photo img { width: 100%; height: auto; }
.about-text { max-width: 620px; }

.contact { padding: 96px var(--gutter); }
.contact-grid {
  display: grid;
  grid-template-columns: 0.83fr 1fr;
  column-gap: 8vw;
  max-width: 1360px;
  margin: 0 auto;
}
.contact h2 { margin-bottom: 24px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field { display: flex; flex-direction: column; margin-bottom: 20px; }
.field label { margin-bottom: 4px; }
.field label small { opacity: .7; font-size: .8em; margin-left: 4px; }
.field input, .field textarea {
  font: inherit; color: #000; background: #fff;
  border: 1px solid #ccc; border-radius: 0;
  padding: 14px 12px; width: 100%;
}
.field textarea { min-height: 100px; resize: vertical; }
.btn {
  font: inherit; font-weight: 700; cursor: pointer;
  background: #fff; color: #000; border: 0;
  padding: 18px 32px; letter-spacing: .05em;
}
.btn:hover { background: #ddd; }
.form-status { margin-top: 12px; min-height: 1.8em; }
.hp { position: absolute; left: -9999px; }

/* ---------- Footer ---------- */
.site-footer {
  padding: 40px var(--gutter) 56px;
  display: flex; flex-direction: column; align-items: flex-end;
  text-align: right;
}
.site-footer p { font-weight: 700; margin: 0 0 16px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.social { display: flex; gap: 14px; margin-top: 6px; }
.social img { width: 24px; height: 24px; }
.social a:hover { opacity: .7; }

/* ---------- Tablet ---------- */
@media (max-width: 1100px) {
  .work-grid, .more-work .work-grid { grid-template-columns: repeat(2, 1fr); }
  .services ul { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Mobile ---------- */
@media (max-width: 800px) {
  :root { --header-h: 96px; }
  .logo img { height: 64px; }

  .menu-toggle { display: block; position: relative; z-index: 31; }
  .site-nav {
    position: fixed; inset: 0; z-index: 30;
    background: var(--bg);
    flex-direction: column; align-items: center; justify-content: center;
    gap: 28px;
    opacity: 0; pointer-events: none; transition: opacity .25s ease;
  }
  .site-nav a { font-size: 28px; }
  .menu-open .site-nav { opacity: 1; pointer-events: auto; }
  .menu-open { overflow: hidden; }

  .hero { padding: 48px var(--gutter) 64px; }
  .hero-grid, .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .hero h1, .hero .reel, .hero .bio { grid-column: 1; grid-row: auto; }
  .hero h1 { margin-bottom: 24px; }
  .hero .bio { margin-top: 28px; max-width: none; }

  .about-photo { margin: 0 auto 36px; }
  .project-body { grid-template-columns: 1fr; gap: 0; }
  .contact-grid { row-gap: 32px; }
  .contact { padding: 56px var(--gutter); }
}

@media (max-width: 560px) {
  .work-grid, .more-work .work-grid { grid-template-columns: 1fr; gap: 28px; }
  .services ul { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
