/* ============================================
   Z. POLONIUS — MIDNIGHT KINETIC DESIGN SYSTEM
   Light/Dark mode support
   ============================================ */


/* ---- DARK MODE (default) ---- */
:root {
  --bg:           #131313;
  --bg-deep:      #0c0c0c;
  --bg-card:      #0f0f0f;
  --bg-nav:       rgba(19,19,19,0.95);
  --border:       rgba(255,255,255,0.08);
  --border-md:    rgba(255,255,255,0.12);
  --border-blue:  rgba(65,143,255,0.35);
  --border-green: rgba(65,164,71,0.35);
  --text:         #e8e8e8;
  --text-muted:   rgba(255,255,255,0.75);
  --text-faint:   rgba(255,255,255,0.65);
  --text-ghost:   rgba(255,255,255,0.55);
  --blue:         #3b82f6;
  --green:        #41A447;
  --font:         'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  --overlay-bg:   rgba(8,8,8,0.92);

  /* ---- RADIUS TOKENS ---- */
  --radius-pill:  100px;
  --radius-lg:    24px;
  --radius-md:    12px;
  --radius-sm:    6px;
}

/* ---- LIGHT MODE ---- */
[data-theme="light"] {
  --bg:           #f5f4f0;
  --bg-deep:      #eceae4;
  --bg-card:      #edecea;
  --bg-nav:       rgba(245,244,240,0.95);
  --border:       rgba(0,0,0,0.12);
  --border-md:    rgba(0,0,0,0.18);
  --border-blue:  rgba(28,100,220,0.4);
  --border-green: rgba(40,130,50,0.4);
  --text:         #1a1a1a;
  --text-muted:   rgba(0,0,0,0.75);
  --text-faint:   rgba(0,0,0,0.60);
  --text-ghost:   rgba(0,0,0,0.30);
  --blue:         #1550c0;
  --green:        #206b29;
  --overlay-bg:   rgba(20,20,20,0.75);
}

/* ---- OS PREFERENCE (if no manual override) ---- */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg:           #f5f4f0;
    --bg-deep:      #eceae4;
    --bg-card:      #edecea;
    --bg-nav:       rgba(245,244,240,0.95);
    --border:       rgba(0,0,0,0.12);
    --border-md:    rgba(0,0,0,0.18);
    --border-blue:  rgba(28,100,220,0.4);
    --border-green: rgba(40,130,50,0.4);
    --text:         #1a1a1a;
    --text-muted:   rgba(0,0,0,0.75);
    --text-faint:   rgba(0,0,0,0.60);
    --text-ghost:   rgba(0,0,0,0.30);
    --blue:         #1550c0;
    --green:        #206b29;
    --overlay-bg:   rgba(20,20,20,0.75);
  }
}

/* ---- RESET ---- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}

/* ---- AI BUTTON ---- */
.btn-ai {
  background: linear-gradient(135deg, #418FFF, #9b51e0);
  color: white; border: none; padding: 6px 16px; font-size: 10px; font-weight: 600;
  border-radius: 100px !important; cursor: pointer; display: flex; align-items: center; gap: 6px;
  transition: all 0.2s; box-shadow: 0 4px 12px rgba(65, 143, 255, 0.2);
  font-family: 'Inter', sans-serif;
}
.btn-ai:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(65, 143, 255, 0.3); }
.btn-ai:disabled { background: #444; opacity: 0.6; cursor: not-allowed; }

/* ---- RICH TEXT CONTENT ---- */
.rich-text { color: var(--text-muted); line-height: 1.8; }
.rich-text p { font-size: 16px; margin-bottom: 16px; max-width: 720px; }
.rich-text .ql-align-center { text-align: center; margin-left: auto; margin-right: auto; }
.rich-text .ql-align-right { text-align: right; }
.rich-text u { text-decoration: underline; }
.rich-text h2 { font-size: 13px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text); margin-top: 40px; margin-bottom: 16px; padding: 12px 16px; background: var(--bg-card); border-left: 2px solid var(--blue); border-radius: 2px; }
.rich-text h3 { font-size: 16px; font-weight: 600; color: var(--text); margin-top: 24px; margin-bottom: 8px; letter-spacing: -0.01em; }
.rich-text ul, .rich-text ol { margin-left: 20px; margin-bottom: 20px; max-width: 720px; }
.rich-text li { margin-bottom: 8px; font-size: 16px; }
.rich-text strong { color: var(--text); font-weight: 600; }
.rich-text a { color: var(--blue); text-decoration: underline; }

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: var(--font); cursor: pointer; border-radius: var(--radius-pill) !important; }

