@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=Space+Grotesk:wght@400;500;600;700&display=swap");

:root {
  --ink: #10170f;
  --deep: #172016;
  --lcd: #98ad57;
  --lcd-bright: #b8c96f;
  --lcd-muted: #7a8d45;
  --paper: #d8e0b1;
  --line: rgba(16, 23, 15, 0.26);
  --sweden-blue: #006aa7;
  --sweden-yellow: #fecc02;
  --mono: "IBM Plex Mono", "Courier New", monospace;
  --display: "Space Grotesk", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--lcd);
  font-family: var(--display);
  font-size: 1rem;
  line-height: 1.55;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  opacity: 0.13;
  background-image:
    linear-gradient(rgba(16, 23, 15, 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 23, 15, 0.28) 1px, transparent 1px);
  background-size: 4px 4px;
  mix-blend-mode: multiply;
}

::selection { color: var(--lcd-bright); background: var(--ink); }

a { color: inherit; }

.signal-noise {
  position: fixed;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  background: linear-gradient(transparent 49%, rgba(16, 23, 15, 0.045) 50%);
  background-size: 100% 6px;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  padding: 0 clamp(20px, 4vw, 64px);
  color: var(--lcd-bright);
  background: rgba(16, 23, 15, 0.94);
  border-bottom: 1px solid rgba(199, 224, 103, 0.35);
  backdrop-filter: blur(12px);
}

.topbar::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -1px;
  width: 88px;
  height: 3px;
  background: linear-gradient(90deg, var(--sweden-blue) 0 44%, var(--sweden-yellow) 44% 56%, var(--sweden-blue) 56% 100%);
  transform: translateX(-50%);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font: 600 0.85rem/1 var(--mono);
  letter-spacing: 0.12em;
}

.wordmark-mark {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  color: var(--ink);
  background: var(--lcd-bright);
  border-radius: 3px;
  font-size: 1.05rem;
}

.status {
  display: flex;
  align-items: center;
  gap: 12px;
  font: 500 0.75rem/1 var(--mono);
  letter-spacing: 0.16em;
}

.sweden-flag {
  position: relative;
  display: inline-block;
  width: 22px;
  height: 14px;
  flex: 0 0 auto;
  overflow: hidden;
  background: var(--sweden-blue);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3);
}

.sweden-flag::before,
.sweden-flag::after {
  content: "";
  position: absolute;
  background: var(--sweden-yellow);
}

.sweden-flag::before { left: 7px; top: 0; width: 3px; height: 100%; }
.sweden-flag::after { left: 0; top: 5px; width: 100%; height: 3px; }

.nerd-toggle {
  margin-left: 8px;
  padding: 8px 10px;
  color: var(--lcd-bright);
  background: transparent;
  border: 1px solid rgba(199, 224, 103, 0.55);
  border-radius: 2px;
  font: 500 0.65rem/1 var(--mono);
  letter-spacing: 0.08em;
  cursor: pointer;
}

.nerd-toggle:hover, .nerd-toggle:focus-visible { color: var(--ink); background: var(--lcd-bright); outline: none; }

.signal-bars { display: flex; align-items: flex-end; gap: 2px; height: 15px; }
.signal-bars i { display: block; width: 3px; background: var(--lcd-bright); }
.signal-bars i:nth-child(1) { height: 4px; }
.signal-bars i:nth-child(2) { height: 7px; }
.signal-bars i:nth-child(3) { height: 11px; }
.signal-bars i:nth-child(4) { height: 15px; animation: signal 2.4s steps(2) infinite; }

.screen {
  min-height: 82svh;
  padding: 108px clamp(20px, 7vw, 110px) 52px;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(230px, 0.7fr);
  align-items: center;
  gap: clamp(40px, 7vw, 120px);
  max-width: 1500px;
  margin: 0 auto;
  min-height: 78svh;
}

.eyebrow {
  margin: 0 0 24px;
  font: 600 0.75rem/1.4 var(--mono);
  letter-spacing: 0.16em;
}

.eyebrow::before { content: "[ "; }
.eyebrow::after { content: " ]"; }

h1, h2, h3, p { margin-top: 0; }

