:root {
  --bg:            #ffffff;
  --bg-lift:       #f4f5f8;
  --bg-alt:        #f9fafc;
  --bg-card:       rgba(255, 255, 255, 0.6);
  --bg-field:      #ffffff;
  --border:        #d8dce4;
  --border-soft:   #e8ecf0;
  --border-strong: #8b94a3;
  --border-hover:  #6b7280;

  --text:        #0f1320;
  --text-soft:   #4a5160;
  --text-muted:  #6c7384;

  --accent:      #6667ab;
  --accent-dim:  #8889c5;
  --accent-glow: rgba(102, 103, 171, 0.14);

  --error:       #dc2626;
  --error-glow:  rgba(220, 38, 38, 0.15);

  --font-sans:  "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-mono:  "JetBrains Mono", "SF Mono", Consolas, monospace;

  --max-w:        1180px;
  --max-w-narrow: 820px;
  --header-h:     72px;

  --color-scheme: light;
}

[data-theme="dark"] {
  --bg:            #0a0e17;
  --bg-lift:       #131a2c;
  --bg-alt:        #0d1320;
  --bg-card:       #11172580;
  --bg-field:      #161c2c;
  --border:        #1f2738;
  --border-soft:   #141a26;
  --border-strong: #6a7591;
  --border-hover:  #8a95ad;

  --text:        #e8e8ec;
  --text-soft:   #9fa3b3;
  --text-muted:  #828a9d;

  --accent:      #9899cc;
  --accent-dim:  #7374a8;
  --accent-glow: rgba(152, 153, 204, 0.18);

  --error:       #f87171;
  --error-glow:  rgba(248, 113, 113, 0.18);

  --color-scheme: dark;
}

html { color-scheme: var(--color-scheme); }

/* ------------------------------- Skip link & visually hidden */

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 200;
  padding: 0.875rem 1.25rem;
  background: var(--accent);
  color: var(--bg);
  text-decoration: none;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 6px;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 1rem;
  outline: 2px solid var(--text);
  outline-offset: 2px;
}


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

/* ------------------------------- Accessible focus indicators */

:focus { outline: none; }

a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

input:focus-visible,
textarea:focus-visible {
  /* fields use their own border/box-shadow focus treatment */
  outline: none;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

a { color: inherit; text-decoration: none; }

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

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
}

.container-narrow {
  max-width: var(--max-w-narrow);
}

.section {
  padding: clamp(5rem, 10vw, 9rem) 0;
  position: relative;
  background: var(--bg);
}

.section.observation { background: var(--bg-alt); }
.section.thesis      { background: var(--bg-lift); }
.section.audience    { background: var(--bg-alt); }
.section.faq         { background: var(--bg-lift); }
.section.briefing    { background: var(--bg-alt); }

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease, backdrop-filter 0.3s ease;
}

.site-header.scrolled {
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.88);
  border-bottom-color: var(--border-soft);
}

[data-theme="dark"] .site-header.scrolled {
  background: rgba(10, 14, 23, 0.85);
}

.header-inner {
  display: flex;
  align-items: center;
  height: var(--header-h);
  gap: 1.25rem;
}

.header-inner > .btn-ghost {
  margin-left: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
}

.brand-mark {
  height: 31px;
  width: auto;
  filter: brightness(0) saturate(100%) invert(40%) sepia(13%) saturate(1633%) hue-rotate(214deg) brightness(95%) contrast(85%);
  opacity: 0.92;
  transition: opacity 0.2s ease, filter 0.2s ease;
}

.brand:hover .brand-mark { opacity: 1; }

[data-theme="dark"] .brand-mark {
  filter: brightness(0) invert(1);
}

/* ------------------------------- Typewriter */

.typewriter {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  min-width: 0;
  max-width: 55vw;
  color: var(--text-soft);
  padding-left: 1rem;
  border-left: 1px solid var(--border-strong);
}