/* ---- CONTENT LAYOUT ---- */
p, li {
  max-width: 720px;
  line-height: 1.65;
}

.readable-content {
  max-width: 720px;
  margin: 0;
}

.about-hero-bio, .info-cell-val, .bio-para, .content-p, .rec-text, .cta-text {
  max-width: 720px;
}

/* ---- NAVIGATION ---- */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 40px;
  border-bottom: 0.5px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-nav);
  backdrop-filter: blur(12px);
  z-index: 50;
  transition: background 0.3s ease, border-color 0.3s ease;
}
.nav-logo { font-size: 15px; font-weight: 600; letter-spacing: -0.03em; color: var(--text); }
.nav-logo span { color: var(--blue); }
.nav-links { display: flex; gap: 24px; list-style: none; align-items: center; }
.nav-links a { color: var(--text-muted); font-size: 13px; letter-spacing: 0.01em; transition: color 0.2s; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-right { display: flex; align-items: center; gap: 10px; }

/* ---- BURGER / MORE MENU (Desktop Dropdown) ---- */
.nav-more-menu { position: relative; }
.nav-burger-links {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--bg-nav);
  backdrop-filter: blur(20px);
  border: 0.5px solid var(--border-md);
  border-radius: var(--radius-md);
  list-style: none;
  padding: 8px 0;
  min-width: 180px;
  display: none;
  flex-direction: column;
  margin-top: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.nav-burger-links.open { display: flex; }
.nav-burger-links li a {
  display: block;
  padding: 10px 20px;
  font-size: 13px;
  color: var(--text-muted);
  transition: all 0.2s;
}
.nav-burger-links li a:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text);
}
.mobile-only { display: none !important; }

@media (max-width: 768px) {
  .desktop-only { display: none !important; }
  .mobile-only { display: block !important; }
}

/* ---- THEME SWITCH ---- */
.theme-switch {
  background: transparent;
  border: 0.5px solid var(--border-md);
  color: var(--text-muted);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.2s;
  flex-shrink: 0;
}
.theme-switch:hover { border-color: var(--blue); color: var(--blue); }

.nav-btn {
  background: var(--blue);
  color: #fff;
  border: none;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-pill);
  transition: opacity 0.2s;
}
.nav-btn:hover { opacity: 0.85; }

/* ---- BREADCRUMB ---- */
.breadcrumb { display: flex; align-items: center; gap: 8px; padding: 14px 40px; border-bottom: 0.5px solid var(--border); }
.breadcrumb a { font-size: 11px; color: var(--text-faint); letter-spacing: 0.04em; transition: color 0.2s; }
.breadcrumb a:hover { color: var(--blue); }
.breadcrumb-sep { font-size: 11px; color: var(--text-ghost); }
.breadcrumb-current { font-size: 11px; color: var(--text-muted); }

/* ---- SECTION HEADER ---- */
.section-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 40px; border-bottom: 0.5px solid var(--border); }
.section-title { font-size: 14px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); }
.section-link { font-size: 14px; font-weight: 500; color: var(--blue); letter-spacing: 0.05em; transition: opacity 0.2s; }
.section-link:hover { opacity: 0.75; }

/* ---- SECTION FOOTER ---- */
.section-footer { display: flex; justify-content: center; padding: 16px 40px; border-top: 0.5px solid var(--border); border-bottom: 0.5px solid var(--border); }
.btn-outline {
  background: transparent; color: var(--text-muted); border: 0.5px solid var(--border-md);
  padding: 10px 32px; font-size: 12px; font-weight: 500; letter-spacing: 0.06em;
  text-transform: uppercase; transition: all 0.2s; display: inline-block; text-align: center;
}
.btn-outline:hover { color: var(--text); border-color: var(--text-muted); }

/* ---- TAGS ---- */
.tag { display: inline-block; font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; padding: 3px 8px; border: 0.5px solid var(--border-md); color: var(--text-faint); }
.tag-ai    { border-color: var(--border-blue); color: var(--blue); }
.tag-work  { border-color: var(--border-green); color: var(--green); }
.tag-vol   { border-color: var(--border); color: var(--text-faint); }
.tag-edu   { border-color: var(--border-md); color: var(--text-muted); }

/* ---- STATUS PILL ---- */
.status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); border: 0.5px solid var(--border-md); padding: 6px 10px; background: var(--bg-card); }
.status-dot { width: 6px; height: 6px; background: var(--green); border-radius: 50%; }

