:root {
  --bg: #0f0f0f;
  --bg-deep: #070707;
  --panel: rgba(255, 255, 255, 0.08);
  --panel-strong: rgba(255, 255, 255, 0.14);
  --text: #f7f7f2;
  --muted: rgba(247, 247, 242, 0.68);
  --soft: rgba(247, 247, 242, 0.46);
  --line: rgba(255, 255, 255, 0.16);
  --accent: #e6ded1;
  --accent-dark: #cbbda9;
  --accent-cool: #7aa2ff;
  --accent-cool-dark: #4169d8;
  --accent-cool-soft: rgba(122, 162, 255, 0.16);
  --max-width: 1180px;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  font-family: "Inter", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.menu-open {
  overflow: hidden;
}

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

p,
h1,
h2 {
  margin: 0;
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  transition: background 0.25s ease, border-color 0.25s ease, backdrop-filter 0.25s ease;
}

.site-header.scrolled {
  border-bottom: 1px solid var(--line);
  background: rgba(15, 15, 15, 0.72);
  backdrop-filter: blur(18px);
}

.navbar {
  width: min(100% - 40px, var(--max-width));
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: rgba(247, 247, 242, 0.9);
  font-weight: 700;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  width: auto;
  height: auto;
  padding-bottom: 6px;
  border: 0;
  border-bottom: 1px solid rgba(122, 162, 255, 0.72);
  border-radius: 0;
  color: var(--accent);
  background: transparent;
  box-shadow: 0 10px 28px rgba(122, 162, 255, 0.18);
  font-size: 0.8rem;
  font-weight: 800;
}

.brand-text {
  font-size: 0.94rem;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-menu a {
  position: relative;
  padding: 7px 11px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

.nav-menu a::after {
  content: "";
  position: absolute;
  right: 14px;
  bottom: 3px;
  left: 14px;
  height: 1px;
  background: var(--accent-cool);
  box-shadow: 0 0 18px rgba(122, 162, 255, 0.9), 0 0 34px rgba(122, 162, 255, 0.5);
  opacity: 0;
  transform: scaleX(0.45);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.nav-menu a:hover {
  color: var(--text);
  text-shadow: 0 0 18px rgba(122, 162, 255, 0.4);
}

.nav-menu a:hover::after {
  opacity: 1;
  transform: scaleX(1);
}

.nav-contact {
  color: #ffffff !important;
  background: transparent !important;
  box-shadow: none;
}

.nav-contact:hover {
  color: #ffffff !important;
  background: transparent !important;
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: inset 0 -1px 0 rgba(122, 162, 255, 0.58), 0 10px 28px rgba(122, 162, 255, 0.12);
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 5px auto;
  border-radius: 2px;
  background: var(--text);
}

.scrollytelling {
  position: relative;
  background: var(--bg);
}

.story-scene {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 72px 20px 44px;
  overflow: hidden;
  isolation: isolate;
}

.story-scene::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -3;
  background-image: var(--scene-image);
  background-position: center;
  background-size: cover;
  filter: grayscale(0.25);
  opacity: 0.34;
  transform: scale(1.06);
  transition: opacity 1s ease, transform 1.6s ease, filter 1s ease;
}

.story-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 16% 50%, rgba(255, 255, 255, 0.12), transparent 28%),
    linear-gradient(90deg, rgba(7, 7, 7, 0.94) 0%, rgba(15, 15, 15, 0.8) 43%, rgba(15, 15, 15, 0.52) 100%),
    linear-gradient(180deg, rgba(7, 7, 7, 0.24), rgba(7, 7, 7, 0.82));
}

.opening-scene::after {
  background:
    radial-gradient(circle at 18% 48%, rgba(230, 222, 209, 0.16), transparent 30%),
    radial-gradient(circle at 82% 34%, rgba(122, 162, 255, 0.16), transparent 26%),
    linear-gradient(90deg, rgba(7, 7, 7, 0.96) 0%, rgba(15, 15, 15, 0.88) 50%, rgba(15, 15, 15, 0.58) 100%),
    linear-gradient(180deg, rgba(7, 7, 7, 0.1), rgba(7, 7, 7, 0.9));
}

.story-scene.is-visible::before {
  opacity: 0.48;
  transform: scale(1);
  filter: grayscale(0.08);
}

.story-scene::selection {
  color: var(--bg);
  background: var(--accent);
}

.scene-content {
  width: min(100%, var(--max-width));
  margin: 0 auto;
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.85s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.85s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.story-scene.is-visible .scene-content {
  opacity: 1;
  transform: translateY(0);
}

.story-scene:nth-child(even) .scene-content {
  padding-left: 0;
}

.story-scene:nth-child(3n) .scene-content {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}

.story-scene:nth-child(3n)::after {
  background:
    radial-gradient(circle at 82% 50%, rgba(255, 255, 255, 0.1), transparent 28%),
    linear-gradient(270deg, rgba(7, 7, 7, 0.94) 0%, rgba(15, 15, 15, 0.78) 48%, rgba(15, 15, 15, 0.54) 100%),
    linear-gradient(180deg, rgba(7, 7, 7, 0.24), rgba(7, 7, 7, 0.82));
}

.story-scene[data-step] .scene-content::before {
  content: attr(data-step);
}

.story-scene[data-step]::marker {
  content: "";
}

.scene-content::before {
  content: "";
}

.story-scene::selection,
.scene-content::selection {
  background: var(--accent);
}

.story-scene .scene-content {
  position: relative;
}

.story-scene .scene-content::after {
  content: attr(data-empty);
}

.story-scene[data-step] .scene-content {
  --step-label: attr(data-step);
}

.story-scene[data-step] .scene-kicker::before {
  content: attr(data-step);
  display: inline-flex;
  align-items: center;
  min-width: 24px;
  height: auto;
  margin-right: 12px;
  padding-bottom: 5px;
  border: 0;
  border-bottom: 1px solid rgba(122, 162, 255, 0.72);
  border-radius: 0;
  color: var(--accent-cool);
  box-shadow: 0 10px 26px rgba(122, 162, 255, 0.18);
  font-size: 0.72rem;
  font-weight: 800;
}

.scene-kicker {
  display: inline-flex;
  align-items: center;
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  max-width: 920px;
  margin-bottom: 0;
  color: var(--text);
  font-size: clamp(3.1rem, 8vw, 7.2rem);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 0.95;
}

h2 {
  max-width: 960px;
  font-size: clamp(2.7rem, 6.5vw, 6.2rem);
}

.hero-name {
  max-width: 1060px;
  font-size: clamp(3.1rem, 8vw, 7.2rem);
}

.hero-role {
  max-width: 620px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.45rem);
  font-weight: 700;
  line-height: 1.45;
}

.scene-question {
  max-width: 760px;
  margin: 30px 0 0;
  color: var(--accent);
  font-size: clamp(1.5rem, 3vw, 2.65rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.scene-note {
  max-width: 560px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  line-height: 1.75;
}

.scroll-story-hint {
  display: inline-block;
  max-width: 680px;
  margin: 24px 0 0;
  padding-bottom: 8px;
  color: transparent;
  background: linear-gradient(90deg, #7aa2ff, #b58cff, #ff8ec7, #ffd166, #7aa2ff);
  background-size: 240% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  font-size: clamp(1rem, 1.8vw, 1.35rem);
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.45;
  text-shadow: 0 0 26px rgba(122, 162, 255, 0.22);
  animation: rainbowFlow 7s linear infinite;
}

.scroll-story-hint::after {
  content: "";
  display: block;
  width: min(100%, 360px);
  height: 1px;
  margin-top: 9px;
  background: linear-gradient(90deg, #7aa2ff, #b58cff, #ff8ec7, #ffd166);
  box-shadow: 0 0 22px rgba(122, 162, 255, 0.7), 0 0 42px rgba(255, 142, 199, 0.28);
}

@keyframes rainbowFlow {
  from {
    background-position: 0% 50%;
  }

  to {
    background-position: 240% 50%;
  }
}

.process-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 740px;
  margin-top: 34px;
}

.process-strip span {
  position: relative;
  padding: 0 0 9px;
  border: 0;
  border-radius: 0;
  color: rgba(247, 247, 242, 0.84);
  background: transparent;
  box-shadow: inset 0 -1px 0 rgba(122, 162, 255, 0.62), 0 10px 30px rgba(122, 162, 255, 0.13);
  font-size: 0.88rem;
  font-weight: 700;
  backdrop-filter: blur(10px);
}

.scene-actions {
  margin-top: 34px;
}

.final-scene::after {
  background:
    linear-gradient(90deg, rgba(7, 7, 7, 0.96) 0%, rgba(15, 15, 15, 0.86) 50%, rgba(15, 15, 15, 0.72) 100%),
    linear-gradient(180deg, rgba(7, 7, 7, 0.18), rgba(7, 7, 7, 0.92));
}

.final-scene {
  padding-bottom: 0;
}

.cta-panel {
  position: relative;
  overflow: hidden;
  max-width: 680px;
  margin-top: 34px;
  padding: 24px 0 4px;
  border: 0;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.08), rgba(122, 162, 255, 0.05) 46%, rgba(255, 255, 255, 0.025)),
    rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 26px 90px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(22px) saturate(130%);
}

.final-scene .cta-panel {
  align-self: center;
  width: 100vw;
  max-width: none;
  margin: 56px calc(50% - 50vw) 0;
  padding: 34px max(20px, calc((100vw - var(--max-width)) / 2)) 38px;
  text-align: center;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.09), rgba(122, 162, 255, 0.07) 48%, rgba(255, 255, 255, 0.035)),
    linear-gradient(180deg, rgba(15, 15, 15, 0.78), var(--bg-deep));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -1px 0 rgba(122, 162, 255, 0.12),
    0 -28px 90px rgba(0, 0, 0, 0.22);
}

