@import url("https://fonts.googleapis.com/css2?family=Merriweather:wght@300;400;700&family=Montserrat:wght@400;500;600;700&display=swap");

/* Reset and Base */
:root {
  --bg: #0b0b12;
  --surface: #151525;
  --surface-2: #1c1c31;
  --text: #f3f3ff;
  --muted: #b5b6d3;
  --accent: #8b5cf6;
  --accent-2: #a78bfa;
  --border: #2c2c48;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 10px 24px rgba(3, 4, 14, 0.35);
  --shadow-md: 0 16px 40px rgba(4, 6, 20, 0.45);
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
}

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

html {
  scroll-behavior: smooth;
}

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

body {
  font-family: "Merriweather", serif;
  color: var(--text);
  line-height: 1.6;
  background:
    radial-gradient(
      circle at top right,
      rgba(167, 139, 250, 0.1),
      transparent 45%
    ),
    linear-gradient(180deg, #101026 0%, var(--bg) 100%);
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Typography */
h1,
h2,
h3,
h4 {
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text);
}

h1 {
  font-size: 2.5rem;
  border-bottom: 3px solid var(--accent);
  padding-bottom: 0.5rem;
  margin-bottom: 2rem;
}

h2 {
  font-size: 2rem;
  color: var(--accent-2);
  margin-top: 2rem;
}

h3 {
  font-size: 1.5rem;
  color: var(--text);
}

a {
  color: var(--accent-2);
  transition: color 0.3s ease;
}

a:hover {
  color: var(--accent);
}

/* Header */
header {
  background: linear-gradient(
    180deg,
    rgba(28, 28, 49, 0.95),
    rgba(21, 21, 37, 0.95)
  );
  border-bottom: 1px solid rgba(167, 139, 250, 0.22);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 9999;
  overflow: visible;
}

header .container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 80px;
}

nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: clamp(0.65rem, 1.45vw, 1.3rem);
}

nav li {
  position: relative;
}

nav a {
  text-decoration: none;
  color: var(--muted);
  font-family: "Montserrat", sans-serif;
  font-weight: 500;
  font-size: 0.95rem;
  white-space: nowrap;
  transition: color 0.3s ease;
}

.nav-dropdown::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 0.55rem;
}

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

.dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  min-width: 240px;
  padding: 0.6rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(167, 139, 250, 0.2);
  background: linear-gradient(
    180deg,
    rgba(28, 28, 49, 0.98),
    rgba(21, 21, 37, 0.98)
  );
  box-shadow: var(--shadow-md);
  display: none;
  flex-direction: column;
  gap: 0;
  z-index: 10000;
}

.dropdown-menu li {
  width: 100%;
}

.dropdown-menu a {
  display: block;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  font-size: 0.9rem;
}

.dropdown-menu a:hover {
  background-color: rgba(167, 139, 250, 0.14);
  color: var(--text);
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu {
  display: flex;
}


.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 2500;
  background: rgba(5, 6, 14, 0.45);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
}

.mobile-nav-overlay.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Main Content */
main {
  min-height: 60vh;
  padding: 4rem 0;
}

/* Hero Section for Homepage */
.hero {
  text-align: center;
  padding: 3rem 0;
  background: linear-gradient(
    145deg,
    rgba(28, 28, 49, 0.9),
    rgba(21, 21, 37, 0.95)
  );
  border: 1px solid rgba(167, 139, 250, 0.24);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: 3rem;
}

.profile-photo {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--accent);
  margin-bottom: 1.5rem;
}

.tagline {
  font-size: 1.25rem;
  color: var(--accent-2);
  font-family: "Montserrat", sans-serif;
  font-weight: 500;
  margin-bottom: 1rem;
}

