/* ==========================================================================
   Oberfranken RP – Custom Layer
   Tailwind übernimmt Layout-Utilities. Hier liegen Brand, Motion, A11y.
   ========================================================================== */

:root {
  --of-bg: #050706;
  --of-bg-elevated: #0a100d;
  --of-surface: rgba(13, 20, 17, 0.78);
  --of-border: rgba(52, 211, 153, 0.16);
  --of-accent: #34d399;
  --of-accent-strong: #10b981;
  --of-text: #eef5f1;
  --of-muted: #93a399;
  --of-danger: #f87171;
  --of-glow: 0 0 42px rgba(16, 185, 129, 0.28);
  --of-radius: 1.25rem;
  --header-h: 4.5rem;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 0.75rem);
}

body {
  background: var(--of-bg);
  color: var(--of-text);
  font-family: Inter, system-ui, sans-serif;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(16, 185, 129, 0.35);
  color: #fff;
}

/* Skip-Link -------------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--of-accent-strong);
  color: #052e22;
  font-weight: 600;
  border-radius: 0.5rem;
}

.skip-link:focus {
  top: 1rem;
}

/* Header ----------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  border-bottom: 1px solid transparent;
  background: transparent;
  transition: background 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
}

.site-header.is-scrolled {
  background: rgba(5, 7, 6, 0.78);
  border-bottom-color: var(--of-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.logo-mark {
  display: grid;
  place-items: center;
  min-width: 4.15rem;
  height: 2.4rem;
  padding: 0 0.65rem;
  border-radius: 0.7rem;
  background: linear-gradient(160deg, rgba(52, 211, 153, 0.2), rgba(16, 185, 129, 0.05));
  border: 1px solid var(--of-border);
  color: var(--of-accent);
  font-family: Outfit, Inter, sans-serif;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.nav-link {
  color: var(--of-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--of-text);
}

/* Buttons ---------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 2.85rem;
  padding: 0.7rem 1.2rem;
  border-radius: 0.85rem;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:focus-visible {
  outline: 2px solid var(--of-accent);
  outline-offset: 3px;
}

.btn-primary {
  background: linear-gradient(180deg, #34d399, #059669);
  color: #042f22;
  box-shadow: var(--of-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
}

.btn-discord {
  background: #5865f2;
  color: #fff;
}

.btn-discord:hover {
  background: #4752c4;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--of-text);
  border: 1px solid var(--of-border);
}

.btn-ghost:hover {
  border-color: rgba(52, 211, 153, 0.45);
}

/* Hero ------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: end;
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: -8% 0;
  height: 116%;
  will-change: transform;
  transform: translate3d(0, 0, 0) scale(1.12);
  transform-origin: center center;
  backface-visibility: hidden;
}

.hero-media img,
.hero-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-media video:not([src]) {
  display: none;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(5, 7, 6, 0.35) 0%, rgba(5, 7, 6, 0.55) 42%, rgba(5, 7, 6, 0.96) 100%),
    radial-gradient(ellipse at 20% 80%, rgba(16, 185, 129, 0.18), transparent 50%);
  pointer-events: none;
}

.hero-grain {
  position: absolute;
  inset: 0;
  opacity: 0.18;
  pointer-events: none;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 7rem 0 4.5rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--of-accent);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: rgba(5, 7, 6, 0.55);
  border: 1px solid var(--of-border);
  backdrop-filter: blur(10px);
  font-size: 0.85rem;
}

.status-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: #6b7280;
  box-shadow: 0 0 0 4px rgba(107, 114, 128, 0.18);
}

.status-dot.is-online {
  background: var(--of-accent);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.18);
  animation: pulse-dot 2s ease-out infinite;
}

.status-dot.is-offline {
  background: var(--of-danger);
  box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.18);
}

@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.display-title {
  font-family: Outfit, Inter, sans-serif;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.95;
}

.display-title span {
  color: var(--of-accent);
  text-shadow: 0 0 32px rgba(52, 211, 153, 0.35);
}

/* Cards / surfaces ------------------------------------------------------- */
.surface {
  background: var(--of-surface);
  border: 1px solid var(--of-border);
  border-radius: var(--of-radius);
  backdrop-filter: blur(12px);
}

