:root {
  --bg: #090c10;
  --bg-soft: #0e1319;
  --panel: #11171f;
  --panel-hover: #151d27;
  --line: #26313d;
  --line-soft: rgba(255, 255, 255, 0.08);
  --text: #f0f4f8;
  --muted: #94a0ad;
  --muted-bright: #bdc7d2;
  --accent: #62e6a7;
  --accent-dark: #092d21;
  --accent-glow: rgba(98, 230, 167, 0.14);
  --danger: #ff6b7a;
  --max-width: 1180px;
  --reading-width: 760px;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 80% 5%, rgba(41, 112, 82, 0.09), transparent 28rem),
    var(--bg);
  font-family: var(--sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  content: "";
  pointer-events: none;
  opacity: 0.22;
  background-image: linear-gradient(rgba(255,255,255,.022) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.022) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 75%);
}

::selection { color: #06150f; background: var(--accent); }

a { color: inherit; }

button,
input { font: inherit; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 1rem;
  left: 1rem;
  padding: .7rem 1rem;
  color: #07140f;
  background: var(--accent);
  border-radius: .5rem;
  font-weight: 700;
  transform: translateY(-200%);
}

.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  z-index: 50;
  top: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(9, 12, 16, 0.82);
  backdrop-filter: blur(18px);
}

.nav-wrap,
.site-footer {
  width: min(calc(100% - 2.5rem), var(--max-width));
  margin-inline: auto;
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4.75rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  font-size: 1.05rem;
  font-weight: 750;
  letter-spacing: -.025em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  color: var(--bg);
  background: var(--accent);
  border-radius: .45rem;
  font-family: var(--mono);
  font-size: .9rem;
  font-weight: 900;
  box-shadow: 0 0 25px rgba(98, 230, 167, .15);
}

.accent { color: var(--accent); }

nav { display: flex; align-items: center; gap: 1.8rem; }

nav a {
  color: var(--muted-bright);
  font-size: .86rem;
  font-weight: 600;
  text-decoration: none;
  transition: color .2s ease;
}

nav a:hover,
nav a:focus-visible { color: var(--accent); }

nav .nav-cta {
  padding: .55rem .9rem;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: .55rem;
}

.hero,
.section,
.article-shell,
.not-found {
  width: min(calc(100% - 2.5rem), var(--max-width));
  margin-inline: auto;
}

.hero {
  position: relative;
  min-height: calc(100vh - 4.75rem);
  padding: clamp(5rem, 11vh, 8.5rem) 0 6rem;
}

.hero-glow {
  position: absolute;
  z-index: -1;
  top: 1rem;
  left: -12rem;
  width: 35rem;
  height: 35rem;
  border-radius: 50%;
  background: rgba(98, 230, 167, 0.07);
  filter: blur(100px);
}

