/* =================================================================
   MATS HANSEN — PORTFOLIO
   Monokai Pro palette · light text-heavy sections · vanilla CSS
   ================================================================= */

:root {
  /* Monokai Pro */
  --mk-bg:        #2D2A2E;
  --mk-bg-2:      #221F22;
  --mk-bg-3:      #19181A;
  --mk-fg:        #FCFCFA;
  --mk-fg-dim:    #C1C0C0;
  --mk-comment:   #727072;
  --mk-line:      #403E41;
  --mk-red:       #FF6188;
  --mk-orange:    #FC9867;
  --mk-yellow:    #FFD866;
  --mk-green:     #A9DC76;
  --mk-blue:      #78DCE8;
  --mk-purple:    #AB9DF2;

  /* Light surfaces for text-heavy sections */
  --paper:        #FAFAF7;
  --paper-2:      #FFFFFF;
  --ink:          #1F1D20;
  --ink-2:        #3E3B40;
  --ink-3:        #6B676D;
  --rule:         #E6E2DD;
  --page-bg:
    radial-gradient(1200px 680px at 84% -6%, rgba(120, 220, 232, .12), transparent 62%),
    radial-gradient(940px 620px at -10% 18%, rgba(171, 157, 242, .13), transparent 64%),
    radial-gradient(980px 680px at 92% 46%, rgba(169, 220, 118, .07), transparent 68%),
    radial-gradient(900px 620px at 10% 78%, rgba(255, 216, 102, .045), transparent 70%),
    linear-gradient(180deg, #2D2A2E 0%, #2A272C 44%, #2D2A2E 100%);
  --section-bg: transparent;

  /* Layout */
  --max:          1180px;
  --pad:          clamp(1.25rem, 4vw, 2.5rem);
  --section-pad-top: clamp(5rem, 11vh, 7rem);
  --section-pad-bottom: clamp(3rem, 7vw, 5rem);
  --radius:       14px;
  --radius-lg:    20px;

  /* Type */
  --font-sans:    "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "Cascadia Code", Menlo, Consolas, monospace;

  /* Motion */
  --ease:         cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }
*::selection { background: var(--mk-yellow); color: var(--mk-bg); }

html {
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;        /* Firefox */
  -ms-overflow-style: none;     /* old IE/Edge */
  -webkit-overflow-scrolling: touch;
}
html::-webkit-scrollbar,
body::-webkit-scrollbar { display: none; width: 0; height: 0; }

/* Mobile / touch: natural smooth scrolling with the native scrollbar visible */
@media (max-width: 720px), (hover: none) and (pointer: coarse) {
  :root {
    --section-pad-top: 2rem;
    --section-pad-bottom: 1rem;
  }
  html {
    scroll-snap-type: none;
    scrollbar-width: auto;
    -ms-overflow-style: auto;
  }
  body {
    scrollbar-width: auto;
    -ms-overflow-style: auto;
  }
  html::-webkit-scrollbar,
  body::-webkit-scrollbar {
    display: block;
    width: 8px;
    height: 8px;
  }
  html::-webkit-scrollbar-track,
  body::-webkit-scrollbar-track {
    background: var(--mk-bg-3);
  }
  html::-webkit-scrollbar-thumb,
  body::-webkit-scrollbar-thumb {
    background: var(--mk-comment);
    border-radius: 999px;
    border: 2px solid var(--mk-bg-3);
  }
  .section { scroll-snap-align: none; justify-content: flex-start; min-height: 0; }
  .footer { scroll-snap-align: none; }

  /* Tighter spacing across all sections */
  .section__head { margin-bottom: 1.25rem; }
  .section--cv .section__head,
  .section--skills .section__head,
  .section--contact .section__head { margin-bottom: 1rem; }
  .cv-col__title--mt { margin-top: .75rem; }

  /* Compact repo cards */
  .repo-grid { gap: .5rem; }
  .repo { padding: .8rem .9rem; }
  .repo__desc { font-size: .85rem; margin-bottom: .5rem; }
  .repo__topics { margin-bottom: .5rem; gap: .25rem; }
  .repo-more { margin-top: .6rem; }
  .repo-foot { margin-top: .75rem; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; scroll-snap-type: none; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

html, body { margin: 0; padding: 0; min-height: 100%; }
html { background: var(--mk-bg); }
body {
  font-family: var(--font-sans);
  color: var(--mk-fg);
  background-color: var(--mk-bg);
  background: var(--page-bg);
  background-repeat: no-repeat;
  background-size: cover;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  line-height: 1.55;
}

@media (hover: hover) and (pointer: fine) {
  body { background-attachment: fixed; }
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
img, svg { display: block; max-width: 100%; }
code { font-family: var(--font-mono); }

/* ================== LANGUAGE TOGGLE (top-right, sticky) ================== */
.lang-toggle {
  position: fixed;
  top: clamp(.85rem, 2vw, 1.25rem);
  right: clamp(.85rem, 2vw, 1.25rem);
  z-index: 70;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: rgba(34, 31, 34, .82);
  border: 1px solid var(--mk-line);
  border-radius: 999px;
  padding: 3px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .12em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .5);
  transition: background .25s var(--ease), border-color .25s var(--ease);
}
.lang-toggle__btn {
  padding: .35rem .7rem;
  background: transparent;
  border: none;
  color: var(--mk-fg-dim);
  cursor: pointer;
  border-radius: 999px;
  font: inherit;
  letter-spacing: inherit;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.lang-toggle__btn:hover { color: var(--mk-fg); }
.lang-toggle__btn.is-active {
  background: var(--mk-purple);
  color: var(--mk-bg);
  font-weight: 700;
}

/* Adapt for light theme sections (CV, projects) */
body[data-theme="light"] .lang-toggle {
  background: rgba(255, 255, 255, .9);
  border-color: var(--rule);
  box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .15);
}
body[data-theme="light"] .lang-toggle__btn { color: var(--ink-3); }
body[data-theme="light"] .lang-toggle__btn:hover { color: var(--ink); }
body[data-theme="light"] .lang-toggle__btn.is-active {
  background: var(--ink);
  color: var(--mk-fg);
}

@media (max-width: 720px) {
  .lang-toggle { font-size: 10.5px; }
  .lang-toggle__btn { padding: .3rem .55rem; }
}

/* ================== SECTION NAV (right dots) ================== */
.section-nav {
  position: fixed;
  top: 50%;
  right: 1.25rem;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: .9rem;
  z-index: 50;
}
.section-nav .dot {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(252, 252, 250, .35);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .12);
  transition: background .3s var(--ease), transform .3s var(--ease), box-shadow .3s var(--ease);
}
body[data-theme="light"] .section-nav .dot {
  background: rgba(31, 29, 32, .25);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .35);
}
.section-nav .dot.active {
  background: var(--mk-green);
  transform: scale(1.4);
  box-shadow: 0 0 18px rgba(169, 220, 118, .6);
}
body[data-theme="light"] .section-nav .dot.active {
  background: var(--mk-purple);
  box-shadow: 0 0 18px rgba(171, 157, 242, .55);
}
.section-nav .dot::before {
  content: attr(data-label);
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .04em;
  white-space: nowrap;
  background: var(--mk-bg-2);
  color: var(--mk-fg);
  padding: 4px 10px;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.section-nav .dot:hover::before { opacity: 1; transform: translateY(-50%) translateX(-4px); }
@media (max-width: 720px) { .section-nav { display: none; } }

/* ================== SECTION BASE ================== */
.section {
  min-height: 100vh;
  width: 100%;
  padding: var(--section-pad-top) var(--pad) var(--section-pad-bottom);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  scroll-snap-align: start;
  scroll-snap-stop: normal;
  background: transparent;
  color: var(--mk-fg);
}
/* Footer rides along with the contact section's snap point so it's visible there */
.footer { scroll-snap-align: none; }
.section__head {
  width: 100%;
  max-width: var(--max);
  margin-bottom: 3rem;
}
.section__head--center { text-align: center; }
.section__kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--mk-comment);
  margin-bottom: .9rem;
}
.section__title {
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -.02em;
  margin: 0 0 .6rem;
  line-height: 1.05;
}
.section__title--mono { font-family: var(--font-mono); }
.section__lead {
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  color: var(--mk-fg-dim);
  max-width: 60ch;
  margin: 0;
}
.section__head--center .section__lead { margin-inline: auto; }

