/* ruthner.at – gemeinsame Basis (Startseite, Kontakt, Impressum) */

/* Schriften selbst gehostet (statt Google-Fonts-CDN) – vermeidet die
   IP-Uebertragung an Google beim Laden externer Ressourcen. Variable Fonts,
   je eine Datei pro Schnitt deckt den gesamten Schnittbereich ab. */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/fraunces-normal.woff2") format("woff2-variations"), url("fonts/fraunces-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/fraunces-italic.woff2") format("woff2-variations"), url("fonts/fraunces-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("fonts/manrope.woff2") format("woff2-variations"), url("fonts/manrope.woff2") format("woff2");
}

:root {
  --ink: #0c0e0b;
  --ink-2: #131611;
  --paper: #f3efe6;
  --paper-dim: #b3ae9f;
  --paper-mute: #7f7b70;
  --gold: #d9b45a;
  --gold-2: #e8cd86;
  --gold-dim: rgba(217, 180, 90, 0.16);
  --moss: #7fb069;
  --rose: #e07a6a;
  --line: rgba(243, 239, 230, 0.12);
  --line-strong: rgba(243, 239, 230, 0.22);
  --glass: rgba(243, 239, 230, 0.035);
  --glass-hover: rgba(243, 239, 230, 0.07);

  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Code", Consolas, ui-monospace, monospace;
  --radius: 16px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gutter: clamp(20px, 5vw, 72px);
  --nav-h: 66px;
}

* { box-sizing: border-box; }

html {
  background: var(--ink);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 64px);
}

body {
  margin: 0;
  color: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
::selection { background: var(--gold); color: var(--ink); }

h1, h2, h3 {
  font-family: var(--serif);
  font-variation-settings: "opsz" 144;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.05;
  margin: 0;
}
em { font-style: italic; font-weight: 400; }

/* ---------- Hintergrund ---------- */

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 50% at 15% 0%, rgba(217, 180, 90, 0.16), transparent 60%),
    radial-gradient(ellipse 60% 50% at 90% 20%, rgba(70, 92, 120, 0.22), transparent 65%),
    radial-gradient(ellipse 80% 60% at 50% 110%, rgba(127, 176, 105, 0.08), transparent 60%),
    var(--ink);
}
/* Statisch statt animiert + blur: ein Blur-Layer in Vollbildgroesse kostet bei jedem Scroll-Frame GPU-Zeit */
.bg-drift {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 45% 40% at 28% 28%, rgba(217, 180, 90, 0.09), transparent 70%),
    radial-gradient(ellipse 45% 40% at 72% 72%, rgba(90, 120, 160, 0.11), transparent 70%);
}
/* Auf schmalen Bildschirmen kostet dieser zweite Vollbild-Gradient-Layer mehr an
   Compositing, als er bei ohnehin sehr geringer Deckkraft noch an Tiefe bringt. Betrifft
   nur .bg-drift -- .bg bleibt (traegt die Basisfarbe). Gilt fuer alle Seiten, die diese
   gemeinsame site.css nutzen, nicht nur die Startseite. */
@media (max-width: 760px) {
  .bg-drift { display: none; }
}
#stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.8;
  will-change: transform;
}
.grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
/* Auf schmalen Bildschirmen kostet der Feinkoerner-Layer (deckt den ganzen Bildschirm ab,
   staendig neu zu compositen) mehr, als er optisch bei 0.05 Deckkraft noch bringt. */
@media (max-width: 760px) {
  .grain { display: none; }
}
.progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0;
  z-index: 30;
  background: linear-gradient(90deg, var(--gold), var(--gold-2));
  box-shadow: 0 0 12px rgba(217, 180, 90, 0.6);
}

/* ---------- Hero-Hintergrund (animierte SVG-Szenen) ---------- */

.hero-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.8s var(--ease);
  /* Bewusst ohne CSS-Filter auf diesem bildschirmfuellenden Element: das erzwingt
     bei jedem Scroll-Frame ein Neu-Rastern und macht das Scrollen ruckelig. Die
     Animation steckt stattdessen nur in der SVG selbst (transform/opacity, GPU-billig). */
}
.hero-bg img.loaded { opacity: 0.6; }
.hero-bg-scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 65% 55% at 22% 40%, rgba(12, 14, 11, 0.88), transparent 62%),
    linear-gradient(180deg, rgba(12, 14, 11, 0.35) 0%, rgba(12, 14, 11, 0.6) 60%, var(--ink) 100%);
}

