/* ============================================================
   STUDENTENWOHNEN — Custom CSS
   Design system: ink + surface + gold accent
   ============================================================ */

/* ------------------------------------------------------------
   CSS Custom Properties
   ------------------------------------------------------------ */
:root {
  --color-ink:          #0F1117;
  --color-surface:      #F7F6F3;
  --color-accent:       #C8A96E;
  --color-accent-light: #EFE4CC;
  --color-muted:        #6B7280;
  --color-border:       #E5E2DC;
  --color-green:        #22C55E;
  --color-white:        #FFFFFF;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  --radius-card:   1.5rem;   /* 24px */
  --radius-btn:    1rem;     /* 16px */

  --shadow-card:      0 4px 24px 0 rgba(15, 17, 23, 0.08);
  --shadow-elevated:  0 12px 48px 0 rgba(15, 17, 23, 0.14);
  --shadow-accent:    0 0 32px 0 rgba(200, 169, 110, 0.40);

  --nav-height: 72px;
}

/* ------------------------------------------------------------
   Base / Reset
   ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Custom scrollbar */
::-webkit-scrollbar              { width: 6px; }
::-webkit-scrollbar-track        { background: var(--color-surface); }
::-webkit-scrollbar-thumb        { background: var(--color-border); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover  { background: var(--color-muted); }

/* Selection */
::selection        { background: var(--color-accent-light); color: var(--color-ink); }
::-moz-selection   { background: var(--color-accent-light); color: var(--color-ink); }

/* ------------------------------------------------------------
   Typography helpers
   ------------------------------------------------------------ */
.font-display { font-family: var(--font-display); }
.font-body    { font-family: var(--font-body); }
.font-mono    { font-family: var(--font-mono); }

/* ------------------------------------------------------------
   Keyframe Animations
   ------------------------------------------------------------ */
@keyframes bounce-slow {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(9px); }
}

@keyframes pulse-ring {
  0%   { transform: scale(1);   opacity: 0.75; }
  100% { transform: scale(2.4); opacity: 0; }
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes hero-grain {
  0%, 100% { transform: translate(0, 0); }
  10%       { transform: translate(-2%, -3%); }
  30%       { transform: translate(3%, 2%); }
  50%       { transform: translate(-1%, 4%); }
  70%       { transform: translate(4%, -2%); }
  90%       { transform: translate(-3%, 1%); }
}

.animate-bounce-slow { animation: bounce-slow 2.2s ease-in-out infinite; }

/* ------------------------------------------------------------
   NAVBAR
   ------------------------------------------------------------ */
#navbar {
  background: linear-gradient(to bottom, rgba(15,17,23,0.72) 0%, transparent 100%);
  transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

#navbar.nav-scrolled {
  background: rgba(15, 17, 23, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.24);
}

/* Nav labels / wordmark — always white since nav is always on dark */
.nav-sublabel  { color: rgba(255, 255, 255, 0.45); }
.nav-wordmark  { color: #ffffff; }

/* Nav links */
.nav-link {
  color: rgba(255, 255, 255, 0.68);
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: calc(100% - 32px);
  height: 1.5px;
  background: var(--color-accent);
  border-radius: 999px;
  transition: transform 0.25s ease;
  transform-origin: center;
}
.nav-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.07);
}
.nav-link:hover::after {
  transform: translateX(-50%) scaleX(1);
}

/* Hamburger button */
.menu-btn:hover { background: rgba(255, 255, 255, 0.09); }

/* Mobile Menu Overlay */
#mobile-menu {
  will-change: clip-path;
}

/* ------------------------------------------------------------
   HERO SECTION
   ------------------------------------------------------------ */
#hero {
  background: linear-gradient(145deg, #0F1117 0%, #161B27 45%, #0F1117 100%);
}

.hero-bg-image {
  background-color: transparent;
  background-size: cover;
  background-position: center 35%;
  will-change: transform;
}

/* Cinematic gradient overlay — top and bottom heavy, transparent mid */
.hero-gradient-overlay {
  background: linear-gradient(
    to bottom,
    rgba(15, 17, 23, 0.92) 0%,
    rgba(15, 17, 23, 0.52) 35%,
    rgba(15, 17, 23, 0.45) 55%,
    rgba(15, 17, 23, 0.78) 85%,
    rgba(15, 17, 23, 0.97) 100%
  );
}

