/* ============================================================
   berggreens.dk — Static Site Styles
   TRON-inspired cyber aesthetic
   Fonts loaded via <link> in HTML (Inter + JetBrains Mono)
   ============================================================ */

/* ===== CSS Custom Properties ===== */
:root {
  --bg:              hsl(220, 20%, 6%);
  --fg:              hsl(200, 20%, 90%);
  --card-bg:         hsl(220, 18%, 10%);
  --card-bg-50:      hsla(220, 18%, 10%, 0.5);
  --card-bg-60:      hsla(220, 18%, 10%, 0.6);
  --secondary-bg:    hsl(220, 15%, 15%);
  --secondary-fg:    hsl(200, 20%, 85%);
  --muted-bg:        hsl(220, 15%, 13%);
  --muted-fg:        hsl(210, 10%, 50%);
  --border:          hsl(185, 40%, 20%);
  --border-20:       hsla(185, 40%, 20%, 0.5);
  --neon:            hsl(185, 100%, 50%);
  --neon-20:         hsla(185, 100%, 50%, 0.2);
  --neon-40:         hsla(185, 100%, 50%, 0.4);
  --neon-glow-60:    hsla(185, 100%, 50%, 0.6);
  --neon-glow-30:    hsla(185, 100%, 50%, 0.3);
  --glow-15:         hsla(185, 100%, 50%, 0.15);
  --glow-08:         hsla(185, 100%, 50%, 0.08);
  --glow-10:         hsla(185, 100%, 50%, 0.10);
  --glow-25:         hsla(185, 100%, 50%, 0.25);
  --glow-12:         hsla(185, 100%, 50%, 0.12);
  --radius:          0.5rem;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--fg);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  letter-spacing: -0.025em;
  line-height: 1.2;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

/* ===== Tron Canvas ===== */
#tron-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* ===== Page Layout ===== */
.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

main {
  flex: 1;
  padding-top: 3.5rem; /* clearance for fixed header */
  position: relative;
  z-index: 10;
}

/* ===== Container Widths ===== */
.container {
  width: 100%;
  max-width: 80rem; /* 1280px */
  margin: 0 auto;
  padding: 0 1rem;
}

.container-md {
  width: 100%;
  max-width: 56rem; /* 896px — max-w-4xl */
  margin: 0 auto;
  padding: 0 1rem;
}

.container-sm {
  width: 100%;
  max-width: 48rem; /* 768px — max-w-3xl */
  margin: 0 auto;
  padding: 0 1rem;
}

/* ===== Header ===== */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  border-bottom: 1px solid var(--neon-20);
  background: hsla(220, 20%, 6%, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-inner {
  max-width: 80rem;
  margin: 0 auto;
  display: flex;
  height: 3.5rem;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
}

.header-logo {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--neon);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
}

/* Desktop nav — hidden on mobile */
.desktop-nav {
  display: none;
  gap: 0.25rem;
  align-items: center;
}

.desktop-nav a {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  border-radius: var(--radius);
  color: var(--muted-fg);
  transition: color 0.2s ease, background-color 0.2s ease;
  text-decoration: none;
}

.desktop-nav a:hover {
  color: var(--fg);
}

.desktop-nav a.active {
  color: var(--neon);
  background-color: var(--secondary-bg);
}

/* Mobile toggle button */
.mobile-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted-fg);
  transition: color 0.2s ease;
}

.mobile-toggle:hover {
  color: var(--fg);
}

/* Mobile nav drawer */
.mobile-nav {
  display: none;
  border-top: 1px solid var(--neon-20);
  background: hsla(220, 20%, 6%, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: fade-in 0.25s ease-out both;
}

.mobile-nav.open {
  display: block;
}

.mobile-nav a {
  display: block;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border-20);
  color: var(--muted-fg);
  transition: color 0.2s ease;
  text-decoration: none;
}

.mobile-nav a:last-child {
  border-bottom: none;
}

.mobile-nav a:hover,
.mobile-nav a.active {
  color: var(--neon);
}

@media (min-width: 768px) {
  .desktop-nav {
    display: flex;
  }

  .mobile-toggle {
    display: none;
  }

  .mobile-nav {
    display: none !important;
  }
}

