/* ==================================================================
   michaelbech.dk — theme
   Dark editorial "graph-paper" aesthetic: near-black navy canvas,
   fine grid, italic serif display type, monospace labels, sharp
   panels with a growing accent line on hover.
   ================================================================== */

:root {
  --bg: #161d27;
  --bg-deep: #0d1116;
  --panel: #212730;
  --panel-soft: #252f3d;
  --line: #495059;
  --line-strong: #757d89;
  --ink: #ebe7e4;
  --ink-dim: #d5d8db;
  --ink-muted: #9fa4ab;
  --accent: #6a9fcc;
  --accent-soft: #4b607c;
  --gold: #e1b06e;
  --terra: #b86b52;
  --sage: #a3a473;

  --grid-minor: rgba(106, 159, 204, 0.05);
  --grid-major: rgba(106, 159, 204, 0.1);

  --serif: "Plantin MT Pro", "Plantin MT Std", Plantin, Georgia, "Times New Roman", serif;
  --mono: "Commit Mono", ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;

  --active-stripe: linear-gradient(90deg, var(--accent) 0 62%, var(--accent-soft) 62% 100%);
  --active-stripe-v: linear-gradient(180deg, var(--accent) 0 62%, var(--accent-soft) 62% 100%);

  color-scheme: dark;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

/* ------------------------------------------------------------------ */
/* Graph-paper background (fixed, behind everything)                   */
/* ------------------------------------------------------------------ */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid-minor) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-minor) 1px, transparent 1px),
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px);
  background-size:
    16px 16px,
    16px 16px,
    80px 80px,
    80px 80px;
}

/* soft accent glow at the top + fade the grid out toward the bottom */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(75% 45% at 50% -12%, rgba(106, 159, 204, 0.14), transparent 60%),
    linear-gradient(180deg, transparent 58%, var(--bg) 100%);
}

/* ------------------------------------------------------------------ */
/* Typography                                                          */
/* ------------------------------------------------------------------ */
.display {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.035em;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.eyebrow--accent { color: var(--accent); }
.eyebrow--gold { color: var(--gold); }
.eyebrow--terra { color: var(--terra); }
.eyebrow--sage { color: var(--sage); }

.lead {
  color: var(--ink-dim);
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  line-height: 1.55;
}

.mono {
  font-family: var(--mono);
}

/* ------------------------------------------------------------------ */
/* Chips (monospace meta tags)                                        */
/* ------------------------------------------------------------------ */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--line);
  padding: 0.34rem 0.62rem;
  background: transparent;
  color: var(--ink-dim);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
  transition: border-color 0.18s ease, color 0.18s ease;
}
a.chip:hover,
.chip:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

/* ------------------------------------------------------------------ */
/* Panels (sharp, translucent, grid shows through)                    */
/* ------------------------------------------------------------------ */
.panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(33, 39, 48, 0.82);
}

/* interactive panel: lift + a two-tone accent line grows across the top */
.panel-hover {
  transition: transform 0.16s ease, border-color 0.16s ease;
}
.panel-hover::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  width: 100%;
  height: 1px;
  background: var(--active-stripe);
  transform: scaleX(0.24);
  transform-origin: left center;
  opacity: 0;
  transition: transform 0.16s ease, opacity 0.16s ease;
  pointer-events: none;
}
.panel-hover:hover,
.panel-hover:focus-within {
  transform: translateY(-2px);
  border-color: var(--line-strong);
}
.panel-hover:hover::before,
.panel-hover:focus-within::before {
  transform: scaleX(1);
  opacity: 1;
}

/* a static two-tone accent stripe pinned to the top of an element */
.stripe-top::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  width: 100%;
  height: 2px;
  background: var(--active-stripe);
  pointer-events: none;
}

/* ------------------------------------------------------------------ */
/* Buttons                                                            */
/* ------------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  padding: 0.62rem 1.05rem;
  background: rgba(33, 39, 48, 0.7);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}
.btn:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.btn-primary {
  border-color: var(--accent);
  background: rgba(106, 159, 204, 0.12);
}
.btn-primary:hover {
  background: rgba(106, 159, 204, 0.2);
  border-color: var(--accent);
}

.btn-ghost {
  border-color: var(--line);
  background: transparent;
  color: var(--ink-dim);
}
.btn-ghost:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

/* small square icon well (sharp, bordered, accent) */
.icon-well {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--line);
  background: rgba(33, 39, 48, 0.6);
  color: var(--accent);
  flex: none;
}

/* ------------------------------------------------------------------ */
/* Sidebar navigation                                                 */
/* ------------------------------------------------------------------ */
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.85rem;
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.16s ease, background-color 0.16s ease;
}
.nav-item svg {
  width: 1.05rem;
  height: 1.05rem;
  stroke-width: 1.6;
}
.nav-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--active-stripe-v);
  transform: scaleY(0);
  transform-origin: center;
  transition: transform 0.18s ease;
}
.nav-item:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.02);
}
.nav-item-active,
.nav-item-active:hover {
  color: var(--ink);
  background: rgba(106, 159, 204, 0.08);
}
.nav-item-active::before {
  transform: scaleY(1);
}

