/* =========================================================
   Victor Mose — Portfolio
   Design tokens
   ========================================================= */
:root {
  /* Color */
  --bg: #0d121c;
  --bg-raised: #131a27;
  --bg-raised-2: #1a2333;
  --line: rgba(237, 239, 243, 0.09);
  --line-strong: rgba(237, 239, 243, 0.16);
  --ink: #edeff3;
  --ink-dim: #8f9bb3;
  --ink-faint: #5c6680;
  --teal: #3fe0cb;
  --teal-dim: #2a9d8f;
  --amber: #f0a857;

  /* Type */
  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "JetBrains Mono", monospace;

  /* Layout */
  --max-width: 112rem;
  --gutter: 2.4rem;
  --radius-s: 0.6rem;
  --radius-m: 1rem;
  --radius-l: 1.6rem;
}

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

html {
  font-size: 62.5%; /* 1rem = 10px */
  scroll-behavior: smooth;
}

@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;
    scroll-behavior: auto !important;
  }
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.6rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

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

ul {
  list-style: none;
}

button {
  font: inherit;
  cursor: pointer;
}

::selection {
  background: var(--teal);
  color: var(--bg);
}

::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-raised-2);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--teal-dim);
}

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Background grid texture — faint, fixed, sits behind everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 10%, transparent 75%);
  opacity: 0.5;
}

/* =========================================================
   Layout helpers
   ========================================================= */
.wrap {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  font-family: var(--font-mono);
  font-size: 1.2rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 1.6rem;
}

.eyebrow::before {
  content: "";
  width: 0.8rem;
  height: 0.8rem;
  border: 1.5px solid var(--teal);
  border-radius: 2px;
  transform: rotate(45deg);
  flex-shrink: 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 5.6rem;
  flex-wrap: wrap;
}

