/* Rapora.io — shared stylesheet. Plain CSS, no build step, no web fonts (perf + "fast" GEO requirement). */

:root {
  /* Brand paper palette — measured from the 1944 OSS manual cover.
     Source of truth: Rapora_brand_tokens.md. The blue-green IS the paper of the
     founding artifact: paper-500 = document surfaces, paper-300 = cards / bands /
     forms, paper-100 = the site-wide reading wash. */
  --paper-500: #c2d8db;   /* document surfaces: manual-block, cover mat, success */
  --paper-300: #ddeaeb;   /* cards, section bands, form container, footer */
  --paper-100: #f1f6f6;   /* site-wide body background wash */
  --paper-line: #a9c4c7;  /* borders within the paper family */

  --ink: #16202e;         /* all text, incl. headings */

  --accent: #9c2b3a;       /* stamp burgundy — CTAs, kickers, links. Never in a gradient. */
  --accent-dark: #7c2130;  /* hover */
  --accent-tint: #f5e7e5;  /* faint red wash for error / hover fills */

  --line: #cfe0e2;         /* subtle cool border (paper family) */
  --muted: #5b6472;        /* secondary text — AA-safe on paper-100 / paper-300 only */
  --white: #ffffff;        /* input / field surfaces */

  /* Corner light — the artifact tone glowing from the top-right corner; stays
     entirely inside the paper family (the burgundy accent NEVER enters a gradient). */
  --corner-light: radial-gradient(130% 160% at 100% 0%, #c2d8db 0%, #ddeaeb 45%, #f1f6f6 100%);

  /* Archive at night — the same top-right corner light, darkened to the paper
     family's dark anchors. CTA bands only. Paper-100 text rides on top. */
  --corner-dark: radial-gradient(130% 160% at 100% 0%, #2d4d52 0%, #1c333a 52%, #16202e 100%);

  --font-serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "Courier New", Courier, "DejaVu Sans Mono", monospace;

  --measure: 42rem;
  --wide: 72rem;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper-100);
  line-height: 1.6;
  font-size: 1.0625rem;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--accent);
}

a:hover {
  color: var(--accent-dark);
}

h1, h2, h3 {
  font-family: var(--font-serif);
  color: var(--ink);
  line-height: 1.2;
  font-weight: 700;
}

h1 {
  font-size: clamp(1.9rem, 1.5rem + 1.8vw, 2.9rem);
  margin: 0 0 1rem;
}

h2 {
  font-size: clamp(1.4rem, 1.2rem + 0.9vw, 1.8rem);
  margin: 2.5rem 0 1rem;
}

h3 {
  font-size: 1.15rem;
  margin: 1.75rem 0 0.5rem;
}

p {
  margin: 0 0 1.1rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -3rem;
  background: var(--ink);
  color: var(--white);
  padding: 0.6rem 1rem;
  border-radius: 0.25rem;
  z-index: 100;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 0.5rem;
}

/* ---------- Layout shells ---------- */

