/* ---------------------------------------------------
   Tjeerd Dam — portfolio
   Monospace, minimal director-style portfolio layout.
--------------------------------------------------- */

:root {
  --bg: #f5f5f4;
  --fg: #1a1a1a;
  --fg-muted: #6b6b6b;
  --border: rgba(0, 0, 0, 0.12);

  --bg-dark: #0c0c0c;
  --fg-dark: #f2f2f0;
  --fg-dark-muted: rgba(242, 242, 240, 0.72);
  --border-dark: rgba(255, 255, 255, 0.18);

  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Roboto Mono", Menlo,
    Consolas, "Courier New", monospace;

  --pad: clamp(16px, 3vw, 32px);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--mono);
  background: var(--bg);
  color: var(--fg);
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration: underline;
}

.italic {
  font-style: italic;
  color: var(--fg-muted);
}

/* ---------- layout shells ---------- */

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page--dark {
  position: relative;
  background: var(--bg-dark);
  color: var(--fg-dark);
}

/* On dark full-bleed pages (about/project/teaser) the header floats over the
   media instead of sitting in its own solid bar, so the video/still fills the
   whole first viewport. */
/* Alleen op pagina's met een volledig-scherm video/still (project, teaser) —
   niet op about, waar de bio-tekst anders onder de header schuift. */
.page--overlay-header .site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0) 100%);
}

/* ---------- header / nav ---------- */

.site-header {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: var(--pad);
  text-transform: uppercase;
}

.site-header .brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.site-header .brand .name {
  font-weight: 500;
  letter-spacing: 0.02em;
}

.site-header .brand .tagline {
  text-transform: none;
  color: var(--fg-muted);
  font-size: 11px;
}

.page--dark .site-header .brand .tagline {
  color: var(--fg-dark-muted);
}

.site-header nav {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.site-header nav a.active {
  text-decoration: underline;
}

/* ---------- media placeholder (gradient "video/image") ---------- */

.media {
  position: absolute;
  inset: 0;
  background-size: 200% 200%;
  animation: drift 18s ease-in-out infinite;
}

@media (min-width: 641px) {
  .media {
    animation-duration: 48s;
  }
}

.media::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.35'/></svg>");
  mix-blend-mode: overlay;
  opacity: 0.5;
}

.media::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.55) 0%,
    rgba(0, 0, 0, 0.05) 45%,
    rgba(0, 0, 0, 0.4) 100%
  );
}

@keyframes drift {
  0% {
    background-position: 0% 0%;
  }
  50% {
    background-position: 100% 100%;
  }
  100% {
    background-position: 0% 0%;
  }
}

/* ---------- media: youtube/vimeo achtergrond-embed ---------- */

.media--embed {
  overflow: hidden;
  background: #000;
}

.media__embed-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 177.78vh; /* 16:9 cover-trick, zoals object-fit: cover voor iframes */
  height: 56.25vw;
  min-width: 100%;
  min-height: 100%;
  transform: translate(-50%, -50%);
  border: 0;
  pointer-events: none;
}

/* ---------- media: stills-slideshow (geen video) ---------- */

.media--slideshow {
  background: #111;
}

.media__slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.4s ease;
}

.media__slide.is-active {
  opacity: 1;
}

/* ---------- index / work list ---------- */

.work {
  flex: 1;
  padding: var(--pad);
  padding-top: calc(var(--pad) * 3.5);
}

.work__list {
  max-width: 640px;
}

.work__group {
  margin-bottom: 1.75em;
}

.work__group-title {
  text-transform: uppercase;
  color: var(--fg-muted);
  letter-spacing: 0.04em;
  margin-bottom: 0.5em;
}

.work__row {
  display: block;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
}

.work__row:hover {
  text-decoration: none;
  color: var(--fg);
}

.work__row:hover .work__row-main {
  text-decoration: underline;
}

.year {
  color: var(--fg-muted);
  font-style: normal;
}

.work__festivals {
  font-style: italic;
  color: var(--fg-muted);
  font-size: 12px;
  margin-top: 1px;
}