/* ================== HERO / IDE ================== */
.section--hero {
  min-height: 100vh;
  background: transparent;
  color: var(--mk-fg);
  padding-top: clamp(3rem, 6vw, 5rem);
  gap: clamp(1rem, 3vw, 1.5rem);
}
.ide {
  width: 100%;
  max-width: 1180px;
  background: var(--mk-bg-2);
  border-radius: var(--radius-lg);
  border: 1px solid var(--mk-line);
  box-shadow:
    0 30px 80px -20px rgba(0, 0, 0, .55),
    0 8px 24px -8px rgba(0, 0, 0, .4);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: perspective(1400px) rotateX(2deg);
  transition: transform .8s var(--ease);
}
.ide:hover { transform: perspective(1400px) rotateX(0deg); }

/* ---- Windows-style title bar ---- */
.ide__chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 36px;
  background: #3C3C3C;
  border-bottom: 1px solid #1E1E1E;
  user-select: none;
  -webkit-app-region: drag;
  position: relative;
}
.ide__chrome-left {
  display: flex; align-items: center; gap: 0;
  padding-left: .55rem;
  height: 100%;
}
.ide__app-icon {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  margin-right: .35rem;
}
.ide__menu {
  list-style: none; margin: 0; padding: 0;
  display: flex; align-items: center;
  height: 100%;
  font-size: 12px;
  color: #CCCCCC;
}
.ide__menu li {
  padding: 0 .65rem;
  height: 100%;
  display: flex; align-items: center;
  cursor: default;
  transition: background .15s var(--ease);
}
.ide__menu li:hover { background: #505050; }
@media (max-width: 640px) {
  .ide__menu { display: none; }
}

.ide__title {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-sans);
  font-size: 12px;
  color: #CCCCCC;
  text-align: center;
  letter-spacing: .01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 50%;
  padding: 0 .5rem;
  opacity: .9;
  pointer-events: none;
}

