:root {
  --color-bg: #ffffff;
  --color-text-primary: #111111;
  --color-text-body: #262626;
  --color-link: #22a7fa;
  --color-divider: #e5e5e5;
  --container-width: 800px;
  --container-left: 300px;
  --container-top: 75px;
  --font-family: 'Outfit', sans-serif;
}

[data-theme="dark"] {
  --color-bg: #222222;
  --color-text-primary: #eeeeee;
  --color-text-body: #bfbfbf;
  --color-divider: #353535;
}

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

html {
  scrollbar-width: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html::-webkit-scrollbar {
  display: none;
}

body {
  overflow-x: hidden;
  font-family: var(--font-family);
  background: var(--color-bg);
  color: var(--color-text-primary);
  transition: background-color 0.2s ease, color 0.2s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  display: flex;
  width: var(--container-width);
  margin-left: var(--container-left);
  padding-top: var(--container-top);
  padding-bottom: 150px;
  flex-direction: column;
  align-items: flex-start;
  gap: 40px;
}

.project-header {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.back-link,
.project-link {
  color: var(--color-link);
  font-size: 16px;
  line-height: 24px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.back-link {
  margin-bottom: 10px;
}

.project-title {
  color: var(--color-text-primary);
  font-size: 40px;
  font-weight: 500;
  line-height: 44px;
  letter-spacing: 0;
}

.project-subtitle {
  max-width: 620px;
  color: var(--color-text-body);
  font-size: 18px;
  font-weight: 400;
  line-height: 26px;
}

.project-figure {
  width: 100%;
}

.project-figure img,
.project-figure chess-replay-mascot {
  display: block;
  width: 100%;
  border: 1px solid var(--color-divider);
  border-radius: 8px;
}

.project-figure chess-replay-mascot {
  aspect-ratio: 11 / 6;
  background: hsl(0 0% 95%);
}

.divider {
  width: 100%;
  height: 0;
  border: 0;
  border-top: 1px solid var(--color-divider);
  margin: 10px 0;
}

.project-copy {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: flex-start;
}

.project-copy h2 {
  margin-bottom: 24px;
  color: var(--color-text-primary);
  font-size: 16px;
  font-weight: 500;
  line-height: 20px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.project-copy p {
  width: 100%;
  margin-bottom: 20px;
  color: var(--color-text-primary);
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  text-align: justify;
}

.project-actions {
  display: flex;
  margin-top: 8px;
  align-items: center;
  gap: 24px;
}

.project-actions .back-link {
  margin-bottom: 0;
}

.bottom-nav-wrapper {
  position: fixed;
  z-index: 1000;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

.bottom-nav {
  display: flex;
  width: 136px;
  height: 42px;
  padding: 4px 12px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: #222222;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2), 0 1px 3px rgba(0, 0, 0, 0.1);
  pointer-events: auto;
}

.nav-right,
.scroll-dots {
  display: flex;
  align-items: center;
}

.nav-right {
  gap: 12px;
}

.scroll-dots {
  height: 20px;
  gap: 8px;
}

.scroll-dot {
  width: 2.5px;
  height: 18px;
  flex: none;
  border-radius: 9999px;
  background: #e6e6e6;
  transition: height 0.25s ease, background-color 0.25s ease;
}

.scroll-dot:first-child,
.scroll-dot:last-child {
  background: #a6a6a6;
}

.scroll-dot.active {
  height: 20px;
  background: #0088ff;
}

.nav-theme-toggle {
  display: flex;
  width: 20px;
  height: 20px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
}

.nav-theme-toggle svg {
  width: 20px;
  height: 20px;
}

[data-theme="dark"] .nav-theme-toggle svg {
  transform: rotate(180deg);
}

@media (min-width: 481px) and (max-width: 1024px) {
  .container {
    width: 500px;
    margin: 0 auto;
  }
}

@media (max-width: 480px) {
  :root {
    --container-width: calc(100% - 48px);
    --container-left: 24px;
    --container-top: 60px;
  }

  .container {
    margin-right: 24px;
    padding-bottom: 100px;
  }

  .project-title {
    font-size: 32px;
    line-height: 38px;
  }

  .project-subtitle {
    font-size: 16px;
    line-height: 24px;
  }

  .project-copy p {
    text-align: left;
  }

  .project-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .bottom-nav-wrapper {
    bottom: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body,
  .scroll-dot {
    transition: none;
  }
}
