/* =================================================================
   denninissen.de — clean, modern, playful
   Aesthetic: dark editorial + warm coral accent + living 3D field
   ================================================================= */

:root {
  /* Type */
  --font-display: "Bricolage Grotesque", Georgia, serif;
  --font-body: "Hanken Grotesk", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* Dark theme (default) */
  --bg: #0b0b0f;
  --bg-soft: #131319;
  --bg-elev: #17171f;
  --text: #f4f1ea;
  --text-muted: #9b988f;
  --text-faint: #6a6760;
  --accent: #ff5d3b;       /* coral / tangerine */
  --accent-soft: #ff8163;
  --accent-2: #6ea8ff;     /* cool blue, used in the 3D field */
  --line: rgba(244, 241, 234, 0.12);
  --line-strong: rgba(244, 241, 234, 0.22);
  --glow: rgba(255, 93, 59, 0.35);

  --radius: 16px;
  --maxw: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="light"] {
  --bg: #f3efe6;
  --bg-soft: #ebe6da;
  --bg-elev: #fffdf8;
  --text: #16151a;
  --text-muted: #5d5a51;
  --text-faint: #908c82;
  --accent: #e8431f;
  --accent-soft: #c9381a;
  --accent-2: #2f6df0;
  --line: rgba(20, 20, 25, 0.12);
  --line-strong: rgba(20, 20, 25, 0.2);
  --glow: rgba(232, 67, 31, 0.25);
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background 0.5s var(--ease), color 0.5s var(--ease);
}

/* Layered atmospheric gradient behind the canvas */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(60% 50% at 18% 12%, color-mix(in oklab, var(--accent) 18%, transparent), transparent 70%),
    radial-gradient(55% 55% at 88% 22%, color-mix(in oklab, var(--accent-2) 16%, transparent), transparent 70%),
    radial-gradient(70% 60% at 50% 110%, color-mix(in oklab, var(--accent) 10%, transparent), transparent 70%);
  opacity: 0.9;
  transition: opacity 0.5s var(--ease);
}

a { color: inherit; text-decoration: none; }

::selection { background: var(--accent); color: #fff; }

kbd {
  font-family: var(--font-mono);
  font-size: 0.72em;
  padding: 0.15em 0.45em;
  border-radius: 6px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  box-shadow: 0 1px 0 var(--line-strong);
  line-height: 1;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 1000;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 16px; }

/* ---------- Background canvas / grain / cursor ---------- */
.bg-canvas {
  position: fixed;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  display: block;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}

.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, var(--glow), transparent 65%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  will-change: transform;
}
@media (hover: hover) and (pointer: fine) {
  body:hover .cursor-glow { opacity: 1; }
}

/* ---------- Layout helpers ---------- */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(80px, 12vw, 160px) clamp(20px, 5vw, 48px);
}

.section__head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: clamp(36px, 6vw, 64px);
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.section__index {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  letter-spacing: 0.05em;
}
.section__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 6vw, 3.4rem);
  letter-spacing: -0.02em;
  line-height: 1;
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease), backdrop-filter 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-stuck {
  background: color-mix(in oklab, var(--bg) 72%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--line);
}
.nav__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px clamp(20px, 5vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav__brand {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.nav__brand-accent { color: var(--accent); }
.nav__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--glow);
  animation: pulse 2.8s var(--ease) infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 var(--glow); }
  70% { box-shadow: 0 0 0 10px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.nav__links {
  display: flex;
  gap: 28px;
  font-size: 0.92rem;
}
.nav__links a {
  position: relative;
  color: var(--text-muted);
  transition: color 0.25s var(--ease);
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s var(--ease);
}
.nav__links a:hover { color: var(--text); }
.nav__links a:hover::after { width: 100%; }

.nav__actions { display: flex; align-items: center; gap: 10px; }

.cmdk-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-muted);
  background: color-mix(in oklab, var(--bg-elev) 70%, transparent);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease);
}
.cmdk-trigger:hover { border-color: var(--line-strong); color: var(--text); }
.cmdk-trigger kbd { font-size: 0.65rem; }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg-elev) 70%, transparent);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.25s var(--ease), transform 0.4s var(--ease);
}
.theme-toggle:hover { border-color: var(--line-strong); transform: rotate(15deg); }
.theme-toggle__moon { display: none; }
[data-theme="light"] .theme-toggle__sun { display: none; }
[data-theme="light"] .theme-toggle__moon { display: block; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 120px clamp(20px, 5vw, 48px) 80px;
}
.hero__inner { max-width: 820px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 24px;
}
.eyebrow__pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.8s var(--ease) infinite;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3.4rem, 13vw, 8.5rem);
  line-height: 0.92;
  letter-spacing: -0.035em;
  margin-bottom: 28px;
}
.hero__title-accent { color: var(--accent); }