/* ------------------------------------------------------------------ */
/* Links                                                              */
/* ------------------------------------------------------------------ */
.link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.16s ease;
}
.link:hover {
  border-bottom-color: var(--accent);
}

/* ------------------------------------------------------------------ */
/* Hero                                                               */
/* ------------------------------------------------------------------ */
.hero {
  position: relative;
}
.hero::after {
  content: "";
  position: absolute;
  inset: -25% -10% auto auto;
  width: 78%;
  height: 62%;
  z-index: -1;
  background: radial-gradient(60% 60% at 35% 30%, rgba(106, 159, 204, 0.16), transparent 70%);
  filter: blur(24px);
  animation: hero-glow 18s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes hero-glow {
  0% {
    opacity: 0.65;
    transform: translate3d(0, 0, 0) scale(1);
  }
  100% {
    opacity: 1;
    transform: translate3d(7%, 5%, 0) scale(1.12);
  }
}

/* photo frame (sharp, bordered, subtle accent line) */
.photo-frame {
  position: relative;
  border: 1px solid var(--line);
  background: rgba(33, 39, 48, 0.7);
  overflow: hidden;
}
.photo-frame img {
  display: block;
  width: 100%;
  height: auto;
  filter: contrast(1.02) saturate(0.94);
}
.photo-frame::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  width: 100%;
  height: 2px;
  background: var(--active-stripe);
  z-index: 1;
}

/* ------------------------------------------------------------------ */
/* Scroll-reveal + fade-up                                            */
/* ------------------------------------------------------------------ */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0ms);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.fade-up {
  opacity: 0;
  transform: translateY(16px);
  animation: fade-up 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--fade-delay, 0ms);
}
@keyframes fade-up {
  to {
    opacity: 1;
    transform: none;
  }
}

/* ------------------------------------------------------------------ */
/* Timeline                                                           */
/* ------------------------------------------------------------------ */
/* Anchor the connecting line to the <ol> so it lines up with the nodes
   (which are anchored to each <li>). The <ol> has no horizontal padding,
   so its 20% / 50% reference matches the nodes' reference exactly. */
.timeline-line {
  position: relative;
}
.timeline-line::before {
  content: "";
  position: absolute;
  left: 20px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--active-stripe-v);
  /* translateX(-50%) centers the 2px line on the node's x; scaleY = reveal grow */
  transform: translateX(-50%) scaleY(0);
  transform-origin: top;
  transition: transform 1.6s ease;
}
.timeline-line.is-visible::before {
  transform: translateX(-50%) scaleY(1);
}
@media (min-width: 768px) {
  .timeline-line::before {
    left: 50%;
  }
}

/* timeline node (small diamond on the line) */
.tl-node {
  position: absolute;
  left: 20px;
  top: 1.15rem;
  width: 11px;
  height: 11px;
  background: var(--bg);
  border: 1.5px solid var(--accent);
  transform: translateX(-50%) rotate(45deg);
  z-index: 1;
}
@media (min-width: 768px) {
  .tl-node {
    left: 50%;
  }
  /* right-side cards: node stays centered on the line */
  .tl-item--right .tl-node {
    left: 50%;
  }
  .tl-item--left .tl-node {
    left: 50%;
  }
}

/* ------------------------------------------------------------------ */
/* Reduced motion                                                     */
/* ------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .hero::after {
    animation: none;
    opacity: 0.8;
  }
  .fade-up {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .timeline-line::before {
    transform: translateX(-50%) scaleY(1);
    transition: none;
  }
  .panel-hover,
  .panel-hover::before,
  .nav-item,
  .nav-item::before {
    transition: none;
  }
}

/* ------------------------------------------------------------------ */
/* Sidebar (mobile drawer, fixed on desktop)                          */
/* ------------------------------------------------------------------ */
[data-sidebar] {
  transform: translateX(-100%);
}
[data-sidebar].menu-open {
  transform: none;
}
@media (min-width: 768px) {
  [data-sidebar] {
    transform: none;
  }
}

/* ------------------------------------------------------------------ */
/* Cookie consent banner                                              */
/* ------------------------------------------------------------------ */
.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  border-top: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 -18px 40px -24px rgba(0, 0, 0, 0.8);
  padding: 1.05rem 1.25rem;
}
.cookie-banner[hidden] { display: none; }
.cookie-banner::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--active-stripe);
}
.cookie-banner__inner {
  position: relative;
  margin: 0 auto;
  max-width: 1080px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.cookie-banner__text {
  margin: 0;
  max-width: 74ch;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--ink-dim);
}
.cookie-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-left: auto;
}
.cookie-banner__btn {
  padding: 0.5rem 0.95rem;
  font-size: 0.74rem;
}
@media (min-width: 768px) {
  .cookie-banner { left: 18rem; }
}
@media (max-width: 640px) {
  .cookie-banner__inner {
    flex-direction: column;
    align-items: stretch;
    text-align: left;
  }
  .cookie-banner__actions {
    margin-left: 0;
    justify-content: flex-end;
  }
}
