:root {
  --bg: #fbfcfa;
  --text: #10120f;
  --muted: #5c6259;
  --faint: #878d83;
  --line: #dfe4dc;
  --line-strong: #bbc5b8;
  --accent: #74d900;
  --panel: #ffffff;
  --shadow: 0 24px 70px rgba(20, 24, 18, 0.07);
  --max: 1320px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    var(--bg);
  background-size: 48px 48px;
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

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

svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
  flex: 0 0 auto;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.brand-icon {
  fill: currentColor;
  stroke: none;
}

.brand-icon path {
  fill: currentColor;
  stroke: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  width: 100%;
  height: 76px;
  padding: 0 42px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  background: rgba(251, 252, 250, 0.84);
  border-bottom: 1px solid rgba(16, 18, 15, 0.12);
  backdrop-filter: blur(18px);
}

.brand {
  font-size: 17px;
  font-weight: 750;
}

nav {
  display: flex;
  gap: 28px;
  color: var(--muted);
  font-size: 14px;
}

nav a,
.social-links a {
  transition:
    color 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

nav a:hover {
  color: var(--text);
}

.social-links {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
}

.social-links a {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.48);
  color: var(--text);
}

.social-links a:hover {
  border-color: var(--text);
  transform: translateY(-1px);
}

.section {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}

.hero {
  min-height: calc(100svh - 76px);
  display: grid;
  grid-template-columns: minmax(0, 0.84fr) minmax(340px, 0.58fr);
  gap: 72px;
  align-items: center;
  padding: 76px 0 48px;
  position: relative;
}

.hero-copy h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(68px, 9vw, 132px);
  line-height: 0.9;
  font-weight: 790;
}

.hero-copy p {
  max-width: 590px;
  margin: 34px 0 0;
  color: var(--muted);
  font-size: 21px;
  line-height: 1.55;
}

.life-knot-card {
  width: 100%;
  align-self: center;
  perspective: 1200px;
}