/* ===== Footer ===== */
footer {
  border-top: 1px solid var(--neon-20);
  background: hsla(220, 20%, 6%, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 2rem 1rem;
  text-align: center;
  position: relative;
  z-index: 10;
}

footer p {
  font-size: 0.75rem;
  color: var(--muted-fg);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.1em;
}

/* ===== Glow Utilities ===== */
.glow-box {
  box-shadow:
    0 0 8px  var(--glow-15),
    0 0 24px var(--glow-08),
    inset 0 1px 0 var(--glow-10);
}

.glow-box:hover {
  box-shadow:
    0 0 12px var(--glow-25),
    0 0 40px var(--glow-12),
    inset 0 1px 0 hsla(185, 100%, 50%, 0.15);
}

/* ===== Scroll Reveal ===== */
.scroll-reveal {
  opacity: 0;
  transform: translateY(16px);
  filter: blur(4px);
  transition:
    opacity   0.6s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
    filter    0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-reveal.visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

/* ===== Hero Section ===== */
.hero {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1rem;
}

.hero-title {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  padding-bottom: 0.1em;
  background: linear-gradient(
    to bottom,
    hsl(195, 60%, 92%) 0%,
    hsl(185, 100%, 62%) 35%,
    hsl(185, 100%, 45%) 65%,
    hsl(185, 70%, 22%) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero-secondary {
  margin-top: 1rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--neon);
  font-size: 1.125rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-shadow: var(--neon-glow-60) 0 0 10px, var(--neon-glow-30) 0 0 30px;
}

@media (min-width: 768px) {
  .hero-secondary {
    font-size: 1.25rem;
  }
}

.hero-tagline {
  margin-top: 1.5rem;
  color: var(--muted-fg);
  font-size: 0.9rem;
  max-width: 32rem;
  line-height: 1.7;
  text-wrap: balance;
}

@media (min-width: 768px) {
  .hero-tagline {
    font-size: 1rem;
  }
}

/* ===== Intro Section ===== */
.intro-section {
  padding: 0 1rem 4rem;
}

.intro-section p {
  max-width: 42rem;
  margin: 0 auto;
  text-align: center;
  color: var(--muted-fg);
  font-size: 0.875rem;
  line-height: 1.7;
}

@media (min-width: 768px) {
  .intro-section p {
    font-size: 1rem;
  }
}

/* ===== Tile Cards ===== */
.tiles-section {
  padding: 0 1rem 6rem;
}

.tiles-grid {
  display: grid;
  gap: 1.5rem;
  max-width: 56rem;
  margin: 0 auto;
  align-items: stretch;
}

/* Stretch scroll-reveal wrappers so tile-cards can fill full height */
.tiles-grid > .scroll-reveal {
  display: flex;
  flex-direction: column;
  height: 100%;
}

@media (min-width: 768px) {
  .tiles-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.tile-card {
  display: flex;
  flex-direction: column;
  flex: 1;
  border-radius: var(--radius);
  border: 1px solid var(--neon-20);
  background: var(--card-bg-50);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 1.5rem;
  box-shadow:
    0 0 8px  var(--glow-15),
    0 0 24px var(--glow-08),
    inset 0 1px 0 var(--glow-10);
  transition:
    box-shadow    0.3s ease,
    border-color  0.3s ease,
    transform     0.15s ease;
  text-decoration: none;
  color: inherit;
}

.tile-card:hover {
  border-color: var(--neon-40);
  box-shadow:
    0 0 12px var(--glow-25),
    0 0 40px var(--glow-12),
    inset 0 1px 0 hsla(185, 100%, 50%, 0.15);
}

.tile-card:active {
  transform: scale(0.97);
}

.tile-icon {
  color: var(--neon);
  opacity: 0.7;
  margin-bottom: 0.75rem;
  transition: opacity 0.2s ease;
  display: block;
}

.tile-card:hover .tile-icon {
  opacity: 1;
}

.tile-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 0.5rem;
  transition: color 0.2s ease;
}

.tile-card:hover .tile-title {
  color: var(--neon);
}

.tile-desc {
  font-size: 0.875rem;
  color: var(--muted-fg);
  line-height: 1.6;
}

/* ===== Content Pages ===== */
.page-section {
  padding: 4rem 1rem;
}

@media (min-width: 768px) {
  .page-section {
    padding: 6rem 1rem;
  }
}

.page-header {
  margin-bottom: 2rem;
}

.page-title {
  font-size: clamp(1.875rem, 5vw, 3rem);
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 0.5rem;
}

/* Scarzix large centred heading */
.page-title-scarzix {
  font-size: clamp(3rem, 10vw, 4.5rem);
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: var(--neon);
  text-shadow:
    0 0 10px var(--neon-glow-60),
    0 0 30px var(--neon-glow-30);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-align: center;
}

.page-subtitle {
  font-size: 0.875rem;
  color: var(--muted-fg);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.page-header-center {
  text-align: center;
}

/* ===== Content Sections Stack ===== */
.content-stack {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.content-section {
  border-radius: var(--radius);
  border: 1px solid var(--neon-20);
  background: var(--card-bg-60);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 1.5rem;
  box-shadow:
    0 0 8px  var(--glow-15),
    0 0 24px var(--glow-08),
    inset 0 1px 0 var(--glow-10);
}

@media (min-width: 768px) {
  .content-section {
    padding: 2rem;
  }
}

.content-section h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--neon);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.content-body {
  color: var(--secondary-fg);
  line-height: 1.7;
  font-size: 0.875rem;
}

@media (min-width: 768px) {
  .content-body {
    font-size: 1rem;
  }
}

.content-body p + p {
  margin-top: 0.75rem;
}

/* ===== Bullet List with Neon Dot ===== */
.neon-list {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.neon-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  color: var(--secondary-fg);
}

.neon-dot {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background-color: var(--neon);
  flex-shrink: 0;
  display: inline-block;
}

.neon-dot.dim {
  opacity: 0.5;
}

/* ===== Neon inline text ===== */
.text-neon {
  color: var(--neon);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875em;
}

/* ===== Skills/Tags ===== */
.skills-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.skill-tag {
  padding: 0.25rem 0.75rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--neon-20);
  background: var(--secondary-bg);
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--neon);
}

/* ===== Blockquote ===== */
blockquote {
  border-left: 2px solid var(--neon);
  padding-left: 1rem;
  margin: 0.75rem 0;
  color: var(--neon);
  font-style: italic;
}

/* ===== External Links ===== */
.external-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--neon);
  font-size: 0.875rem;
  font-family: 'JetBrains Mono', monospace;
  text-decoration: none;
  transition: text-decoration 0.1s;
}

.external-link:hover {
  text-decoration: underline;
}

.links-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

/* ===== Animations ===== */
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  .scroll-reveal {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
  }

  #tron-grid {
    display: none !important;
  }

  .mobile-nav {
    animation: none !important;
  }
}