.hero__lead {
  font-size: clamp(1.1rem, 2.4vw, 1.5rem);
  color: var(--text-muted);
  max-width: 620px;
  margin-bottom: 40px;
}
.hero__lead a {
  color: var(--text);
  border-bottom: 1.5px solid var(--accent);
  transition: color 0.25s var(--ease);
}
.hero__lead a:hover { color: var(--accent); }

.rotator {
  display: inline-flex;
  color: var(--text);
  font-weight: 600;
}
.rotator__word {
  display: inline-block;
  background: linear-gradient(100deg, var(--accent), var(--accent-soft));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.rotator__word.is-swapping { animation: word-swap 0.5s var(--ease); }
@keyframes word-swap {
  0% { opacity: 0; transform: translateY(0.5em) rotate(2deg); filter: blur(4px); }
  100% { opacity: 1; transform: none; filter: blur(0); }
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 36px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 1rem;
  padding: 14px 26px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.3s var(--ease), background 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 30px -10px var(--glow);
}
.btn--primary:hover { transform: translateY(-3px); box-shadow: 0 14px 40px -10px var(--glow); }
.btn__arrow { transition: transform 0.3s var(--ease); }
.btn--primary:hover .btn__arrow { transform: translateY(3px); }
.btn--ghost { border-color: var(--line-strong); color: var(--text); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-3px); }

.hero__hint {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-faint);
}

.scroll-cue {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 42px;
  border: 1.5px solid var(--line-strong);
  border-radius: 14px;
  display: grid;
  place-items: start center;
  padding-top: 7px;
}
.scroll-cue__line {
  width: 3px;
  height: 8px;
  border-radius: 3px;
  background: var(--accent);
  animation: scroll-bob 1.8s var(--ease) infinite;
}
@keyframes scroll-bob {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50% { transform: translateY(10px); opacity: 1; }
}

/* ---------- About ---------- */
.about {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: start;
}
.about__lead p {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: var(--text-muted);
}
.about__lead p + p { margin-top: 1.2em; }
.about__lead strong { color: var(--text); font-weight: 600; }

.about__facts {
  list-style: none;
  padding: 0;
  border-top: 1px solid var(--line);
}
.about__facts li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.about__facts-key {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.about__facts-val { text-align: right; font-weight: 500; }

/* ---------- Projects ---------- */
.projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}
.project {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 30px;
  border-radius: var(--radius);
  background: color-mix(in oklab, var(--bg-soft) 60%, transparent);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
  overflow: hidden;
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), background 0.4s var(--ease);
}
.project::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 80% at 0% 0%, color-mix(in oklab, var(--accent) 14%, transparent), transparent 55%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
}
.project:hover {
  transform: translateY(-6px);
  border-color: var(--line-strong);
}
.project:hover::after { opacity: 1; }
.project__top { display: flex; justify-content: space-between; align-items: center; }
.project__num { font-family: var(--font-mono); color: var(--accent); font-size: 0.85rem; }
.project__tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: 999px;
}
.project__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}
.project__desc { color: var(--text-muted); font-size: 0.97rem; flex: 1; }
.project__link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--accent);
  width: fit-content;
}
.project__link span { transition: transform 0.3s var(--ease); }
.project:hover .project__link span { transform: translateX(5px); }