/* Subtle film noise texture overlay */
.hero-noise-overlay {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 180px 180px;
  animation: hero-grain 7s steps(1) infinite;
  mix-blend-mode: overlay;
}

/* ------------------------------------------------------------
   GLASSMORPHISM UTILITIES (used in hero cards, badges, btns)
   ------------------------------------------------------------ */
.glass-badge {
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.glass-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
.glass-card:hover {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(200, 169, 110, 0.30);
  transform: translateY(-3px);
}

.glass-btn {
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.20);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.glass-btn:hover {
  background: rgba(255, 255, 255, 0.17);
  transform: scale(1.02);
}
.glass-btn:active { transform: scale(0.98); }

/* Gold ping animation for green live dot */
.ping-dot {
  animation: pulse-ring 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* Gold CTA button accent glow on hover */
.btn-accent {
  transition: box-shadow 0.25s ease, transform 0.2s ease, background 0.2s ease;
}
.btn-accent:hover {
  box-shadow: var(--shadow-accent);
  transform: scale(1.025);
}
.btn-accent:active { transform: scale(0.97); }

/* Stat card icon wrapper */
.stat-icon {
  background: rgba(200, 169, 110, 0.18);
  border: 1px solid rgba(200, 169, 110, 0.22);
}

/* ------------------------------------------------------------
   WORD-SPLIT ANIMATION WRAPPER
   Prevents layout shift during GSAP word animations
   ------------------------------------------------------------ */
.word-wrap {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  line-height: inherit;
}
.word-inner { display: inline-block; }

/* ------------------------------------------------------------
   SECTION UTILITIES (reused across future sections)
   ------------------------------------------------------------ */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
}
.section-label::before {
  content: '';
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--color-accent);
  border-radius: 999px;
}

/* Dark section section-label variant (text already gold via CSS, just needed for docs) */
/* No override needed — .section-label is already gold on all bg colors */

/* Reveal classes — NO CSS initial state.
   GSAP from() owns the starting values entirely.
   Removing opacity/transform here was causing gsap.from() to read
   opacity:0 as the TO target, keeping elements permanently invisible. */
.reveal-up   { }
.reveal-fade { }
.reveal-image { will-change: clip-path; }

/* ------------------------------------------------------------
   IMAGE SLOTS (placeholder before actual images are added)
   ------------------------------------------------------------ */