h1 {
  max-width: 890px;
  margin-bottom: 28px;
  font-size: clamp(3.2rem, 6.3vw, 6.6rem);
  line-height: 0.92;
  letter-spacing: -0.07em;
  font-weight: 600;
}

h1 span,
.contact h2 span { color: var(--paper); text-shadow: 2px 2px 0 var(--ink); }

.intro {
  max-width: 720px;
  margin-bottom: 36px;
  font-size: clamp(1.04rem, 1.4vw, 1.28rem);
  line-height: 1.6;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.key {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 52px;
  padding: 0 22px;
  gap: 9px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  box-shadow: 4px 4px 0 var(--ink);
  font: 600 0.78rem/1 var(--mono);
  letter-spacing: 0.08em;
  text-decoration: none;
  transition: transform 150ms ease, box-shadow 150ms ease, color 150ms ease, background 150ms ease;
}

.key span { opacity: 0.62; }
.key-primary { color: var(--lcd-bright); background: var(--ink); }
.key:hover, .key:focus-visible { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.key:focus-visible { outline: 3px solid var(--paper); outline-offset: 4px; }

.profile-card {
  position: relative;
  justify-self: end;
  width: min(100%, 330px);
  transform: rotate(1.5deg);
}

.portrait-frame {
  position: relative;
  aspect-ratio: 0.96;
  overflow: hidden;
  background: var(--deep);
  border: 3px solid var(--ink);
  box-shadow: 12px 12px 0 rgba(16, 23, 15, 0.25);
}

.portrait-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 55%, rgba(168, 198, 75, 0.18));
}

.portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  image-rendering: pixelated;
  filter: saturate(0) sepia(0.15) contrast(1.1);
}

.focus-corner { position: absolute; z-index: 2; width: 22px; height: 22px; }
.corner-a { top: 10px; left: 10px; border-top: 2px solid var(--sweden-yellow); border-left: 2px solid var(--sweden-yellow); }
.corner-b { right: 10px; bottom: 10px; border-right: 2px solid var(--sweden-blue); border-bottom: 2px solid var(--sweden-blue); }

.profile-meta {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 16px;
  margin: -2px 10px 0;
  padding: 16px;
  color: var(--lcd-bright);
  background: var(--ink);
  font: 500 0.68rem/1.3 var(--mono);
  letter-spacing: 0.08em;
}

.profile-meta strong { grid-column: 1 / -1; font-size: 1.1rem; letter-spacing: 0.04em; }

.scroll-prompt {
  position: absolute;
  left: clamp(20px, 7vw, 110px);
  bottom: 26px;
  display: flex;
  align-items: center;
  gap: 12px;
  font: 500 0.67rem/1 var(--mono);
  letter-spacing: 0.12em;
}

.scroll-prompt i { display: block; width: 48px; height: 1px; background: var(--ink); animation: scan 1.8s ease-in-out infinite; transform-origin: left; }

.section {
  display: grid;
  grid-template-columns: 125px minmax(0, 1fr);
  gap: clamp(26px, 4vw, 64px);
  padding: clamp(54px, 6vw, 88px) clamp(20px, 7vw, 110px);
  border-top: 2px solid var(--ink);
}

.section-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-family: var(--mono);
}

.section-label span {
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 28px;
  color: var(--lcd-bright);
  background: var(--ink);
  font-size: 0.7rem;
}

.section-label p { margin: 5px 0 0; font-size: 0.68rem; line-height: 1.4; letter-spacing: 0.12em; }
.section-content { min-width: 0; }

