/* ==========================================================================
   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-hero { padding-top: clamp(2.5rem, 8vw, 6rem); text-align: center; }
.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; }

/* ---- 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; }

  /* 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; }
}