.life-knot-flip {
  position: relative;
  width: 100%;
  display: block;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 720ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.life-knot-flip.is-flipped {
  transform: rotateY(180deg);
}

.life-knot-face {
  width: 100%;
  border: 1px solid var(--text);
  border-radius: 6px;
  background:
    linear-gradient(rgba(16, 18, 15, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 18, 15, 0.035) 1px, transparent 1px),
    var(--panel);
  background-size: 22px 22px;
  box-shadow: var(--shadow);
  overflow: hidden;
  backface-visibility: hidden;
}

.life-knot-front {
  display: block;
}

.life-knot-back {
  position: absolute;
  inset: 0;
  display: grid;
  min-height: 100%;
  transform: rotateY(180deg);
  background:
    linear-gradient(rgba(16, 18, 15, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 18, 15, 0.045) 1px, transparent 1px),
    #ffffff;
  background-size: 22px 22px;
}

.life-knot-back-content {
  min-height: 100%;
  display: grid;
  align-content: center;
  gap: 18px;
  padding: clamp(26px, 4vw, 46px);
  text-align: left;
}

.life-knot-back-content .section-kicker {
  margin: 0;
}

.life-knot-back-content strong {
  max-width: 420px;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 0.98;
}

.life-knot-back-content span:not(.section-kicker) {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.life-knot-back-content em {
  color: var(--accent);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  font-style: normal;
}

.life-knot-front canvas {
  width: 100%;
  aspect-ratio: 1;
  display: block;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.life-knot-front canvas:active {
  cursor: grabbing;
}

.life-knot-caption {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line-strong);
  padding: 0 14px;
  color: var(--faint);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 11px;
}

.life-knot-caption span:first-child {
  color: var(--accent);
}

.hero-actions,
.contact-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 34px;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid var(--text);
  border-radius: 4px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 720;
  transition:
    transform 180ms ease,
    background 180ms ease,
    border-color 180ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary {
  background: var(--text);
  color: white;
}

.button.secondary {
  background: rgba(255, 255, 255, 0.42);
  color: var(--text);
  border-color: var(--line-strong);
}

.button.secondary:hover {
  border-color: var(--text);
}

.section-kicker,
.project-year {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.about,
.videos,
.projects,
.contact {
  padding: 112px 0;
  border-top: 1px solid rgba(16, 18, 15, 0.14);
}

.section-kicker {
  margin-bottom: 18px;
  color: var(--accent);
  font-size: 12px;
  text-transform: uppercase;
}

h2 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(34px, 5vw, 70px);
  line-height: 1;
  font-weight: 760;
}

.about-grid {
  max-width: 1260px;
  margin-top: 54px;
  display: grid;
  grid-template-columns: minmax(260px, 0.6fr) minmax(0, 1.4fr);
  gap: 72px;
  border-top: 1px solid var(--line-strong);
  padding-top: 28px;
  align-items: start;
}

.about-grid p,
.interest-list,
.project-row p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.about-notes {
  display: grid;
  gap: 16px;
}

.about-details {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 82px;
  align-items: start;
}

.interest-list {
  padding: 0;
  list-style: none;
  display: grid;
  gap: 16px;
}

.interest-list li {
  position: relative;
  padding-left: 22px;
}

.interest-list li::before,
.about-note::before {
  content: "/";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.about-note {
  position: relative;
  padding-left: 22px;
}

.about-grid a,
.interest-list a {
  color: var(--text);
  border-bottom: 1px solid var(--accent);
  font-weight: 700;
}

.music-player {
  position: relative;
  display: grid;
  gap: 12px;
  width: 100%;
  max-width: 420px;
  justify-self: end;
}

.floating-tape {
  position: fixed;
  top: 92px;
  right: 26px;
  z-index: 30;
  width: 48px;
  height: 48px;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  justify-items: center;
  border: 1px solid rgba(16, 18, 15, 0.78);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.9), transparent 28%),
    linear-gradient(145deg, #f5ecd8, #c8bea7);
  color: var(--text);
  font-size: 16px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 14px 34px rgba(16, 18, 15, 0.18);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px) scale(0.86);
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    border-color 180ms ease;
}

.floating-tape.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.floating-tape:hover {
  border-color: var(--accent);
  transform: translateY(-1px) scale(1.04);
}

.floating-tape.is-skipping {
  animation: floating-skip 520ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.cassette {
  position: relative;
  width: 100%;
  aspect-ratio: 1.62;
  border: 0;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.55), transparent 34%),
    linear-gradient(180deg, #d8cfba, #b8ad98);
  padding: 10px;
  color: var(--text);
  cursor: pointer;
  transform-origin: 50% 72%;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 -8px 18px rgba(16, 18, 15, 0.12),
    0 20px 52px rgba(16, 18, 15, 0.16);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}

.cassette::before,
.cassette::after {
  content: "";
  position: absolute;
  top: 12px;
  width: 9px;
  height: 9px;
  border: 1px solid rgba(16, 18, 15, 0.48);
  border-radius: 50%;
  background:
    linear-gradient(45deg, transparent 43%, rgba(16, 18, 15, 0.45) 44% 56%, transparent 57%),
    #eee6d5;
}

.cassette::before {
  left: 13px;
}

.cassette::after {
  right: 13px;
}

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

.cassette.is-playing {
  animation: cassette-click 820ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.cassette.is-playing .cassette-reel {
  animation: reel-spin 820ms linear;
}

.cassette.is-playing .cassette-shell {
  animation: cassette-shell-jolt 820ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.cassette.is-playing .cassette-window {
  animation: tape-window-glow 820ms ease;
}

.cassette.is-playing + .song-now-playing {
  animation: now-playing-pop 520ms ease;
}

.cassette-shell {
  position: relative;
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
  border: 1px solid rgba(16, 18, 15, 0.46);
  border-radius: 6px;
  background:
    linear-gradient(rgba(16, 18, 15, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 18, 15, 0.035) 1px, transparent 1px),
    #cfc5ae;
  background-size: 18px 18px;
  padding: 18px 16px 14px;
}

.cassette-shell::before,
.cassette-shell::after {
  content: "";
  position: absolute;
  bottom: 12px;
  width: 9px;
  height: 9px;
  border: 1px solid rgba(16, 18, 15, 0.44);
  border-radius: 50%;
  background: #eee6d5;
}

.cassette-shell::before {
  left: 12px;
}

.cassette-shell::after {
  right: 12px;
}

.cassette-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  border: 1px solid rgba(16, 18, 15, 0.36);
  border-radius: 3px;
  background:
    repeating-linear-gradient(0deg, transparent 0 9px, rgba(16, 18, 15, 0.07) 10px),
    #f5ecd8;
  padding: 7px 10px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 10px;
  text-transform: uppercase;
}

.cassette-strip {
  display: flex;
  justify-content: center;
  align-items: center;
  border-top: 1px solid rgba(16, 18, 15, 0.24);
  padding-top: 8px;
  color: rgba(16, 18, 15, 0.7);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 10px;
  text-transform: uppercase;
}

.cassette-label span:first-child {
  font-weight: 800;
}

.cassette-label span:last-child,
.cassette-strip {
  color: var(--muted);
}

.avicii-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
}

.cassette-pill {
  border: 1px solid rgba(16, 18, 15, 0.22);
  border-radius: 999px;
  padding: 3px 7px;
  background: rgba(116, 217, 0, 0.18);
  color: var(--text);
  text-align: center;
  white-space: normal;
}

.cassette-window {
  min-height: 86px;
  display: grid;
  grid-template-columns: 66px minmax(50px, 1fr) 66px;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(16, 18, 15, 0.44);
  border-radius: 999px;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.6), transparent 55%),
    #211f1a;
  padding: 12px;
}