h2 {
  max-width: 980px;
  margin-bottom: clamp(28px, 4vw, 48px);
  font-size: clamp(2.3rem, 4.6vw, 5.1rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
  font-weight: 600;
}

h2 em { color: var(--paper); font-style: normal; }

.section.manifesto { display: none; background: var(--deep); color: var(--lcd-bright); }
.manifesto .section-label span { color: var(--ink); background: var(--lcd-bright); }

.manifesto-grid {
  display: grid;
  grid-template-columns: 1fr 0.75fr;
  gap: clamp(30px, 6vw, 90px);
  align-items: end;
}

.manifesto-grid p { margin-bottom: 0; }
.large-copy { color: var(--paper); font-size: clamp(1.35rem, 2.5vw, 2.3rem); line-height: 1.32; letter-spacing: -0.025em; }

.capabilities { background: var(--paper); }
.capability-list { border-top: 2px solid var(--ink); }

.capability-list article {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.cap-index {
  font: 600 2.1rem/1 var(--mono);
  transition: transform 180ms ease;
}

.capability-list article:hover .cap-index { transform: translateX(10px); }
.capability-list h3 { margin: 0 0 8px; font-size: clamp(1.35rem, 2.4vw, 2.2rem); letter-spacing: -0.035em; }
.capability-list p { max-width: 720px; margin-bottom: 0; font-size: 1.03rem; }

.work { color: var(--lcd-bright); background: var(--ink); }
.work .section-label span { color: var(--ink); background: var(--lcd-bright); }

.section-heading-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 30px;
  margin-bottom: clamp(28px, 4vw, 48px);
}

.section-heading-row h2 { max-width: 780px; margin: 0; }
.section-heading-row > p { width: 170px; margin: 0 0 8px; font: 500 0.7rem/1.5 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; }

.timeline { border-top: 1px solid rgba(199, 224, 103, 0.35); }
.work-item { display: grid; grid-template-columns: 58px minmax(150px, 0.42fr) 1fr; gap: 20px; padding: 21px 0; border-bottom: 1px solid rgba(199, 224, 103, 0.25); }
.work-marker span { display: grid; place-items: center; width: 35px; height: 35px; border: 1px solid var(--lcd-bright); border-radius: 50%; font: 500 0.68rem/1 var(--mono); }
.work-company p { margin: 0 0 6px; font: 600 0.86rem/1.2 var(--mono); letter-spacing: 0.04em; }
.work-company span, .product-card span { color: var(--lcd-muted); font: 500 0.66rem/1.3 var(--mono); letter-spacing: 0.1em; }
.work-detail h3 { margin: 0 0 8px; color: var(--paper); font-size: clamp(1.25rem, 2.2vw, 1.9rem); }
.work-detail p { max-width: 650px; margin-bottom: 0; color: rgba(226, 237, 184, 0.75); }

.toolkit { background: var(--lcd); }
.toolkit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(25px, 5vw, 70px); }
.code-panel { color: var(--lcd-bright); background: var(--ink); border: 2px solid var(--ink); box-shadow: 10px 10px 0 rgba(16, 23, 15, 0.22); }
.panel-bar { display: flex; justify-content: space-between; padding: 11px 15px; color: var(--ink); background: var(--lcd-bright); font: 600 0.7rem/1 var(--mono); letter-spacing: 0.08em; }
.code-panel ul, .skill-panel ul { list-style: none; margin: 0; padding: 0; }
.code-panel li { display: flex; align-items: center; gap: 20px; padding: 13px 18px; border-bottom: 1px solid rgba(199, 224, 103, 0.22); font-family: var(--mono); }
.code-panel li:last-child { border-bottom: 0; }
.code-panel li span { color: var(--lcd-muted); font-size: 0.7rem; }
.code-panel strong { font-size: 1.05rem; font-weight: 500; }
.skill-panel { display: flex; flex-direction: column; }
.skill-panel li { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: clamp(1.02rem, 1.5vw, 1.22rem); }
.skill-panel li::before { content: ">"; margin-right: 14px; font-family: var(--mono); }
.meter { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; margin-top: auto; padding-top: 32px; font: 600 0.62rem/1 var(--mono); letter-spacing: 0.08em; }
.meter i { height: 8px; background: repeating-linear-gradient(90deg, var(--ink) 0 10px, transparent 10px 13px); }