.img-slot {
  background: linear-gradient(145deg, #ECEAE4 0%, #E0DDD7 100%);
  overflow: hidden;
  position: relative;
}
.img-slot img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.img-slot-dark {
  background: linear-gradient(145deg, #1E2330 0%, #151A26 100%);
}

/* ------------------------------------------------------------
   MARQUEE
   ------------------------------------------------------------ */
.marquee-wrapper { overflow: hidden; }
.marquee-track {
  display: flex; align-items: center;
  gap: 0; width: max-content;
  will-change: transform;
}

/* ------------------------------------------------------------
   SECTION CARDS (light sections)
   ------------------------------------------------------------ */
.feature-card {
  background: #fff;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-card);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}
.feature-card:hover {
  border-color: var(--color-accent-light);
  box-shadow: var(--shadow-card);
  transform: translateY(-4px);
}

/* Bento card */
.bento-card {
  overflow: hidden;
  border-radius: var(--radius-card);
  border: 1.5px solid var(--color-border);
  background: #fff;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.3s ease;
}
.bento-card:hover {
  border-color: rgba(200,169,110,0.4);
  box-shadow: var(--shadow-elevated);
  transform: translateY(-5px);
}

/* ------------------------------------------------------------
   PROXIMITY PILLS (location section)
   ------------------------------------------------------------ */
.proximity-pill {
  display: inline-flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.09);
  border: 1px solid rgba(255,255,255,0.16);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 999px;
  padding: 10px 18px;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.proximity-pill:hover {
  background: rgba(255,255,255,0.16);
  border-color: rgba(200,169,110,0.45);
}

/* ------------------------------------------------------------
   PROCESS TIMELINE
   ------------------------------------------------------------ */
.timeline-connector {
  position: absolute;
  top: 31px;
  left: calc(12.5% + 24px);
  right: calc(12.5% + 24px);
  height: 1.5px;
  background: var(--color-border);
  z-index: 0;
}
.timeline-connector-fill {
  position: absolute; top: 0; left: 0;
  height: 100%; width: 100%;
  background: linear-gradient(to right, var(--color-accent), #E8C98C);
  border-radius: 999px;
  transform-origin: left center;
  /* No initial transform — GSAP from({scaleX:0}) owns the starting state */
}

/* Step circle */
.timeline-step-circle {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid var(--color-border);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-card);
  position: relative; z-index: 1;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.timeline-step.is-active .timeline-step-circle,
.timeline-step:hover .timeline-step-circle {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 6px rgba(200,169,110,0.12), var(--shadow-card);
}

/* Mobile timeline — line runs through center of the 40px circles (-left-12 = absolute 0px from wrapper) */
.timeline-mobile-line {
  position: absolute;
  top: 20px;   /* start from circle center */
  left: 19px;  /* half of 40px circle width = center */
  width: 1.5px;
  bottom: 0;
  background: var(--color-border);
  z-index: 0;
}

/* ------------------------------------------------------------
   FAQ
   ------------------------------------------------------------ */
.faq-item { border-bottom: 1.5px solid var(--color-border); }
.faq-item:first-child { border-top: 1.5px solid var(--color-border); }

.faq-trigger {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; text-align: left;
  padding: 22px 0; cursor: pointer;
  background: none; border: none;
  font-family: var(--font-body); color: var(--color-ink);
  transition: color 0.2s ease;
}
.faq-trigger:hover .faq-question { color: var(--color-accent); }

.faq-content { overflow: hidden; }

.faq-icon {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  flex-shrink: 0;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.faq-item.open .faq-icon {
  background: var(--color-accent-light);
  border-color: var(--color-accent);
}

/* ------------------------------------------------------------
   FORM INPUTS
   ------------------------------------------------------------ */
.form-input,
.form-textarea,
.form-select {
  width: 100%;
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: 12px;
  padding: 13px 16px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--color-ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.form-input:focus,
.form-textarea:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3.5px rgba(200,169,110,0.18);
  background: #fff;
}
.form-input::placeholder,
.form-textarea::placeholder { color: var(--color-muted); }
.form-textarea { resize: vertical; min-height: 108px; line-height: 1.6; }

.form-checkbox {
  width: 18px; height: 18px; flex-shrink: 0;
  border: 1.5px solid var(--color-border);
  border-radius: 5px; cursor: pointer;
  accent-color: var(--color-accent);
  margin-top: 1px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}
.form-label-optional {
  font-weight: 400;
  color: var(--color-muted);
  font-size: 11px;
  margin-left: 4px;
}

/* Submit button */
.btn-submit {
  width: 100%;
  background: var(--color-ink);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 15px 24px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-submit:hover  { background: #1a1f2e; transform: translateY(-1px); box-shadow: 0 8px 24px rgba(15,17,23,0.30); }
.btn-submit:active { transform: translateY(0); }
.btn-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* Trust signals */
.trust-item {
  display: flex; align-items: flex-start; gap: 14px;
}
.trust-icon {
  width: 40px; height: 40px; flex-shrink: 0;
  border-radius: 12px;
  background: rgba(200,169,110,0.12);
  border: 1px solid rgba(200,169,110,0.22);
  display: flex; align-items: center; justify-content: center;
}

/* Success banner */
.success-banner {
  background: rgba(34,197,94,0.12);
  border: 1.5px solid rgba(34,197,94,0.3);
  border-radius: 16px;
  padding: 16px 20px;
}

/* ------------------------------------------------------------
   FOOTER
   ------------------------------------------------------------ */
.footer-link {
  color: rgba(255,255,255,0.45);
  font-size: 14px;
  transition: color 0.2s ease;
  display: inline-block;
}
.footer-link:hover { color: var(--color-accent); }

/* ------------------------------------------------------------
   REDUCED MOTION OVERRIDES
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .hero-noise-overlay { animation: none; }
  .hero-bg-image { will-change: auto; }
}
