/* ============================================================
   rasmusbugge.eu — campaign one-pager
   Aesthetic: editorial bureau — warm paper, Instrument Serif
   display, mono meta labels, hairline rules, asymmetric layout.
   EU blue as ink accent, a single gold star as punctuation.
   ============================================================ */

/* ---------- Self-hosted fonts (no FOUT) ---------- */
@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/instrument-serif.woff2") format("woff2");
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/archivo-var.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/plex-mono-400.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/plex-mono-500.woff2") format("woff2");
}

:root {
  --paper: #f4f1e9;
  --paper-deep: #ece8dc;
  --ink: #14141a;
  --ink-soft: #4c4c55;
  --ink-faint: rgba(20, 20, 26, 0.4);
  --line: rgba(20, 20, 26, 0.16);
  --line-strong: rgba(20, 20, 26, 0.75);
  --blue: #2036c8;
  --gold: #d9a33a;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Archivo", Helvetica, sans-serif;
  --mono: "IBM Plex Mono", monospace;
  --gutter: clamp(1.4rem, 4vw, 4rem);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 300;
  line-height: 1.6;
  overflow-x: hidden;
}

::selection { background: var(--blue); color: var(--paper); }

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

em {
  font-style: normal;
  color: var(--blue);
}

/* ---------- Language switching ---------- */
html[data-lang="da"] .en { display: none !important; }
html[data-lang="en"] .da { display: none !important; }

/* ---------- Grain ---------- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 240 240' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Top bar ---------- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem var(--gutter);
  border-bottom: 1px solid transparent;
  transition: background 0.4s ease, border-color 0.4s ease, padding 0.4s ease;
}
.topbar.is-scrolled {
  background: rgba(244, 241, 233, 0.92);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--line);
  padding: 0.8rem var(--gutter);
}

.monogram {
  font-family: var(--serif);
  font-size: 1.35rem;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: 0.15rem;
}
.monogram-star {
  color: var(--blue);
  font-size: 0.6em;
  transform: translateY(-0.6em);
}

.topnav { display: flex; gap: 2.2rem; }
.topnav a {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.2s ease;
}
.topnav a:hover { color: var(--blue); }

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
}
.lang-toggle button {
  background: none;
  border: none;
  font: inherit;
  font-weight: 500;
  color: var(--ink-faint);
  cursor: pointer;
  padding: 0.15rem 0;
  transition: color 0.2s ease;
}
.lang-toggle button:hover { color: var(--ink); }
.lang-toggle button.is-active {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.lang-sep { color: var(--ink-faint); }

/* ---------- Links ---------- */
.arrow-link {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 0.3rem;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.arrow-link:hover { color: var(--blue); border-color: var(--blue); }

/* ---------- Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.is-visible { opacity: 1; transform: none; }
.d1 { transition-delay: 0.1s; }
.d2 { transition-delay: 0.2s; }
.d3 { transition-delay: 0.3s; }
.d4 { transition-delay: 0.4s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .marquee-track { animation: none !important; }
  .band-bg { transform: none !important; }
  .ring-rotor { animation: none !important; }
  .bg-ring { animation: none !important; opacity: var(--o, 0.16); }
  html { scroll-behavior: auto; }
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 7.5rem var(--gutter) 4rem;
  position: relative;
  overflow: hidden;
}
.hero > * { position: relative; }

/* scattered mini EU star rings — random sizes, blue, animated */
.hero-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.bg-ring {
  position: absolute;
  background-image: url("hero-stars.svg");
  background-size: contain;
  background-repeat: no-repeat;
  animation: ring-pulse ease-in-out infinite alternate;
}
@keyframes ring-pulse {
  from { opacity: var(--o, 0.16); }
  to { opacity: calc(var(--o, 0.16) * 0.45); }
}
.r1 { top: 5%;    left: 4%;   width: 120px; height: 120px; --o: 0.20; animation-duration: 5.2s; }
.r2 { top: 22%;   left: 34%;  width: 58px;  height: 58px;  --o: 0.13; animation-duration: 4.1s; animation-delay: 1.2s; }
.r3 { top: 7%;    right: 9%;  width: 170px; height: 170px; --o: 0.17; animation-duration: 6.5s; animation-delay: 0.6s; }
.r4 { bottom: 16%; left: 10%; width: 90px;  height: 90px;  --o: 0.16; animation-duration: 4.8s; animation-delay: 2.1s; }
.r5 { bottom: 4%; left: 42%;  width: 140px; height: 140px; --o: 0.12; animation-duration: 7s;  animation-delay: 0.9s; }
.r6 { top: 48%;   left: 22%;  width: 44px;  height: 44px;  --o: 0.12; animation-duration: 3.6s; animation-delay: 1.7s; }
.r7 { bottom: 26%; right: 3%; width: 100px; height: 100px; --o: 0.18; animation-duration: 5.6s; animation-delay: 0.3s; }
.r8 { top: 64%;   right: 40%; width: 66px;  height: 66px;  --o: 0.11; animation-duration: 4.4s; animation-delay: 2.6s; }
.r9 { bottom: 3%; right: 16%; width: 76px;  height: 76px;  --o: 0.15; animation-duration: 5s;   animation-delay: 1.5s; }

.hero-meta {
  color: var(--ink-faint);
  border-bottom: 1px solid var(--line);
  padding-bottom: 1.1rem;
  margin-bottom: clamp(2rem, 6vh, 4.5rem);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: end;
}

.hero-name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(4.5rem, 13vw, 11.5rem);
  line-height: 0.88;
  letter-spacing: -0.015em;
  -webkit-text-stroke: 0.014em currentColor;
}
.hero-name em { -webkit-text-stroke: 0.014em var(--blue); }
.hero-line { display: block; }
.hero-line-accent {
  margin-left: clamp(1.5rem, 5vw, 5rem);
}
.hero-line-accent em { color: var(--blue); }