.typewriter-prompt {
  color: var(--accent);
  font-weight: 500;
  letter-spacing: 0.05em;
}

.typewriter-text {
  color: var(--text);
}

.typewriter-caret {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  background: var(--accent);
  margin-left: 1px;
  vertical-align: -0.18em;
  animation: caretBlink 1.1s steps(2, end) infinite;
  border-radius: 1px;
}

@keyframes caretBlink {
  0%, 49%   { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@media (max-width: 900px) {
  .typewriter { display: none; }
}

/* ------------------------------- Theme toggle */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-soft);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
}

.theme-toggle:hover {
  border-color: var(--accent-dim);
  color: var(--accent);
}

.theme-toggle:active { transform: scale(0.96); }

.theme-icon-sun { display: none; }

[data-theme="dark"] .theme-icon-sun { display: block; }
[data-theme="dark"] .theme-icon-moon { display: none; }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 0 0 0 var(--accent-glow);
}

.btn-primary:hover {
  background: #525390;
  box-shadow: 0 0 32px 4px var(--accent-glow);
  transform: translateY(-1px);
}

[data-theme="dark"] .btn-primary {
  color: #0a0e17;
}

[data-theme="dark"] .btn-primary:hover {
  background: #adaedd;
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent-dim);
  color: var(--accent);
}

.btn-ghost {
  background: transparent;
  color: var(--text-soft);
  border-color: var(--border);
  padding: 0.55rem 1.1rem;
  font-size: 0.875rem;
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--accent-dim);
}

.btn-block {
  width: 100%;
  padding: 1rem 1.5rem;
  font-size: 1rem;
}

.btn-link {
  color: var(--text-soft);
  font-size: 0.95rem;
  font-weight: 400;
  padding: 0.75rem 0;
  transition: color 0.2s ease;
}

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

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

.hero {
  position: relative;
  min-height: 100vh;
  margin-top: calc(-1 * var(--header-h));
  display: flex;
  align-items: center;
  padding: calc(clamp(4rem, 10vh, 8rem) + var(--header-h)) 0 clamp(4rem, 10vh, 7rem);
  overflow: hidden;
}

.mesh {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.9;
}

.mesh svg { width: 100%; height: 100%; }

.mesh-nodes circle {
  fill: var(--accent);
  animation: nodePulse 4s ease-in-out infinite;
  transform-origin: center;
  transform-box: fill-box;
}

.mesh-lines line {
  stroke: var(--accent);
}
.mesh-nodes circle:nth-child(2) { animation-delay: 0.4s; }
.mesh-nodes circle:nth-child(3) { animation-delay: 0.8s; }
.mesh-nodes circle:nth-child(4) { animation-delay: 1.2s; }
.mesh-nodes circle:nth-child(5) { animation-delay: 1.6s; }
.mesh-nodes circle:nth-child(6) { animation-delay: 2.0s; }
.mesh-nodes circle:nth-child(7) { animation-delay: 2.4s; }
.mesh-nodes circle:nth-child(8) { animation-delay: 2.8s; }
.mesh-nodes circle:nth-child(9) { animation-delay: 3.2s; }

@keyframes nodePulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.mesh-lines line {
  animation: lineFade 8s ease-in-out infinite;
}
.mesh-lines line:nth-child(odd) { animation-delay: 2s; }

@keyframes lineFade {
  0%, 100% { stroke-opacity: 0.15; }
  50% { stroke-opacity: 0.5; }
}

.hero-inner {
  position: relative;
  z-index: 1;
}

.kicker {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.5rem;
}

.hero-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2.5rem, 6vw, 4.75rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 1.75rem;
  max-width: 22ch;
  color: var(--text);
  text-wrap: balance;
}

.hero-sub {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  line-height: 1.55;
  color: var(--text-soft);
  max-width: 56ch;
  margin: 0 0 2.5rem;
}

.hero-cta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

/* ------------------------------- Section labels & titles */

.section-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: 1rem;
}