.section-title {
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.section-index {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  color: var(--ink-faint);
}

section {
  padding: 12rem 0;
  position: relative;
}

@media (max-width: 56.25em) {
  section {
    padding: 8rem 0;
  }
  .section-title {
    font-size: 3.2rem;
  }
}

/* Reveal-on-scroll */
.reveal {
  opacity: 0;
  transform: translateY(2.4rem);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-stagger.is-visible > * {
  transition-delay: calc(var(--i, 0) * 90ms);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  font-family: var(--font-mono);
  font-size: 1.4rem;
  letter-spacing: 0.02em;
  padding: 1.3rem 2.2rem;
  border-radius: var(--radius-s);
  border: 1px solid var(--line-strong);
  transition: border-color 0.25s ease, transform 0.25s ease, background 0.25s ease;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn--primary {
  background: var(--teal);
  color: #08110f;
  border-color: var(--teal);
  font-weight: 600;
}
.btn--primary:hover {
  background: #59e9d6;
  border-color: #59e9d6;
}

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

.btn svg {
  width: 1.4rem;
  height: 1.4rem;
}

/* =========================================================
   Nav
   ========================================================= */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 2rem 0;
  transition: padding 0.3s ease, background 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
}

.nav.is-scrolled {
  padding: 1.4rem 0;
  background: rgba(13, 18, 28, 0.82);
  backdrop-filter: blur(12px);
  border-bottom-color: var(--line);
}

.nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__mark {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.nav__mark .dot {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 3px rgba(63, 224, 203, 0.18);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 3.6rem;
  font-family: var(--font-mono);
  font-size: 1.3rem;
}

.nav__links a {
  color: var(--ink-dim);
  position: relative;
  padding-bottom: 0.4rem;
  transition: color 0.25s ease;
}
.nav__links a:hover,
.nav__links a.is-active {
  color: var(--ink);
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1.5px;
  background: var(--teal);
  transition: width 0.25s ease;
}
.nav__links a:hover::after,
.nav__links a.is-active::after {
  width: 100%;
}

.nav__resume-mobile {
  display: none;
}

.nav__resume {
  border: 1px solid var(--line-strong);
  padding: 0.8rem 1.6rem;
  border-radius: var(--radius-s);
  transition: border-color 0.25s ease, color 0.25s ease;
}
.nav__resume:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.nav__toggle {
  display: none;
  background: none;
  border: none;
  color: var(--ink);
  width: 3.6rem;
  height: 3.6rem;
  align-items: center;
  justify-content: center;
}
.nav__toggle svg {
  width: 2.2rem;
  height: 2.2rem;
}

@media (max-width: 56.25em) {
  .nav__links {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(30rem, 80vw);
    height: 100vh;
    background: var(--bg-raised);
    flex-direction: column;
    justify-content: center;
    gap: 3.2rem;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border-left: 1px solid var(--line);
    font-size: 1.6rem;
  }
  .nav__links.is-open {
    transform: translateX(0);
  }
  .nav__resume {
    display: none;
  }
  .nav__links .nav__resume-mobile {
    display: inline-flex;
    border: 1px solid var(--teal);
    color: var(--teal);
    padding: 1rem 2rem;
    border-radius: var(--radius-s);
  }
  .nav__toggle {
    display: flex;
    z-index: 101;
  }
}

/* =========================================================
   Hero
   ========================================================= */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 8rem;
}

.hero__grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 4rem;
  align-items: center;
}

@media (max-width: 75em) {
  .hero__grid {
    grid-template-columns: 1fr;
  }
}

.hero__kicker {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  color: var(--teal);
  letter-spacing: 0.04em;
  margin-bottom: 2.4rem;
  display: block;
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(4rem, 7vw, 7.2rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.hero__title em {
  font-style: normal;
  color: var(--teal);
}

.hero__lede {
  margin-top: 2.8rem;
  max-width: 52rem;
  font-size: 1.9rem;
  color: var(--ink-dim);
  line-height: 1.65;
}

.hero__cta {
  margin-top: 4rem;
  display: flex;
  gap: 1.6rem;
  flex-wrap: wrap;
}

.hero__meta {
  margin-top: 6rem;
  display: flex;
  gap: 4rem;
  font-family: var(--font-mono);
  font-size: 1.3rem;
  color: var(--ink-faint);
  flex-wrap: wrap;
}
.hero__meta strong {
  color: var(--ink);
  font-weight: 500;
}

@media (max-width: 37.5em) {
  .hero__meta {
    gap: 2.4rem;
  }
}

/* Pipeline diagram — signature element */
.pipeline {
  position: relative;
}
.pipeline svg {
  width: 100%;
  height: auto;
  overflow: visible;
}
.pipeline .flow-line {
  stroke: var(--line-strong);
  stroke-width: 1.5;
  fill: none;
}
.pipeline .flow-dash {
  stroke: var(--teal);
  stroke-width: 1.5;
  fill: none;
  stroke-dasharray: 6 14;
  animation: flow 2.4s linear infinite;
}
.pipeline .node-ring {
  fill: var(--bg-raised);
  stroke: var(--line-strong);
  stroke-width: 1.5;
}
.pipeline .node-dot {
  fill: var(--teal);
}
.pipeline .node-dot.amber {
  fill: var(--amber);
}
.pipeline text {
  font-family: var(--font-mono);
  font-size: 11px;
  fill: var(--ink-faint);
  letter-spacing: 0.06em;
  dominant-baseline: middle;
}
.pipeline .node-label {
  fill: var(--ink-dim);
  font-weight: 500;
}

@keyframes flow {
  to {
    stroke-dashoffset: -40;
  }
}

@media (max-width: 75em) {
  .pipeline {
    margin-top: 2rem;
    opacity: 0.9;
  }
}

/* =========================================================
   About
   ========================================================= */
.about__grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 6rem;
  align-items: start;
}

@media (max-width: 56.25em) {
  .about__grid {
    grid-template-columns: 1fr;
    gap: 4rem;
  }
}

.about__portrait {
  position: relative;
  border-radius: var(--radius-l);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-raised);
  aspect-ratio: 1 / 1.05;
  max-width: 36rem;
}

.about__portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about__portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px var(--line);
  background: linear-gradient(160deg, rgba(63, 224, 203, 0.14), transparent 45%);
  pointer-events: none;
}

.about__text p {
  color: var(--ink-dim);
  font-size: 1.75rem;
  line-height: 1.75;
  margin-bottom: 2.2rem;
  max-width: 58rem;
}

.about__text strong {
  color: var(--ink);
  font-weight: 600;
}

