/* ============================================================
   PORTFOLIO — Niels Rozemeijer
   ============================================================ */

/* ── Fonts ─────────────────────────────────────────────────── */
@font-face {
  font-family: 'PP Neue Montreal';
  src: url('../Public/fonts/PPNeueMontreal-Book.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'PP Neue Montreal';
  src: url('../Public/fonts/PPNeueMontreal-Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ── Design tokens ──────────────────────────────────────────── */
:root {
  --bg:            #ffffff;
  --bg-surface:    #f3f3f3;
  --bg-elevated:   #f0f0f0;
  --text:          #000000;
  --text-muted:    #8e8e8e;
  --text-footer:   #737373;
  --accent:        #007cff;

  --max-w:         1040px;
  --section-gap:   120px;
  --radius-xl:     24px;
  --radius-lg:     12px;
  --radius-md:     8px;
  --radius-btn:    32px;

  --font:          'PP Neue Montreal', -apple-system,
                   BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:          #000000;
    --bg-surface:  #171717;
    --bg-elevated: #1a1a1a;
    --text:        #ffffff;
    --text-muted:  #8e8e8e;
    --text-footer: #8e8e8e;
  }
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.5;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }

/* ── Nav ────────────────────────────────────────────────────── */
.nav {
  display: flex;
  align-items: center;
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

@media (prefers-color-scheme: dark) {
  .nav {
    background: rgba(0, 0, 0, 0.6);
  }
}

.nav-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

@media (min-width: 1080px) {
  .nav-wrap { padding: 0; }
}

/* Base nav link styles — overflow hidden enables the stagger clip */
.nav__home,
.nav__link {
  font-weight: 500;
  font-size: 18px;
  letter-spacing: 0.18px;
  white-space: nowrap;
  position: relative;
  display: block;
  overflow: hidden;
}

.nav__right {
  display: flex;
  align-items: center;
  gap: 24px;
}

/* ── Nav stagger animation ───────────────────────────────────── */
/* Both the visible text and the incoming clone share the same padding/timing */
.nav__home-text,
.nav__home-clone,
.nav__link-text,
.nav__link-clone {
  display: block;
  padding: 12px 0;
  line-height: 1;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Clone starts above the element, hidden by overflow: hidden */
.nav__home-clone,
.nav__link-clone {
  position: absolute;
  top: 0;
  left: 0;
  transform: translateY(-100%);
}

/* On hover: visible text exits down, clone enters from top */
.nav__home:hover .nav__home-text { transform: translateY(100%); }
.nav__home:hover .nav__home-clone { transform: translateY(0); }
.nav__link:hover .nav__link-text  { transform: translateY(100%); }
.nav__link:hover .nav__link-clone { transform: translateY(0); }

/* ── Page wrapper ───────────────────────────────────────────── */
.page {
  display: flex;
  flex-direction: column;
  gap: var(--section-gap);
  align-items: center;
  padding-top: var(--section-gap);
  padding-bottom: var(--section-gap);
}

.container {
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
}

@media (min-width: 1080px) {
  .container { padding: 0; }
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: var(--radius-btn);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: 0.18px;
  white-space: nowrap;
  transition: filter 0.2s;
}
/* Color-only hover — no Y movement */
.btn:hover { filter: brightness(0.88); }
.btn--primary   { background: var(--accent); color: #fff; }
.btn--secondary { background: var(--bg-elevated); color: var(--text); }

/* ── Section titles ─────────────────────────────────────────── */
.section-title {
  font-size: 32px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 0.32px;
}

/* ── Hero (landing) ─────────────────────────────────────────── */
.hero {
  display: flex;
  flex-direction: column;
  gap: 64px;
  width: 100%;
}

.hero__text {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 800px;
}

.hero__headline {
  font-size: 32px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 0.32px;
}

.hero__cta {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}

.hero__media {
  width: 100%;
  aspect-ratio: 1040 / 585;
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

@media (max-width: 700px) {
  .hero__media { border-radius: var(--radius-lg); }
}

.hero__media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Projects grid ──────────────────────────────────────────── */
.projects-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
}

.projects-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 32px 16px;
}

/* ── Project card ───────────────────────────────────────────── */
.project-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: calc(50% - 8px);
  cursor: pointer;
  text-decoration: none;
}

@media (max-width: 700px) {
  .project-card { width: 100%; }
}

/* Full-width card variant — larger radius on desktop, same 12px on mobile */
.project-card--wide {
  width: 100%;
}

.project-card--wide .project-card__image,
.project-card--wide .nda-overlay {
  border-radius: var(--radius-xl);
}

@media (max-width: 700px) {
  .project-card--wide .project-card__image,
  .project-card--wide .nda-overlay {
    border-radius: var(--radius-lg);
  }
}

.project-card__image {
  position: relative;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 512 / 288;
}

.project-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease, filter 0.4s ease;
  display: block;
}

.project-card:not(.project-card--nda):hover .project-card__image img {
  transform: scale(1.03);
}

.project-card__info { display: flex; flex-direction: column; gap: 4px; }

.project-card__title {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.22px;
  line-height: 1.27;
}

.project-card__subtitle {
  font-size: 20px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.2px;
  line-height: 1.2;
}

/* ── NDA overlay — visible on hover only ────────────────────── */
.project-card--nda { cursor: default; }

.nda-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #000000;
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: var(--radius-lg);
  pointer-events: none;
}

@media (prefers-color-scheme: dark) {
  .nda-overlay {
    background: rgba(0, 0, 0, 0.55);
    color: #ffffff;
  }
}

.project-card--nda:hover .nda-overlay { opacity: 1; }
.project-card--nda:hover .project-card__image img {
  filter: blur(4px);
  transform: scale(1.03);
}

.nda-overlay__icon {
  width: 24px;
  height: 24px;
}

.nda-overlay__label {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* ── Side projects ──────────────────────────────────────────── */
.side-projects-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
}

.side-projects-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 32px 16px;
}

