/* Bunker Mentality. One-page v2: the creed, printed on a sheet of paper
   years ago. Palette and type per site/reference/design-plan.md. */

/* Fonts, self-hosted. */
@font-face {
  font-family: 'Barlow Condensed';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/barlow-condensed-v13-latin-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Barlow Condensed';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/barlow-condensed-v13-latin-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Courier Prime';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/courier-prime-v11-latin-regular.woff2') format('woff2');
}

:root {
  --paper: #d6d3ca;
  --paper-light: #e1ded6;
  --paper-deep: #b8b4a8;
  --ink: #211f19;
  --ink-soft: #3b382f;
  --ink-faint: #6b675b;
  --rule: rgba(50, 47, 38, 0.45);
  --stamp: #454136;
  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --type: 'Courier Prime', 'Courier New', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; overflow-x: clip; }

body {
  font-family: var(--type);
  font-size: 1.0625rem;
  color: var(--ink-soft);
  background-color: var(--paper);
  /* Aged-paper vibe across the whole screen: uneven tone, age spots,
     darkened screen edges. Not a literal sheet. */
  background-image:
    radial-gradient(ellipse 22% 12% at 82% 16%, rgba(110, 105, 92, 0.22), transparent 70%),
    radial-gradient(ellipse 30% 14% at 8% 58%, rgba(110, 105, 92, 0.16), transparent 70%),
    radial-gradient(ellipse 18% 10% at 68% 88%, rgba(110, 105, 92, 0.18), transparent 70%),
    radial-gradient(ellipse 12% 7% at 30% 6%, rgba(110, 105, 92, 0.13), transparent 70%),
    radial-gradient(ellipse 120% 80% at 50% 28%, rgba(225, 222, 214, 0.6), transparent 85%),
    linear-gradient(160deg, rgba(184, 180, 168, 0.22), transparent 40%, rgba(184, 180, 168, 0.3));
  background-attachment: fixed;
  min-height: 100vh;
}

/* Screen-edge ageing, fixed so it frames the viewport, not a sheet. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  box-shadow:
    inset 0 0 12px rgba(60, 56, 44, 0.28),
    inset 0 0 110px rgba(85, 80, 64, 0.3);
}

/* ---- The sheet ---------------------------------------------------- */

.sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100vh;
  padding: clamp(2.25rem, 6vw, 4.5rem) clamp(1.375rem, 6vw, 3rem) clamp(2rem, 5vw, 3.5rem);
  color: var(--ink-soft);
}

/* Content column inside the full-bleed field. */
.masthead, .hero, .portrait, .signup, footer {
  width: 100%;
  max-width: 46rem;
  margin-inline: auto;
}

/* Paper fibre + speckle over everything on the sheet, ink included:
   it is what makes the print sit IN the paper rather than on it. */
.mottle {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
    background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='11' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)' opacity='0.55'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
  opacity: 0.5;
}

/* ---- Print -------------------------------------------------------- */

.masthead { text-align: center; }
.plate {
  display: inline-block;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.35rem, 4vw, 1.9rem);
  letter-spacing: 0.34em;
  text-indent: 0.34em; /* balance the tracking */
  text-transform: uppercase;
  color: var(--stamp);
  border: 4px double var(--stamp);
  /* black-ink stamp, worn */
  padding: 0.55em 0.9em 0.5em;
  transform: rotate(-2.2deg);
  filter: url(#stampwear);
  opacity: 0.75;
  /* ink-starved patches */
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='m'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.16' numOctaves='3' seed='8' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0.9 0.9 0.9 0 -0.35'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23m)'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='m'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.16' numOctaves='3' seed='8' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0.9 0.9 0.9 0 -0.35'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23m)'/%3E%3C/svg%3E");
}

.hero {
  max-width: 58rem;
  margin-top: clamp(2.5rem, 7vw, 4rem);
  text-align: center;
}
h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.8rem, 7.2vw, 3.6rem);
  line-height: 1.06;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: var(--ink);
  filter: url(#inkbleed);
  text-wrap: balance;
}