.feature-card,
.faction-card,
.team-card,
.step-card,
.stat-card {
  background: linear-gradient(180deg, rgba(16, 24, 20, 0.9), rgba(8, 12, 10, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--of-radius);
  transition: transform 0.45s var(--of-ease, cubic-bezier(0.16, 1, 0.3, 1)), border-color 0.25s ease, box-shadow 0.25s ease;
}

.feature-card:hover,
.faction-card:hover,
.team-card:hover {
  border-color: rgba(52, 211, 153, 0.35);
  box-shadow: var(--of-glow);
}

.team-card:hover,
.step-card:hover {
  transform: translate3d(0, -4px, 0);
}

.icon-tile {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.85rem;
  background: rgba(16, 185, 129, 0.1);
  color: var(--of-accent);
  border: 1px solid var(--of-border);
}

.avatar {
  display: grid;
  place-items: center;
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 1rem;
  background: rgba(16, 185, 129, 0.12);
  color: var(--of-accent);
  font-family: Outfit, sans-serif;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* Accordion -------------------------------------------------------------- */
.accordion details {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 1rem;
  background: rgba(10, 16, 13, 0.7);
  overflow: hidden;
}

.accordion details + details {
  margin-top: 0.65rem;
}

.accordion summary {
  cursor: pointer;
  list-style: none;
  padding: 1rem 1.15rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.accordion summary::-webkit-details-marker {
  display: none;
}

.accordion summary::after {
  content: "\f078";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  color: var(--of-accent);
  transition: transform 0.2s ease;
}

.accordion details[open] summary::after {
  transform: rotate(180deg);
}

.accordion .acc-body {
  padding: 0 1.15rem 1.1rem;
  color: var(--of-muted);
  line-height: 1.7;
}

/* Forms ------------------------------------------------------------------ */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #c5d4cc;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border-radius: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.35);
  color: var(--of-text);
  padding: 0.75rem 0.9rem;
  outline: none;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--of-accent);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

.field .error {
  color: var(--of-danger);
  font-size: 0.78rem;
  min-height: 1.1em;
}

.hp-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
  overflow: hidden;
}

/* Mobile nav ------------------------------------------------------------- */
.mobile-panel {
  display: none;
}

.mobile-panel.is-open {
  display: block;
}

@media (min-width: 1024px) {
  .mobile-panel,
  .mobile-panel.is-open {
    display: none !important;
  }
}

body.nav-locked {
  overflow: hidden;
}

/* Motion: Hero-Stagger, Masken, Tilt, Stats ----------------------------- */
:root {
  --of-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-in {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  animation: hero-in 1.05s var(--of-ease) forwards;
}

.hero-in-1 { animation-delay: 0.06s; }
.hero-in-2 { animation-delay: 0.16s; }
.hero-in-3 { animation-delay: 0.28s; }
.hero-in-4 { animation-delay: 0.4s; }
.hero-in-5 { animation-delay: 0.52s; }
.hero-in-6 { animation-delay: 0.64s; }

@keyframes hero-in {
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.reveal-mask {
  overflow: hidden;
}

.reveal-mask > span {
  display: block;
  transform: translate3d(0, 115%, 0);
  transition: transform 1.05s var(--of-ease);
}

.reveal-mask.is-in > span {
  transform: translate3d(0, 0, 0);
}

.heading-rule {
  display: block;
  width: 4.5rem;
  height: 2px;
  margin-top: 1.15rem;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--of-accent), transparent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.9s var(--of-ease) 0.15s;
}

.heading-rule.is-in {
  transform: scaleX(1);
}

.js-tilt {
  position: relative;
  isolation: isolate;
  transform-style: preserve-3d;
}

.js-tilt.is-tilting {
  will-change: transform;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.js-tilt::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    420px circle at var(--mx, 50%) var(--my, 50%),
    rgba(52, 211, 153, 0.18),
    transparent 46%
  );
  transition: opacity 0.35s var(--of-ease);
}

.js-tilt:hover::after,
.js-tilt.is-tilting::after {
  opacity: 1;
}

.js-tilt .icon-tile {
  transform: translateZ(22px);
}

.stat-value {
  font-family: Outfit, Inter, sans-serif;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.section-kicker {
  color: var(--of-accent);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* Footer ----------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--of-border);
  background: #040605;
}

/* Toast ------------------------------------------------------------------ */
.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 80;
  max-width: 22rem;
  padding: 0.9rem 1rem;
  border-radius: 0.9rem;
  background: #0f1a15;
  border: 1px solid var(--of-border);
  box-shadow: var(--of-glow);
  transform: translateY(120%);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.toast.is-visible {
  transform: none;
  opacity: 1;
}

/* Focus / reduced motion ------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--of-accent);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .status-dot.is-online { animation: none; }
  .hero-in,
  .reveal-mask > span,
  [data-aos] {
    opacity: 1 !important;
    transform: none !important;
  }
  .heading-rule { transform: scaleX(1) !important; }
  .hero-media {
    transform: none !important;
    will-change: auto;
  }
}

@media print {
  .site-header, .hero-media, .btn, form, .mobile-panel { display: none !important; }
  body { background: #fff; color: #111; }
}