.section-label::before {
  content: '';
  display: inline-block;
  width: 36px;
  height: 1px;
  background: var(--accent);
  opacity: 0.65;
}

.section-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 3rem;
  color: var(--text);
}

/* ------------------------------- Observation */

.observation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: clamp(1.5rem, 3vw, 3rem);
  margin-top: 2rem;
}

.obs-item {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}

.obs-item h3 {
  font-family: var(--font-sans);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 0.65rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.obs-item p {
  margin: 0;
  color: var(--text-soft);
  font-size: 1rem;
  line-height: 1.6;
}

.obs-stats {
  margin-top: clamp(3rem, 6vw, 5rem);
  padding: clamp(2.5rem, 5vw, 3.5rem) 0 0;
  border-top: 1px solid var(--border);
}

.obs-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 4vw, 2.5rem);
  text-align: center;
  align-items: start;
}

.obs-stat-item {
  padding: 0.5rem 0.5rem;
  position: relative;
}

.obs-stat-item + .obs-stat-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 15%;
  bottom: 15%;
  width: 1px;
  background: var(--border);
}

.obs-stat-number {
  font-family: var(--font-serif);
  font-size: clamp(2.25rem, 5.5vw, 3.75rem);
  font-weight: 400;
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.025em;
  margin: 0 0 1.1rem;
  white-space: nowrap;
}

.obs-stat-unit {
  font-size: 0.5em;
  color: var(--text-soft);
  margin-left: 0.3rem;
  vertical-align: 0.4em;
  letter-spacing: 0;
}

.obs-stat-label {
  font-family: var(--font-serif);
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  color: var(--text-soft);
  max-width: 24ch;
  margin: 0 auto;
  line-height: 1.45;
}

.obs-stats-cite {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  text-transform: uppercase;
  text-align: center;
  margin: clamp(2.5rem, 4vw, 3rem) 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-soft);
}

@media (max-width: 720px) {
  .obs-stats-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .obs-stat-item + .obs-stat-item::before { display: none; }
}

/* ------------------------------- Thesis */

.thesis {
  background:
    radial-gradient(circle at 20% 30%, rgba(102, 103, 171, 0.06) 0%, transparent 50%),
    var(--bg-lift);
}

[data-theme="dark"] .thesis {
  background:
    radial-gradient(circle at 20% 30%, rgba(152, 153, 204, 0.06) 0%, transparent 50%),
    var(--bg-lift);
}

.thesis-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: thesis;
}

.thesis-list li {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: clamp(1rem, 3vw, 2.5rem);
  padding: 1.75rem 0;
  border-top: 1px solid var(--border);
  align-items: start;
}

.thesis-list li:last-child { border-bottom: 1px solid var(--border); }

.thesis-num {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  padding-top: 0.6rem;
}

.thesis-list li p {
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 2.2vw, 1.7rem);
  line-height: 1.35;
  font-weight: 400;
  color: var(--text);
  margin: 0;
  letter-spacing: -0.005em;
}

/* ------------------------------- Audience */

.audience-intro {
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  line-height: 1.6;
  color: var(--text-soft);
  max-width: 62ch;
  margin: 0 0 2.5rem;
}

.audience-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1rem;
}

.audience-item {
  padding: 1.75rem 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: 4px;
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.audience-item:hover {
  border-color: var(--accent-dim);
  border-left-color: var(--accent);
  transform: translateX(4px);
}

.audience-item p {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  line-height: 1.5;
  color: var(--text);
  font-style: italic;
}

/* ------------------------------- FAQ */

.faq-list {
  display: flex;
  flex-direction: column;
  margin-top: 1rem;
}

.faq-item {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
}

.faq-item:last-child {
  border-bottom: 1px solid var(--border);
}

.faq-q {
  font-family: var(--font-sans);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.65rem;
  letter-spacing: -0.005em;
}

.faq-a {
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--text-soft);
  margin: 0;
  line-height: 1.6;
  max-width: 64ch;
}

/* ------------------------------- Briefing */

