/* ---------- fonts (local) ---------- */
@font-face {
  font-family: "Cormorant Garamond";
  src: url("../fonts/cormorant-garamond-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans";
  src: url("../fonts/ibm-plex-sans-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ---------- tokens ---------- */
:root {
  --bg: #f3ece9;            /* page background, also the colour of the haze */
  --bg-rgb: 243, 236, 233;  /* same colour as numbers, for rgba() gradients */
  --bg-bottom: #c5c5bd;     /* bottom of the gradient in the no-picture layout */
  --ink: #1a1a1a;
  --rule: #1a1a1a;
  --font-display: "Cormorant Garamond", "Times New Roman", Georgia, serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

/* The page is exactly one screen tall: header + hero + footer, no scrolling. */
body {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

a,
.email {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* ---------- header (solid background, no video) ---------- */
.site-header {
  background: var(--bg);
  text-align: center;
  padding: 2.5rem 1rem 1.25rem;
}

.company-name {
  margin: 0 0 0.9rem;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.company-rule {
  width: min(46%, 700px);
  height: 2px;
  margin: 0 auto;
  background: var(--rule);
}

/* ---------- stage (frame background + haze, spans hero and footer) ---------- */
.stage {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  isolation: isolate;
}

.hero {
  position: relative;
  flex: 1;
  min-height: 320px; /* only very short windows will scroll */
}

.hero-canvas,
.haze {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Base treatment on every frame: a touch of blur, lifted blacks, less contrast. */
.hero-canvas {
  filter: blur(1.2px) contrast(0.88) brightness(1.06) saturate(0.85);
  z-index: 0;
}

/*
 * The haze layers use mask-image so their effect is strongest where the
 * mask is opaque and fades to nothing where it is transparent.
 * Every gradient is centred at the top-middle of the hero and fades out
 * towards the bottom corners.
 */

/* wide, gentle blur */
.haze-blur-far {
  z-index: 1;
  -webkit-backdrop-filter: blur(11px);
  backdrop-filter: blur(11px);
  -webkit-mask-image: radial-gradient(ellipse 95% 115% at 50% 0%, #000 0%, #000 20%, transparent 100%);
  mask-image: radial-gradient(ellipse 95% 115% at 50% 0%, #000 0%, #000 20%, transparent 100%);
}

/* tighter, heavier blur near the top centre */
.haze-blur-near {
  z-index: 2;
  -webkit-backdrop-filter: blur(26px);
  backdrop-filter: blur(26px);
  -webkit-mask-image: radial-gradient(ellipse 70% 85% at 50% 0%, #000 0%, transparent 85%);
  mask-image: radial-gradient(ellipse 70% 85% at 50% 0%, #000 0%, transparent 85%);
}

/* milky wash in the background colour; also melts the top edge into the header */
.haze-wash {
  z-index: 3;
  background:
    linear-gradient(to bottom, rgba(var(--bg-rgb), 1) 0%, rgba(var(--bg-rgb), 0) 28%),
    radial-gradient(ellipse 85% 110% at 50% 0%,
      rgba(var(--bg-rgb), 0.80) 0%,
      rgba(var(--bg-rgb), 0.55) 35%,
      rgba(var(--bg-rgb), 0.15) 75%,
      rgba(var(--bg-rgb), 0)    100%);
}

/* ---------- hero content ---------- */
.hero-content {
  position: absolute;
  inset: 0;
  z-index: 4;
}

/* Anchored 5% from the left wall and 18% above the footer line. */
.paragraph {
  position: absolute;
  left: 5%;
  bottom: 18%;
  width: min(32%, 485px);
  min-width: 260px;
  min-height: 15.3rem;
  padding: 2.5rem 3rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* spread the paragraphs across the card's height */
  border: 1px solid var(--ink);
  background: var(--bg);
  animation: rise 900ms cubic-bezier(0.2, 0.7, 0.2, 1) 150ms both;
}

.paragraph p {
  margin: 0;
  font-size: clamp(0.77rem, 1.36vw, 1.1rem);
}

.paragraph p:last-child { margin-bottom: 0; }

.paragraph a,
.footer-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- footer ---------- */
.site-footer {
  position: relative;
  z-index: 5;
  background: var(--bg);
  border-top: 1.5px solid var(--rule);
  padding: 1.35rem 3rem 1.7rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.4rem;
}

.site-footer p {
  margin: 0;
  font-size: clamp(0.68rem, 1.23vw, 0.94rem);
}

.site-footer p + p { margin-top: 0.5rem; }

/* looks like a link, behaves like a button */
.footer-link {
  font: inherit;
  font-size: clamp(0.6rem, 0.94vw, 0.72rem);
  color: var(--ink);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.footer-link:hover { opacity: 0.65; }

/* ---------- privacy policy window ---------- */
.modal {
  border: 1px solid var(--ink);
  background: var(--bg);
  color: var(--ink);
  padding: 0;
  width: min(92vw, 640px);
  max-height: 85vh;
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

.modal-body {
  position: relative;
  padding: 2.5rem 3rem;
  max-height: 85vh;
  overflow-y: auto;
}

.modal-title {
  margin: 0 0 1.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.modal-text p {
  margin: 0 0 1em;
  font-size: clamp(0.9rem, 1.4vw, 1.05rem);
  line-height: 1.6;
}

.modal-text p:last-child { margin-bottom: 0; }

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  font: inherit;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--ink);
  background: none;
  border: 0;
  cursor: pointer;
}

/* ---------- plain layout (no usable frames) ----------
   main.js adds .no-frames to <body> when the picture folder is empty or
   fails its checks. Same page, but: no picture, gradient background, and
   the paragraph text centred in the body with no box around it. */

.no-frames .stage {
  background: linear-gradient(to top, var(--bg-bottom) 0%, var(--bg) 100%);
}

.no-frames .hero-canvas,
.no-frames .haze-blur-far,
.no-frames .haze-blur-near {
  display: none;
}

.no-frames .hero-content {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.no-frames .paragraph {
  position: static;
  width: min(90%, 42rem);
  min-width: 0;
  min-height: 0;
  padding: 0;
  gap: 1.6em;
  border: 0;
  background: none;
  text-align: center;
}

/* ---------- small screens ---------- */
@media (max-width: 640px) {
  .paragraph { left: 6%; width: 88%; min-height: 14rem; padding: 2rem; }
  .site-footer { padding: 1.5rem 1.25rem 2rem; }
  .modal-body { padding: 2rem 1.5rem; }
}