.wrap {
  width: 100%;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.prose {
  max-width: var(--measure);
}

main {
  display: block;
}

section + section {
  border-top: 1px solid var(--line);
}

.section {
  padding: 3rem 0;
}

.section--tight {
  padding: 2rem 0;
}

/* ---------- Header / nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(241, 246, 246, 0.9);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}

.logo {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.01em;
}

.logo:hover {
  color: var(--accent);
}

.nav-toggle {
  display: none;
}

.nav-toggle-label {
  display: none;
  cursor: pointer;
  padding: 0.4rem;
}

.nav-toggle-label span,
.nav-toggle-label span::before,
.nav-toggle-label span::after {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  position: relative;
  transition: 0.15s ease;
}

.nav-toggle-label span::before {
  content: "";
  position: absolute;
  top: -7px;
}

.nav-toggle-label span::after {
  content: "";
  position: absolute;
  top: 7px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 1.35rem;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.site-nav a {
  text-decoration: none;
  color: var(--ink);
  font-size: 0.96rem;
}

.site-nav a[aria-current="page"] {
  color: var(--accent);
  font-weight: 600;
  border-bottom: 2px solid var(--accent);
}

.lang-switch {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.lang-switch a {
  padding: 0.3rem 0.7rem;
  text-decoration: none;
  color: var(--muted);
}

.lang-switch a[aria-current="true"] {
  background: var(--ink);
  color: var(--white);
}

/* ---------- Language hint banner (JS-optional progressive enhancement) ---------- */

.lang-hint {
  display: none;
  background: var(--paper-300);
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}

.lang-hint.is-visible {
  display: block;
}

.lang-hint .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

.lang-hint button {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0.2rem 0.4rem;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--white);
  text-decoration: none;
  padding: 0.75rem 1.4rem;
  border-radius: 0.4rem;
  font-weight: 600;
  font-size: 0.98rem;
  border: 1px solid transparent;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.btn:hover {
  background: var(--accent-dark);
  color: var(--white);
  box-shadow: 0 6px 16px -8px rgba(124, 33, 48, 0.6);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn--ghost {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

.btn--ghost:hover {
  background: var(--accent);
  color: var(--white);
  box-shadow: none;
}

/* ---------- Hero ---------- */

.hero {
  padding: 3.5rem 0 3rem;
  /* Corner light: the artifact tone glowing from the top-right, fading into the
     paper-100 body. Paper family only — the burgundy accent stays a discrete mark. */
  background: var(--corner-light);
}

/* Kicker as a rubber-stamp tag: typewriter face, thin accent frame, a hair
   of rotation. One of only two places the mono face appears (see manual quotes). */
.hero .kicker {
  display: inline-block;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 1rem;
  padding: 0.28rem 0.6rem;
  border: 1.5px solid var(--accent);
  border-radius: 2px;
  transform: rotate(-1.3deg);
}

/* A short accent rule under hero headings — a red-pencil archival mark. */
.hero h1::after {
  content: "";
  display: block;
  width: 2.75rem;
  height: 3px;
  margin-top: 1.15rem;
  background: var(--accent);
  border-radius: 2px;
}

.hero .subhead {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: var(--measure);
}

.hero-cta {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Cover of the manual — sits inside the article text. Centered on narrow
   screens; floats to the right so the intro wraps around it on wider ones. */
.cover-figure {
  margin: 0 auto 1.25rem;
  max-width: 250px;
}

/* The cover sits on a paper-500 mat — the "document surface" signal — with the
   caption below it on the body wash (muted text stays off paper-500 for AA). */
.cover-figure img {
  width: 100%;
  height: auto;
  padding: 0.7rem;
  background: var(--paper-500);
  border: 1px solid var(--paper-line);
  box-shadow: 0 18px 40px -22px rgba(27, 42, 74, 0.45);
}

.cover-figure figcaption {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--muted);
  margin-top: 0.6rem;
}

@media (min-width: 620px) {
  .cover-figure {
    float: right;
    width: 240px;
    margin: 0.35rem 0 1rem 1.9rem;
  }
}

/* ---------- CTA band ---------- */

.cta-band {
  background: var(--corner-dark);
  color: var(--paper-100);
}

.cta-band h2,
.cta-band h3 {
  color: var(--paper-100);
}

.cta-band .btn {
  background: var(--white);
  color: var(--ink);
}

.cta-band .btn:hover {
  background: var(--paper-300);
}

.cta-band p {
  color: var(--paper-100);
}

/* ---------- Manual quote block (Origin page — the identity moment) ---------- */
/* Styled as an excerpt from the declassified document itself: the cover's pale
   blue-green paper, a typewriter face, a typed double-rule frame, and a small
   stamped "VERBATIM" mark in the corner. */

.manual-block {
  position: relative;
  clear: both;
  background: var(--paper-500);
  border: 1px solid var(--paper-line);
  box-shadow: inset 0 0 0 1px var(--paper-500), inset 0 0 0 2px var(--paper-line);
  padding: 2rem 2.25rem 1.9rem;
  margin: 1.75rem 0;
}

.manual-block::after {
  content: "VERBATIM";
  position: absolute;
  top: 0.85rem;
  right: 1rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: 2px;
  padding: 0.15rem 0.4rem;
  transform: rotate(3deg);
  opacity: 0.72;
}

html[lang="bg"] .manual-block::after {
  content: "ДОСЛОВНО";
  letter-spacing: 0.16em;
}

.manual-block ul {
  margin: 0;
  padding-left: 1.3rem;
}

.manual-block li {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1.75;
  margin-bottom: 0.85rem;
  color: var(--ink);
}

.manual-block li::marker {
  color: var(--accent);
}

.manual-block li:last-child {
  margin-bottom: 0;
}

.pull-quote {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  line-height: 1.4;
  color: var(--ink);
  border-left: 3px solid var(--accent);
  padding: 0.4rem 0 0.4rem 1.4rem;
  margin: 2.25rem 0;
}

/* ---------- Ethics rules ---------- */

.rule-list {
  display: grid;
  gap: 1.5rem;
  margin-top: 2rem;
}

.rule {
  background: var(--paper-300);
  border: 1px solid var(--paper-line);
  border-left: 3px solid var(--accent);
  border-radius: 0.5rem;
  padding: 1.25rem 1.5rem 1.25rem 1.4rem;
  box-shadow: 0 1px 2px rgba(22, 32, 46, 0.04);
}

.rule h3 {
  margin-top: 0;
  color: var(--ink);
}

.rule p {
  margin-bottom: 0;
  color: var(--ink);
}

/* ---------- Founding-partner grids ---------- */

.grid-2 {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.card {
  background: var(--paper-300);
  border: 1px solid var(--paper-line);
  border-radius: 0.5rem;
  padding: 1.5rem 1.75rem;
  box-shadow: 0 1px 2px rgba(22, 32, 46, 0.04);
}

.card h3 {
  margin-top: 0;
}

.card ul {
  padding-left: 1.1rem;
  margin: 0;
}

.card li {
  margin-bottom: 0.6rem;
}

.card li:last-child {
  margin-bottom: 0;
}

/* ---------- Forms ---------- */

.form {
  margin-top: 1.5rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  max-width: 30rem;
}

.form input[type="email"] {
  flex: 1 1 14rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  font-size: 1rem;
  font-family: var(--font-sans);
  background: var(--white);
  color: var(--ink);
}

.form-note {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.6rem;
  max-width: 30rem;
}

.contact-cards {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
  margin: 2rem 0;
}

@media (min-width: 640px) {
  .contact-cards {
    grid-template-columns: 1fr 1fr;
  }
}

.contact-cards a.card {
  text-decoration: none;
  display: block;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.contact-cards a.card:hover {
  border-color: var(--accent);
  box-shadow: 0 10px 24px -16px rgba(124, 33, 48, 0.55);
  transform: translateY(-2px);
}

.contact-cards .card strong {
  display: block;
  color: var(--ink);
  font-size: 1.05rem;
  margin-bottom: 0.3rem;
}

.contact-cards a.card:hover strong {
  color: var(--accent);
}

/* ---------- Contact form ---------- */

.contact-form-lead {
  margin: 2.25rem 0 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
}

.contact-form {
  max-width: 34rem;
  margin: 1.25rem 0 0;
  background: var(--paper-300);
  border: 1px solid var(--paper-line);
  border-radius: 0.5rem;
  padding: 1.5rem;
}

.contact-form .field {
  margin-bottom: 1.1rem;
}

.contact-form label,
.contact-form legend {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.35rem;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  font-size: 1rem;
  font-family: var(--font-sans);
  background: var(--white);
  color: var(--ink);
}

.contact-form textarea {
  resize: vertical;
  min-height: 7rem;
  line-height: 1.55;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}

.contact-form fieldset.choice {
  border: 0;
  padding: 0;
  margin: 0 0 1.1rem;
}

.contact-form .opt {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-weight: 400;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  padding: 0.7rem 0.9rem;
  margin-bottom: 0.6rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.contact-form .opt:last-child {
  margin-bottom: 0;
}

.contact-form .opt input[type="radio"] {
  margin-top: 0.2rem;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.contact-form .opt:hover {
  border-color: var(--accent);
}

.contact-form .opt:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-tint);
}

/* Honeypot — kept in the accessibility tree off-screen, never shown to humans. */
.contact-form .hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-form .cf-turnstile {
  margin: 0.25rem 0 1.1rem;
}

.contact-form button[type="submit"] {
  cursor: pointer;
}

.contact-form button[disabled] {
  opacity: 0.6;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.cf-status {
  margin: 1rem 0 0;
  padding: 0.75rem 1rem;
  border-radius: 0.4rem;
  font-size: 0.95rem;
}

.cf-status--ok {
  background: var(--paper-500);
  border: 1px solid var(--paper-line);
  color: var(--ink);
}

.cf-status--error {
  background: var(--accent-tint);
  border: 1px solid var(--accent);
  color: var(--accent-dark);
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 2px solid var(--paper-line);
  background: var(--paper-300);
  padding: 2.5rem 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer .wrap {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-links {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--accent);
}

/* ---------- Responsive nav ---------- */

@media (max-width: 780px) {
  .nav-toggle-label {
    display: block;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--paper-100);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem 1.5rem 1.5rem;
    display: none;
    gap: 1rem;
  }

  .site-nav ul {
    flex-direction: column;
    gap: 0.9rem;
  }

  .nav-toggle:checked ~ .site-nav {
    display: flex;
  }
}

/* ---------- Reduced motion ---------- */

@media (max-width: 560px) {
  .manual-block {
    padding: 1.5rem 1.25rem;
  }

  .manual-block::after {
    top: 0.6rem;
    right: 0.7rem;
  }
}

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

  .btn:hover,
  .btn:active,
  .contact-cards a.card:hover {
    transform: none;
  }
}