.briefing {
  background: linear-gradient(180deg, var(--bg-alt) 0%, var(--bg) 100%);
}

.briefing-intro {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--text-soft);
  margin: 0 0 3rem;
  max-width: 60ch;
}

.briefing-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 600px) {
  .field-row { grid-template-columns: 1fr; }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.field label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-soft);
  font-weight: 500;
}

/* Required field marker — small superscript red asterisk in the label.
   `aria-hidden="true"` on the span keeps screen readers from announcing it;
   the input's own `required` attribute carries the semantic info. */
.required {
  color: var(--error) !important;
  font-size: 0.7em;
  font-weight: 700;
  line-height: 1;
  margin-left: 0.15rem;
  position: relative;
  top: -0.35em;
  vertical-align: super;
}

/* Inline field error state — red border + small red message under the field. */
.field.field-error input,
.field.field-error textarea,
.field.field-error select {
  border-color: var(--error) !important;
}

.field.field-error input:focus,
.field.field-error textarea:focus,
.field.field-error select:focus {
  border-color: var(--error) !important;
  box-shadow: 0 0 0 3px var(--error-glow) !important;
}

.field-error-msg {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--error);
  margin: 0.45rem 0 0;
  line-height: 1.3;
}

/* Fallback for inputs not wrapped in .field (e.g. newsletter form). */
input.input-error,
textarea.input-error,
select.input-error {
  border-color: var(--error) !important;
}
input.input-error:focus,
textarea.input-error:focus,
select.input-error:focus {
  box-shadow: 0 0 0 3px var(--error-glow) !important;
}

.field input,
.field select,
.field textarea {
  background: var(--bg-field);
  border: 1.5px solid var(--border-strong);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  padding: 0.95rem 1.05rem;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  resize: vertical;
  width: 100%;
  box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.02);
}

.field select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23828a9d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 14px;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: var(--border-hover);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px var(--accent-glow);
}

[data-theme="dark"] .field input,
[data-theme="dark"] .field select,
[data-theme="dark"] .field textarea {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

[data-theme="dark"] .field input:focus,
[data-theme="dark"] .field select:focus,
[data-theme="dark"] .field textarea:focus {
  background-color: #1a2236;
}

.field textarea::placeholder,
.field input::placeholder {
  color: var(--text-muted);
}

.briefing-form .btn-block {
  margin-top: 0.75rem;
}

/* ------------------------------- Newsletter */

.newsletter {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 1px solid var(--border);
}

.newsletter-kicker {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}

.newsletter-body {
  margin: 0 0 1.5rem;
  color: var(--text-soft);
  font-size: 1rem;
  line-height: 1.55;
  max-width: 56ch;
}

.newsletter-body strong { color: var(--text); font-weight: 600; }

.newsletter-samples-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 0.85rem;
}

.newsletter-samples {
  list-style: none;
  margin: 0 0 1.75rem;
  padding: 0;
}

.newsletter-samples li {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--text-soft);
  padding: 0.35rem 0 0.35rem 0.9rem;
  border-left: 2px solid var(--accent-dim);
  margin: 0.4rem 0;
  line-height: 1.5;
}

.newsletter-form {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.newsletter-form input {
  flex: 1;
  min-width: 240px;
  background: var(--bg-field);
  border: 1.5px solid var(--border-strong);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  padding: 0.85rem 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.02);
}

.newsletter-form input:hover {
  border-color: var(--border-hover);
}