.eyebrow,
.section-label {
  display: flex;
  align-items: center;
  gap: .65rem;
  color: var(--accent);
  font-family: var(--mono);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.status-dot {
  width: .48rem;
  height: .48rem;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(98, 230, 167, .09), 0 0 18px var(--accent);
}

.hero h1 {
  max-width: 900px;
  margin: 1.7rem 0 1.5rem;
  font-size: clamp(3.6rem, 8.8vw, 8rem);
  font-weight: 780;
  letter-spacing: -.075em;
  line-height: .92;
}

.hero h1 span {
  color: transparent;
  -webkit-text-stroke: 1px #6e7985;
}

.hero-copy {
  max-width: 540px;
  margin: 0;
  color: var(--muted-bright);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 1.7rem;
  margin-top: 2.3rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  min-height: 3rem;
  padding: .72rem 1.1rem;
  border-radius: .55rem;
  font-size: .87rem;
  font-weight: 750;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.button-primary {
  color: #07140f;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-glow);
}

.button-primary:hover,
.button-primary:focus-visible {
  background: #7af0b8;
  box-shadow: 0 0 0 6px var(--accent-glow);
  transform: translateY(-2px);
}

.text-link {
  color: var(--muted-bright);
  font-size: .9rem;
  font-weight: 650;
  text-decoration: none;
}

.text-link:hover { color: var(--accent); }

.terminal-card {
  position: absolute;
  right: 0;
  bottom: 7rem;
  width: min(43%, 470px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: .8rem;
  background: rgba(14, 19, 25, .87);
  box-shadow: 0 30px 80px rgba(0,0,0,.35);
  transform: rotate(1.5deg);
}

.terminal-top {
  display: flex;
  align-items: center;
  gap: .4rem;
  height: 2.8rem;
  padding: 0 1rem;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255,255,255,.025);
}

.terminal-top span { width: .55rem; height: .55rem; border-radius: 50%; background: #49525d; }
.terminal-top span:first-child { background: #e3646a; }
.terminal-top span:nth-child(2) { background: #d9ae62; }
.terminal-top span:nth-child(3) { background: var(--accent); }
.terminal-top small { margin-left: auto; color: #687482; font-family: var(--mono); font-size: .68rem; }

.terminal-body {
  padding: 1.25rem 1.4rem 1.5rem;
  color: #cbd5df;
  font-family: var(--mono);
  font-size: clamp(.68rem, 1vw, .79rem);
}

.terminal-body p { margin: .45rem 0; }
.terminal-output { color: #768391; }
.prompt { color: var(--accent); }
.cursor { display: inline-block; width: .48rem; height: .95rem; background: var(--accent); vertical-align: -.12rem; animation: blink 1.1s step-end infinite; }

@keyframes blink { 50% { opacity: 0; } }

.section {
  padding: clamp(5rem, 10vw, 9rem) 0;
  border-top: 1px solid var(--line-soft);
}

.section-label { margin-bottom: 2rem; }
.section-label span { color: #5c6874; }

.about-grid {
  display: grid;
  grid-template-columns: minmax(250px, .8fr) minmax(300px, 1.2fr);
  gap: clamp(3rem, 10vw, 9rem);
  align-items: start;
}

.about h2,
.section-heading h2 {
  margin: 0;
  font-size: clamp(2.3rem, 5vw, 4.7rem);
  letter-spacing: -.06em;
  line-height: 1;
}

.about-copy { max-width: 650px; }
.about-copy > p { margin: 0 0 1.25rem; color: var(--muted-bright); font-size: 1.06rem; }
.about-copy > p:first-child { color: var(--text); font-size: 1.28rem; }

.focus-list { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 2rem; }
.focus-list span {
  padding: .42rem .7rem;
  color: var(--accent);
  border: 1px solid rgba(98, 230, 167, .18);
  border-radius: 999px;
  background: rgba(98, 230, 167, .04);
  font-family: var(--mono);
  font-size: .72rem;
}

.resume-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
  gap: clamp(2.5rem, 6vw, 5rem);
}

.resume-column h3 {
  margin: 0 0 1.25rem;
  color: var(--muted-bright);
  font-family: var(--mono);
  font-size: .76rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.timeline {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: .8rem;
  background: rgba(17, 23, 31, .62);
}

.timeline-item {
  display: grid;
  grid-template-columns: 2.8rem minmax(0, 1fr);
  gap: 1rem;
  padding: 1.5rem;
}

.timeline-item + .timeline-item {
  border-top: 1px solid var(--line);
}

.timeline-marker {
  display: grid;
  width: 2.8rem;
  height: 2.8rem;
  place-items: center;
  color: #07140f;
  background: var(--accent);
  border-radius: .55rem;
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 900;
}

.timeline-marker-denmark {
  color: #fff;
  background: #bb2636;
}

.timeline-marker-school {
  color: #dceaff;
  background: #173e69;
}

.timeline-topline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.timeline-topline h4 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: -.02em;
  line-height: 1.35;
}

.timeline-topline time {
  flex: none;
  color: var(--muted);
  font-family: var(--mono);
  font-size: .66rem;
  text-transform: uppercase;
}

.timeline-organization,
.timeline-location {
  margin: .2rem 0 0;
  color: var(--muted-bright);
  font-size: .84rem;
}

.timeline-location {
  color: var(--muted);
  font-size: .76rem;
}

.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin: .85rem 0 0;
  padding: 0;
  list-style: none;
}

.skill-list li {
  padding: .28rem .55rem;
  color: var(--accent);
  border: 1px solid rgba(98, 230, 167, .16);
  border-radius: 999px;
  background: rgba(98, 230, 167, .04);
  font-family: var(--mono);
  font-size: .64rem;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2.3rem;
}

.section-heading .section-label { margin-bottom: 1.1rem; }
.section-heading > p { margin: 0 0 .35rem; color: var(--muted); font-size: .87rem; }

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 1.2rem;
}

.search-wrap svg {
  position: absolute;
  left: 1.1rem;
  width: 1rem;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.7;
  stroke-linecap: round;
}

#search {
  width: 100%;
  padding: 1rem 3.2rem 1rem 3rem;
  color: var(--text);
  outline: none;
  border: 1px solid var(--line);
  border-radius: .65rem;
  background: rgba(17, 23, 31, .7);
  transition: border-color .2s ease, box-shadow .2s ease;
}

#search::placeholder { color: #65717d; }
#search:focus { border-color: rgba(98, 230, 167, .55); box-shadow: 0 0 0 4px rgba(98, 230, 167, .08); }
.search-wrap kbd { position: absolute; right: 1rem; padding: .05rem .45rem; color: #788491; border: 1px solid var(--line); border-radius: .3rem; background: #0d1218; font-family: var(--mono); font-size: .7rem; }

.post-grid { border-top: 1px solid var(--line); }

.post-card {
  position: relative;
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 1.25rem;
  padding: 2.1rem 1rem;
  border-bottom: 1px solid var(--line);
  transition: background .25s ease, padding .25s ease;
}

.post-card[hidden] { display: none; }
.post-card:hover { padding-inline: 1.4rem; background: linear-gradient(90deg, rgba(98,230,167,.055), rgba(98,230,167,.01)); }
.card-link { position: absolute; z-index: 1; inset: 0; }
.card-link:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.card-number { padding-top: .15rem; color: #596571; font-family: var(--mono); font-size: .75rem; }
.card-content { min-width: 0; }
.post-meta { display: flex; gap: 1rem; color: #77838f; font-family: var(--mono); font-size: .68rem; text-transform: uppercase; }
.post-meta span::before { content: "·"; margin-right: 1rem; color: #4c5762; }
.post-card h3 { margin: .55rem 0 .45rem; font-size: clamp(1.3rem, 3vw, 2rem); letter-spacing: -.035em; line-height: 1.2; transition: color .2s ease; }
.post-card:hover h3 { color: var(--accent); }
.post-card p { max-width: 760px; margin: 0; color: var(--muted); font-size: .92rem; }
.read-link { display: inline-flex; gap: .5rem; margin-top: 1.1rem; color: var(--muted-bright); font-size: .78rem; font-weight: 700; }
.read-link span { color: var(--accent); transition: transform .2s ease; }
.post-card:hover .read-link span { transform: translateX(4px); }
.no-results { padding: 3rem; color: var(--muted); text-align: center; border-bottom: 1px solid var(--line); }

.article-shell { padding: clamp(3rem, 7vw, 6.5rem) 0 7rem; }
.article-header { max-width: 900px; margin: 0 auto 5rem; }
.back-link { display: inline-flex; gap: .6rem; margin-bottom: 3.5rem; color: var(--muted); font-size: .82rem; font-weight: 650; text-decoration: none; }
.back-link:hover { color: var(--accent); }
.article-header .eyebrow { margin-bottom: 1.25rem; }
.article-header h1 { margin: 0; font-size: clamp(2.7rem, 7vw, 6.2rem); letter-spacing: -.07em; line-height: .98; }
.article-header > p { max-width: 700px; margin: 1.5rem 0; color: var(--muted-bright); font-size: 1.1rem; }
.article-meta { display: flex; gap: 1rem; color: #76818d; font-family: var(--mono); font-size: .72rem; text-transform: uppercase; }
.article-meta span::before { content: "·"; margin-right: 1rem; }

.article-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, var(--reading-width));
  justify-content: center;
  gap: clamp(2.5rem, 6vw, 5.5rem);
  align-items: start;
}

.toc { position: sticky; top: 7rem; padding-left: 1rem; border-left: 1px solid var(--line); }
.toc > p { margin: 0 0 .9rem; color: var(--text); font-size: .72rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.toc ol { margin: 0; padding: 0; list-style: none; }
.toc li { margin: .5rem 0; line-height: 1.35; }
.toc li.toc-level-3 { padding-left: .65rem; }
.toc a { color: #707c89; font-size: .7rem; text-decoration: none; transition: color .2s ease; }
.toc a:hover { color: var(--accent); }

.prose { min-width: 0; color: #c4ced8; font-size: 1rem; }
.prose > :first-child { margin-top: 0; }
.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 { position: relative; color: var(--text); letter-spacing: -.035em; line-height: 1.2; scroll-margin-top: 6rem; }
.prose h2 { margin: 3.8rem 0 1rem; padding-top: .8rem; font-size: 2rem; }
.prose h3 { margin: 2.7rem 0 .8rem; font-size: 1.45rem; }
.prose h4 { margin: 2rem 0 .7rem; font-size: 1.15rem; }
.heading-anchor { position: absolute; right: 100%; padding-right: .5rem; color: var(--accent); font-family: var(--mono); font-weight: 400; opacity: 0; text-decoration: none; transition: opacity .2s ease; }
.prose h1:hover .heading-anchor,
.prose h2:hover .heading-anchor,
.prose h3:hover .heading-anchor,
.prose h4:hover .heading-anchor,
.heading-anchor:focus { opacity: 1; }
.prose p { margin: 1rem 0 1.35rem; }
.prose strong { color: #f5f8fb; }
.prose a { color: var(--accent); text-decoration-color: rgba(98, 230, 167, .4); text-underline-offset: .2em; }
.prose a:hover { text-decoration-color: var(--accent); }
.prose ul,
.prose ol { margin: 1.1rem 0 1.5rem; padding-left: 1.5rem; }
.prose li { margin: .4rem 0; padding-left: .25rem; }
.prose li::marker { color: var(--accent); font-family: var(--mono); }
.prose hr { height: 1px; margin: 3.5rem 0; border: 0; background: var(--line); }
.prose blockquote { margin: 2rem 0; padding: .8rem 1.25rem; color: var(--muted-bright); border-left: 3px solid var(--accent); background: linear-gradient(90deg, rgba(98,230,167,.07), transparent); }
.prose blockquote > :first-child { margin-top: 0; }
.prose blockquote > :last-child { margin-bottom: 0; }
.prose img { display: block; max-width: 100%; height: auto; margin: 2rem auto; border: 1px solid var(--line); border-radius: .7rem; }
.prose :not(pre) > code { padding: .17rem .38rem; color: #91efc1; border: 1px solid rgba(98,230,167,.12); border-radius: .3rem; background: #10221c; font-family: var(--mono); font-size: .86em; overflow-wrap: anywhere; }
.code-block { margin: 1.6rem 0 2rem; overflow: hidden; border: 1px solid var(--line); border-radius: .7rem; background: #070a0e; box-shadow: 0 20px 45px rgba(0,0,0,.18); }
.code-toolbar { display: flex; align-items: center; justify-content: space-between; min-height: 2.65rem; padding: 0 .85rem 0 1rem; color: #74808c; border-bottom: 1px solid var(--line-soft); background: #0c1117; font-family: var(--mono); font-size: .68rem; text-transform: lowercase; }
.copy-code { padding: .25rem .45rem; color: #8d99a6; border: 0; border-radius: .3rem; background: transparent; cursor: pointer; font-family: var(--mono); font-size: .67rem; }
.copy-code:hover,
.copy-code:focus-visible { color: var(--accent); background: rgba(98,230,167,.07); }
.code-block pre { margin: 0; padding: 1.15rem 1.3rem 1.3rem; overflow-x: auto; color: #d0d9e2; font-family: var(--mono); font-size: .78rem; line-height: 1.65; tab-size: 2; }
.code-block code { font-family: inherit; }
.table-wrap { margin: 1.8rem 0; overflow-x: auto; border: 1px solid var(--line); border-radius: .6rem; }
.prose table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.prose th,
.prose td { padding: .75rem .9rem; border-bottom: 1px solid var(--line); }
.prose th { color: var(--text); background: #111820; }
.prose tr:last-child td { border-bottom: 0; }
.task-list { padding-left: .25rem !important; list-style: none; }
.task-item input { margin-right: .45rem; accent-color: var(--accent); }

.article-footer { max-width: var(--reading-width); margin: 5rem auto 0; padding: 2.5rem; border: 1px solid var(--line); border-radius: .8rem; background: linear-gradient(135deg, rgba(98,230,167,.08), rgba(17,23,31,.75)); text-align: center; }
.article-footer p { margin: 0 0 1rem; color: var(--muted); font-size: .86rem; }

.not-found { display: grid; min-height: 70vh; place-content: center; text-align: center; }
.not-found .eyebrow { justify-content: center; }
.not-found h1 { margin: 1rem 0 .5rem; font-size: clamp(2.7rem, 7vw, 5.5rem); letter-spacing: -.06em; }
.not-found p { margin: 0 0 2rem; color: var(--muted); }
.not-found .button { margin: auto; }

.site-footer { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 2rem; padding: 2.5rem 0; color: #697582; border-top: 1px solid var(--line-soft); font-size: .75rem; }
.footer-brand { color: var(--text); }
.footer-brand .brand-mark { width: 1.55rem; height: 1.55rem; font-size: .7rem; }
.site-footer p { margin: 0; text-align: center; }
.site-footer p span { margin-left: .7rem; }
.site-footer > a { justify-self: end; color: var(--muted); text-decoration: none; }
.site-footer > a:hover { color: var(--accent); }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease var(--delay, 0ms), transform .7s cubic-bezier(.2,.7,.2,1) var(--delay, 0ms); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 900px) {
  .hero { min-height: auto; padding-bottom: 5rem; }
  .terminal-card { position: relative; right: auto; bottom: auto; width: min(100%, 560px); margin-top: 4rem; transform: none; }
  .article-layout { grid-template-columns: minmax(0, var(--reading-width)); }
  .toc { display: none; }
}

@media (max-width: 680px) {
  .nav-wrap,
  .site-footer,
  .hero,
  .section,
  .article-shell,
  .not-found { width: min(calc(100% - 1.5rem), var(--max-width)); }
  .nav-wrap { min-height: 4.25rem; }
  nav { gap: 1rem; }
  nav a:first-child { display: none; }
  nav .nav-cta { display: none; }
  .hero { padding-top: 4rem; }
  .hero h1 { letter-spacing: -.065em; }
  .hero-actions { align-items: flex-start; flex-direction: column; gap: 1rem; }
  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
  .resume-grid { grid-template-columns: 1fr; }
  .timeline-topline { align-items: flex-start; flex-direction: column; gap: .2rem; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: .8rem; }
  .post-card { grid-template-columns: 34px 1fr; gap: .6rem; padding-inline: .2rem; }
  .post-card:hover { padding-inline: .4rem; }
  .post-meta { flex-wrap: wrap; gap: .4rem; }
  .post-meta span::before { margin-right: .4rem; }
  .article-header { margin-bottom: 3.5rem; }
  .back-link { margin-bottom: 2.5rem; }
  .article-meta { flex-wrap: wrap; }
  .prose h2 { font-size: 1.65rem; }
  .code-block { margin-inline: -.25rem; }
  .site-footer { grid-template-columns: 1fr auto; }
  .site-footer p { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