.products { color: var(--lcd-bright); background: var(--deep); }
.products .section-label span { color: var(--ink); background: var(--lcd-bright); }
.product-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.product-card { position: relative; display: flex; min-height: 225px; padding: 25px; color: var(--lcd-bright); border: 2px solid var(--lcd-bright); text-decoration: none; overflow: hidden; transition: transform 180ms ease, box-shadow 180ms ease; }
.product-card > div:last-child { align-self: flex-end; position: relative; z-index: 1; }
.product-card::after { content: "↗"; position: absolute; top: 3px; right: 20px; font-size: 7rem; line-height: 1; opacity: 0.09; transition: transform 220ms ease; }
.product-card:hover, .product-card:focus-visible { transform: translateY(-7px); box-shadow: 0 9px 0 var(--lcd-muted); }
.product-card:hover::after { transform: translate(8px, -8px); }
.product-card:focus-visible { outline: 3px solid var(--paper); outline-offset: 4px; }
.product-card.archived { cursor: default; }
.product-card.archived::after { content: "//"; }
.product-card.archived:hover { transform: none; box-shadow: none; }
.product-card.archived:hover::after { transform: none; }
.product-card.inverted { color: var(--ink); background: var(--lcd-bright); }
.product-card.inverted span { color: rgba(16, 23, 15, 0.65); }
.product-number { position: absolute; top: 25px; left: 30px; font: 500 0.7rem/1 var(--mono); }
.product-card h3 { margin: 9px 0 8px; font-size: clamp(2rem, 3.2vw, 3.3rem); letter-spacing: -0.055em; }
.product-card p { max-width: 440px; margin-bottom: 0; }

.contact { display: flex; min-height: 64svh; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--ink); background: var(--lcd); }
.contact h2 { margin-bottom: 28px; }
.contact > p:not(.eyebrow) { max-width: 680px; margin-bottom: 36px; font-size: 1.1rem; }

.offclock { color: var(--ink); background: var(--paper); }
.offclock-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.offclock-grid article { position: relative; min-height: 220px; padding: 28px; border: 2px solid var(--ink); overflow: hidden; }
.offclock-grid article:nth-child(2) { color: var(--lcd-bright); background: var(--ink); }
.offclock-grid h3 { margin: 34px 0 8px; font-size: clamp(2rem, 3.2vw, 3.3rem); line-height: 0.95; letter-spacing: -0.055em; }
.offclock-grid article > p:last-child { max-width: 500px; margin-bottom: 0; }
.pixel-icon { position: absolute; top: 22px; right: 28px; font: 500 2.5rem/1 var(--mono); filter: grayscale(1); }

.nerd-console {
  position: fixed;
  right: clamp(14px, 3vw, 40px);
  bottom: clamp(14px, 3vw, 40px);
  z-index: 50;
  width: min(560px, calc(100vw - 28px));
  color: var(--lcd-bright);
  background: rgba(16, 23, 15, 0.98);
  border: 2px solid var(--lcd-bright);
  box-shadow: 10px 10px 0 rgba(16, 23, 15, 0.3);
  font: 500 0.78rem/1.55 var(--mono);
  transform: translateY(calc(100% + 60px));
  visibility: hidden;
  transition: transform 220ms steps(4), visibility 220ms;
}

.nerd-console.is-open { transform: translateY(0); visibility: visible; }
.console-bar { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; color: var(--ink); background: var(--lcd-bright); font-weight: 600; letter-spacing: 0.06em; }
.console-bar button { padding: 0; color: var(--ink); background: none; border: 0; font: 600 1.2rem/1 var(--mono); cursor: pointer; }
.console-body { padding: 18px; }
.console-body p { margin: 0 0 7px; }
.console-body p > span { color: var(--paper); }
.console-output { padding-left: 18px; color: rgba(226, 237, 184, 0.75); }
.cursor-line i { display: inline-block; width: 8px; height: 14px; margin-left: 5px; vertical-align: -2px; background: var(--lcd-bright); animation: blink 900ms steps(1) infinite; }

.nerd-mode::before { opacity: 0.24; background-size: 3px 3px; }
.nerd-mode .wordmark-mark { box-shadow: 0 0 16px rgba(199, 224, 103, 0.7); }

footer { display: flex; justify-content: space-between; gap: 24px; padding: 24px clamp(20px, 4vw, 64px); color: var(--lcd-bright); background: var(--ink); font: 500 0.68rem/1.3 var(--mono); letter-spacing: 0.08em; }
footer a { text-decoration: none; }
footer p { margin: 0; }