.hero-role {
  margin-top: 2rem;
  color: var(--ink-soft);
}

.hero-tagline {
  margin-top: 1.6rem;
  max-width: 30rem;
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  line-height: 1.5;
}

.hero-links {
  display: flex;
  gap: 2.2rem;
  margin-top: 2.8rem;
}

.hero-figure {
  position: relative;
  max-width: 21rem;
  justify-self: end;
  margin-right: clamp(0rem, 3vw, 3rem);
  width: 100%;
}
.hero-figure img {
  display: block;
  width: 100%;
  height: auto;
  position: relative;
  z-index: 1;
}
/* EU flag star ring behind the portrait (centered on the image, above the caption) */
.star-ring {
  position: absolute;
  top: -14%;
  left: -20%;
  right: -20%;
  bottom: 10%;
  z-index: 0;
  pointer-events: none;
}
.star-ring svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.ring-rotor {
  fill: var(--blue);
  opacity: 0.75;
}
.hero-figure figcaption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--line-strong);
  color: var(--ink-faint);
  position: relative;
  z-index: 1;
}
.fig-star { color: var(--gold); font-size: 0.9rem; }

/* ---------- Marquee ---------- */
.marquee {
  overflow: hidden;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  padding: 1.1rem 0;
  background: var(--paper);
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 40s linear infinite;
}
.marquee-track span {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3.2vw, 2.6rem);
  white-space: nowrap;
  color: var(--ink);
  padding-right: 1rem;
}
@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* ---------- Front page statements ---------- */
.statements {
  margin-top: 2.4rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  max-width: 34rem;
}
.statements p {
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.4vw, 1.9rem);
  line-height: 1.3;
}

/* ---------- Politik page ---------- */
.page {
  padding: 9rem var(--gutter) 4rem;
}
.page-intro {
  margin-top: 1.6rem;
  max-width: 34rem;
  color: var(--ink-soft);
  font-size: 1.05rem;
}
.page { padding-bottom: clamp(3rem, 7vh, 5rem); }