/* ---------- Navigation ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: var(--nav-h);
  padding: 0 var(--gutter);
  border-bottom: 1px solid transparent;
  transition: background 0.35s, border-color 0.35s;
}
.nav.scrolled {
  background: rgba(12, 14, 11, 0.9);
  border-bottom-color: var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand img {
  height: 34px;
  width: auto;
  filter: drop-shadow(0 0 10px rgba(217, 180, 90, 0.25));
  transition: transform 0.5s var(--ease), filter 0.4s;
}
.brand:hover img { transform: scale(1.06); filter: drop-shadow(0 0 16px rgba(217, 180, 90, 0.55)); }
.brand em { color: var(--gold); }
.nav-links { display: flex; align-items: center; gap: 28px; font-size: 14px; font-weight: 500; }
.nav-links a { color: var(--paper-dim); transition: color 0.25s; }
.nav-links a:hover, .nav-links a.current { color: var(--paper); }
.nav-cta {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink) !important;
  background: var(--gold);
  padding: 9px 16px;
  border-radius: 999px;
  font-weight: 700;
  transition: background 0.25s, transform 0.25s var(--ease) !important;
}
.nav-cta:hover { background: var(--gold-2); transform: translateY(-1px); }
@media (max-width: 720px) { .nav-links a:not(.nav-cta) { display: none; } }

/* ---------- Typo-Bausteine ---------- */

.kicker {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 22px;
}
.kicker::before {
  content: "";
  display: inline-block;
  width: 26px;
  height: 1px;
  background: var(--gold);
  vertical-align: middle;
  margin-right: 12px;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}
.lede {
  font-size: clamp(17px, 1.6vw, 21px);
  color: var(--paper-dim);
  max-width: 56ch;
  margin: 0 0 36px;
  line-height: 1.55;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 26px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  font-family: var(--sans);
  border: 0;
  cursor: pointer;
  transition: transform 0.35s var(--ease), background 0.25s, color 0.25s, border-color 0.25s, opacity 0.25s;
}
.btn-primary { background: var(--gold); color: var(--ink); }
.btn-primary:hover { background: var(--gold-2); transform: translateY(-2px); }
.btn-ghost { border: 1px solid var(--line-strong); color: var(--paper); background: transparent; }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-2); transform: translateY(-2px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

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

main { position: relative; z-index: 1; }
.hero {
  position: relative;
  z-index: 1;
  padding: clamp(60px, 12vh, 140px) var(--gutter) clamp(50px, 8vh, 90px);
  max-width: 1240px;
  margin: 0 auto;
}
.hero h1 {
  font-size: clamp(44px, 7.2vw, 108px);
  max-width: 14ch;
  margin-bottom: 26px;
}
.hero h1 em { color: var(--gold-2); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center; }

.section {
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(56px, 9vh, 110px) var(--gutter) 0;
}
.section:last-of-type { padding-bottom: clamp(56px, 9vh, 110px); }

/* Rendering erst, wenn eine Sektion nahe am Viewport ist -- erspart dem Browser beim
   ersten Laden das Layout/Painting fuer alles, was noch weit unten steht. Die beiden
   ersten Sektionen (Klarsatz, Video Wallpaper) bleiben aussen vor: Die liegen nah am
   oberen Rand und sollen nicht erst beim Scrollen nachgezogen werden. */
.section:not(#klarsatz):not(#wallpaper) {
  content-visibility: auto;
  contain-intrinsic-size: auto 900px;
}

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

footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line);
  padding: 44px var(--gutter) 40px;
}
.foot-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  font-size: 13px;
  color: var(--paper-mute);
}
.foot-inner strong { color: var(--paper-dim); font-weight: 600; }
.foot-links { display: flex; gap: 22px; }
.foot-links a { color: var(--paper-mute); transition: color 0.25s; }
.foot-links a:hover { color: var(--gold-2); }
.foot-brand {
  font-family: var(--serif);
  font-size: 30px;
  color: var(--paper);
  line-height: 1;
  margin-bottom: 10px;
}
.foot-brand em { color: var(--gold); }