/* ---- SKILL TAGS ---- */
.skill-tag { display: inline-block; font-size: 10px; letter-spacing: 0.04em; padding: 4px 10px; border: 0.5px solid var(--border); color: var(--text-faint); margin: 3px 3px 0 0; }
.skill-tag.blue { border-color: var(--border-blue); color: var(--blue); }

/* ---- FOOTER ---- */
.footer {
  background: var(--bg-deep);
  border-top: 0.5px solid var(--border);
  padding: 80px 40px 120px;
  display: grid;
  grid-template-columns: 2fr 1fr 1.5fr 1fr;
  gap: 60px;
  position: relative;
  z-index: 10;
}
.footer-col-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 24px;
}
.footer-brand .nav-logo { font-size: 22px; margin-bottom: 16px; display: block; text-decoration: none; }
.footer-tagline { font-size: 14px; color: var(--text-muted); line-height: 1.6; max-width: 280px; }
.footer-nav { list-style: none; padding: 0; margin: 0; }
.footer-nav li { margin-bottom: 14px; }
.footer-nav a { font-size: 14px; color: var(--text-muted); text-decoration: none; transition: color 0.2s; }
.footer-nav a:hover { color: var(--blue); }

.footer-credits { font-size: 12px; color: var(--text-ghost); line-height: 1.8; }
.footer-credits p { margin-bottom: 12px; }
.credit-logos { display: flex; align-items: center; gap: 16px; margin-top: 16px; opacity: 0.4; transition: opacity 0.3s; }
.credit-logos:hover { opacity: 0.8; }
.credit-logo { height: 18px; width: auto; color: var(--text); }

.footer-social { display: flex; gap: 20px; align-items: center; }
.social-icon { color: var(--text-muted); transition: all 0.2s; display: flex; align-items: center; justify-content: center; }
.social-icon:hover { color: var(--blue); transform: translateY(-3px); }

@media (max-width: 768px) {
  .footer {
    grid-template-columns: 1fr;
    padding: 60px 24px 140px;
    gap: 40px;
    text-align: left;
  }
  .footer-social { justify-content: flex-start; }
}

.footer-left { font-size: 11px; color: var(--text-ghost); letter-spacing: 0.04em; }

/* ---- BUTTONS ---- */
.btn-primary { background: var(--blue); color: #fff; border: none; border-radius: var(--radius-pill) !important; padding: 12px 32px; font-size: 13px; font-weight: 600; letter-spacing: 0.02em; transition: all 0.2s; display: inline-block; text-align: center; box-shadow: 0 4px 14px rgba(65, 143, 255, 0.2); }
.btn-primary:hover { background: #2d7ae8; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(65, 143, 255, 0.4), 0 0 10px rgba(65, 143, 255, 0.2); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary.sending { pointer-events: none; opacity: 0.5; }

/* Global Outline Button Style */
.btn-outline {
  display: inline-block;
  padding: 10px 24px;
  border: 0.5px solid var(--border-md);
  color: var(--text-muted);
  border-radius: var(--radius-pill) !important;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  background: transparent;
  cursor: pointer;
  text-align: center;
}
.btn-outline:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: rgba(65, 143, 255, 0.05);
  transform: translateY(-1px);
}
.floating-cta {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--blue);
  color: #fff;
  border-radius: 50px;
  padding: 14px 24px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 24px rgba(65, 143, 255, 0.3);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}