.side-project-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: calc(33.333% - 11px);
  text-decoration: none;
  cursor: pointer;
}

.side-project-card .project-card__image {
  border-radius: var(--radius-md);
  aspect-ratio: 512 / 288;
}

@media (max-width: 700px) {
  .side-projects-grid { flex-direction: column; }
  .side-project-card  { width: 100%; }
  .side-project-card .project-card__image { border-radius: var(--radius-lg); }
}

.side-project-card:hover .project-card__image img {
  transform: scale(1.03);
}

/* ── About me ───────────────────────────────────────────────── */
.about-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
}

.about-content {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 48px;
}

.about-text {
  flex: 0 0 562px;
  max-width: 562px;
  font-weight: 500;
  font-size: 18px;
  color: var(--text-muted);
  letter-spacing: 0.18px;
  line-height: 1.33;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.about-photo {
  flex: 0 1 424px;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  aspect-ratio: 16 / 9;
}

.about-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

@media (max-width: 1040px) {
  .about-content { flex-direction: column; }
  .about-text, .about-photo { flex: none; width: 100%; max-width: 100%; }
}

/* ── Footer ─────────────────────────────────────────────────── */
.footer {
  background: var(--bg-surface);
  width: 100%;
  padding: 64px 20px;
}

.footer__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  gap: 16px;
}

@media (min-width: 1080px) {
  .footer__inner { padding: 0; }
}

.footer__column {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 336px;
}

.footer__heading {
  font-size: 18px;
  font-weight: 500;
  line-height: 1.33;
  color: var(--text);
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.footer__links a {
  font-size: 18px;
  font-weight: 500;
  line-height: 1.33;
  color: var(--text-footer);
  transition: color 0.2s;
}
.footer__links a:hover { color: var(--text); }

/* ============================================================
   PROJECT PAGE
   ============================================================ */

/* ── Project hero ───────────────────────────────────────────── */
.project-page { display: flex; flex-direction: column; gap: var(--section-gap); padding-bottom: var(--section-gap); }

.project-hero {
  display: flex;
  flex-direction: column;
  gap: 64px;
  width: 100%;
  padding-top: var(--section-gap);
}

.project-hero__text {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 800px;
}

.project-hero__title {
  font-size: 32px;
  font-weight: 500;
  line-height: 40px;
  letter-spacing: 0.32px;
}

.project-hero__subtitle {
  font-size: 20px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.2px;
  line-height: 24px;
}

.project-hero__image {
  width: 100%;
  aspect-ratio: 1040 / 585;
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

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

/* ── Project summary (sits inside .project-hero) ────────────── */
.project-summary__grid {
  display: flex;
  gap: 16px;
}

@media (max-width: 700px) {
  .project-summary__grid { flex-wrap: wrap; }
  .summary-item { flex: 0 0 calc(50% - 8px); width: auto; }
}

.summary-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 248px;
  flex-shrink: 0;
}

.summary-item__label {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-footer);
  letter-spacing: 0.18px;
  line-height: 24px;
}

.summary-item__value {
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.18px;
  line-height: 24px;
}

.summary-item__value ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Project intro ──────────────────────────────────────────── */
.project-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.project-intro__left {
  flex: 0 0 512px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.project-intro__body {
  font-size: 28px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.28px;
  line-height: 36px;
}

.project-intro__columns {
  display: flex;
  gap: 16px;
}

.intro-col {
  flex: 0 0 248px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.intro-col__label {
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.18px;
  line-height: 24px;
}

.intro-col__text {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-footer);
  letter-spacing: 0.18px;
  line-height: 24px;
}

.project-intro__photo {
  flex: 0 0 424px;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  align-self: stretch;
  min-height: 300px;
  position: relative;
}

.project-intro__photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 900px) {
  .project-intro { flex-direction: column; gap: 64px; }
  .project-intro__left { flex: none; width: 100%; }
  .project-intro__photo { flex: none; width: 100%; height: 300px; }
  .intro-col { flex: 1; }
}

