/* ==========================================================================
   Unqualified Arts — static site styles
   Fonts: Inter (UI + display), Source Code Pro (ImprovAIsed branding)
   ========================================================================== */

/* ---- Fonts ---------------------------------------------------------------- */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../assets/fonts/InterVariable.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("../assets/fonts/InterVariable-Italic.woff2") format("woff2");
}
@font-face {
  font-family: "Source Code Pro"; font-style: normal; font-weight: 300;
  font-display: swap; src: url("../assets/fonts/SourceCodePro-Light.woff2") format("woff2");
}
@font-face {
  font-family: "Source Code Pro"; font-style: normal; font-weight: 400;
  font-display: swap; src: url("../assets/fonts/SourceCodePro-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "Source Code Pro"; font-style: normal; font-weight: 700;
  font-display: swap; src: url("../assets/fonts/SourceCodePro-Bold.woff2") format("woff2");
}
@font-face {
  font-family: "Source Code Pro"; font-style: italic; font-weight: 400;
  font-display: swap; src: url("../assets/fonts/SourceCodePro-Italic.woff2") format("woff2");
}
@font-face {
  font-family: "Source Code Pro"; font-style: italic; font-weight: 700;
  font-display: swap; src: url("../assets/fonts/SourceCodePro-BoldItalic.woff2") format("woff2");
}

/* ---- Design tokens -------------------------------------------------------- */
:root {
  --bg: #000000;
  --fg: #dddddd;
  --muted: #9a9a9a;
  --card: #17191a;
  --line: rgba(221, 221, 221, 0.14);
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "Source Code Pro", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --measure: 1180px;
  --pad: clamp(1.25rem, 5vw, 4rem);
}

/* ---- Reset / base --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.6;
  font-feature-settings: "cv05", "ss03";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip; /* clip (not hidden) so it doesn't break the sticky header */
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

::selection { background: var(--fg); color: #111111; }

/* ---- Layout --------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--pad);
}
main { flex: 1 0 auto; width: 100%; }

/* The "Un" emphasis — the brand signature (Un-qualified) */
.u { font-style: italic; }

/* ---- Header / nav --------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding-block: 1.15rem;
  background: rgba(0, 0, 0, 0.78); /* fallback when backdrop-filter is unsupported */
  border-bottom: 1px solid var(--line);
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
  }
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem 2rem;
  flex-wrap: wrap;
}
.wordmark {
  font-weight: 700;
  font-size: clamp(1.25rem, 2.4vw, 1.625rem);
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}
.nav-links {
  display: flex;
  gap: clamp(1rem, 3vw, 2.25rem);
  flex-wrap: wrap;
}
.nav-links a {
  text-decoration: none;
  font-size: clamp(1rem, 1.4vw, 1.125rem);
  color: var(--fg);
  opacity: 0.92;
  transition: opacity 0.15s ease;
}
.nav-links a:hover,
.nav-links a:focus-visible { opacity: 0.55; }