/* floating hover-preview thumbnail */

.preview {
  position: fixed;
  z-index: 50;
  width: 220px;
  height: 140px;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.98);
  transition: opacity 0.12s ease;
  overflow: hidden;
}

.preview.is-visible {
  opacity: 1;
}

.preview .media {
  position: absolute;
  inset: 0;
}

.preview__label {
  position: absolute;
  bottom: 6px;
  left: 8px;
  z-index: 2;
  color: #fff;
  font-size: 10px;
  text-transform: uppercase;
}

/* ---------- info page ---------- */

.info {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.info__top {
  position: relative;
  z-index: 5;
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  gap: var(--pad);
  padding: var(--pad);
  padding-top: calc(var(--pad) * 3.5);
  flex-wrap: wrap;
}

.info__bio {
  max-width: 46ch;
}

.info__bio-heading {
  text-transform: uppercase;
  color: var(--fg-dark-muted);
  letter-spacing: 0.04em;
  margin: 0 0 1em;
}

.info__bio p {
  margin: 0 0 1em;
}

.info__contact {
  text-align: right;
  white-space: nowrap;
}

.info__contact div {
  margin-bottom: 2px;
}

.info__ticker {
  position: relative;
  z-index: 5;
  padding: var(--pad);
  padding-top: 8px;
  font-size: 11px;
  color: var(--fg-dark-muted);
}

.info__ticker a {
  color: inherit;
}

.info__ticker .sep {
  margin: 0 6px;
  opacity: 0.5;
}

.socials {
  position: relative;
  z-index: 5;
  display: flex;
  justify-content: center;
  gap: 22px;
  padding: 0 var(--pad) var(--pad);
}

.socials a {
  display: inline-flex;
  opacity: 0.65;
}

.socials a:hover {
  opacity: 1;
  text-decoration: none;
}

.socials svg {
  width: 20px;
  height: 20px;
}

/* ---------- project page ---------- */

.project {
  position: relative;
  flex: 0 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.project__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.project__caption {
  position: relative;
  z-index: 5;
  margin-top: auto;
  padding: var(--pad);
}

.project__festivals {
  position: relative;
  z-index: 5;
  padding: 0 var(--pad);
  margin-top: -8px;
  margin-bottom: 8px;
  font-style: italic;
  color: var(--fg-dark-muted);
}

.project__description {
  position: relative;
  z-index: 5;
  padding: 0 var(--pad) var(--pad);
  max-width: 60ch;
  color: var(--fg-dark-muted);
}

.project__link {
  position: relative;
  z-index: 5;
  padding: 0 var(--pad) var(--pad);
}

.project__link a {
  text-decoration: underline;
}

.sound-toggle {
  position: absolute;
  z-index: 6;
  top: calc(var(--pad) * 3.5);
  right: var(--pad);
  background: none;
  border: 1px solid var(--border-dark);
  color: var(--fg-dark);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 6px 10px;
  cursor: pointer;
}

.sound-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* ---------- teaser page: "I'm bored" + scroll-snap naar het Snake-scherm ---------- */

.page--snap {
  height: 100vh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
}

.page--snap .project,
.page--snap .snake-screen {
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.page--snap .project__festivals {
  margin-top: auto;
}

.teaser__bored-wrap {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%);
  text-align: center;
}

.teaser__bored {
  font-style: italic;
  margin: 0 0 6px;
}

.teaser__arrow {
  font-size: 20px;
  animation: bob 1.6s ease-in-out infinite;
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(6px);
  }
}

.snake-screen {
  position: relative;
  flex: 0 0 auto;
  height: 100vh;
  background: #000;
  overflow: hidden;
}

.snake-screen canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#matrix-rain {
  z-index: 1;
  opacity: 0.55;
}

#snake-canvas {
  z-index: 2;
}