.hero-kicker {
  font-family: "Montserrat", sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.hero-name {
  margin: 0 auto 1rem;
  border-bottom: none;
  padding-bottom: 0;
  font-size: clamp(2.25rem, 6vw, 3.75rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.hero-name span {
  color: var(--accent-2);
  display: inline-block;
  text-shadow: 0 0 30px rgba(167, 139, 250, 0.45);
}

.hero-actions {
  margin-top: 2rem;
}

.section-intro {
  text-align: center;
  margin: 4rem 0;
  padding: 2rem;
  background: linear-gradient(
    160deg,
    rgba(28, 28, 49, 0.9),
    rgba(21, 21, 37, 0.95)
  );
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.section-intro__text {
  font-size: 1.2rem;
  color: var(--muted);
  max-width: 800px;
  margin: 1rem auto 0;
}

.section-update {
  margin: 4rem 0;
  padding: 2rem;
  background: linear-gradient(
    160deg,
    rgba(28, 28, 49, 0.9),
    rgba(21, 21, 37, 0.95)
  );
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.section-update__title {
  text-align: center;
  margin-bottom: 0.75rem;
}

.section-update__body {
  text-align: center;
  color: var(--muted);
}

.section-update__cta {
  text-align: center;
  margin-top: 1.5rem;
}

/* Buttons */
.button {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--text);
  padding: 0.8rem 2rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-family: "Montserrat", sans-serif;
  font-weight: 500;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease,
    filter 0.3s ease;
  border: none;
  cursor: pointer;
  margin: 0.5rem;
  box-shadow: 0 12px 24px rgba(139, 92, 246, 0.28);
}

.button:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(139, 92, 246, 0.38);
  color: var(--text);
}

.button:focus-visible {
  color: var(--text);
}

.button-disabled,
.button[aria-disabled="true"] {
  background: #5f6673;
  color: rgba(255, 255, 255, 0.8);
  box-shadow: none;
  cursor: not-allowed;
  pointer-events: none;
  filter: none;
}

.button-disabled:hover,
.button[aria-disabled="true"]:hover {
  transform: none;
  box-shadow: none;
  filter: none;
}

.button-outline {
  background: transparent;
  border: 2px solid var(--accent-2);
  color: var(--accent-2);
}

.button-outline:hover {
  background: rgba(167, 139, 250, 0.14);
  color: var(--text);
}

/* Cards */
.card {
  background: linear-gradient(
    160deg,
    rgba(28, 28, 49, 0.9),
    rgba(21, 21, 37, 0.95)
  );
  padding: 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(167, 139, 250, 0.2);
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.card h3 {
  margin-top: 0;
  color: var(--text);
}


.book-cover {
  width: min(100%, 320px);
  display: block;
  border-radius: var(--radius-md);
  border: 1px solid rgba(167, 139, 250, 0.25);
  box-shadow: var(--shadow-sm);
  margin: 0 auto 1.25rem;
}

/* Grid Layout */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  background: var(--surface);
  border: 1px solid rgba(167, 139, 250, 0.16);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

th {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  color: var(--text);
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  padding: 1rem;
}

td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}

tr:last-child td {
  border-bottom: none;
}

/* Zone Colors */
.green-zone {
  color: var(--success);
  font-weight: bold;
}
.yellow-zone {
  color: var(--warning);
  font-weight: bold;
}
.red-zone {
  color: var(--danger);
  font-weight: bold;
}

/* Equation styling */
.equation {
  background: linear-gradient(
    145deg,
    rgba(52, 211, 153, 0.08),
    rgba(139, 92, 246, 0.07)
  );
  padding: 1.5rem;
  border-radius: var(--radius-md);
  font-family: "Courier New", monospace;
  font-size: 1.2rem;
  text-align: center;
  margin: 1.5rem 0;
  border: 1px solid rgba(52, 211, 153, 0.3);
  border-left: 4px solid var(--success);
  color: var(--text);
}

.about-story-layout {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.about-story-image {
  flex: 1;
  min-width: 250px;
}

.about-story-copy {
  flex: 2;
}

/* Footer */
footer {
  background: linear-gradient(180deg, #111124 0%, var(--bg) 100%);
  border-top: 1px solid rgba(167, 139, 250, 0.2);
  color: var(--muted);
  padding: 3rem 0;
  margin-top: 4rem;
}

footer a {
  color: var(--accent-2);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
  header .container {
    justify-content: flex-start;
    height: auto;
    padding: 1rem 0;
    overflow: visible;
  }

  header nav {
    width: 100%;
    padding: 0 1rem 0.2rem;
    overflow: visible;
  }

  nav ul {
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 0.95rem;
    margin-top: 0;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.15rem 0 0.4rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.72) rgba(21, 21, 37, 0.9);
  }

  nav ul::-webkit-scrollbar {
    height: 6px;
  }

  nav ul::-webkit-scrollbar-track {
    background: rgba(21, 21, 37, 0.82);
    border-radius: 999px;
  }

  nav ul::-webkit-scrollbar-thumb {
    background: linear-gradient(
      90deg,
      rgba(139, 92, 246, 0.85),
      rgba(167, 139, 250, 0.9)
    );
    border-radius: 999px;
  }

  nav ul::-webkit-scrollbar-thumb:hover {
    background: rgba(167, 139, 250, 0.95);
  }

  nav > ul > li > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.4rem;
    padding: 0.5rem 0.9rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(167, 139, 250, 0.25);
    background: var(--surface-2);
    color: var(--text);
    transition:
      color 0.25s ease,
      background-color 0.25s ease,
      border-color 0.25s ease,
      box-shadow 0.25s ease;
  }

  nav > ul > li > a:hover {
    background: rgba(167, 139, 250, 0.2);
    border-color: rgba(167, 139, 250, 0.48);
    color: var(--text);
  }

  .nav-dropdown.is-open > a,
  nav.mobile-dropdown-open [data-mobile-active-menu] {
    background: linear-gradient(
      180deg,
      rgba(139, 92, 246, 0.22),
      rgba(28, 28, 49, 0.96)
    );
    border-color: rgba(167, 139, 250, 0.7);
    color: var(--text);
    box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.35);
  }

  .dropdown-menu {
    position: fixed;
    top: calc(var(--mobile-dropdown-top, 4.75rem));
    left: 1rem;
    right: 1rem;
    transform: none;
    width: auto;
    max-height: calc(100vh - var(--mobile-dropdown-top, 4.75rem) - 1rem);
    overflow-y: auto;
    padding: 0.75rem;
    border-radius: var(--radius-lg);
    border-color: rgba(167, 139, 250, 0.36);
    box-shadow: var(--shadow-md);
    z-index: 2600;
    transition:
      opacity 0.25s ease,
      transform 0.25s ease,
      visibility 0.25s ease;
  }

  .dropdown-menu a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0.65rem 0.8rem;
    gap: 0.5rem;
  }

  .dropdown-menu a::after {
    content: var(--dropdown-item-icon, "›");
    margin-left: auto;
    padding-left: 0.4rem;
    color: rgba(243, 243, 255, 0.58);
    font-size: 0.9em;
    line-height: 1;
  }

  .dropdown-menu a:active,
  .dropdown-menu a:focus-visible {
    background: rgba(167, 139, 250, 0.2);
    color: var(--text);
    box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.42);
    outline: none;
  }

  .dropdown-menu li + li {
    border-top: 1px solid rgba(167, 139, 250, 0.15);
    margin-top: 0.2rem;
    padding-top: 0.2rem;
  }

  .mobile-nav-overlay .dropdown-menu {
    display: flex;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    pointer-events: none;
  }

  .mobile-nav-overlay.is-visible .dropdown-menu.is-overlay-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }

  @media (prefers-reduced-motion: reduce) {
    .dropdown-menu,
    .mobile-nav-overlay .dropdown-menu,
    .mobile-nav-overlay.is-visible .dropdown-menu.is-overlay-open {
      transition: none;
      transform: none;
    }
  }

  h1 {
    font-size: 2rem;
  }
  h2 {
    font-size: 1.5rem;
  }

  .hero {
    padding: 2.5rem 1.25rem;
  }

  .hero-actions {
    margin-top: 1.5rem;
  }

  .section-intro,
  .section-update {
    margin: 2.5rem 0;
    padding: 1.5rem;
  }

  .section-intro__text,
  .section-update__body {
    font-size: 1.05rem;
  }

  .section-update__title {
    font-size: 1.35rem;
  }

  .about-story-layout {
    flex-direction: column;
  }

  .about-story-image,
  .about-story-copy {
    width: 100%;
    min-width: 0;
  }

  .book-cover {
    width: 100%;
    max-width: min(320px, calc(100vw - 5rem));
    max-height: 70vh;
    height: auto;
    object-fit: contain;
  }
}

.blog-post {
  max-width: 900px;
  margin: 0 auto;
}

.blog-post h1 {
  margin-top: 0.5rem;
}

.blog-post__subtitle {
  margin-top: -0.2rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.blog-post__hero-image {
  width: 100%;
  height: auto;
  border-radius: 0.85rem;
  margin-bottom: 1.5rem;
}

.blog-post__hero-image--narrow {
  width: 50%;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.blog-post__eyebrow {
  font-family: "Montserrat", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.82rem;
  color: var(--accent-2);
  margin-bottom: 0.5rem;
}

.blog-post p {
  color: var(--muted);
  margin-bottom: 1.2rem;
}

.blog-post__links {
  margin-top: 2.5rem;
  border-top: 1px solid rgba(167, 139, 250, 0.24);
  padding-top: 2rem;
}

.blog-post__link-grid {
  margin-top: 1rem;
}

.blog-post__link-card {
  text-decoration: none;
  display: block;
}

.blog-post__link-card h3 {
  margin-top: 0;
  color: var(--accent-2);
}

.blog-post__link-card p {
  margin-bottom: 0;
}