.ide__chrome-right {
  display: flex; height: 100%;
  -webkit-app-region: no-drag;
}
.winbtn {
  width: 46px; height: 100%;
  background: transparent;
  border: none;
  color: #CCCCCC;
  display: grid; place-items: center;
  cursor: pointer;
  transition: background .12s var(--ease), color .12s var(--ease);
}
.winbtn:hover { background: #4F4F4F; }
.winbtn--close:hover { background: #E81123; color: #fff; }

.ide__body {
  display: grid;
  grid-template-columns: 220px 1fr;
  height: clamp(500px, 70vh, 600px);
  min-height: 0;
}

.ide__sidebar {
  background: var(--mk-bg-3);
  border-right: 1px solid var(--mk-line);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--mk-fg-dim);
  display: flex;
  flex-direction: column;
}
.ide__side-head {
  padding: .9rem 1rem .6rem;
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--mk-comment);
}
.tree { list-style: none; margin: 0; padding: 0 .25rem; flex: 1; }
.tree__group > .tree__caret { color: var(--mk-comment); margin-right: .25rem; }
.tree__folder { color: var(--mk-fg); font-weight: 500; }
.tree__group > ul { list-style: none; padding: .25rem 0 .25rem 1.1rem; margin: 0; }
.tree__file {
  padding: .35rem .5rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: .5rem;
  cursor: pointer;
  user-select: none;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.tree__file:hover { background: rgba(255, 255, 255, .04); color: var(--mk-fg); }
.tree__file.active { background: rgba(120, 220, 232, .08); color: var(--mk-fg); }
.tree__icon {
  width: 18px; height: 18px;
  border-radius: 4px;
  font-size: 9px; font-weight: 700;
  display: inline-grid; place-items: center;
  letter-spacing: 0;
  color: var(--mk-bg);
}
.tree__icon--js   { background: var(--mk-yellow); }
.tree__icon--json { background: var(--mk-orange); }
.tree__icon--py   { background: var(--mk-blue); }
.tree__icon--md   { background: var(--mk-green); }
.tree__icon--env  { background: var(--mk-purple); }
.ide__main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--mk-bg);
}