/* ---- Footer --------------------------------------------------------------- */
.site-footer {
  flex-shrink: 0;
  padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(1.5rem, 4vw, 2.5rem);
}
.site-footer .wordmark {
  display: inline-block;
  font-size: clamp(1.375rem, 3vw, 1.75rem);
}
.site-footer hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: clamp(1.75rem, 4vw, 2.75rem) 0 1.25rem;
}
.copyright { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* ---- Typography ----------------------------------------------------------- */
.page-title {
  font-weight: 700;
  font-size: clamp(2.5rem, 7vw, 3.875rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
  margin: clamp(1.5rem, 5vw, 3rem) 0 1.25rem;
}
h2 {
  font-weight: 700;
  font-size: clamp(1.75rem, 4.5vw, 2.625rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.prose { max-width: 74ch; }
.prose p { margin: 0 0 1.25rem; }
.prose p.lead { font-weight: 700; }
.prose a { color: inherit; text-underline-offset: 3px; }
.prose ul {
  margin: 0 0 1.25rem;
  padding-left: 1.25rem;
}
.prose li { margin-bottom: 0.35rem; }
.section-gap { margin-top: clamp(2.5rem, 6vw, 4.5rem); }

/* ---- Home: hero ----------------------------------------------------------- */
.hero {
  padding-top: clamp(3rem, 12vw, 9rem);
  padding-bottom: clamp(2rem, 6vw, 4rem);
}
.hero-title {
  margin: 0;
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.03em;
}
.hero-line1 {
  display: block;
  font-size: clamp(3rem, 12vw, 9.375rem);
  letter-spacing: -0.015em;
}
.hero-line2 {
  display: block;
  text-align: right;
  font-style: italic;
  font-size: clamp(4.5rem, 20vw, 15.625rem);
  letter-spacing: 0.005em;
  line-height: 0.85;
}
.tagline {
  max-width: 42ch;
  margin: clamp(1.75rem, 4vw, 2.75rem) auto 0;
  text-align: center;
  font-weight: 700;
  font-size: clamp(1.25rem, 2.3vw, 1.75rem);
  line-height: 1.3;
}
.hero-cta {
  margin: 0.85rem 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}
.hero-cta a { color: var(--fg); text-underline-offset: 3px; }

/* ---- Home: image collage -------------------------------------------------- */
.collage {
  display: grid;
  grid-template-columns: 0.9fr 1.3fr; /* tall photo left, wider stacked pair right */
  gap: clamp(1rem, 2.5vw, 2rem);
  align-items: stretch;
  padding-bottom: clamp(3rem, 8vw, 6rem);
}
.collage a {
  display: block;
  height: 100%;
  overflow: hidden;
  outline: none;
}
.collage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease, opacity 0.3s ease;
}
.collage a:hover img,
.collage a:focus-visible img { transform: scale(1.04); opacity: 0.9; }

/* Left: the improv photo, full-height, spanning both rows on the right */
.collage__improv  { grid-column: 1; grid-row: 1 / span 2; }
/* Right column, stacked */
.collage__estonia { grid-column: 2; grid-row: 1; aspect-ratio: 16 / 10; }
.collage__stage   { grid-column: 2; grid-row: 2; aspect-ratio: 16 / 10; }

/* ---- Production cards ------------------------------------------------------ */
.cards { display: grid; gap: clamp(1.25rem, 3vw, 2rem); margin-top: clamp(1.5rem, 4vw, 2.5rem); }
.card {
  background: var(--card);
  padding: clamp(1.5rem, 3.5vw, 2.75rem);
  display: grid;
  grid-template-columns: 1fr minmax(200px, 280px);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}
.card__title { margin: 0 0 0.75rem; }
.card__status {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 1rem;
}
.card__body p { margin: 0 0 1rem; max-width: 62ch; }
.card__body p.lead { font-weight: 700; }
.card__link { color: var(--fg); text-underline-offset: 3px; }
.card__poster { align-self: start; }
.card__poster img { width: 100%; }

/* ---- ImprovAIsed landing -------------------------------------------------- */
.improv-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.38), #000 72%),
    linear-gradient(90deg, #000 0%, transparent 20%, transparent 80%, #000 100%),
    url("../assets/img/improvaised-matrix-bg.jpg") center top / cover no-repeat;
}
.improv-page::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.34);
}
.improv-hero {
  position: relative;
  padding-top: clamp(2.5rem, 8vw, 6rem);
  text-align: center;
}
.improv-hero::before {
  content: "";
  position: absolute;
  inset: clamp(1rem, 4vw, 3rem) 0 auto;
  height: clamp(9rem, 24vw, 18rem);
  z-index: -1;
  opacity: 0.3;
  background:
    repeating-linear-gradient(90deg, transparent 0 18px, rgba(138, 212, 228, 0.28) 19px, transparent 21px),
    repeating-linear-gradient(180deg, transparent 0 24px, rgba(141, 16, 63, 0.35) 25px, transparent 28px);
  mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
}
.improv-wordmark {
  font-family: var(--mono);
  font-weight: 300;
  letter-spacing: -0.02em;
  font-size: clamp(2.75rem, 12vw, 9rem);
  line-height: 1;
  margin: 0;
  word-break: break-word;
}
.improv-quote {
  font-family: var(--mono);
  max-width: 30ch;
  margin: clamp(1rem, 3vw, 2rem) auto 0;
  font-size: clamp(1.05rem, 2.6vw, 1.75rem);
  line-height: 1.35;
}
.improv-quote cite {
  display: block;
  margin-top: 0.75rem;
  font-style: normal;
  font-size: 0.7em;
  color: var(--muted);
}
/* The "AI" inside improvAIsed / improvised branding */
.ai { font-weight: 700; font-style: italic; }