/* ---------- Section scaffolding ---------- */
.section-label {
  display: flex;
  align-items: baseline;
  gap: 1.1rem;
  color: var(--ink-soft);
  margin-bottom: 2.2rem;
}
.label-star { color: var(--gold); font-size: 0.85em; transform: translateY(-1px); }

.section-title {
  font-family: var(--serif);
  font-weight: 400;
  -webkit-text-stroke: 0.014em currentColor;
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  max-width: 18ch;
}
.section-title em { color: var(--blue); }

/* ---------- Vision ---------- */
.vision {
  padding: clamp(5rem, 12vh, 9rem) var(--gutter);
  position: relative;
  overflow: hidden;
}
.vision .section-head { margin-bottom: clamp(3rem, 7vh, 5rem); }

/* Three color bands — posterized colonnade, scroll parallax via --p */
.band {
  position: relative;
  min-height: 88svh;
  display: flex;
  align-items: center;
  padding: clamp(4rem, 10vh, 7rem) var(--gutter);
  overflow: hidden;
  border-top: 1px solid var(--line-strong);
}

.band-bg {
  position: absolute;
  inset: -12% 0;
  background-size: cover;
  background-position: center;
  opacity: 0.28;
  transform: translateY(calc((var(--p, 0.5) - 0.5) * -9%));
  will-change: transform;
}
.band-ink .band-bg { opacity: 0.45; }

.band-blue { background: #e9ecf9; }
.band-gold { background: #f7eeda; }
.band-ink  { background: #101636; }

.band-panel {
  position: relative;
  max-width: 36rem;
}
/* soft halo behind text for legibility — no visible box */
.band-panel::before {
  content: "";
  position: absolute;
  inset: -5rem -7rem;
  background: radial-gradient(ellipse closest-side, var(--halo) 55%, transparent 100%);
  pointer-events: none;
}
.band-panel > * { position: relative; }
.band-blue { --halo: rgba(233, 236, 249, 0.92); }
.band-gold { --halo: rgba(247, 238, 218, 0.92); }
.band-ink  { --halo: rgba(16, 22, 54, 0.94); }

/* alternate text position: left / right / left */
.band-gold { justify-content: flex-end; }

.band-flow { min-height: 0; }

.band-heading {
  font-family: var(--serif);
  font-weight: 400;
  -webkit-text-stroke: 0.014em currentColor;
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  line-height: 1.0;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 2.2rem;
}
.band-blue .band-heading { color: var(--blue); }
.band-gold .band-heading { color: #8a6410; }
.band-ink .band-heading { color: var(--paper); }

.band-policies {
  display: flex;
  flex-direction: column;
  gap: 2.1rem;
}
.band-policy h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.45rem, 2.4vw, 1.9rem);
  line-height: 1.1;
  color: var(--ink);
  margin-bottom: 0.5rem;
}
.band-policy p {
  color: var(--ink-soft);
  font-size: 0.97rem;
  max-width: 34rem;
}
.band-ink .band-policy h3 { color: var(--paper); }
.band-ink .band-policy p { color: rgba(244, 241, 233, 0.8); }

/* ---------- About ---------- */
.about {
  padding: clamp(5rem, 12vh, 9rem) var(--gutter);
  background: var(--paper-deep);
  border-top: 1px solid var(--line-strong);
}
.about .section-head { margin-bottom: clamp(3rem, 6vh, 4.5rem); }

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2.5rem, 5vw, 5.5rem);
  align-items: start;
}

.about-lede {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
  line-height: 1.35;
  margin-bottom: 1.6rem;
}
.about-body {
  color: var(--ink-soft);
  max-width: 36rem;
}

.about-side {
  display: flex;
  flex-direction: column;
  gap: 2.2rem;
}

.about-figure {
  max-width: 17rem;
}
.about-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line-strong);
  filter: saturate(0.92) contrast(1.03);
}
.about-figure figcaption {
  padding-top: 0.6rem;
  color: var(--ink-faint);
}

.cred-table {
  list-style: none;
  border-top: 1px solid var(--line-strong);
}
.cred-table li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 1rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
}
.cred-label { color: var(--blue); padding-top: 0.2rem; }
.cred-value { font-size: 0.95rem; color: var(--ink); }