.ide__tabs {
  display: flex;
  background: #252526;
  border-bottom: 1px solid #1E1E1E;
  font-family: var(--font-sans);
  font-size: 12.5px;
  overflow-x: auto;
  scrollbar-width: none;
}
.ide__tabs::-webkit-scrollbar { display: none; }
.tab {
  appearance: none;
  background: #2D2D2D;
  border: none;
  border-right: 1px solid #1E1E1E;
  border-bottom: 1px solid transparent;
  padding: .55rem .9rem;
  display: flex; align-items: center; gap: .5rem;
  color: #969696;
  cursor: pointer;
  white-space: nowrap;
  font: inherit;
  transition: color .15s var(--ease), background .15s var(--ease), border-color .15s var(--ease);
  position: relative;
}
.tab:hover { color: var(--mk-fg-dim); background: #2A2A2A; }
.tab.active {
  background: var(--mk-bg);
  color: var(--mk-fg);
  border-top: 1px solid var(--mk-yellow);
  margin-top: -1px;
}
.tab.active::after {
  content: "";
  position: absolute;
  inset: auto 0 -1px 0;
  height: 1px;
  background: var(--mk-bg);
}
.tab__icon {
  font-size: 9px; font-weight: 700; padding: 2px 4px; border-radius: 3px;
  background: var(--mk-line); color: var(--mk-fg);
  min-width: 18px; text-align: center;
}
.tab__icon--js   { background: var(--mk-yellow); color: var(--mk-bg); }
.tab__icon--json { background: var(--mk-orange); color: var(--mk-bg); }
.tab__icon--py   { background: var(--mk-blue); color: var(--mk-bg); }
.tab__icon--md   { background: var(--mk-green); color: var(--mk-bg); }
.tab__icon--env  { background: var(--mk-purple); color: var(--mk-bg); }
.tab__close {
  color: var(--mk-comment); margin-left: .25rem; font-size: 16px; line-height: 1;
  width: 18px; height: 18px;
  display: grid; place-items: center;
  border-radius: 4px;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.tab__close:hover { background: rgba(255,255,255,.1); color: var(--mk-fg); }
.tab--closed { display: none !important; }

.ide__editor {
  flex: 1 1 0;
  min-height: 0;
  padding: 1rem 1.25rem;
  overflow: auto;
  background: var(--mk-bg);
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: var(--mk-line) transparent;
}
.ide__editor::-webkit-scrollbar { width: 10px; height: 10px; }
.ide__editor::-webkit-scrollbar-track { background: transparent; }
.ide__editor::-webkit-scrollbar-thumb { background: var(--mk-line); border-radius: 5px; border: 2px solid var(--mk-bg); }
.ide__editor::-webkit-scrollbar-thumb:hover { background: var(--mk-comment); }
.code-pane {
  margin: 0;
  font-family: var(--font-mono);
  font-size: clamp(13px, 1.1vw, 15px);
  line-height: 1.85;
  color: var(--mk-fg);
  display: none;
  animation: fadeInCode .25s var(--ease);
}
.code-pane.active { display: block; }
@keyframes fadeInCode {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.code {
  margin: 0;
  font-family: var(--font-mono);
  font-size: clamp(13px, 1.1vw, 15px);
  line-height: 1.85;
  color: var(--mk-fg);
}
.code-pane .ln,
.code .ln {
  display: inline-block;
  width: 2.5ch;
  margin-right: 1rem;
  text-align: right;
  color: var(--mk-comment);
  user-select: none;
}
.code .kw, .code-pane .kw { color: var(--mk-red); }
.code .vr, .code-pane .vr { color: var(--mk-fg); }
.code .pr, .code-pane .pr { color: var(--mk-blue); }
.code .st, .code-pane .st { color: var(--mk-yellow); }
.code .op, .code-pane .op { color: var(--mk-fg-dim); }
.code .br, .code-pane .br { color: var(--mk-purple); }
.code .cm, .code-pane .cm { color: var(--mk-comment); font-style: italic; }
.code .fn, .code-pane .fn { color: var(--mk-green); }
.code .hl, .code-pane .hl { color: var(--mk-orange); }
.code .caret, .code-pane .caret {
  display: inline-block;
  color: var(--mk-yellow);
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.ide__terminal {
  --terminal-panel-h: 110px;
  border-top: 1px solid var(--mk-line);
  background: var(--mk-bg-3);
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.ide__terminal-head {
  display: flex;
  gap: 1rem;
  padding: .55rem 1rem;
  border-bottom: 1px solid var(--mk-line);
}
.term-tab {
  appearance: none;
  background: transparent;
  border: 0;
  font-size: 10.5px;
  letter-spacing: .12em;
  color: var(--mk-comment);
  text-transform: uppercase;
  padding: 0 0 4px;
  border-bottom: 2px solid transparent;
  font-family: var(--font-mono);
  line-height: 1.2;
  cursor: pointer;
  transition: color .15s var(--ease), border-color .15s var(--ease);
}
.term-tab:hover { color: var(--mk-fg-dim); }
.term-tab.active { color: var(--mk-fg); border-bottom-color: var(--mk-green); }
.ide__terminal-body {
  height: var(--terminal-panel-h);
  overflow-y: auto;
  padding: .85rem 1rem 1rem;
}
.ide__terminal-panel { display: none; }
.ide__terminal-panel.active { display: block; }
.term-line {
  color: var(--mk-fg-dim);
  margin-bottom: .15rem;
}
.term-line .prompt { color: var(--mk-green); }
.term-line .path   { color: var(--mk-blue); margin-left: .25rem; }
.term-line .sep    { color: var(--mk-comment); margin-right: .5rem; margin-left: .25rem; }
.term-out { color: var(--mk-yellow); min-height: 1.35em; }
.cursor { display: inline-block; color: var(--mk-yellow); animation: blink 1s steps(2) infinite; }
.output-label,
.problems-summary {
  color: var(--mk-comment);
  font-size: 11px;
  letter-spacing: .08em;
  margin-bottom: .35rem;
  text-transform: uppercase;
}
.problems-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.problems-list li {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: .55rem;
  align-items: baseline;
  color: var(--mk-fg-dim);
  margin-bottom: .25rem;
}
.problem-severity {
  color: var(--mk-green);
  font-weight: 700;
}
.problem-location {
  color: var(--mk-blue);
}

.ide__statusbar {
  display: flex;
  gap: 1.2rem;
  align-items: center;
  padding: .5rem 1rem;
  background: var(--mk-bg-3);
  border-top: 1px solid var(--mk-line);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--mk-fg-dim);
}
.status-spacer { flex: 1; }
.status-branch {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--mk-green);
}
.status-branch svg {
  flex: 0 0 auto;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.hero-scroll-cue {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  color: var(--mk-fg-dim);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .45rem .8rem;
  border-radius: 999px;
  transition: color .2s var(--ease), transform .2s var(--ease);
  animation: scrollCueHop 2.8s var(--ease) infinite;
}
.hero-scroll-cue:hover {
  color: var(--mk-green);
  transform: translateY(2px);
}
.hero-scroll-cue__arrow {
  color: var(--mk-green);
  font-size: 1.25em;
  line-height: 1;
}
@keyframes scrollCueHop {
  0%, 18%, 100% { transform: translateY(0); }
  7% { transform: translateY(7px); }
  12% { transform: translateY(2px); }
}

@media (max-width: 820px) {
  .ide__body { grid-template-columns: 1fr; }
  .ide__sidebar { display: none; }
}
@media (max-width: 720px) {
  .section--hero {
    padding-top: 4.5rem;
    padding-bottom: 2rem;
  }
  .ide {
    border-radius: 12px;
    transform: none;
  }
  .ide:hover { transform: none; }
  .ide__body {
    height: min(68svh, 520px);
  }
  .ide__chrome {
    height: 34px;
  }
  .ide__chrome-left {
    flex: 0 0 auto;
    min-width: 0;
  }
  .ide__app-icon {
    margin-right: .15rem;
  }
  .ide__menu {
    display: none;
  }
  .ide__title {
    position: static;
    transform: none;
    flex: 1 1 auto;
    max-width: none;
    text-align: left;
    padding-inline: .25rem;
  }
  .ide__chrome-right {
    flex: 0 0 auto;
  }
  .winbtn {
    width: 34px;
  }
  .ide__tabs {
    font-size: 11.5px;
  }
  .tab {
    padding: .48rem .65rem;
    gap: .38rem;
  }
  .tab__close {
    margin-left: 0;
  }
  .ide__editor {
    padding: .8rem .75rem;
    overflow-x: hidden;
  }
  .code-pane,
  .code {
    font-size: clamp(10px, 2.65vw, 11.5px);
    line-height: 1.7;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .code-pane .ln,
  .code .ln {
    display: inline-block;
    width: 2ch;
    margin-right: .35rem;
  }
  .ide__terminal {
    --terminal-panel-h: 100px;
    display: block;
    flex: 0 0 auto;
    font-size: 10.5px;
  }
  .ide__terminal-head {
    gap: .7rem;
    padding: .4rem .75rem;
  }
  .term-tab {
    font-size: 9px;
    padding-bottom: 3px;
  }
  .ide__terminal-body {
    padding: .5rem .75rem .6rem;
  }
  .term-line {
    margin-bottom: .08rem;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .term-out {
    min-height: 1.2em;
  }
  .ide__statusbar {
    justify-content: space-between;
    gap: .55rem;
    padding: .45rem .75rem;
    font-size: 10.5px;
  }
  .hero-scroll-cue {
    font-size: 11px;
    padding: .35rem .65rem;
  }
}

/* ================== CV (light) ================== */
.section--cv {
  background: transparent;
  color: var(--mk-fg);
}
.section--cv .section__lead { color: var(--mk-fg-dim); }
.section--cv .section__head {
  margin-bottom: clamp(1rem, 2vw, 1.5rem);
}
.section--cv .section__title {
  font-size: clamp(1.75rem, 3.6vw, 2.6rem);
}
.cv-grid {
  width: 100%;
  max-width: var(--max);
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: clamp(1.5rem, 3.5vw, 3rem);
}
@media (max-width: 880px) { .cv-grid { grid-template-columns: 1fr; } }

.cv-col__title {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -.01em;
  margin: 0 0 .75rem;
  display: flex;
  align-items: center;
  gap: .65rem;
}
.cv-col__title--mt { margin-top: 1.25rem; }
.cv-col__num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--mk-green);
  background: rgba(34, 31, 34, .8);
  border: 1px solid var(--mk-line);
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 500;
  letter-spacing: .08em;
}

.timeline {
  list-style: none;
  margin: 0; padding: 0;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  top: .35rem; bottom: .35rem;
  left: 7px;
  width: 2px;
  background: linear-gradient(180deg, rgba(171, 157, 242, .55), transparent);
}
.timeline__item {
  position: relative;
  padding: 0 0 1rem 1.75rem;
}
.timeline__dot {
  position: absolute;
  left: 0; top: .35rem;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--mk-bg);
  border: 3px solid var(--mk-purple);
  box-shadow: 0 0 0 3px rgba(171, 157, 242, .12);
  transition: transform .3s var(--ease), border-color .3s var(--ease);
}
.timeline__item:hover .timeline__dot { transform: scale(1.2); border-color: var(--mk-orange); }
.timeline__meta {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .08em;
  color: var(--mk-comment);
  text-transform: uppercase;
  margin-bottom: .15rem;
}
.timeline__role {
  font-weight: 600;
  font-size: 1rem;
  color: var(--mk-fg);
  letter-spacing: -.01em;
  line-height: 1.3;
}
.timeline__org {
  color: var(--mk-fg-dim);
  font-size: .9rem;
  margin-top: 1px;
}
.timeline__points {
  margin: .35rem 0 0;
  padding-left: 1rem;
  color: var(--mk-fg-dim);
  font-size: .88rem;
  line-height: 1.45;
}
.timeline__points li { margin-bottom: .1rem; }
.timeline--alt .timeline__dot { border-color: var(--mk-blue); box-shadow: 0 0 0 3px rgba(120, 220, 232, .12); }

.chips {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: .5rem;
}
.chips li {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: .35rem .7rem;
  border: 1px solid var(--mk-line);
  background: rgba(34, 31, 34, .78);
  border-radius: 999px;
  color: var(--mk-fg-dim);
  transition: border-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.chips li:hover { border-color: var(--mk-purple); color: var(--mk-fg); transform: translateY(-1px); }

/* ================== SKILLS / CYBER ================== */
.section--skills {
  background: transparent;
  color: var(--mk-fg);
  overflow: hidden;
}
.section--skills .section__head { margin-bottom: clamp(1rem, 2vw, 1.5rem); }
.section--skills > * { position: relative; z-index: 1; }

.skills-grid {
  width: 100%;
  max-width: var(--max);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: .75rem;
}
.skill-card {
  position: relative;
  padding: .9rem 1rem 1rem;
  background: rgba(34, 31, 34, .8);
  border: 1px solid var(--mk-line);
  border-radius: var(--radius);
  backdrop-filter: blur(4px);
  transition: transform .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease);
}
.skill-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background:
    linear-gradient(135deg, rgba(169,220,118,.4), rgba(120,220,232,.25), rgba(171,157,242,.35)) border-box;
  -webkit-mask:
    linear-gradient(#000 0 0) padding-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  transition: opacity .3s var(--ease);
}
.skill-card:hover { transform: translateY(-4px); border-color: transparent; box-shadow: 0 20px 40px -20px rgba(169,220,118,.3); }
.skill-card:hover::before { opacity: 1; }
.skill-card header { display: flex; align-items: baseline; gap: .55rem; margin-bottom: .35rem; }
.skill-card h3 { font-family: var(--font-mono); font-size: 1rem; margin: 0; color: var(--mk-fg); }
.skill-card__tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--mk-green);
  letter-spacing: .08em;
}
.skill-card p { color: var(--mk-fg-dim); font-size: .85rem; line-height: 1.4; margin: 0 0 .55rem; }
.skill-list { list-style: none; margin: 0; padding: 0; font-family: var(--font-mono); font-size: 12px; }
.skill-list li {
  display: flex; flex-direction: column; gap: .1rem;
  padding: .3rem 0;
  border-bottom: 1px dashed var(--mk-line);
  color: var(--mk-fg-dim);
}
.skill-list li:last-child { border-bottom: 0; }
.skill-list li span {
  font-size: 10px;
  letter-spacing: .08em;
  color: var(--mk-comment);
  text-transform: uppercase;
}
.skill-list li b {
  color: var(--mk-yellow);
  font-weight: 500;
  font-size: 12px;
  line-height: 1.35;
  word-break: break-word;
}

@media (max-width: 1075px) {
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .section--skills .section__head {
    margin-bottom: .85rem;
  }
  .section--skills .section__title {
    font-size: clamp(1.85rem, 9vw, 2.4rem);
  }
  .skills-grid {
    grid-template-columns: 1fr;
    gap: .55rem;
  }
  .skill-card {
    padding: .72rem .8rem .78rem;
    border-radius: 12px;
  }
  .skill-card header {
    gap: .45rem;
    margin-bottom: .25rem;
  }
  .skill-card h3 {
    font-size: .92rem;
  }
  .skill-card__tag {
    font-size: 10px;
  }
  .skill-card p {
    font-size: .78rem;
    line-height: 1.32;
    margin-bottom: .35rem;
  }
  .skill-list {
    font-size: 11px;
  }
  .skill-list li {
    gap: .05rem;
    padding: .22rem 0;
  }
  .skill-list li span {
    font-size: 9px;
  }
  .skill-list li b {
    font-size: 11px;
    line-height: 1.25;
  }
}

@media (max-width: 380px) {
  .skill-card {
    padding: .65rem .72rem .7rem;
  }
  .skill-card p {
    font-size: .76rem;
  }
}

/* ================== PROJECTS (GitHub-ish) ================== */
.section--projects {
  background: transparent;
  color: var(--mk-fg);
}
.repo-grid {
  width: 100%;
  max-width: var(--max);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1rem;
}
.repo {
  position: relative;
  display: flex; flex-direction: column;
  padding: 1.25rem;
  background: rgba(34, 31, 34, .82);
  border: 1px solid var(--mk-line);
  border-radius: var(--radius);
  transition: border-color .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease);
}
.repo:hover {
  border-color: var(--mk-green);
  transform: translateY(-3px);
  box-shadow: 0 20px 44px -24px rgba(169, 220, 118, .28);
}
.repo__head {
  display: flex; align-items: center; gap: .55rem;
  margin-bottom: .35rem;
}
.repo__icon {
  width: 18px; height: 18px;
  color: var(--mk-fg-dim);
  flex: 0 0 auto;
}
.repo__name {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1rem;
  color: var(--mk-blue);
}
.repo:hover .repo__name { text-decoration: underline; }
.repo__visibility {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--mk-line);
  color: var(--mk-comment);
  margin-left: auto;
  text-transform: lowercase;
  letter-spacing: .04em;
}
.repo__desc {
  color: var(--mk-fg-dim);
  font-size: .92rem;
  margin: 0 0 1rem;
  flex: 1;
}
.repo__topics {
  list-style: none;
  display: flex; flex-wrap: wrap; gap: .35rem;
  margin: 0 0 .9rem; padding: 0;
}
.repo__topics li {
  font-family: var(--font-mono);
  font-size: 11px;
  background: rgba(120, 220, 232, .12);
  color: var(--mk-blue);
  padding: 2px 8px;
  border-radius: 999px;
}
.repo__foot {
  display: flex; align-items: center; gap: 1rem;
  font-size: 12px; color: var(--mk-comment);
  font-family: var(--font-mono);
}
.repo__lang { display: flex; align-items: center; gap: .35rem; }
.lang-dot {
  width: 10px; height: 10px; border-radius: 50%;
  display: inline-block;
}
.repo__stat { display: inline-flex; align-items: center; gap: .25rem; }
.repo__stat svg { width: 14px; height: 14px; }
.repo__updated { margin-left: auto; font-size: 11px; color: var(--mk-comment); }
.repo-more {
  margin-top: 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .65rem 1rem;
  border: 1px solid var(--mk-line);
  border-radius: 999px;
  background: rgba(34, 31, 34, .82);
  color: var(--mk-fg);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  box-shadow: 0 8px 20px -16px rgba(0, 0, 0, .55);
  transition: border-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
.repo-more:hover {
  border-color: var(--mk-green);
  color: var(--mk-green);
  transform: translateY(-1px);
  box-shadow: 0 14px 28px -20px rgba(0, 0, 0, .35);
}
.repo-more[hidden] { display: none; }
.repo-more__hide { display: none; }
.repo-more.is-expanded .repo-more__show,
.repo-more.is-expanded .repo-more__count { display: none; }
.repo-more.is-expanded .repo-more__hide { display: inline; }
.repo-more__count {
  color: var(--mk-green);
}
.repo-foot {
  margin-top: 2.25rem;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--mk-fg-dim);
}
.repo-foot a { color: var(--mk-green); border-bottom: 1px dashed var(--mk-green); }
.repo-foot a:hover { color: var(--mk-orange); border-color: var(--mk-orange); }

