@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

/* ====== Baseline & theming ====== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #050b07;
  --card: #07160f;
  --text: #d7ffe1;
  --muted: #7ce3a0;
  --primary: #38ff98;
  --ring: color-mix(in oklab, var(--primary) 60%, white);
  --border-strong: color-mix(in oklab, var(--primary) 70%, #ffffff 10%);
  --glow: 0 0 14px color-mix(in oklab, var(--primary) 55%, transparent);
  --scanline: rgba(10, 30, 18, 0.4);
  --radius: 16px;
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  --maxw: 1000px;
  --background-primary: var(--card);
  --background-secondary: color-mix(in oklab, var(--card) 85%, #000 15%);
  --background-modifier-border: var(--border-strong);
  --text-normal: var(--text);
  --interactive-accent: var(--primary);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #040805;
    --card: #06130d;
    --text: #d7ffe1;
    --muted: #7ce3a0;
    --ring: color-mix(in oklab, var(--primary) 70%, black);
    --shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
  }
}

html,
body {
  padding: 0;
  margin: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background:
    radial-gradient(
      900px 520px at 20% -10%,
      color-mix(in oklab, var(--primary) 25%, transparent) 0%,
      transparent 55%
    ),
    var(--bg);
  color: var(--text);
  font:
    12px/1.8 'Press Start 2P',
    'Share Tech Mono',
    'IBM Plex Mono',
    'Fira Mono',
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    'Liberation Mono',
    'Courier New',
    monospace;
  text-shadow: 0 0 8px color-mix(in oklab, var(--primary) 35%, transparent);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    180deg,
    var(--scanline),
    var(--scanline) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: screen;
  opacity: 0.35;
  z-index: 0;
}

.ai-helper {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 9999;
}

.ai-helper__toggle {
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  background: transparent;
  padding: 0;
}

.ai-helper__icon {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background-image: url('/assets/img/g-wizz.svg');
  background-size: contain;
  background-repeat: no-repeat;
  animation: ai-helper-icon 0.4s infinite alternate ease-in-out;
}

.ai-helper__chat {
  position: absolute;
  top: 74px;
  right: 0;
  width: min(90vw, 340px);
  max-height: min(70vh, 480px);
  background: color-mix(in oklab, var(--card) 94%, #000 6%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow:
    0 0 22px rgba(0, 0, 0, 0.7),
    var(--glow);
  display: grid;
  gap: 10px;
}

.ai-helper__title {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
}

.ai-helper__messages {
  display: grid;
  gap: 8px;
  overflow-y: auto;
  max-height: 260px;
  padding-right: 4px;
}

.ai-helper__message {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  font-size: 10px;
  line-height: 1.6;
}

.ai-helper__message--assistant {
  background: color-mix(in oklab, var(--primary) 12%, transparent);
}

.ai-helper__message--user {
  background: color-mix(in oklab, var(--primary) 24%, transparent);
}

.ai-helper__form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.ai-helper__input,
.ai-helper__send {
  font: inherit;
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: color-mix(in oklab, var(--card) 86%, #000 14%);
}

.ai-helper__input {
  min-width: 0;
  padding: 8px 10px;
}

.ai-helper__send {
  padding: 8px 10px;
  cursor: pointer;
}

.ai-helper__toggle:focus-visible,
.ai-helper__input:focus-visible,
.ai-helper__send:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--ring);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes ai-helper-icon {
  0% {
    transform: rotate(-4deg);
  }
  100% {
    transform: rotate(4deg);
  }
}

/* ====== Layout helpers ====== */
.layout {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  z-index: 1;
}
.page {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.page > main {
  flex: 1;
}
.container {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 24px;
}

/* ====== Sidebar ====== */
.sidebar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  width: 240px;
  background: linear-gradient(180deg, color-mix(in oklab, var(--card) 85%, #000), var(--card));
  border-right: 1px solid var(--border-strong);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: width 0.2s ease;
  z-index: 20;
  box-shadow:
    0 0 20px rgba(0, 0, 0, 0.6),
    var(--glow);
}
.sidebar-top {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-title {
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.sidebar-toggle {
  border: none;
  background: color-mix(in oklab, var(--primary) 20%, transparent);
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: 12px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition:
    transform 0.12s ease,
    background-color 0.12s ease;
  box-shadow: var(--glow);
}
.sidebar-toggle:hover {
  transform: translateY(-1px);
}
.sidebar-arrow {
  width: 16px;
  height: 16px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
}
.sidebar-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid transparent;
  justify-content: flex-start;
  transition:
    transform 0.12s ease,
    background-color 0.12s ease,
    border-color 0.12s ease;
}
.nav-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--icon-color, var(--primary));
  flex-shrink: 0;
}
.nav-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.sidebar-nav a:hover {
  background: color-mix(in oklab, var(--primary) 18%, transparent);
  border-color: var(--border-strong);
  box-shadow: var(--glow);
}
.sidebar-nav a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--ring);
}