.pull-quote {
  margin-top: clamp(3.5rem, 8vh, 6rem);
  text-align: center;
}
.quote-star {
  display: block;
  color: var(--gold);
  font-size: 1.1rem;
  margin-bottom: 1.4rem;
}
.pull-quote p {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.7rem, 3.6vw, 2.8rem);
  line-height: 1.2;
  max-width: 26ch;
  margin: 0 auto;
}

/* ---------- About (front page) ---------- */
.about {
  padding: clamp(5rem, 12vh, 8rem) var(--gutter);
  border-top: 1px solid var(--line-strong);
}
.about-text {
  max-width: 38rem;
  margin-top: 1.8rem;
  color: var(--ink-soft);
}
.about-text p + p { margin-top: 1.1rem; }

/* ---------- 404 ---------- */
.notfound {
  min-height: 78svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8rem var(--gutter) 5rem;
}
.notfound-code {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(6rem, 22vw, 17rem);
  line-height: 0.9;
  letter-spacing: -0.02em;
  color: var(--ink);
  -webkit-text-stroke: 0.014em currentColor;
  margin-bottom: 1.2rem;
}
.notfound-star {
  color: var(--gold);
  font-size: 0.62em;
  display: inline-block;
  margin: 0 0.06em;
  transform: translateY(-0.08em);
}
.notfound .section-title { margin-bottom: 1.4rem; }
.notfound-body {
  max-width: 30rem;
  color: var(--ink-soft);
  margin-bottom: 2.4rem;
}

/* ---------- Contact ---------- */
.contact {
  padding: clamp(5.5rem, 14vh, 10rem) var(--gutter);
  border-top: 1px solid var(--line-strong);
}
.contact-title {
  font-family: var(--serif);
  font-weight: 400;
  -webkit-text-stroke: 0.014em currentColor;
  font-size: clamp(3.2rem, 8.5vw, 7rem);
  line-height: 0.98;
  letter-spacing: -0.01em;
}
.contact-title em { color: var(--blue); }

.contact-body {
  margin-top: 1.8rem;
  max-width: 30rem;
  color: var(--ink-soft);
}
.contact-body + .contact-body {
  margin-top: 1rem;
}

.contact-channels {
  margin-top: 2.6rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.6rem;
}

.contact-mail {
  display: inline-block;
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3.4vw, 2.6rem);
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid var(--line-strong);
  padding-bottom: 0.35rem;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.contact-mail:hover {
  color: var(--blue);
  border-color: var(--blue);
}

.contact-phone {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 0.3rem;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.contact-phone:hover { color: var(--blue); border-color: var(--blue); }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line-strong);
  overflow: hidden;
}
.footer-meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 1.4rem var(--gutter);
  color: var(--ink-faint);
}
.footer-wordmark {
  font-family: var(--serif);
  -webkit-text-stroke: 0.014em currentColor;
  font-size: clamp(2.6rem, 13vw, 12rem);
  line-height: 1;
  letter-spacing: -0.02em;
  text-align: center;
  color: var(--ink);
  padding: 0.5rem var(--gutter) 2.8rem;
  white-space: nowrap;
  user-select: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .topnav { display: none; }

  .hero { padding-top: 6.5rem; }
  .hero-grid {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .hero-figure {
    justify-self: center;
    max-width: 16.5rem;
    margin-right: 0;
    margin-top: 1.5rem;
  }

  .band { min-height: 72svh; }

  .about-grid { grid-template-columns: 1fr; gap: 3rem; }

  .star-ring { top: -12%; left: -20%; right: -20%; bottom: 12%; }
}

@media (max-width: 540px) {
  .hero-links { flex-direction: column; gap: 1.4rem; align-items: flex-start; }
  .vision-row { grid-template-columns: 2.4rem minmax(0, 1fr); padding: 2rem 0; }
  .cred-table li { grid-template-columns: 1fr; gap: 0.25rem; }
  .footer-meta { flex-direction: column; }
}