/* ================== CONTACT / EMAIL ================== */
:root { --footer-h: 92px; }
@media (max-width: 720px) {
  :root { --footer-h: 168px; }
}
.section--contact {
  background: transparent;
  color: var(--mk-fg);
  min-height: calc(100vh - var(--footer-h));
  scroll-snap-align: start;
}
.section--contact .section__head {
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

/* Email window */
.mailwin {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  background: var(--mk-bg-2);
  border: 1px solid var(--mk-line);
  border-radius: var(--radius);
  box-shadow:
    0 30px 80px -20px rgba(0, 0, 0, .55),
    0 8px 24px -8px rgba(0, 0, 0, .35);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.mailwin__chrome {
  display: flex; align-items: center; justify-content: space-between;
  height: 36px;
  background: #3C3C3C;
  border-bottom: 1px solid #1E1E1E;
}
.mailwin__chrome-left {
  display: flex; align-items: center; gap: .55rem;
  padding: 0 .9rem;
  font-size: 12.5px;
  color: #CCCCCC;
  font-family: var(--font-sans);
  letter-spacing: .01em;
}
.mailwin__chrome-right {
  display: flex; height: 100%;
}

/* Form rows */
.mailwin__form {
  display: flex; flex-direction: column;
  background: var(--mk-bg);
  color: var(--mk-fg);
}
.mailwin__row {
  display: flex; align-items: center;
  gap: .85rem;
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--mk-line);
}
.mailwin__row--body {
  flex: 1;
  align-items: stretch;
  padding: .85rem 1rem;
}
.mailwin__lbl {
  flex: 0 0 56px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--mk-comment);
}