.totop {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: rgba(12, 14, 11, 0.85);
  color: var(--paper);
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.35s, transform 0.35s var(--ease), border-color 0.25s;
  pointer-events: none;
}
.totop.show { opacity: 1; transform: none; pointer-events: auto; }
.totop:hover { border-color: var(--gold); color: var(--gold-2); }

/* ---------- Icons (Line-Art, zeichnen sich beim Einblenden einmalig) ---------- */

.ico {
  width: 66px;
  height: 66px;
  border-radius: 18px;
  border: 1px solid rgba(217, 180, 90, 0.28);
  background:
    radial-gradient(circle at 30% 25%, rgba(217, 180, 90, 0.2), transparent 62%),
    var(--glass);
  box-shadow: 0 14px 30px -18px rgba(217, 180, 90, 0.6);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.ico svg {
  width: 38px;
  height: 38px;
  overflow: visible;
  fill: none;
  stroke: var(--gold-2);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  font-family: var(--serif);
}
.ico-sm { width: 46px; height: 46px; border-radius: 13px; }
.ico-sm svg { width: 26px; height: 26px; stroke-width: 2; }
.hero .ico { margin-bottom: 22px; }

/* pathLength=100 normalisiert alle Pfade -> gleiche Zeichendauer */
.ico .d { stroke-dasharray: 100; stroke-dashoffset: 100; }
.ico .f { opacity: 0; }
.in .ico .d { animation: ico-draw 1.3s var(--ease) var(--d, 0s) forwards; }
.in .ico .f { animation: ico-fade 0.7s ease calc(0.7s + var(--d, 0s)) forwards; }
/* Danach nur kleine transform/opacity-Details (GPU-guenstig, keine Repaints) */
.in .ico .spin  { animation: ico-fade 0.7s ease 0.7s forwards, ico-spin 22s linear 1.4s infinite; transform-origin: 24px 24px; }
.in .ico .orbit { animation: ico-fade 0.7s ease 0.7s forwards, ico-spin 7s linear 1.4s infinite; transform-origin: 24px 24px; }
.in .ico .pulse { animation: ico-fade 0.7s ease calc(0.7s + var(--d, 0s)) forwards, ico-pulse 2.6s ease-in-out calc(1.4s + var(--d, 0s)) infinite; }
.in .ico .scan  { animation: ico-fade 0.7s ease 0.9s forwards, ico-scan 2.4s ease-in-out 1.4s infinite alternate; }
.in .ico .bar   { animation: ico-fade 0.5s ease var(--d, 0s) forwards, ico-eq 1.1s ease-in-out calc(0.5s + var(--d, 0s)) infinite alternate; transform-box: fill-box; transform-origin: center; }
.in .ico .flame { animation: ico-fade 0.5s ease 1s forwards, ico-flame 0.45s ease-in-out 1.5s infinite alternate; transform-origin: 24px 29px; }
.in .ico .ring  { animation: ico-ring 2.4s ease-out 1.2s infinite; transform-origin: 24px 19px; }
@keyframes ico-draw  { to { stroke-dashoffset: 0; } }
@keyframes ico-fade  { to { opacity: 1; } }
@keyframes ico-spin  { to { transform: rotate(360deg); } }
@keyframes ico-pulse { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }
@keyframes ico-scan  { from { transform: translateY(-9px); } to { transform: translateY(9px); } }
@keyframes ico-eq    { from { transform: scaleY(0.35); } to { transform: scaleY(1); } }
@keyframes ico-flame { from { transform: scaleY(0.7); opacity: 0.7; } to { transform: scaleY(1.1); opacity: 1; } }
@keyframes ico-ring  { 0% { transform: scale(0.6); opacity: 0.9; } 100% { transform: scale(1.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .ico * { animation: none !important; }
  .ico .d { stroke-dashoffset: 0; }
  .ico .f, .ico .ring { opacity: 1; }
}

/* ---------- Scroll-Reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: calc(var(--i, 0) * 70ms);
}
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}
