:root {
  --warm-bg: #faf8f6;
  --text-primary: #1a0f08;
  --text-secondary: #5c483a;
  --text-tertiary: #8a7568;
  --accent: #c96844;
  --border: rgba(140, 117, 104, 0.12);
  font-size: 16px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(180deg, #faf8f6 0%, #fbf6f2 100%);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 4%;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(250, 248, 246, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 100;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: #262626;
  text-decoration: none;
}

.nav__logo:hover {
  text-decoration: none;
}

.nav__logo-icon {
  flex-shrink: 0;
  display: block;
  opacity: 0.9;
}

.nav__logo-text {
  line-height: 1;
  text-decoration: none;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.nav__links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  transition: color 0.2s ease;
}

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

/* Dropdown Menu */
.nav__dropdown {
  position: relative;
}

.nav__dropdown-trigger {
  background: none;
  border: none;
  font-family: inherit;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  transition: color 0.2s ease;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav__dropdown-trigger::after {
  content: '';
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  opacity: 0.6;
  transition: transform 0.2s ease;
}

.nav__dropdown:hover .nav__dropdown-trigger::after {
  transform: rotate(180deg);
}

.nav__dropdown-trigger:hover {
  color: var(--text-primary);
}

.nav__dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.75rem;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.5rem 0;
  min-width: 140px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.nav__dropdown:hover .nav__dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav__dropdown-menu a {
  display: block;
  padding: 0.625rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav__dropdown-menu a:hover {
  background-color: rgba(0, 0, 0, 0.03);
  color: var(--text-primary);
}

.hero {
  flex: 1;
  display: flex;
  align-items: center;
  margin-top: 4rem;
  min-height: calc(85vh - 4rem);
  padding-top: max(12vh, 5rem);
  padding-bottom: max(2vh, 1rem);
}

.hero__content {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 4% 2rem;
}

.hero__content h1 {
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: clamp(2rem, 4vh, 2.5rem);
}

.hero__description {
  font-size: 1rem;
  line-height: 1.7;
  background: linear-gradient(180deg, var(--text-secondary) 0%, var(--text-tertiary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 400;
  margin-bottom: clamp(1.5rem, 3vh, 2rem);
  letter-spacing: 0.002em;
}

.hero__details {
  font-size: 1rem;
  line-height: 1.7;
  background: linear-gradient(180deg, var(--text-secondary) 0%, var(--text-tertiary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: clamp(1.25rem, 2.5vh, 1.75rem);
}

.hero__backing {
  font-size: 0.9375rem;
  color: var(--text-tertiary);
  margin-bottom: 2.5rem;
  letter-spacing: 0.01em;
}

.hero__backing strong {
  color: var(--text-secondary);
  font-weight: 500;
}

.hero__cta {
  display: inline-block;
  color: var(--accent);
  text-decoration: none;
  padding: 0;
  font-weight: 500;
  font-size: 0.9375rem;
  letter-spacing: 0.01em;
  border-bottom: 1.5px solid var(--accent);
  transition: opacity 0.2s ease;
  margin-top: clamp(1rem, 2vh, 1.5rem);
}

.hero__cta:hover {
  opacity: 0.7;
}

.research {
  max-width: 720px;
  margin: 0 auto;
  padding: 6rem 4%;
}

.research h2 {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-tertiary);
  margin-bottom: 2.5rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.research__grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.research__item {
  padding: 0;
}

.research__item h3 {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  letter-spacing: -0.005em;
  display: inline;
}

.research__item p {
  font-size: 0.9375rem;
  background: linear-gradient(180deg, var(--text-secondary) 0%, var(--text-tertiary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.65;
  display: inline;
}

.footer {
  padding: 3rem 4%;
  color: var(--text-tertiary);
  font-size: 0.875rem;
  text-align: center;
  letter-spacing: 0.01em;
}

.footer__links {
  margin-top: 0.5rem;
}

.footer__links a {
  color: var(--text-tertiary);
  text-decoration: none;
}

.footer__links a:hover {
  color: var(--text-secondary);
  text-decoration: underline;
}

a:focus-visible {
  outline: 1.5px solid var(--accent);
  outline-offset: 4px;
}

::selection {
  background: rgba(201, 104, 68, 0.12);
  color: var(--text-primary);
}

/* About Page */
.about-page {
  padding: 8rem 4% 4rem;
  max-width: 720px;
  margin: 0 auto;
}

.about-page__content h1 {
  font-size: clamp(2.25rem, 4vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4rem;
}

.founders {
  display: grid;
  gap: 4rem;
  margin-bottom: 5rem;
}

.founder__header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.founder__info h2 {
  font-size: 1.375rem;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.founder__social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  transition: color 0.2s ease;
  text-decoration: none;
}

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

.founder__role {
  color: var(--text-tertiary);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8125rem;
  font-weight: 500;
}

.founder__bio {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.founder__contact {
  font-size: 0.9375rem;
  color: var(--text-tertiary);
}

/* Legal Pages (Privacy, Terms) */
.legal-content {
  margin-top: -2rem;
}

.legal-content__date {
  color: var(--text-tertiary);
  font-size: 0.875rem;
  margin-bottom: 2rem;
}

.legal-content h2 {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.legal-content p {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.legal-content ul {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.legal-content li {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.legal-content a {
  color: var(--text-primary);
  text-decoration: underline;
}

.legal-content a:hover {
  color: var(--text-secondary);
}

.origin-story,
.vision-section {
  margin-bottom: 3.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
}

.origin-story h2,
.vision-section h2 {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 1.75rem;
  letter-spacing: -0.01em;
}

.origin-story p,
.vision-section p {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

.origin-story__link {
  text-decoration: none;
  color: inherit;
}

.origin-story__title {
  cursor: pointer;
}

.origin-story__date {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.origin-story__cta {
  display: inline-block;
  margin-top: 1rem;
}

.origin-story ul {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.origin-story li {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.origin-story a:not(.origin-story__link):not(.hero__cta) {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent);
}

.origin-story a:not(.origin-story__link):not(.hero__cta):hover {
  opacity: 0.7;
}

@media (max-width: 768px) {
  .nav {
    padding: 1rem 5%;
    position: fixed;
  }

  .nav__links {
    gap: 1.5rem;
  }

  .nav__links a {
    font-size: 0.8125rem;
  }

  .hero {
    padding: 0 5%;
    margin-top: 3.5rem;
    min-height: auto;
    padding-top: clamp(4rem, 12vh, 6rem);
    padding-bottom: clamp(4rem, 12vh, 6rem);
  }

  .hero__content {
    padding: 0;
    max-width: none;
  }

  .hero__content h1 {
    font-size: clamp(1.5rem, 6vw, 2rem);
    line-height: 1.2;
    margin-bottom: clamp(1.5rem, 3.5vh, 2rem);
  }

  .hero__description,
  .hero__details {
    font-size: 0.9375rem;
    line-height: 1.65;
    margin-bottom: clamp(1rem, 2.5vh, 1.5rem);
  }

  .research {
    padding: 4rem 5%;
    max-width: none;
  }

  .research__grid {
    max-width: none;
  }

  .footer {
    padding: 2.5rem 5%;
  }

  .about-page {
    padding: 7rem 5% 3rem;
  }

  /* Hide desktop nav on mobile */
  .nav__links--desktop {
    display: none !important;
  }

  /* Show hamburger button on mobile */
  .nav__hamburger {
    display: flex !important;
  }
}

/* Hamburger Menu Button */
.nav__hamburger {
  display: none; /* Hidden on desktop */
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 101;
}

.nav__hamburger span {
  width: 100%;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.25s cubic-bezier(0.4, 0.0, 0.2, 1);
  transform-origin: center;
}

.nav__hamburger.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.nav__hamburger.active span:nth-child(2) {
  opacity: 0;
}

.nav__hamburger.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Mobile Menu Overlay */
.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(250, 248, 246, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 99;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.4, 0.0, 0.2, 1),
              visibility 0.25s cubic-bezier(0.4, 0.0, 0.2, 1);
  overflow-y: auto;
  padding-top: 4.5rem;
}

.mobile-menu.active {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.mobile-menu__nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: center;
  padding: 2rem;
}

/* Individual menu items with staggered animation */
.mobile-menu__nav > a {
  display: block;
  padding: 1rem 2rem; /* Better touch targets */
  margin: 0 -2rem; /* Compensate for padding to maintain visual alignment */
  font-size: 1.75rem; /* Larger for main navigation */
  font-weight: 300; /* Lighter weight for elegance */
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.01em;
  opacity: 0;
  transform: translateY(20px);
  transition: color 0.2s ease,
              transform 0.2s ease,
              opacity 0.4s cubic-bezier(0.4, 0.0, 0.2, 1),
              background-color 0.2s ease;
  border-radius: 0.5rem;
  position: relative;
}

/* Staggered animation timing */
.mobile-menu.active .mobile-menu__nav > a {
  opacity: 1;
  transform: translateY(0);
}

.mobile-menu.active .mobile-menu__nav > a:nth-child(1) {
  transition-delay: 0.05s;
}
.mobile-menu.active .mobile-menu__nav > a:nth-child(2) {
  transition-delay: 0.1s;
}
.mobile-menu.active .mobile-menu__nav > a:nth-child(3) {
  transition-delay: 0.15s;
}
.mobile-menu.active .mobile-menu__nav > a:nth-child(4) {
  transition-delay: 0.2s;
}
.mobile-menu.active .mobile-menu__nav > a:nth-child(5) {
  transition-delay: 0.25s;
}
.mobile-menu.active .mobile-menu__nav > a:nth-child(6) {
  transition-delay: 0.3s;
}

/* Active page indicator */
.mobile-menu__nav > a.active {
  color: var(--accent);
}

.mobile-menu__nav > a.active::before {
  content: '';
  position: absolute;
  left: 0;
  width: 4px;
  height: 60%;
  top: 20%;
  background: var(--accent);
  border-radius: 2px;
}

/* Hover state with better touch feedback */
.mobile-menu__nav > a:hover,
.mobile-menu__nav > a:active {
  color: var(--accent);
  transform: translateX(4px);
  background-color: rgba(0, 0, 0, 0.02);
}

/* Descriptions under links */
.mobile-menu__nav > a > small {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  opacity: 0.6;
  margin-top: 0.25rem;
  letter-spacing: 0;
}

.mobile-menu__github {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  font-size: 1rem; /* Smaller for secondary action */
  font-weight: 400;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s cubic-bezier(0.4, 0.0, 0.2, 1),
              transform 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.mobile-menu.active .mobile-menu__github {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.3s; /* After all main navigation items */
}

.mobile-menu__github svg {
  width: 20px;
  height: 20px;
}

/* Mobile Sticky Header for Essay Pages */
.mobile-sticky-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 48px;
  background: rgba(250, 248, 246, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  transform: translateY(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.mobile-sticky-header.visible {
  display: flex;
  transform: translateY(0);
}

.mobile-sticky-header__back {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  padding: 0.5rem;
  margin-left: -0.5rem;
  border-radius: 0.25rem;
  transition: background-color 0.2s ease;
  flex-shrink: 0;
}

.mobile-sticky-header__back:hover,
.mobile-sticky-header__back:active {
  background-color: rgba(201, 104, 68, 0.08);
}

.mobile-sticky-header__back svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.mobile-sticky-header__title {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text-primary);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  padding: 0 1rem;
  opacity: 0.8;
}

.mobile-sticky-header__menu {
  background: none;
  border: none;
  padding: 0.5rem;
  margin-right: -0.5rem;
  display: flex;
  flex-direction: column;
  gap: 3px;
  cursor: pointer;
  flex-shrink: 0;
}

.mobile-sticky-header__menu span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.mobile-sticky-header__menu.active span:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}

.mobile-sticky-header__menu.active span:nth-child(2) {
  opacity: 0;
}

.mobile-sticky-header__menu.active span:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

/* Only show on mobile */
@media (min-width: 769px) {
  .mobile-sticky-header {
    display: none !important;
  }
}

/* Essay Metadata */
.essay-meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin: 1.5rem 0 2.5rem 0;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.essay-meta__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.essay-meta__item svg {
  width: 16px;
  height: 16px;
  opacity: 0.6;
  flex-shrink: 0;
}

.essay-meta__authors {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.essay-meta__author {
  color: var(--text-primary);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

.essay-meta__author:hover {
  color: var(--accent);
}

.essay-meta__date {
  color: var(--text-secondary);
}

.essay-meta__reading-time {
  color: var(--text-secondary);
}

@media (max-width: 768px) {
  .essay-meta {
    font-size: 0.85rem;
    gap: 1rem;
    padding: 0.75rem 0;
  }

  .essay-meta__item svg {
    width: 14px;
    height: 14px;
  }
}