.floating-cta:hover { background: #2d7ae8; transform: translateY(-2px); box-shadow: 0 10px 30px rgba(65, 143, 255, 0.4); }
.floating-cta:active { transform: scale(0.96); }

/* ---- CONTACT OVERLAY ---- */
.overlay { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.35s ease; }
.overlay.active { opacity: 1; pointer-events: all; }
.overlay-bg { position: absolute; inset: 0; background: var(--overlay-bg); backdrop-filter: blur(6px); }
.modal { position: relative; width: 100%; max-width: 620px; background: var(--bg); border: 0.5px solid var(--border-md); border-radius: var(--radius-lg); transform: translateY(24px) scale(0.98); transition: transform 0.4s cubic-bezier(0.16,1,0.3,1), opacity 0.35s ease, background 0.3s ease; opacity: 0; margin: 20px; max-height: 90vh; overflow-y: auto; }
.overlay.active .modal { transform: translateY(0) scale(1); opacity: 1; }
.modal-header { padding: 28px 32px 0; display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 6px; }
.modal-label { font-size: 9px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--blue); margin-bottom: 8px; }
.modal-title { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; color: var(--text); line-height: 1.1; }
.modal-sub { font-size: 13px; color: var(--text-faint); margin-top: 6px; line-height: 1.5; }
.modal-close { background: transparent; border: 0.5px solid var(--border-md); color: var(--text-muted); width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; margin-left: 16px; transition: all 0.2s; border-radius: 50%; }
.modal-close:hover { border-color: var(--text-muted); color: var(--text); }
.modal-progress { height: 1px; background: var(--border); margin: 20px 32px 0; }
.modal-progress-bar { height: 100%; background: var(--blue); width: 0%; transition: width 0.4s ease; }
.modal-divider { height: 0.5px; background: var(--border); margin: 0 32px; }
.modal-body { padding: 24px 32px 32px; }
.field { margin-bottom: 18px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.field-label { display: block; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 7px; transition: color 0.2s; }
.field:focus-within .field-label { color: var(--blue); }
.input { width: 100%; background: var(--bg-deep); border: 0.5px solid var(--border); color: var(--text); font-size: 13px; font-family: var(--font); padding: 11px 14px; outline: none; transition: border-color 0.2s, background 0.2s; -webkit-appearance: none; border-radius: var(--radius-md); }
.input::placeholder { color: var(--text-ghost); }
.input:focus { border-color: var(--blue); background: var(--bg-card); }
.input.valid { border-color: var(--green); }
.input.error { border-color: #dc4040; }
textarea.input { resize: none; height: 100px; line-height: 1.6; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { font-size: 11px; letter-spacing: 0.04em; padding: 8px 18px; border: 0.5px solid var(--border); color: var(--text-faint); transition: all 0.2s; background: transparent; border-radius: 100px; }
.pill:hover { border-color: var(--border-md); color: var(--text-muted); }
.pill.selected { border-color: var(--border-blue); color: var(--blue); background: rgba(65,143,255,0.06); }
.modal-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 4px; }
.modal-contact-info { display: flex; flex-direction: column; gap: 3px; }
.modal-contact-info span { font-size: 11px; color: var(--text-ghost); }
.modal-social { display: flex; gap: 12px; padding: 18px 32px; border-top: 0.5px solid var(--border); }
.modal-social a { font-size: 11px; color: var(--text-faint); letter-spacing: 0.05em; transition: color 0.2s; }
.modal-social a:hover { color: var(--blue); }
.modal-social-sep { font-size: 11px; color: var(--text-ghost); }
.success-view { display: none; padding: 48px 32px; text-align: center; flex-direction: column; align-items: center; gap: 16px; }
.success-view.show { display: flex; }
.success-icon { width: 48px; height: 48px; border: 0.5px solid var(--border-green); display: flex; align-items: center; justify-content: center; margin: 0 auto; }
.success-icon svg { width: 20px; height: 20px; stroke: var(--green); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.success-title { font-size: 20px; font-weight: 600; color: var(--text); letter-spacing: -0.02em; }
.success-sub { font-size: 13px; color: var(--text-muted); line-height: 1.6; max-width: 320px; }

/* ---- ANIMATIONS ---- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up   { animation: fadeUp 0.5s ease forwards; }
.fade-up-1 { animation-delay: 0.05s; opacity: 0; }
.fade-up-2 { animation-delay: 0.12s; opacity: 0; }
.fade-up-3 { animation-delay: 0.20s; opacity: 0; }
.fade-up-4 { animation-delay: 0.28s; opacity: 0; }

/* ---- SCROLL REVEAL ----
   Elementer med [data-reveal] / [data-reveal-stagger] starter skjult og
   afsløres af IntersectionObserver (initScrollReveal i main.js), når de
   scroller ind i viewporten. Stagger-børn forskydes via inline transition-delay. */
@media (prefers-reduced-motion: no-preference) {
  [data-reveal],
  [data-reveal-stagger] > * {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
  }
  [data-reveal].is-visible,
  [data-reveal-stagger].is-visible > * {
    opacity: 1;
    transform: none;
  }
}

/* ---- REDUCED MOTION ----
   Respekter brugerens systemvalg: dæmp parallax, scroll-hint-bounce, reveals
   og øvrige overgange. (Typewriter er JS-styret og bevares bevidst.) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Ensure arrows are visible on touch devices */
@media (hover: none) {
  .proj-arrow, .article-arrow, .cell-arrow {
    opacity: 1 !important;
  }
}

/* ============================================
   MOBILRESPONSIVITET
   ============================================ */

/* Hamburger knap — skjult på desktop */
.nav-hamburger {
  display: none;
  background: transparent;
  border: 0.5px solid var(--border-md);
  color: var(--text-muted);
  width: 34px; height: 34px;
  align-items: center; justify-content: center;
  font-size: 16px; cursor: pointer;
  flex-shrink: 0;
}

/* BENTO GRID (Unified Design) */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 32px 0 40px;
  padding: 0 40px;
}
.bento-grid .bento-cell {
  padding: 32px 32px 64px;
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 0.5px solid var(--border-md);
  border-radius: 16px;
  cursor: pointer;
  position: relative;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 0;
  overflow: hidden;
}
.bento-grid .bento-cell:hover {
  transform: translateY(-4px);
  border-color: var(--blue);
  box-shadow: 0 12px 30px rgba(0,0,0,0.18), 0 0 16px rgba(65, 143, 255, 0.08);
}
.bento-grid .bento-cell:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
  background: rgba(65,143,255,0.08);
  border-color: var(--blue);
}
.bento-grid .bento-cell.expanded {
  background: rgba(65,143,255,0.08);
  border-color: var(--blue);
}
.bento-grid .bento-cell.expanded .cell-desc { 
  max-height: 1000px; 
  opacity: 1; 
  margin-top: 16px; 
}
.bento-grid .cell-label {
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 12px;
}
.bento-grid .cell-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.3;
}
.bento-grid .cell-sub { 
  font-size: 14px; 
  color: var(--text-muted); 
  margin-bottom: 6px; 
}
.bento-grid .cell-desc {
  font-size: 14px;
  color: var(--text-faint);
  line-height: 1.65;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: all 0.5s ease;
}
.bento-grid .cell-arrow {
  position: absolute;
  bottom: 20px;
  right: 24px;
  font-size: 14px;
  color: var(--blue);
  opacity: 0;
  transition: opacity 0.2s;
}
.bento-grid .bento-cell:hover .cell-arrow,
.bento-grid .bento-cell.expanded .cell-arrow { 
  opacity: 1; 
}
.bento-grid .accent-blue .cell-title { color: var(--blue); }
.bento-grid .accent-green .cell-title { color: var(--green); }