.cassette-reel {
  aspect-ratio: 1;
  border: 2px solid #f0e6d3;
  border-radius: 50%;
  background:
    radial-gradient(circle, #211f1a 0 12%, #f0e6d3 13% 21%, transparent 22%),
    conic-gradient(from 0deg, #f0e6d3 0 9deg, transparent 9deg 56deg, #f0e6d3 56deg 65deg, transparent 65deg 120deg, #f0e6d3 120deg 129deg, transparent 129deg 176deg, #f0e6d3 176deg 185deg, transparent 185deg 240deg, #f0e6d3 240deg 249deg, transparent 249deg 296deg, #f0e6d3 296deg 305deg, transparent 305deg 360deg),
    #3a3328;
}

.cassette-band {
  height: 8px;
  border-top: 2px solid #17140f;
  border-bottom: 2px solid #17140f;
}

.song-now-playing {
  min-height: 48px;
  margin: 0;
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  text-align: center;
  justify-items: center;
}

.song-now-playing span {
  color: var(--accent);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  text-transform: uppercase;
}

.song-now-playing strong {
  color: var(--text);
  font-size: 16px;
  line-height: 1.25;
}

.song-frame {
  position: fixed;
  top: -240px;
  left: -320px;
  width: 240px;
  height: 135px;
  border: 0;
  opacity: 0;
  clip-path: inset(50%);
  pointer-events: none;
}

@keyframes reel-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes cassette-click {
  0% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
  24% {
    transform: translateY(10px) rotate(-1.4deg) scale(0.985);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.72),
      inset 0 -8px 18px rgba(16, 18, 15, 0.12),
      0 8px 24px rgba(16, 18, 15, 0.2);
  }
  52% {
    transform: translateY(-4px) rotate(1deg) scale(1.012);
  }
  76% {
    transform: translateY(1px) rotate(-0.35deg) scale(1);
  }
  100% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
}

@keyframes cassette-shell-jolt {
  0%,
  100% {
    filter: none;
  }
  30% {
    filter: contrast(1.08) saturate(1.06);
  }
}

@keyframes tape-window-glow {
  0%,
  100% {
    box-shadow: none;
  }
  34% {
    box-shadow:
      inset 0 0 24px rgba(116, 217, 0, 0.16),
      0 0 0 2px rgba(116, 217, 0, 0.18);
  }
}

@keyframes now-playing-pop {
  0% {
    opacity: 0.4;
    transform: translateY(-4px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes floating-skip {
  0% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
  36% {
    transform: translateY(-3px) rotate(18deg) scale(1.08);
  }
  70% {
    transform: translateY(1px) rotate(-8deg) scale(0.98);
  }
  100% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
}

.videos {
  padding-top: 104px;
}

.video-heading {
  max-width: 980px;
}

.video-feature {
  margin-top: 44px;
  border-top: 1px solid var(--text);
  padding-top: 22px;
}

.video-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 24px;
  align-items: center;
}

.video-embed {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--text);
  border-radius: 6px;
  overflow: hidden;
  background: var(--text);
  box-shadow: var(--shadow);
}

.video-embed iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}

.video-meta {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) minmax(220px, 0.7fr);
  gap: 18px;
  align-items: baseline;
  padding-top: 18px;
  color: var(--muted);
}