.creed {
  margin: clamp(1.75rem, 5vw, 2.5rem) auto 0;
  font-size: clamp(0.95rem, 1.9vw, 1rem);
  line-height: 2;
  color: var(--ink-soft);
}
@media (max-width: 900px) {
  .creed { text-align: left; max-width: 33em; margin-inline: auto; }
  .creed br { display: none; }
}

/* Printed rule between the creed and the rest. */
.signup::before {
  content: '';
  display: block;
  width: 5.5rem;
  height: 2px;
  margin: 0 auto clamp(1.75rem, 5vw, 2.5rem);
  background: var(--rule);
}

/* Photo slot: an old print pasted on. */
.portrait { margin: 2.75rem auto 0; max-width: 24rem; }
.portrait img {
  display: block;
  width: 100%;
  border: 6px solid rgba(225, 222, 214, 0.9);
  outline: 1px solid rgba(50, 47, 38, 0.4);
  box-shadow: 0 2px 8px rgba(50, 46, 36, 0.35);
  filter: grayscale(1) contrast(0.95) brightness(0.98);
  transform: rotate(0.6deg);
}

/* ---- The form, printed like a paper form -------------------------- */

.signup {
  margin: clamp(2.75rem, 7vw, 4rem) auto 0;
  max-width: 27rem;
  text-align: center;
}
.signup-copy {
  font-family: var(--type);
  font-size: 1rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
form { margin-top: 1.3rem; text-align: left; }
label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  align-items: flex-end;
}
input[type='email'] {
  flex: 1 1 12rem;
  font-family: var(--type);
  font-size: 1.05rem;
  color: var(--ink);
  /* a printed form box: faintly filled, ruled all round, heavier write-line */
  background: rgba(230, 227, 219, 0.5);
  border: 1px solid rgba(50, 47, 38, 0.35);
  border-bottom: 2px solid var(--ink-soft);
  border-radius: 0;
  padding: 0.55em 0.6em;
  min-width: 0;
  box-shadow: inset 0 1px 3px rgba(50, 47, 38, 0.12);
}
input[type='email']::placeholder {
  color: var(--ink-faint);
  opacity: 0.6;
  font-style: italic;
}
input[type='email']:focus-visible {
  outline: none;
  border-color: var(--ink);
  box-shadow: inset 0 1px 3px rgba(50, 47, 38, 0.12), 0 2px 0 0 var(--ink);
}

button {
  font-family: var(--type);
  font-size: 0.92rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  background: transparent;
  border: 2px solid var(--ink);
  border-radius: 2px;
  padding: 0.6em 1.3em 0.55em;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease, transform 60ms ease;
  /* The ink breathes: fades back and re-inks on a slow loop. Static full
     ink under reduced motion (the global rule kills the animation). */
  animation: reink 4s ease-in-out infinite;
}
@keyframes reink {
  0%, 100% { color: var(--ink); border-color: var(--ink); }
  50% { color: rgba(33, 31, 25, 0.45); border-color: rgba(33, 31, 25, 0.4); }
}
button:hover, button:focus-visible { animation: none; }
button:hover {
  background: var(--ink);
  color: var(--paper-light);
}
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.55; cursor: default; }
button:focus-visible {
  outline: 2px solid var(--stamp);
  outline-offset: 3px;
}
@media (max-width: 480px) {
  .field-row button { width: 100%; }
}

.status {
  margin-top: 1rem;
  font-family: var(--type);
  font-size: 0.95rem;
}
.status.ok { color: var(--ink); }
.status.err { color: var(--stamp); }
.status:empty { display: none; }

.privacy {
  margin-top: 1rem;
  font-family: var(--type);
  font-size: 0.8rem;
  color: var(--ink-faint);
}

/* ---- Footer: printer's imprint ------------------------------------ */

footer {
  margin-top: auto;
  padding-top: clamp(3rem, 8vw, 4.5rem);
  text-align: center;
  font-family: var(--type);
  font-size: 0.78rem;
  color: var(--ink-faint);
}

a { color: var(--ink); }
a:focus-visible { outline: 2px solid var(--stamp); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