@media (max-width: 768px) { 
  .bento-grid { grid-template-columns: 1fr 1fr; gap: 16px; padding: 0 20px; margin: 24px 0; } 
  .bento-grid .bento-cell { padding: 24px 24px 48px; }
  .bento-grid .cell-title { font-size: 16px; }
  .bento-grid .cell-desc { font-size: 14px; }
  .bento-grid .cell-arrow { bottom: 16px; right: 16px; font-size: 12px; }
}
@media (max-width: 480px) { 
  .bento-grid { grid-template-columns: 1fr; } 
}

@media (max-width: 768px) {
  html {
    scroll-snap-type: y proximity;
    scroll-padding-top: 60px;
  }
  section, #projectsSection, #cvSection, #recSection, #mediaSection, #blogSection, .footer {
    scroll-snap-align: start;
  }
  body { font-size: 16px; }
  /* NAV */
  .nav { padding: 14px 20px; }
  .nav-links {
    display: none;
    position: fixed;
    top: 57px; left: 0; right: 0;
    background: var(--bg-nav);
    backdrop-filter: blur(12px);
    border-bottom: 0.5px solid var(--border);
    flex-direction: column;
    gap: 0; padding: 8px 0;
    z-index: 49;
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a {
    display: block; padding: 12px 20px;
    border-bottom: 0.5px solid var(--border);
    font-size: 14px;
  }
  .nav-hamburger { display: flex; }
  .nav-right { gap: 8px; }
  .nav-btn { padding: 7px 18px; font-size: 12px; border-radius: 100px; }

  /* BURGER MENU OVERLAY */
  .nav-burger-links {
    display: none;
    position: fixed;
    top: 57px; left: 0; right: 0; bottom: 0;
    background: var(--bg);
    flex-direction: column;
    padding: 0;
    z-index: 9999;
    list-style: none;
    overflow-y: auto;
  }
  .nav-burger-links.open { display: flex; }

  /* Close row at the top */
  .burger-close-row {
    border-bottom: 0.5px solid var(--border);
    display: flex !important;
    justify-content: flex-end;
    padding: 0;
  }
  .burger-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 13px;
    letter-spacing: 0.04em;
    padding: 14px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
  }
  .burger-close-btn:hover { color: var(--text); }

  /* Menu links */
  .nav-burger-links li { width: 100%; border-bottom: 0.5px solid var(--border); }
  .nav-burger-links li:last-child { border-bottom: none; }
  .nav-burger-links a {
    display: block;
    padding: 22px 24px;
    color: var(--text);
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.02em;
    transition: color 0.2s, padding-left 0.2s;
  }
  .nav-burger-links a:hover { color: var(--blue); padding-left: 30px; }
  .nav-burger-links a.active { color: var(--blue); }

  /* HERO */
  .hero { height: auto; min-height: 400px; }
  .hero-content {
    grid-template-columns: 1fr;
    padding: 32px 20px;
    align-items: flex-end;
  }
  .hero-name { font-size: 36px; }
  .hero-right { display: none; }

  /* PROJECTS GRID & CV STRIP - SWIPEABLE ON MOBILE */
  .proj-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    margin: 0;
    padding: 0;
  }
  .cv-strip, .rec-grid, .skills-strip {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0 20px 32px;
    gap: 16px;
    margin: 0 -20px; /* Bleed out to edges */
  }
  .cv-strip::-webkit-scrollbar, .rec-grid::-webkit-scrollbar, .skills-strip::-webkit-scrollbar { display: none; }
  
  .proj-card {
    min-width: 0;
    flex-shrink: 1;
    scroll-snap-align: none;
    border: none !important;
    border-bottom: 0.5px solid var(--border) !important;
    border-radius: 0;
    background: transparent;
  }
  .cv-item, .rec-card, .skill-card {
    min-width: 85vw;
    flex-shrink: 0;
    scroll-snap-align: center;
    border: 0.5px solid var(--border) !important;
    border-radius: 16px;
    background: var(--bg-card);
  }
  .proj-card-img-wrap { height: 220px; }

  /* QUOTE GRID */
  .quote-grid { grid-template-columns: 1fr; }
  .quote-card:nth-child(2n) { border-right: none; }

  /* SECTION HEADER */
  .section-header { padding: 14px 20px; }

  /* SECTION FOOTER */
  .section-footer { padding: 14px 20px; }

  /* CTA BAR */
  .cta-bar { display: none; } /* Consolidated into floating CTA/Bottom Nav */
  .floating-cta { display: none; } /* Hidden on mobile as we have bottom-nav */

  /* FOOTER */
  .footer {
    flex-direction: column;
    gap: 12px; padding: 16px 20px;
    align-items: flex-start;
  }

  /* MODAL */
  .modal { margin: 10px; max-height: 95vh; }
  .modal-header { padding: 20px 20px 0; }
  .modal-body { padding: 16px 20px 20px; }
  .field-row { grid-template-columns: 1fr; }
  .modal-footer { flex-direction: column; gap: 10px; }
  .modal-social { padding: 14px 20px; }

  /* PAGE HEROES */
  .page-hero { padding: 32px 20px; grid-template-columns: 1fr; }
  .page-hero-stat { display: none; }

  /* DETAIL */
  .intro-wrap { grid-template-columns: 1fr; }
  .intro-col { border-right: none; }
  .meta-col { border-top: 0.5px solid var(--border); padding: 24px 20px; }
  .content-wrap { grid-template-columns: 1fr; }
  .content-main { border-right: none; }
  .content-sidebar { border-top: 0.5px solid var(--border); padding: 24px 20px; }
  .entry-nav { grid-template-columns: 1fr; }
  .cover-title { font-size: 28px; }

  /* ABOUT */
  .about-hero { grid-template-columns: 1fr; }
  .about-hero-right { height: 260px; }
  .about-hero-left { padding: 32px 20px; }
  .info-grid { grid-template-columns: repeat(2, 1fr); }
  .bio-wrap { grid-template-columns: 1fr; }
  .bio-main { border-right: none; padding: 24px 20px; }
  .bio-sidebar { border-top: 0.5px solid var(--border); padding: 24px 20px; }
  .persontype-wrap { grid-template-columns: 1fr; }
  .persontype-cell { border-right: none; }

  /* CV */
  .timeline { grid-template-columns: 100px 1fr; }
  .skills-strip { grid-template-columns: repeat(2, 1fr); }
  .edu-grid { grid-template-columns: 1fr; }
  .rec-grid { grid-template-columns: 1fr; }

  /* CONTACT PAGE */
  .contact-wrap { grid-template-columns: 1fr; }
  .contact-left {
    padding: 32px 20px;
    border-right: none;
    border-bottom: 0.5px solid var(--border);
  }
  .contact-right { min-height: auto; }
  .contact-form-header { padding: 24px 20px 0; }
  .contact-form-body { padding: 16px 20px; }
  .contact-form-footer { padding: 16px 20px 24px; }

  /* BREADCRUMB */
  .breadcrumb { padding: 10px 20px; }
}