/* ── Project steps ──────────────────────────────────────────── */
.project-steps {
  display: flex;
  flex-direction: column;
  gap: var(--section-gap);
}

.project-step {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.project-step__meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 800px;
}

.project-step__title {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.18px;
  line-height: 24px;
}

.project-step__body {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.18px;
  line-height: 1.5;
}

.project-step__image {
  width: 100%;
  aspect-ratio: 1040 / 585;
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.project-step__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Project results ────────────────────────────────────────── */
.project-results {
  display: flex;
  gap: 16px;
}

.result-stat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 248px;
}

.result-stat__value {
  font-size: 48px;
  font-weight: 400;
  letter-spacing: 0.48px;
  line-height: 56px;
}

.result-stat__label {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.18px;
  line-height: 24px;
}

/* ── Keyframes ──────────────────────────────────────────────── */
@keyframes wordBlurIn {
  from { opacity: 0; filter: blur(8px); transform: translateY(6px); }
  to   { opacity: 1; filter: blur(0);   transform: translateY(0);   }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0);    }
}

@keyframes scaleReveal {
  from { opacity: 0; transform: scale(0.97) translateY(12px); }
  to   { opacity: 1; transform: scale(1)    translateY(0);    }
}

/* ── Hero headline — word-by-word blur ──────────────────────── */
.word-animate {
  display: inline-block;
  animation: wordBlurIn 0.75s cubic-bezier(0.16, 1, 0.3, 1) var(--word-delay, 0s) both;
}

/* ── Hero CTA & media ───────────────────────────────────────── */
.hero__cta  { opacity: 0; }
.hero__media { opacity: 0; }

.hero__cta.in {
  animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) var(--delay, 0s) both;
}
.hero__media.in {
  animation: scaleReveal 1.2s cubic-bezier(0.16, 1, 0.3, 1) var(--delay, 0s) both;
}

/* ── Scroll reveal (sections & cards) ──────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity  0.6s cubic-bezier(0.16, 1, 0.3, 1) var(--stagger, 0s),
    transform 0.6s cubic-bezier(0.16, 1, 0.3, 1) var(--stagger, 0s);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Project page — hero animations ────────────────────────── */
.project-hero__title {
  animation: fadeUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.05s both;
}
.project-hero__subtitle {
  animation: fadeUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}
.project-hero__image {
  animation: scaleReveal 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.35s both;
}

/* ── Mobile typography (≤ 700px) ────────────────────────────── */
@media (max-width: 700px) {
  /* Nav */
  .nav__home,
  .nav__link {
    font-size: 16px;
    letter-spacing: 0.16px;
  }

  /* Hero headline */
  .hero__headline {
    font-size: 24px;
    line-height: 32px;
    letter-spacing: 0.24px;
  }

  /* Section titles */
  .section-title {
    font-size: 22px;
    line-height: 28px;
    letter-spacing: 0.22px;
  }

  /* Project card labels */
  .project-card__title {
    font-size: 20px;
    line-height: 24px;
    letter-spacing: 0.2px;
  }

  .project-card__subtitle {
    font-size: 16px;
    line-height: 20px;
    letter-spacing: 0.16px;
  }

  /* About section */
  .about-content { gap: 16px; }
  .about-photo   { border-radius: var(--radius-lg); }
  .about-text {
    font-size: 16px;
    line-height: 20px;
    letter-spacing: 0.16px;
  }

  /* Footer */
  .footer__heading,
  .footer__links a {
    font-size: 16px;
    line-height: 20px;
  }

  /* Project page — hero text */
  .project-hero__title {
    font-size: 24px;
    line-height: 32px;
    letter-spacing: 0.24px;
  }

  .project-hero__subtitle {
    font-size: 16px;
    line-height: 20px;
    letter-spacing: 0.16px;
  }

  /* Project intro body quote */
  .project-intro__body {
    font-size: 20px;
    line-height: 28px;
    letter-spacing: 0.2px;
  }

  /* Intro & summary labels / values */
  .intro-col__label,
  .intro-col__text,
  .summary-item__label,
  .summary-item__value {
    font-size: 16px;
    line-height: 20px;
    letter-spacing: 0.16px;
  }

  /* Result stat numbers */
  .result-stat__value {
    font-size: 32px;
    line-height: 40px;
    letter-spacing: 0.32px;
  }
}