/* AUTH BUTTONS */
.auth-buttons__group {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  width: 100%;
}
.auth-icon-btn {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 6px;
  border-radius: 10px;
  cursor: pointer;
  line-height: 0; /* prevents extra vertical space */
}

/* Icon sizing: base (keep consistent box) */
.auth-icon-btn img,
.auth-icon-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* Small = compact square-ish */
.sidebar-auth .google-logo--small,
.sidebar-auth .logout-logo--small {
  height: 18px;
  width: 18px;
}

/* Large = bredere variant (pas width aan zoals je SVG bedoeld is) */
.sidebar-auth .google-logo--large,
.sidebar-auth .logout-logo--large {
  height: 72px;
  width: 144px;
}

/* Simple hover effect (works for img or inline svg) */
.auth-icon-btn:hover {
  transform: translateY(-1px);
}
.auth-icon-btn:hover img,
.auth-icon-btn:hover svg {
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.25));
}

/* keyboard focus ring */
.auth-icon-btn:focus-visible {
  outline: 2px solid color-mix(in oklab, var(--accent) 70%, transparent);
  outline-offset: 2px;
}

/* Default (unfolded): show LARGE */
.sidebar-auth .google-logo--small {
  display: none !important;
}
.sidebar-auth .google-logo--large {
  display: block !important;
}

/* Folded: show SMALL */
body.sidebar-collapsed .sidebar-auth .google-logo--small {
  display: block !important;
}
body.sidebar-collapsed .sidebar-auth .google-logo--large {
  display: none !important;
}

/* Default (unfolded): show LARGE logout */
.sidebar-auth .logout-logo--small {
  display: none !important;
}
.sidebar-auth .logout-logo--large {
  display: block !important;
}

/* Folded: show SMALL logout */
body.sidebar-collapsed .sidebar-auth .logout-logo--small {
  display: block !important;
}
body.sidebar-collapsed .sidebar-auth .logout-logo--large {
  display: none !important;
}

/* Sidebar auth placement */
.sidebar-auth {
  margin-top: auto; /* Places login buttons under navlinks */
  display: grid;
  gap: 10px;
  padding-top: 10px;
}

.footer-auth {
  width: min(100%, 360px);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.auth-status,
.auth-user {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  margin: 0;
}
.auth-status {
  min-height: 1em;
  display: block;
  width: 100%;
  max-width: 360px;
  margin: 0;
}

.auth-status[data-tone='success'] {
  color: #5dffb8;
}
.auth-status[data-tone='error'] {
  color: #ff7b7b;
}

body.sidebar-collapsed .sidebar {
  width: 72px;
  padding-inline: 10px;
  flex: 0 0 72px;
  position: relative;
}
body.sidebar-collapsed .sidebar-title,
body.sidebar-collapsed .nav-label {
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
  overflow: hidden;
}
body.sidebar-collapsed .sidebar-nav a {
  justify-content: center;
  gap: 0;
  padding-inline: 0;
}
body.sidebar-collapsed .sidebar-auth {
  justify-items: center;
}
body.sidebar-collapsed .sidebar-arrow {
  transform: rotate(135deg);
}

.section-divider {
  border: 0;
  height: 1px;
  margin: 24px 0;
  background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
  box-shadow: var(--glow);
}

.sidebar-nav .nav-divider {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-nav .nav-divider .section-divider {
  margin: 12px 0;
}

@media (max-width: 900px) {
  .container {
    padding-inline: 18px;
  }
}

/* ====== Hero ====== */
.hero {
  position: relative;
}
.hero-banner {
  background-image: url('/assets/img/website-banner.svg');
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  background-color: var(--background-secondary);
  border-bottom: 1px solid var(--border-strong);
  box-shadow: inset 0 -12px 30px rgba(0, 0, 0, 0.6);
}
.hero-inner {
  min-height: 170px;
  display: grid;
  place-items: center;
  text-align: center;
  padding-block: 36px 24px;
}
.title-3d {
  margin: 0;
  font-size: clamp(2rem, 1.2rem + 3vw, 3.5rem);
  letter-spacing: 1px;
  color: var(--text);
  font-family: 'Press Start 2P', 'Share Tech Mono', sans-serif;
  text-shadow:
    0 0 12px color-mix(in oklab, var(--primary) 55%, transparent),
    0 0 28px color-mix(in oklab, var(--primary) 35%, transparent);
}
.subtitle {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

h2 {
  margin: 0;
  letter-spacing: 0.2px;
}
h2 {
  font-size: 1.25rem;
  color: var(--text);
}

/* ====== Main grid + cards ====== */
main {
  padding-block: 28px 40px;
}
.grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}
.card {
  flex: 1 1 var(--card-width, 260px);
  min-width: min(100%, var(--card-width, 260px));
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px clamp(16px, 2vw, 28px);
  border: 1px solid var(--border-strong);
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    border-color 0.12s ease;
  box-shadow:
    0 0 16px rgba(0, 0, 0, 0.55),
    var(--glow);
}
.card:hover {
  transform: translateY(-2px);
}
.card-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: calc(var(--radius) - 6px);
  margin-bottom: 12px;
  display: block;
}

.grid.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  grid-auto-flow: row;
  gap: 20px;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.card-category-label {
  background: color-mix(in oklab, var(--primary) 35%, var(--card));
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  color: var(--text);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--text) 60%, transparent);
}

