/* ==========================================================================
   Historical Film — site styles
   ========================================================================== */

:root {
  color-scheme: dark;
  --black: #000000;
  --ink: #ece7de;              /* off-white text */
  --ink-soft: rgba(236, 231, 222, 0.62);
  --line: rgba(236, 231, 222, 0.30);
  --line-strong: rgba(236, 231, 222, 0.72);
  --error: #e0806c;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", Georgia, "Times New Roman", serif;

  /* Still frame: 1544 × 930 */
  --still-ratio: 1544 / 930;
  --gutter: max(16px, env(safe-area-inset-left), env(safe-area-inset-right));
}

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

html {
  background: var(--black);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--black);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

.page {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding:
    max(clamp(16px, 4.5vh, 64px), env(safe-area-inset-top))
    var(--gutter)
    max(clamp(56px, 10vh, 120px), env(safe-area-inset-bottom));
}

/* --------------------------------------------------------------------------
   1. Slideshow
   Whole frame is always shown (never cropped). On wide screens the frame
   is capped by viewport height so the title remains in view below it.
   -------------------------------------------------------------------------- */

.stills {
  position: relative;
  width: min(100%, 1440px, calc(74svh * 1544 / 930));
  aspect-ratio: var(--still-ratio);
  background: #070707;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

/* Fallback for browsers without svh support */
@supports not (height: 1svh) {
  .stills { width: min(100%, 1440px, calc(74vh * 1544 / 930)); }
}

.still {
  position: absolute;
  inset: 0;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover; /* frame matches the stills' ratio, so nothing is cropped */
  opacity: 0;
  transition: opacity 1.8s ease-in-out;
  will-change: opacity;
  pointer-events: none;
}

.still.is-active { opacity: 1; }

/* --------------------------------------------------------------------------
   2. Title artwork
   -------------------------------------------------------------------------- */

.title {
  margin: clamp(40px, 7vw, 88px) 0 0;
  width: min(84vw, 560px);
  line-height: 0;
}

.title img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2400 / 525;
}

/* --------------------------------------------------------------------------
   3. Copy
   -------------------------------------------------------------------------- */

.intro {
  margin: clamp(32px, 5vw, 56px) 0 0;
  max-width: 31em;
  font-size: clamp(1.0625rem, 0.98rem + 0.35vw, 1.25rem);
  line-height: 1.7;
  text-align: center;
  color: var(--ink);
  text-wrap: pretty;
  hyphens: manual;
}

.intro em { font-style: italic; }

.credit {
  margin: clamp(22px, 3vw, 32px) 0 0;
  max-width: 31em;
  font-size: clamp(0.9375rem, 0.86rem + 0.3vw, 1.125rem);
  line-height: 1.6;
  letter-spacing: 0.06em;
  text-align: center;
  color: var(--ink-soft);
}

/* On narrow screens, break after "by" rather than inside a name */
.credit span { display: inline-block; }

/* --------------------------------------------------------------------------
   4. Signup (MailerLite embed, restyled with scoped overrides)
   Every selector below is prefixed with .signup to outrank MailerLite's
   own !important rules without touching its markup or behaviour.
   -------------------------------------------------------------------------- */

.signup {
  margin: clamp(28px, 4vw, 44px) 0 0;
  width: min(100%, 400px);
}

.signup noscript p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink-soft);
  text-align: center;
}

.signup #mlb2-48593246.ml-form-embedContainer .ml-form-embedWrapper {
  background-color: transparent !important;
  border-radius: 0 !important;
}

.signup #mlb2-48593246.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody,
.signup #mlb2-48593246.ml-form-embedContainer .ml-form-embedWrapper .ml-form-successBody {
  padding: 0 !important;
}

.signup #mlb2-48593246.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow {
  margin-bottom: 12px;
}

.signup #mlb2-48593246.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow.ml-last-item {
  margin-bottom: 0;
}

/* Inputs: hairline fields on black. 16px text prevents iOS zoom-on-focus. */
.signup #mlb2-48593246.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow input {
  background-color: transparent !important;
  color: var(--ink) !important;
  border: 1px solid var(--line) !important;
  border-radius: 2px !important;
  font-family: var(--serif) !important;
  font-size: 16px !important;
  line-height: 24px !important;
  padding: 13px 14px !important;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.2s ease;
}