@media (max-width: 480px) {
  .hero-name { font-size: 30px; }
  .proj-grid { grid-template-columns: 1fr; }
  .proj-card:nth-child(2n) { border-right: none; }
  .info-grid { grid-template-columns: 1fr; }
  .skills-strip { grid-template-columns: 1fr; }
}

/* ============================================
   FLOATING BOTTOM NAV (mobil)
   ============================================ */

.bottom-nav {
  display: none; /* Skjult på desktop */
}

@media (max-width: 768px) {
  /* Skjul top-nav knapper på mobil */
  .nav-btn { display: none; }
  .nav-hamburger { display: none; }

  /* Giv siden plads til bottom nav */
  body { padding-bottom: 0; }

  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 16px;
    left: 16px;
    right: 16px;
    background: rgba(19,19,19,0.88);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 0.5px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-lg);
    align-items: center;
    justify-content: space-around;
    padding: 10px 8px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5), 0 1px 0 rgba(255,255,255,0.06) inset;
    z-index: 90;
  }

  /* Light mode */
  [data-theme="light"] .bottom-nav {
    background: rgba(245,244,240,0.88);
    border-color: rgba(0,0,0,0.1);
    box-shadow: 0 8px 40px rgba(0,0,0,0.15), 0 1px 0 rgba(255,255,255,0.8) inset;
  }

  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 10px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.2s;
    flex: 1;
    border: none;
    background: transparent;
    text-decoration: none;
    font-family: var(--font);
  }
  .bottom-nav-item:hover { background: rgba(255,255,255,0.05); }
  [data-theme="light"] .bottom-nav-item:hover { background: rgba(0,0,0,0.05); }
  .bottom-nav-item.active { background: rgba(65,143,255,0.12); }
  [data-theme="light"] .bottom-nav-item.active { background: rgba(28,100,220,0.1); }

  .bottom-nav-icon {
    font-size: 17px;
    line-height: 1;
  }
  .bottom-nav-label {
    font-size: 8px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-faint);
    font-family: var(--font);
  }
  .bottom-nav-item.active .bottom-nav-label { color: var(--blue); }

  .bottom-nav-divider {
    width: 0.5px;
    height: 24px;
    background: var(--border);
    flex-shrink: 0;
  }

  .bottom-nav-contact {
    background: var(--blue);
    border-radius: var(--radius-md);
    padding: 7px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    border: none;
    flex-shrink: 0;
    font-family: var(--font);
    transition: opacity 0.2s;
  }
  .bottom-nav-contact:hover { opacity: 0.85; }
  .bottom-nav-contact .bottom-nav-icon { font-size: 15px; color: #fff; }
  .bottom-nav-contact .bottom-nav-label { color: rgba(255,255,255,0.85); }

  /* Tilføj padding så indhold ikke gemmes bag nav */
  main, .contact-wrap, .page-hero,
  .about-hero, .hero { margin-bottom: 0; }
  footer.footer { margin-bottom: 80px; }
}