@keyframes signal { 0%, 45% { opacity: 1; } 46%, 70% { opacity: 0.2; } 71%, 100% { opacity: 1; } }
@keyframes scan { 0%, 100% { transform: scaleX(0.3); } 50% { transform: scaleX(1); } }
@keyframes blink { 0%, 48% { opacity: 1; } 49%, 100% { opacity: 0; } }

@media (min-width: 901px) {
  main {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .hero {
    grid-column: 1 / -1;
    width: 100%;
  }

  .manifesto { display: none; }

  .section,
  .contact {
    display: block;
    min-height: 0;
    padding: clamp(42px, 4vw, 64px);
  }

  .section-label { margin-bottom: 34px; }

  .section h2,
  .contact h2 {
    margin-bottom: 32px;
    font-size: clamp(2.5rem, 3.6vw, 4rem);
  }

  .section-heading-row {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 32px;
  }

  .section-heading-row > p { width: min(100%, 460px); }

  .capability-list article {
    grid-template-columns: 48px 1fr;
    padding: 16px 0;
  }

  .cap-index { font-size: 1.6rem; }
  .capability-list h3 { font-size: clamp(1.25rem, 1.6vw, 1.7rem); }
  .capability-list p { font-size: 0.95rem; }

  .work-item {
    grid-template-columns: 44px 145px 1fr;
    gap: 14px;
    padding: 16px 0;
  }

  .work-marker span { width: 31px; height: 31px; }
  .work-detail h3 { font-size: clamp(1.1rem, 1.45vw, 1.5rem); }
  .work-detail p { font-size: 0.9rem; }
  .work-company p { font-size: 0.75rem; }

  .toolkit-grid { grid-template-columns: 0.85fr 1.15fr; gap: 28px; }

  .product-grid,
  .offclock-grid { grid-template-columns: 1fr 1fr; }

  .product-card,
  .offclock-grid article { min-height: 190px; padding: 22px; }

  .product-card h3,
  .offclock-grid h3 { font-size: clamp(1.8rem, 2.5vw, 2.8rem); }

  .offclock-grid h3 { margin-top: 24px; }
  .product-card p,
  .offclock-grid article > p:last-child { font-size: 0.91rem; line-height: 1.45; }

  .contact {
    min-height: 0;
    border-top: 2px solid var(--ink);
  }

  .contact > p:not(.eyebrow) { margin-bottom: 26px; font-size: 1rem; }
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 118px; padding-bottom: 100px; }
  .hero-copy { max-width: 760px; }
  .profile-card { position: absolute; right: clamp(20px, 7vw, 110px); bottom: 70px; width: 170px; opacity: 0.9; }
  .profile-meta { display: none; }
  .section { grid-template-columns: 1fr; gap: 40px; }
  .section-label { position: relative; }
  .manifesto-grid { grid-template-columns: 1fr; gap: 30px; }
  .toolkit-grid { grid-template-columns: 1fr; }
  .offclock-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .topbar { height: 62px; }
  .status span:last-child { display: none; }
  .nerd-toggle { margin-left: 0; padding: 7px 8px; font-size: 0.58rem; }
  .screen { padding-top: 100px; }
  h1 { font-size: clamp(3rem, 15vw, 4.8rem); }
  .intro { max-width: 95%; }
  .hero { min-height: auto; }
  .hero-actions { padding-bottom: 205px; }
  .profile-card { left: 24px; right: auto; bottom: 58px; width: 150px; transform: rotate(-1.5deg); }
  .scroll-prompt { left: auto; right: 24px; bottom: 40px; flex-direction: column; }
  .scroll-prompt i { width: 36px; }
  .section { padding-top: 56px; padding-bottom: 56px; }
  .section-heading-row { align-items: flex-start; flex-direction: column; }
  .section-heading-row > p { width: auto; }
  .work-item { grid-template-columns: 48px 1fr; }
  .work-detail { grid-column: 2; }
  .product-grid { grid-template-columns: 1fr; }
  .product-card { min-height: 220px; }
  footer { flex-wrap: wrap; }
  footer p:nth-child(2) { order: 3; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