.card-meta time {
  font-size: 0.7rem;
  color: var(--muted);
}

.blog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
  overflow-x: visible;
}

.blog-filter-button {
  border: 1px solid var(--border-strong);
  background: linear-gradient(
    135deg,
    transparent 0%,
    transparent 40%,
    color-mix(in oklab, var(--card) 60%, var(--bg) 40%)
  );
  color: var(--text);
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    transform 0.12s ease,
    background 0.2s ease,
    box-shadow 0.2s ease,
    color 0.2s ease;
  box-shadow: 0 0 16px rgba(0, 0, 0, 0.35);
}

.blog-filter-button:hover {
  transform: translateY(-1px);
}

.blog-filter-button.is-active {
  background: linear-gradient(
    135deg,
    color-mix(in oklab, var(--primary) 60%, var(--card) 40%),
    color-mix(in oklab, var(--primary) 35%, transparent 60%)
  );
  color: #051307;
  box-shadow: 0 0 20px var(--glow);
}
.card-link {
  color: inherit;
  text-decoration: none;
}
.card-link:hover {
  text-decoration: underline;
}
.card-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.98rem;
}

/* ====== Blog posts ====== */
.post {
  display: grid;
  gap: 18px;
}
.post-header {
  display: grid;
  gap: 8px;
}
.post-subtitle {
  margin: 0;
  color: var(--muted);
}
.post-hero {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.post-content {
  display: grid;
  gap: 12px;
}

/* ====== Login page ====== */
.login-shell {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: start;
  --firebase-ui-primary: var(--primary);
  --firebase-ui-secondary: var(--accent);
  --firebase-ui-border-radius: 16px;
}
.login-card {
  background: linear-gradient(
    160deg,
    color-mix(in oklab, var(--card) 90%, var(--primary)),
    var(--card)
  );
  border: 1px solid var(--border-strong);
  border-radius: 24px;
  padding: 32px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 24px;
}
.login-card__header h1 {
  margin: 8px 0 12px;
  font-size: clamp(1.6rem, 2.2vw, 2.2rem);
}
.login-eyebrow {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--muted);
  margin: 0;
}
.login-lede {
  margin: 0;
  color: var(--muted);
}
.login-actions {
  display: grid;
  gap: 12px;
}
.login-actions__group {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid color-mix(in oklab, var(--border-strong) 75%, transparent);
  background: color-mix(in oklab, var(--card) 80%, transparent);
}
.login-actions__label {
  margin: 0;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
}
.login-action {
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 14px 18px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    border-color 0.15s ease;
}
.login-action--primary {
  background: linear-gradient(120deg, #3bff9a, #1dff81 60%, #7effc0);
  color: #04140a;
  box-shadow: 0 10px 30px rgba(4, 20, 10, 0.3);
  border-color: transparent;
}
.login-action--ghost {
  background: transparent;
  color: var(--text);
}
.login-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}
.login-status {
  min-height: 1.5em;
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.login-status[data-tone='success'] {
  color: #5dffb8;
}
.login-status[data-tone='error'] {
  color: #ff7b7b;
}
.login-panel {
  background: color-mix(in oklab, var(--card) 88%, transparent);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 24px;
  display: grid;
  gap: 12px;
}
.login-panel h2 {
  margin: 0;
}
.login-panel ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  display: grid;
  gap: 8px;
}
@media (max-width: 960px) {
  .login-shell {
    grid-template-columns: 1fr;
  }
}
/* ====== Footer ====== */
footer {
  border-top: 1px solid var(--border-strong);
  padding: 20px;
  color: var(--muted);
  text-align: center;
  background-image: url('/assets/img/wall_texture.png');
  background-size: 128px 128px;
  background-position: top left;
  background-repeat: repeat;
}

footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

footer p {
  margin: 0;
}

/* ====== Buttons ====== */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5ch;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: linear-gradient(
    180deg,
    color-mix(in oklab, var(--primary) 35%, var(--card)),
    color-mix(in oklab, var(--primary) 16%, var(--card))
  );
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.12s ease,
    filter 0.12s ease;
}
.button:hover {
  transform: translateY(-1px);
}
.button:active {
  transform: translateY(0);
}
.button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--ring);
}

/* ====== Accessibility ====== */
:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--ring);
  border-radius: 8px;
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