/* ---- NEW AVATARS & CHIPS (added for Admin UI upgrade) ---- */
.rec-author-wrap { display: flex; align-items: center; gap: 14px; margin-top: 20px; }
.rec-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 0.5px solid var(--border);
  background: var(--bg-card);
  flex-shrink: 0;
}
.rec-meta { display: flex; flex-direction: column; gap: 2px; }
.rec-name { font-size: 13px; font-weight: 600; color: var(--text); }
.rec-role { font-size: 11px; color: var(--text-faint); }

.tag-chip {
  display: inline-block;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 10px;
  border: 0.5px solid var(--border-md);
  color: var(--text-faint);
  background: rgba(255,255,255,0.03);
  margin-right: 6px;
  margin-bottom: 6px;
}
.tag-chip.blue { border-color: rgba(65,143,255,0.4); color: var(--blue); }
.tag-chip.green { border-color: rgba(65,164,71,0.4); color: var(--green); }

/* ---- SCROLL HINT ---- */
.scroll-hint {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #fff;
  opacity: 0.6;
  animation: bounce 2s infinite;
  pointer-events: none;
}
.scroll-hint-line { width: 1px; height: 30px; background: currentColor; }
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {transform: translateX(-50%) translateY(0);}
  40% {transform: translateX(-50%) translateY(-10px);}
  60% {transform: translateX(-50%) translateY(-5px);}
}