.improv-card {
  border: 1px solid rgba(138, 212, 228, 0.18);
  box-shadow: 0 0 48px rgba(141, 16, 63, 0.18);
}
.improv-card .card__poster {
  max-width: 340px;
  justify-self: end;
}
.award-badges {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin: 1.5rem 0 1.25rem;
}
.award-badge {
  padding: 0;
  background: transparent;
}
.award-badge img {
  width: clamp(5rem, 9vw, 7rem);
  height: auto;
  box-shadow: 0 0 22px rgba(199, 255, 0, 0.1);
}
.cast-strip {
  padding-block: clamp(1.25rem, 3vw, 2rem);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.cast-strip h2 {
  margin: 0 0 1rem;
}
.cast-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.cast-list li {
  padding-top: 0.5rem;
  border-top: 1px solid rgba(221, 221, 221, 0.22);
  font-weight: 700;
}
.performed-strip {
  padding-block: clamp(1.25rem, 3vw, 2rem);
  border-bottom: 1px solid var(--line);
}
.performed-strip h2 {
  margin: 0 0 1rem;
}
.performed-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: performed;
}
.performed-list li {
  position: relative;
  min-height: 100%;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(221, 221, 221, 0.22);
}
.performed-list li::before {
  counter-increment: performed;
  content: "0" counter(performed);
  display: inline-block;
  margin-bottom: 0.6rem;
  margin-right: 0.65rem;
  color: #8ad4e4;
  font-family: var(--mono);
  font-size: 0.85rem;
}
.performed-list span {
  display: block;
}
.performed-list span:first-child {
  font-weight: 700;
}
.performed-list span:not(:first-child) {
  color: var(--muted);
  font-size: 0.95rem;
}
.production-gallery {
  margin-inline: calc(var(--pad) * -0.25);
}
.gallery-heading {
  margin-bottom: 1rem;
}
.gallery-heading h2 {
  margin: 0;
}
.gallery-set {
  margin-top: clamp(1rem, 3vw, 1.75rem);
}
.gallery-set__heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.gallery-set__heading h3,
.gallery-set__heading p {
  margin: 0;
}
.gallery-set__heading h3 {
  font-size: clamp(1.15rem, 2vw, 1.35rem);
}
.gallery-set__heading p {
  color: var(--muted);
  font-size: 0.95rem;
}
.gallery-rail {
  --gallery-row-height: clamp(13rem, 28vw, 21rem);
  display: flex;
  gap: clamp(0.75rem, 2vw, 1.25rem);
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding-bottom: 0.75rem;
  scrollbar-color: rgba(221, 221, 221, 0.35) transparent;
}
.gallery-item {
  flex: 0 0 auto;
  height: var(--gallery-row-height);
  margin: 0;
  overflow: hidden;
  background: var(--card);
}
.gallery-item--landscape {
  width: calc(var(--gallery-row-height) * 1.6);
}
.gallery-item--portrait {
  width: calc(var(--gallery-row-height) * 0.8);
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.92) contrast(1.06);
}

/* ---- Video embed ---------------------------------------------------------- */
.video {
  max-width: 760px;
  margin-top: clamp(1.5rem, 4vw, 2.5rem);
  aspect-ratio: 16 / 9;
  background: #111;
  border: 1px solid var(--line);
}
.video iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ---- Downloads ------------------------------------------------------------ */
.downloads { list-style: none; margin: 1.75rem 0 0; padding: 0; }
.downloads li { margin-bottom: 0.9rem; }
.downloads a { color: var(--fg); text-underline-offset: 3px; }

/* ---- 404 ------------------------------------------------------------------ */
.notfound { padding-block: clamp(4rem, 15vw, 10rem); text-align: center; }
.notfound .page-title { letter-spacing: -0.05em; }
.notfound a { color: var(--fg); text-underline-offset: 3px; }

/* ==========================================================================
   Scroll reveal — entrance animations (progressive enhancement)
   Elements fade in and slide from an offset when they enter the viewport,
   echoing the original Framer "appear" animations. Direction/stagger are set
   per element with the --rx / --ry / --reveal-delay custom properties.
   Only active once reveal.js adds the `js` class, so the content is fully
   visible with JavaScript disabled.
   ========================================================================== */
html.js .reveal {
  opacity: 0;
  transform: translate3d(var(--rx, 0px), var(--ry, 28px), 0);
  transition:
    opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--reveal-delay, 0s);
  will-change: opacity, transform;
}
html.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  html.js .reveal { opacity: 1; transform: none; transition: none; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 720px) {
  body { font-size: 17px; }

  /* Compact floating nav: wordmark on top, links on a single row beneath */
  .site-header { padding-block: 0.7rem; }
  .nav { gap: 0.35rem 1rem; }
  .wordmark { font-size: 1.2rem; }
  .nav-links { flex-basis: 100%; gap: 0.4rem 0.9rem; }
  .nav-links a { font-size: 0.8125rem; opacity: 1; }

  /* Cards: stack text over poster, poster centered and constrained */
  .card {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .card__poster { max-width: 300px; margin-inline: auto; }
  .improv-card .card__poster { justify-self: center; }
  .award-badges { justify-content: center; }
  .award-badge img { width: clamp(4.75rem, 24vw, 6.25rem); }
  .cast-list,
  .performed-list { grid-template-columns: 1fr; }
  .gallery-set__heading {
    display: block;
  }
  .gallery-set__heading p {
    margin-top: 0.35rem;
  }
  .gallery-rail {
    --gallery-row-height: clamp(12rem, 58vw, 17rem);
  }

  /* Collage: single column, natural stacked order */
  .collage {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .collage__estonia,
  .collage__improv,
  .collage__stage {
    grid-column: 1;
    grid-row: auto;
  }
  .collage__improv  { order: 1; aspect-ratio: 4 / 5; } /* needs its own ratio once it no longer spans rows */
  .collage__estonia { order: 2; aspect-ratio: 16 / 10; }
  .collage__stage   { order: 3; aspect-ratio: 16 / 10; }
}

@media (max-width: 480px) {
  .hero-line2 { text-align: center; }
  .tagline { max-width: none; }
}

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