.snake-hud {
  position: absolute;
  z-index: 3;
  top: var(--pad);
  left: var(--pad);
  color: #2fdc6a;
  font-family: var(--mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-shadow: 0 0 8px rgba(47, 220, 106, 0.7);
}

.snake-hint {
  position: absolute;
  z-index: 3;
  bottom: var(--pad);
  left: 50%;
  transform: translateX(-50%);
  color: rgba(47, 220, 106, 0.65);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.snake-gameover {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 58%;
  transform: translateX(-50%);
  width: 260px;
  text-align: center;
  font-family: var(--mono);
  color: #2fdc6a;
  text-shadow: 0 0 8px rgba(47, 220, 106, 0.7);
}

.snake-gameover__score {
  margin: 0 0 14px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.snake-name-form {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.snake-name-input {
  width: 130px;
  padding: 6px 8px;
  background: rgba(47, 220, 106, 0.08);
  border: 1px solid rgba(47, 220, 106, 0.5);
  color: #eaff9e;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.snake-name-input::placeholder {
  color: rgba(47, 220, 106, 0.4);
}

.snake-name-input:focus {
  outline: none;
  border-color: #2fdc6a;
}

.snake-name-submit {
  padding: 6px 12px;
  background: transparent;
  border: 1px solid rgba(47, 220, 106, 0.5);
  color: #2fdc6a;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.snake-name-submit:hover {
  background: rgba(47, 220, 106, 0.15);
}

.snake-highscores__title {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.6;
  font-size: 11px;
}

.snake-highscores__item {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 2px 0;
  font-size: 11px;
  letter-spacing: 0.04em;
  opacity: 0.85;
}

.snake-highscores__item--new {
  color: #eaff9e;
  opacity: 1;
}

/* ---------- project page: stills + credits below the fold ---------- */

.project-extra {
  padding: var(--pad);
  padding-top: calc(var(--pad) * 2);
}

.project__stills {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.project__still {
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
}

.project__synopsis {
  max-width: 60ch;
  margin-top: calc(var(--pad) * 1.5);
  color: var(--fg-dark-muted);
  white-space: pre-line;
}

.project__credits {
  max-width: 60ch;
  margin-top: calc(var(--pad) * 1.5);
}

.project__credits div {
  margin-bottom: 4px;
}

.project__credits div.gap {
  margin-bottom: 1.2em;
}

.project__credits .label {
  font-weight: 600;
  margin-right: 6px;
}

.project__tease {
  margin-top: calc(var(--pad) * 1.5);
}

.project__tease a {
  font-style: italic;
  color: var(--fg-dark-muted);
  text-decoration: underline;
}

@media (max-width: 640px) {
  .project__stills {
    grid-template-columns: 1fr;
  }
}

.back-link {
  position: relative;
  z-index: 5;
}

/* ---------- secret page (easter egg binnen een easter egg) ---------- */

.secret {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5em;
  padding: var(--pad);
  text-align: center;
}

.secret__line {
  font-style: italic;
  font-size: 15px;
}

.secret__line--muted {
  color: var(--fg-dark-muted);
}

.secret__grid {
  margin: 0;
  padding: var(--pad) calc(var(--pad) * 1.4);
  border: 1px solid var(--border-dark);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  letter-spacing: 0.15em;
  color: var(--fg-dark);
  overflow-x: auto;
}

.secret__password {
  color: inherit;
}

.secret__password:hover {
  color: var(--fg-dark-muted);
}

.secret__grid-wrap {
  position: relative;
}

.secret__copied {
  position: absolute;
  left: 50%;
  bottom: -26.5px;
  transform: translateX(-50%);
  margin: 0;
  white-space: nowrap;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg-dark-muted);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.secret__copied.is-visible {
  opacity: 1;
}

.secret__button {
  display: inline-block;
  border: 1px solid var(--border-dark);
  padding: 8px 16px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px;
}

.secret__button:hover {
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
}

/* ---------- footer ---------- */

.site-footer {
  padding: var(--pad);
  font-size: 11px;
  color: var(--fg-muted);
  text-align: center;
}

/* ---------- responsive ---------- */

@media (max-width: 640px) {
  body {
    font-size: 12px;
  }

  .info__top {
    flex-direction: column;
    align-items: flex-start;
  }

  .info__contact {
    text-align: left;
  }

  .preview {
    display: none;
  }
}