.video-meta span {
  color: var(--accent);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.video-meta strong {
  color: var(--text);
  font-size: 20px;
  line-height: 1.2;
}

.video-meta p {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
}

.video-controls {
  display: grid;
  gap: 12px;
}

.video-nav {
  width: 96px;
  height: 96px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--text);
  border-radius: 4px;
  background: var(--text);
  color: white;
  cursor: pointer;
  transition:
    transform 180ms ease,
    background 180ms ease;
}

.video-nav svg {
  width: 34px;
  height: 34px;
}

.video-next:hover {
  transform: translateX(2px);
}

.video-prev:hover {
  transform: translateX(-2px);
}

.projects {
  display: block;
}

.project-list {
  margin-top: 58px;
  border-top: 1px solid var(--text);
}

.project-row {
  min-height: 154px;
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
  border-bottom: 1px solid var(--line-strong);
}

.project-preview {
  height: 104px;
  display: block;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: white;
  overflow: hidden;
  transition:
    border-color 180ms ease,
    transform 180ms ease;
}

.project-preview:hover {
  border-color: var(--text);
  transform: translateY(-1px);
}

.project-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: top left;
}

.project-main {
  display: grid;
  gap: 8px;
}

.project-row strong {
  display: block;
  font-size: 22px;
  line-height: 1.1;
}

.project-year {
  color: var(--faint);
  font-size: 12px;
}

.project-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.mini-button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.54);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 720;
  white-space: nowrap;
  transition:
    border-color 180ms ease,
    transform 180ms ease,
    background 180ms ease;
}

.mini-button:hover {
  border-color: var(--text);
  background: white;
  transform: translateY(-1px);
}

.contact {
  padding-top: 72px;
  padding-bottom: 46px;
}

.contact h2 {
  max-width: 900px;
}

@media (max-width: 860px) {
  .site-header {
    padding: 0 14px;
    grid-template-columns: 1fr auto;
  }

  nav {
    display: none;
  }

  .section {
    width: min(var(--max), calc(100% - 28px));
  }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 34px;
    padding: 52px 0 58px;
  }

  .hero-copy h1 {
    font-size: clamp(54px, 18vw, 88px);
  }

  .hero-copy p {
    font-size: 17px;
  }

  .life-knot-card {
    max-width: 520px;
  }

  .about,
  .videos,
  .projects,
  .contact {
    padding: 78px 0;
  }

  .contact {
    padding-top: 58px;
  }

  .about-grid,
  .about-details {
    grid-template-columns: 1fr;
  }

  .about-grid {
    gap: 18px;
  }

  .music-player {
    grid-template-columns: 1fr;
    max-width: 430px;
    justify-self: start;
  }

  .video-stage,
  .video-meta {
    grid-template-columns: 1fr;
  }

  .video-controls {
    display: flex;
    justify-self: end;
  }

  .video-nav {
    width: 72px;
    height: 72px;
  }

  .video-nav svg {
    width: 28px;
    height: 28px;
  }

  .project-row {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 24px 0;
  }

  .project-preview {
    height: 176px;
  }

  .project-main {
    gap: 9px;
  }

  .project-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .site-header {
    height: 64px;
  }

  .floating-tape {
    top: 76px;
    right: 14px;
    width: 42px;
    height: 42px;
    font-size: 14px;
  }

  .brand {
    font-size: 16px;
  }

  .social-links a {
    width: 34px;
    height: 34px;
  }

  .hero {
    padding-top: 40px;
  }

  .hero-actions,
  .contact-actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
    padding: 0 14px;
  }

  .project-actions {
    padding-left: 0;
  }

  .cassette-label,
  .cassette-strip {
    font-size: 9px;
  }

  .cassette-window {
    grid-template-columns: 58px minmax(38px, 1fr) 58px;
  }

  .mini-button {
    flex: 1;
  }
}