.newsletter-form input:focus {
  outline: none;
  border-color: var(--accent);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.newsletter-form > .field-error-msg {
  flex-basis: 100%;
  margin: -0.25rem 0 0;
}

[data-theme="dark"] .newsletter-form input {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

[data-theme="dark"] .newsletter-form input:focus {
  background-color: #1a2236;
}

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

.site-footer {
  border-top: 1px solid var(--border-soft);
  padding: 2.5rem 0;
  background: var(--bg);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.footer-mark {
  height: 26px;
  filter: brightness(0) saturate(100%) invert(40%) sepia(13%) saturate(1633%) hue-rotate(214deg) brightness(95%) contrast(85%);
  opacity: 0.85;
}

[data-theme="dark"] .footer-mark {
  filter: brightness(0) invert(1);
  opacity: 0.7;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.footer-copy {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-link {
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

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

/* ------------------------------- Reveal animation */
/*
 * Items are hidden initially and revealed by the IntersectionObserver in
 * site.js when they scroll into view. On mobile connections the deferred
 * JS file can take many seconds to load, so a CSS-only failsafe animation
 * forces every .reveal item visible after 2.5s no matter what — content
 * never gets stuck hidden waiting for JavaScript.
 */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  animation: reveal-failsafe 0.7s ease 2.5s forwards;
}

@keyframes reveal-failsafe {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  animation: none;
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ------------------------------- Responsive tweaks */

@media (max-width: 720px) {
  :root { --header-h: 64px; }

  .hero { min-height: auto; padding-top: calc(4rem + var(--header-h)); padding-bottom: 4rem; }

  .footer-inner { flex-direction: column; align-items: flex-start; gap: 1.25rem; }
  .footer-right { flex-direction: column; align-items: flex-start; gap: 0.5rem; }

  .thesis-list li { grid-template-columns: 1fr; gap: 0.5rem; }
  .thesis-num { padding-top: 0; }
}

/* =========================================================
   Error pages (404 / 403 / 500)
   ========================================================= */

.error-page {
  min-height: calc(100vh - 240px);
  display: flex;
  align-items: center;
  padding: clamp(4rem, 10vh, 7rem) 0;
  margin-top: calc(-1 * var(--header-h));
  padding-top: calc(clamp(4rem, 10vh, 7rem) + var(--header-h));
}

.error-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2.5rem, 6vw, 4.25rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 1.5rem;
  color: var(--text);
  text-wrap: balance;
  max-width: 18ch;
}

.error-detail {
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  color: var(--text-soft);
  max-width: 56ch;
  margin: 0 0 2.5rem;
  line-height: 1.55;
}

.error-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

/* =========================================================
   Honeypot field (anti-bot — must be invisible to real users
   while remaining a real field for bots to autofill)
   ========================================================= */

.vb-honeypot {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  left: -9999px !important;
  top: auto !important;
}

.vb-honeypot input {
  position: absolute !important;
  left: -9999px !important;
  top: auto !important;
}

/* =========================================================
   Cloudflare Turnstile widget
   ========================================================= */

.turnstile-widget {
  display: block;
  margin: 0.5rem 0 0.25rem;
  min-height: 65px;
  width: 100%;
}

.briefing-form .turnstile-widget,
.privacy-contact-form .turnstile-widget {
  margin: 1rem 0 0.5rem;
}

.newsletter-form .turnstile-widget {
  flex-basis: 100%;
  margin: 0.75rem 0;
}

/* =========================================================
   Form success panel (replaces form on successful submit)
   ========================================================= */

.form-success {
  text-align: center;
  padding: clamp(2rem, 5vw, 3rem) 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: 8px;
  animation: form-success-in 0.4s ease-out;
}

@keyframes form-success-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.form-success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 1.6rem;
  font-weight: 600;
  margin: 0 0 1.25rem;
  line-height: 1;
}

.form-success-title {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.form-success-message {
  color: var(--text-soft);
  font-size: 1.05rem;
  line-height: 1.55;
  margin: 0 auto;
  max-width: 44ch;
}

@media (prefers-reduced-motion: reduce) {
  .form-success { animation: none; }
}

/* =========================================================
   Hide the hero radial mesh wash in light theme.
   The decorative purple gradient is built into the SVG and
   doesn't suit the light background, so we only show it on dark.
   ========================================================= */

.mesh > svg > rect {
  display: none;
}

[data-theme="dark"] .mesh > svg > rect {
  display: block;
}