.cta-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: min(380px, 70%);
  height: 1px;
  background: var(--accent-cool);
  box-shadow: 0 0 24px rgba(122, 162, 255, 0.9), 0 0 70px rgba(122, 162, 255, 0.42);
}

.final-scene .cta-panel::before {
  left: 50%;
  width: min(760px, calc(100% - 40px));
  transform: translateX(-50%);
}

.cta-panel p {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 1rem;
}

.final-scene .cta-panel p {
  max-width: 720px;
  margin-right: auto;
  margin-left: auto;
  font-size: clamp(1rem, 1.8vw, 1.2rem);
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.final-scene .cta-actions {
  justify-content: center;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 0 0 12px;
  border: 0;
  border-radius: 0;
  font-size: 0.94rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  overflow: visible;
  isolation: isolate;
  transition: transform 0.2s ease, color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.btn::before {
  content: "";
  position: absolute;
  inset: auto 0 -4px;
  z-index: -1;
  height: 10px;
  border-radius: 0;
  background: var(--accent-cool);
  filter: blur(16px);
  opacity: 0.58;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.btn::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 4px;
  left: 0;
  height: 1px;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 18px rgba(122, 162, 255, 0.9);
  opacity: 0.55;
}

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

.btn:hover::before {
  opacity: 0.9;
  transform: scaleX(1.08);
}

.btn-primary {
  color: #ffffff;
  background: transparent;
  box-shadow: none;
  text-shadow: 0 0 24px rgba(122, 162, 255, 0.32);
}

.btn-primary:hover {
  background: transparent;
}

.btn-secondary {
  color: var(--accent);
  background: transparent;
  box-shadow: none;
}

.btn-secondary:hover {
  color: #ffffff;
  background: transparent;
}

.scroll-progress {
  position: fixed;
  right: 24px;
  top: 50%;
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transform: translateY(-50%);
  color: var(--soft);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.progress-track {
  position: relative;
  width: 2px;
  height: 160px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.16);
}

.progress-fill {
  position: absolute;
  inset: 0 0 auto;
  height: 0%;
  border-radius: inherit;
  background: linear-gradient(180deg, var(--accent), var(--accent-cool));
  transition: height 0.25s ease;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 18px;
  padding: 28px 20px;
  border-top: 1px solid var(--line);
  color: var(--soft);
  background: var(--bg-deep);
  font-size: 0.88rem;
}

.scrollytelling + .footer {
  border-top: 0;
}

.footer p {
  margin-bottom: 0;
}

.footer a {
  color: var(--muted);
  transition: color 0.2s ease;
}

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

/* Standalone pages */
.page-shell {
  min-height: 100vh;
  padding: 110px 20px 70px;
  background:
    radial-gradient(circle at 18% 18%, rgba(122, 162, 255, 0.14), transparent 28%),
    radial-gradient(circle at 86% 42%, rgba(230, 222, 209, 0.12), transparent 26%),
    var(--bg);
}

.page-inner {
  width: min(100%, var(--max-width));
  margin: 0 auto;
}

.page-hero {
  max-width: 860px;
  margin-bottom: 46px;
}

.page-hero h1 {
  font-size: clamp(2.8rem, 7vw, 6rem);
}

.page-hero p {
  max-width: 690px;
  color: var(--muted);
  font-size: 1.08rem;
}

.page-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 26px 0 0;
}

.page-links a {
  position: relative;
  padding: 9px 12px;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  background: transparent;
  font-size: 0.86rem;
  font-weight: 700;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

.page-links a::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 3px;
  left: 12px;
  height: 1px;
  border-radius: 0;
  background: var(--accent-cool);
  box-shadow: 0 0 18px rgba(122, 162, 255, 0.82), 0 0 30px rgba(122, 162, 255, 0.42);
  opacity: 0.45;
}

.page-links a:hover {
  color: #ffffff;
  text-shadow: 0 0 18px rgba(122, 162, 255, 0.5);
}

.home-link {
  color: var(--accent) !important;
}

.home-link span {
  display: inline-block;
  margin-right: 6px;
  color: var(--accent-cool);
  text-shadow: 0 0 18px rgba(122, 162, 255, 0.72);
}

.page-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.page-card {
  position: relative;
  overflow: hidden;
  min-height: 220px;
  padding: 26px 24px;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.035) 42%, rgba(122, 162, 255, 0.055)),
    rgba(255, 255, 255, 0.028);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -1px 0 rgba(122, 162, 255, 0.12),
    0 24px 80px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(24px) saturate(135%);
}