/* ---- CENTRAL CTA BAR ---- */
.cta-bar-central {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 48px 40px;
  border-top: 0.5px solid var(--border);
  border-bottom: 0.5px solid var(--border);
  background: var(--bg-deep);
  margin-top: 0;
}
.cta-bar-content { flex: 1; margin-right: 32px; }
.cta-bar-title { font-size: 16px; color: var(--text); font-weight: 600; margin-bottom: 4px; }
.cta-bar-sub { font-size: 14px; color: var(--text-muted); }

@media (max-width: 768px) {
  .cta-bar-central { flex-direction: column; text-align: center; padding: 40px 20px; gap: 24px; }
  .cta-bar-content { margin-right: 0; }
  .cta-bar-title { font-size: 15px; }
  .cta-bar-sub { font-size: 13px; }
  .cta-bar-central .btn-primary { width: 100%; }
}

/* ---- FLOATING CTA ---- */
.floating-cta {
  position: fixed;
  bottom: 32px;
  right: 32px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px 8px 8px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(65, 143, 255, 0.4);
  z-index: 100;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.floating-cta:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 15px 35px rgba(65, 143, 255, 0.5);
  background: #2d7ae8;
}
.floating-cta-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 1.5px solid rgba(255,255,255,0.35);
  flex-shrink: 0;
  display: block;
}

@media (max-width: 768px) {
  .floating-cta { display: none; } /* Hidden on mobile in favor of Bottom Nav */
}

/* ---- SHARED ARROWS & CTA INDICATORS ---- */
.proj-arrow, .article-arrow {
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Hover reveal on desktop */
.proj-card:hover .proj-arrow,
.article-card:hover .article-arrow {
  opacity: 1;
}

/* Always visible on touch devices */
@media (hover: none) {
  .proj-arrow, .article-arrow {
    opacity: 1 !important;
  }
}

/* ============================================
   PAGE TRANSITIONS (Disabled temporarily to fix visibility)
   ============================================ */
@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in-ready {
  animation: pageFadeIn 0.5s ease forwards;
}

/* ---- COOKIE BANNER ---- */
.cookie-banner {
  position: fixed;
  bottom: 24px;
  left: 24px;
  right: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-md);
  border-radius: var(--radius-lg);
  padding: 24px 32px;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
  transform: translateY(150%);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 1000px;
  margin: 0 auto;
}
.cookie-banner.show { transform: translateY(0); }
.cookie-content { flex: 1; }
.cookie-title { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.cookie-text { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.cookie-actions { display: flex; gap: 12px; flex-shrink: 0; }
.btn-cookie-decline { 
  background: transparent; 
  color: var(--text-faint); 
  border: 1px solid var(--border); 
  padding: 10px 20px; 
  font-size: 13px; 
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-cookie-decline:hover { border-color: var(--text-faint); color: var(--text); }

@media (max-width: 768px) {
  .cookie-banner {
    flex-direction: column;
    bottom: 80px; /* Over bottom nav */
    padding: 20px;
    text-align: center;
    left: 16px; right: 16px;
  }
  .cookie-actions { width: 100%; }
  .cookie-actions button { flex: 1; }
}

/* ---- DEFERRED CONTENT (Spotify Placeholder) ---- */
.deferred-content-placeholder {
  width: 100%;
  height: 152px;
  background: var(--bg-deep);
  border: 1px solid var(--border-md);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 20px;
}
.deferred-text { font-size: 13px; color: var(--text-muted); }
.btn-enable-content {
  background: var(--blue);
  color: white;
  border: none;
  padding: 8px 16px;
  font-size: 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn-enable-content:hover { opacity: 0.9; }

/* ---- SPOTIFY FACADE ---- */
.spotify-facade {
  width: 100%;
  height: 152px;
  background: #181818;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid var(--border-md);
  position: relative;
  overflow: hidden;
}
.spotify-facade::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(29, 185, 84, 0.1), transparent);
  pointer-events: none;
}
.spotify-facade:hover {
  border-color: #1DB954;
  transform: scale(1.005);
  background: #202020;
}
.facade-content {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  z-index: 1;
}
.facade-play-btn {
  width: 48px;
  height: 48px;
  background: #1DB954;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: transform 0.2s;
}
.spotify-facade:hover .facade-play-btn {
  transform: scale(1.1);
  background: #1ed760;
}
.facade-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
}
.facade-sub {
  font-size: 12px;
  color: #b3b3b3;
}