/* Recipient chip */
.mailwin__chip {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .25rem .7rem .25rem .25rem;
  background: rgba(120, 220, 232, .08);
  border: 1px solid rgba(120, 220, 232, .25);
  border-radius: 999px;
}
.mailwin__avatar {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--mk-blue);
  color: var(--mk-bg);
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
}
.mailwin__chip-name {
  font-size: 13px;
  color: var(--mk-fg);
}

/* Inputs */
.mailwin__row input,
.mailwin__row textarea {
  flex: 1;
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--mk-fg);
  font: inherit;
  font-size: 14px;
  resize: none;
}
.mailwin__row input::placeholder,
.mailwin__row textarea::placeholder {
  color: var(--mk-comment);
}
.mailwin__row--body textarea {
  flex: 1;
  min-height: 150px;
  font-family: var(--font-sans);
  line-height: 1.55;
}

/* Footer with send button */
.mailwin__foot {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem;
  padding: .75rem 1rem;
  background: var(--mk-bg-2);
  border-top: 1px solid var(--mk-line);
  flex-wrap: wrap;
}
.mailwin__hint {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--mk-comment);
}
.mailwin__actions {
  display: flex; align-items: center; gap: .5rem;
}
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .55rem 1.2rem;
  border: none; border-radius: 6px;
  background: var(--mk-yellow);
  color: var(--mk-bg);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  cursor: pointer;
  box-shadow: 0 4px 12px -4px rgba(0, 0, 0, .35);
  transition: transform .15s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease), color .2s var(--ease);
}
.btn:hover {
  transform: translateY(-1px);
  background: var(--mk-green);
  box-shadow: 0 10px 24px -10px rgba(169, 220, 118, .55);
}
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn--send svg { transition: transform .25s var(--ease); }
.btn--send:hover svg { transform: translateX(3px) rotate(-8deg); }