.page-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 64%;
  height: 1px;
  background: rgba(122, 162, 255, 0.9);
  box-shadow: 0 0 26px rgba(122, 162, 255, 0.7), 0 0 72px rgba(122, 162, 255, 0.34);
}

.page-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.13), transparent 26%, transparent 72%, rgba(122, 162, 255, 0.08));
  opacity: 0.55;
}

.page-card h2,
.page-card h3 {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 1.12rem;
  letter-spacing: 0;
  line-height: 1.3;
}

.page-card p,
.page-card li {
  color: var(--muted);
  font-size: 0.94rem;
}

.page-card ul {
  padding-left: 18px;
  margin: 0;
}

.page-card.featured {
  background:
    linear-gradient(135deg, rgba(122, 162, 255, 0.17), rgba(255, 255, 255, 0.055) 46%, rgba(230, 222, 209, 0.06)),
    rgba(255, 255, 255, 0.035);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -1px 0 rgba(122, 162, 255, 0.2),
    0 28px 95px rgba(65, 105, 216, 0.13),
    0 24px 80px rgba(0, 0, 0, 0.22);
}

.portfolio-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-label {
  display: inline-flex;
  margin-bottom: 18px;
  padding: 0 0 8px;
  border-radius: 0;
  color: var(--accent-cool);
  background: transparent;
  box-shadow: inset 0 -1px 0 rgba(122, 162, 255, 0.72), 0 10px 28px rgba(122, 162, 255, 0.16);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@media (max-width: 860px) {
  .menu-toggle {
    display: block;
  }

  .nav-menu {
    position: fixed;
    inset: 72px 20px auto;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
    border: 0;
    border-radius: 0;
    background:
      linear-gradient(135deg, rgba(255, 255, 255, 0.09), rgba(122, 162, 255, 0.05)),
      rgba(15, 15, 15, 0.84);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 24px 80px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(22px) saturate(130%);
  }

  .nav-menu.open {
    display: flex;
  }

  .nav-menu a {
    padding: 13px 14px;
  }

  .story-scene:nth-child(even) .scene-content {
    padding-left: 0;
  }

  .story-scene:nth-child(3n) .scene-content {
    align-items: flex-start;
    text-align: left;
  }

  .story-scene:nth-child(3n)::after,
  .story-scene::after {
    background:
      linear-gradient(90deg, rgba(7, 7, 7, 0.94) 0%, rgba(15, 15, 15, 0.82) 62%, rgba(15, 15, 15, 0.58) 100%),
      linear-gradient(180deg, rgba(7, 7, 7, 0.2), rgba(7, 7, 7, 0.86));
  }

  .scroll-progress {
    right: 12px;
  }

  .page-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .navbar {
    width: min(100% - 28px, var(--max-width));
  }

  .brand-text {
    display: none;
  }

  .story-scene {
    min-height: 100svh;
    padding: 76px 16px 36px;
  }

  .final-scene {
    padding-bottom: 0;
  }

  h1,
  h2 {
    font-size: clamp(2.55rem, 14vw, 4.25rem);
    letter-spacing: -0.05em;
  }

  .hero-name {
    font-size: clamp(2.75rem, 14vw, 4.5rem);
  }

  .hero-role {
    margin-top: 14px;
    font-size: clamp(0.98rem, 4vw, 1.14rem);
  }

  .scene-note {
    max-width: 100%;
  }

  .scroll-story-hint {
    margin-top: 18px;
    font-size: 0.95rem;
  }

  .cta-panel {
    padding: 16px;
  }

  .cta-actions,
  .btn {
    width: 100%;
  }

  .page-grid {
    grid-template-columns: 1fr;
  }

  .page-shell {
    padding: 92px 16px 56px;
  }

  .scroll-progress {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .scene-content {
    opacity: 1;
    transform: none;
  }
}