.field-list {
  margin-top: 4rem;
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--line);
}

.field-list__row {
  display: grid;
  grid-template-columns: 14rem 1fr;
  gap: 2rem;
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 1.5rem;
}

.field-list__key {
  font-family: var(--font-mono);
  color: var(--ink-faint);
  font-size: 1.3rem;
  padding-top: 0.2rem;
}

.field-list__value {
  color: var(--ink);
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.tag {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  color: var(--teal);
  border: 1px solid rgba(63, 224, 203, 0.35);
  background: rgba(63, 224, 203, 0.07);
  padding: 0.35rem 1rem;
  border-radius: 100px;
}

.about__actions {
  margin-top: 4rem;
  display: flex;
  gap: 1.6rem;
  flex-wrap: wrap;
}

/* =========================================================
   Projects
   ========================================================= */
.records {
  display: flex;
  flex-direction: column;
}

.record {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 5rem;
  align-items: center;
  padding: 6rem 0;
  border-top: 1px solid var(--line);
}
.records .record:last-child {
  border-bottom: 1px solid var(--line);
}

@media (max-width: 75em) {
  .record {
    grid-template-columns: 1fr;
    gap: 3rem;
    padding: 4.8rem 0;
  }
}

.record__index {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  color: var(--ink-faint);
  margin-bottom: 1.6rem;
  display: block;
}

.record__title {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 600;
  margin-bottom: 1.8rem;
  letter-spacing: -0.01em;
}

.record__tags {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.record__desc {
  color: var(--ink-dim);
  font-size: 1.6rem;
  line-height: 1.7;
  margin-bottom: 2.8rem;
  max-width: 50rem;
}

.record__links {
  display: flex;
  gap: 1.4rem;
  flex-wrap: wrap;
}

.record__media {
  position: relative;
  border-radius: var(--radius-m);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-raised);
  aspect-ratio: 16 / 10;
}

.record__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.record__media:hover img {
  transform: scale(1.04);
}

.record:nth-child(even) .record__media {
  order: -1;
}
@media (max-width: 75em) {
  .record:nth-child(even) .record__media {
    order: 0;
  }
}

/* =========================================================
   Contact
   ========================================================= */
.contact {
  text-align: left;
}

.contact__panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: linear-gradient(160deg, var(--bg-raised), var(--bg));
  padding: 7rem 6rem;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 4rem;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.contact__panel::before {
  content: "";
  position: absolute;
  width: 40rem;
  height: 40rem;
  right: -10rem;
  top: -14rem;
  background: radial-gradient(circle, rgba(63, 224, 203, 0.14), transparent 65%);
  pointer-events: none;
}

@media (max-width: 56.25em) {
  .contact__panel {
    grid-template-columns: 1fr;
    padding: 4.8rem 3rem;
  }
}

.contact__title {
  font-family: var(--font-display);
  font-size: 3.6rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 1.6rem;
}

.contact__text {
  color: var(--ink-dim);
  font-size: 1.7rem;
  max-width: 46rem;
}

.contact__actions {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  align-items: flex-start;
}

@media (max-width: 56.25em) {
  .contact__actions {
    align-items: stretch;
  }
  .contact__actions .btn {
    justify-content: center;
  }
}

/* =========================================================
   Footer
   ========================================================= */
.footer {
  border-top: 1px solid var(--line);
  padding: 4.8rem 0;
}

.footer .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2rem;
}

.footer__text {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  color: var(--ink-faint);
}

.footer__text a {
  color: var(--ink-dim);
  transition: color 0.25s ease;
}
.footer__text a:hover {
  color: var(--teal);
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-links a {
  width: 4rem;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-dim);
  transition: color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
.social-links a:hover {
  color: var(--teal);
  border-color: var(--teal);
  transform: translateY(-2px);
}
.social-links svg {
  width: 1.8rem;
  height: 1.8rem;
}

.back-to-top {
  width: 4.4rem;
  height: 4.4rem;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-dim);
  transition: color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
.back-to-top:hover {
  color: var(--teal);
  border-color: var(--teal);
  transform: translateY(-3px);
}
.back-to-top svg {
  width: 1.8rem;
  height: 1.8rem;
}