@media (max-width: 520px) {
  .mailwin__lbl { flex-basis: 44px; font-size: 10px; }
  .mailwin__row { padding: .55rem .8rem; }
  .mailwin__row--body { padding: .7rem .8rem; }
  .mailwin__row--body textarea { min-height: 110px; }
  .mailwin__foot { padding: .65rem .8rem; }
}

/* ================== FOOTER ================== */
.footer {
  background: transparent;
  color: var(--mk-fg);
  border-top: 1px solid var(--mk-line);
  padding: 0 var(--pad);
  min-height: var(--footer-h);
  display: flex;
  align-items: center;
}
.footer__inner {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.5rem;
}
.footer__brand    { justify-self: start; }
.footer__social   { justify-self: center; }
.footer__legal    { justify-self: end; }
@media (max-width: 720px) {
  .footer__inner { grid-template-columns: 1fr; text-align: center; gap: .75rem; }
  .footer__brand, .footer__social, .footer__legal { justify-self: center; }
  .footer__brand, .footer__legal { justify-content: center; }
}

.footer__brand { display: flex; align-items: center; gap: .8rem; }
.footer__mark {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: var(--mk-bg);
  color: var(--mk-green);
  border: 1px solid var(--mk-line);
  border-radius: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 18px;
}
.footer__name { font-weight: 600; letter-spacing: -.01em; }
.footer__tag { color: var(--mk-comment); font-size: 12px; font-family: var(--font-mono); }

.footer__social { display: flex; justify-content: center; gap: .6rem; }
.footer__social a {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--mk-bg);
  border: 1px solid var(--mk-line);
  color: var(--mk-fg-dim);
  transition: transform .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.footer__social a:hover {
  transform: translateY(-3px) scale(1.05);
  color: var(--mk-bg);
  border-color: transparent;
  box-shadow: 0 12px 24px -10px rgba(0,0,0,.5);
}
.footer__social a:nth-child(1):hover { background: #0A66C2; color: #fff; }
.footer__social a:nth-child(2):hover { background: var(--mk-fg); color: var(--mk-bg); }
.footer__social a:nth-child(3):hover { background: var(--mk-yellow); }

.footer__legal {
  display: flex; align-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--mk-comment);
}

/* ================== REVEAL ANIMATIONS ================== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* Stagger the timeline items */
.timeline__item.reveal { transition-delay: calc(var(--i, 0) * 80ms); }

/* ================== UTILS ================== */
.section--cv code,
.section--projects code {
  font-size: .9em;
  background: rgba(25, 24, 26, .82);
  border: 1px solid var(--mk-line);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--mk-yellow);
}