.signup #mlb2-48593246.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow input::placeholder {
  color: var(--ink-soft);
  opacity: 1;
}

.signup #mlb2-48593246.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow input:hover {
  border-color: rgba(236, 231, 222, 0.48) !important;
}

.signup #mlb2-48593246.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow input:focus {
  outline: none;
  border-color: var(--line-strong) !important;
}

.signup #mlb2-48593246.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow input:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* Keep autofilled fields dark (Safari / Chrome paint them yellow-white) */
.signup #mlb2-48593246.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow input:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 1000px #000 inset;
  caret-color: var(--ink);
}

/* MailerLite's validation state (class added by its script) */
.signup #mlb2-48593246.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-error input {
  border-color: var(--error) !important;
}

/* reCAPTCHA: centred, dark theme, kept at full size where it fits */
.signup #mlb2-48593246.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-recaptcha {
  float: none !important;
  width: 304px !important;
  min-height: 78px;
  margin: 22px auto 22px !important;
}

/* Google's widget draws a light 1px border with a soft shadow and rounded
   corners, which reads as a white hairline on black. Clip the outer 3px so
   only the dark panel shows. The checkbox, logo and links are untouched. */
.signup #mlb2-48593246.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-recaptcha .g-recaptcha {
  width: 304px;   /* the widget's own size, so the clip box matches it   */
  height: 78px;   /* (on phones MailerLite scales this whole box to 0.78) */
  -webkit-clip-path: inset(3px);
  clip-path: inset(3px);
}

/* Error state drawn on the container, just outside the clipped widget */
.signup #mlb2-48593246.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-recaptcha.ml-error {
  outline: 1px solid var(--error);
  outline-offset: -3px;
}

.signup #mlb2-48593246.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-recaptcha.ml-error iframe {
  border: 0 !important;
}

/* Narrow phones: let the long phone placeholder fit (typed text stays 16px) */
@media (max-width: 380px) {
  .signup #mlb2-48593246.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow input::placeholder {
    font-size: 14px;
  }
}

@media (max-width: 340px) {
  .signup #mlb2-48593246.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow input {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  .signup #mlb2-48593246.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow input::placeholder {
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  /* MailerLite scales the widget to 0.78 here; size the box to match */
  .signup #mlb2-48593246.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-recaptcha {
    width: 238px !important;
    min-height: 61px;
    height: 61px;
  }
}

/* Button */
.signup #mlb2-48593246.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-embedSubmit {
  margin: 0 !important;
  float: none !important;
}

.signup #mlb2-48593246.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-embedSubmit button {
  background-color: var(--ink) !important;
  color: var(--black) !important;
  border: 1px solid var(--ink) !important;
  border-radius: 2px !important;
  font-family: var(--serif) !important;
  font-size: 15px !important;
  font-weight: 400 !important;
  letter-spacing: 0.14em !important;
  line-height: 24px !important;
  padding: 13px 16px !important;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.signup #mlb2-48593246.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-embedSubmit button:hover {
  background-color: transparent !important;
  color: var(--ink) !important;
}

.signup #mlb2-48593246.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-embedSubmit button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.signup #mlb2-48593246.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-embedSubmit button.loading {
  background-color: transparent !important;
  color: var(--ink) !important;
}

.signup #mlb2-48593246.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-embedSubmit .ml-form-embedSubmitLoad::after {
  border-color: var(--ink) var(--ink) var(--ink) transparent;
}

/* Success message */
.signup #mlb2-48593246.ml-form-embedContainer .ml-form-embedWrapper .ml-form-successBody .ml-form-successContent {
  text-align: center;
}

.signup #mlb2-48593246.ml-form-embedContainer .ml-form-embedWrapper .ml-form-successBody .ml-form-successContent h4 {
  margin: 0 0 8px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.375rem;
  font-weight: 400;
  line-height: 1.4;
}

.signup #mlb2-48593246.ml-form-embedContainer .ml-form-embedWrapper .ml-form-successBody .ml-form-successContent p {
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   Reduced motion: stills change without a fade
   -------------------------------------------------------------------------- */

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