/* ---------- Notes ---------- */
.notes { display: flex; flex-direction: column; }
.note {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 22px 8px;
  border-top: 1px solid var(--line);
  transition: padding 0.35s var(--ease), color 0.35s var(--ease);
}
.note:last-of-type { border-bottom: 1px solid var(--line); }
.note__date { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-faint); }
.note__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  letter-spacing: -0.01em;
  transition: color 0.3s var(--ease);
}
.note__arrow { color: var(--accent); opacity: 0; transform: translateX(-8px); transition: all 0.3s var(--ease); }
.note:hover { padding-left: 20px; }
.note:hover .note__title { color: var(--accent); }
.note:hover .note__arrow { opacity: 1; transform: translateX(0); }
.notes__hint { margin-top: 24px; color: var(--text-faint); font-size: 0.9rem; }

/* Empty state while the blog is still being seeded */
.notes-empty {
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: clamp(36px, 7vw, 64px) clamp(24px, 5vw, 48px);
  background: color-mix(in oklab, var(--bg-soft) 40%, transparent);
}
.notes-empty__badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--line);
  padding: 5px 13px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.notes-empty__text {
  color: var(--text-muted);
  font-size: clamp(1.05rem, 2.4vw, 1.4rem);
  line-height: 1.5;
  max-width: 46ch;
  margin: 0 auto;
}

/* ---------- Contact ---------- */
.section--contact { text-align: center; }
.contact { max-width: 720px; margin: 0 auto; }
.contact .section__index { display: block; margin-bottom: 16px; }
.contact__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3rem, 11vw, 7rem);
  line-height: 0.95;
  letter-spacing: -0.035em;
  margin-bottom: 20px;
}
.contact__lead { color: var(--text-muted); font-size: clamp(1.05rem, 2vw, 1.25rem); margin-bottom: 36px; }
.contact__mail {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 5vw, 2.4rem);
  font-weight: 500;
  border-bottom: 2px solid var(--line-strong);
  padding-bottom: 6px;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.contact__mail:hover { color: var(--accent); border-color: var(--accent); }
.contact__socials {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 28px;
  margin-top: 44px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}
.contact__socials a {
  color: var(--text-muted);
  position: relative;
  transition: color 0.25s var(--ease);
}
.contact__socials a:hover { color: var(--text); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); }
.footer__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px clamp(20px, 5vw, 48px);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-faint);
}

/* ---------- Command palette ---------- */
.cmdk { position: fixed; inset: 0; z-index: 500; display: grid; place-items: start center; padding-top: 14vh; }
.cmdk[hidden] { display: none; }
.cmdk__backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in oklab, var(--bg) 55%, transparent);
  backdrop-filter: blur(6px);
  animation: fade-in 0.2s var(--ease);
}
.cmdk__panel {
  position: relative;
  width: min(560px, 92vw);
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  animation: cmdk-in 0.28s var(--ease);
}
@keyframes cmdk-in {
  from { opacity: 0; transform: translateY(-12px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.cmdk__search {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.cmdk__search-icon { color: var(--text-faint); font-size: 1.1rem; }
.cmdk__input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.05rem;
}
.cmdk__input::placeholder { color: var(--text-faint); }
.cmdk__esc { font-size: 0.7rem; }
.cmdk__list { list-style: none; padding: 8px; margin: 0; max-height: 50vh; overflow-y: auto; }
.cmdk__item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--text-muted);
}
.cmdk__item[aria-selected="true"] { background: color-mix(in oklab, var(--accent) 16%, transparent); color: var(--text); }
.cmdk__item-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  font-size: 0.95rem;
}
.cmdk__item-label { flex: 1; font-weight: 500; }
.cmdk__item-hint { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-faint); }
.cmdk__empty { padding: 24px; text-align: center; color: var(--text-faint); }

/* ---------- Reveal animation (only active when JS is available) ---------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .nav__links { display: none; }
  .cmdk-trigger span { display: none; }
  .about { grid-template-columns: 1fr; }
  .note { grid-template-columns: 70px 1fr; }
  .note__arrow { display: none; }
}
