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

:root {
  --bg: #0a090d;
  --text: #ffffff;
  --text-light: #bdc1c4;
  --link: #CCCCFF;
  --link-hover: #5D3FD3;
  --border: #333333;
  --border-dark: #bdc1c4;
  --primary: #2f7f93;
  --masthead-height: 80px;
  --sidebar-width: 260px;
}

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

html {
  height: 100%;
  background: var(--bg);
  color-scheme: dark;
  overscroll-behavior: none;
}

body {
  margin: 0;
  padding-top: var(--masthead-height);
  font-family: 'Raleway', -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  overscroll-behavior: none;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

/* ============================================================
   MASTHEAD
   ============================================================ */

.masthead {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--masthead-height);
  background: var(--bg);
  z-index: 100;
  display: flex;
  align-items: center;
}

.masthead__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.masthead__inner nav {
  margin-left: auto;
  margin-right: 3rem;
}

.site-title {
  font-family: 'Raleway', sans-serif;
  font-weight: 300;
  font-size: 18pt;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.05em;
}

.site-title:hover {
  color: var(--text);
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 2.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav li a {
  color: var(--text);
  text-decoration: none;
  font-family: 'Raleway', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.site-nav li a:hover {
  color: #5D3FD3;
  text-decoration: none;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  z-index: 101;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ============================================================
   SIDEBAR
   ============================================================ */

.page-container {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
}

.sidebar {
  position: sticky;
  top: var(--masthead-height);
  width: var(--sidebar-width);
  flex-shrink: 0;
  max-height: calc(100vh - var(--masthead-height));
  overflow-y: auto;
  padding: 2rem 1.5rem 2rem 2rem;
}

.author__avatar img {
  width: 100%;
  display: block;
}

.author__content {
  margin-top: 1rem;
}

.author__name {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.35rem 0;
  color: var(--text);
}

.author__bio {
  font-size: 0.8rem;
  color: var(--text);
  margin: 0 0 0.75rem 0;
  line-height: 1.5;
}

.author__urls {
  list-style: none;
  margin: 0;
  padding: 0;
}

.author__urls li {
  font-size: 0.8rem;
  margin-bottom: 0.45rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.author__urls li i {
  width: 16px;
  text-align: center;
  color: var(--text-light);
  flex-shrink: 0;
}

.author__urls li a,
.author__urls li span {
  color: var(--text);
  text-decoration: none;
}

.author__urls li a:hover {
  color: var(--link);
  text-decoration: none;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */

@keyframes scaleUpIn {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes moveToRight {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(100%); }
}

.main-content {
  flex: 1;
  min-width: 0;
  padding-top: 2rem;
  padding-left: 3rem;
  padding-right: 3rem;
  padding-bottom: 4rem;
  animation: scaleUpIn 0.8s ease;
}

.main-content.is-exiting {
  animation: moveToRight 0.8s ease forwards;
}

.page__title {
  font-family: 'Raleway', sans-serif;
  font-size: 1.5rem;
  font-weight: 400;
  margin: 0 0 1.25rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  line-height: 1.3;
  letter-spacing: 0.1em;
}

.page__body p {
  font-size: 0.875rem;
  line-height: 2;
  margin-bottom: 1rem;
  color: var(--text);
}

.page__body h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 2rem 0 0.75rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.page__body h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
  padding-bottom: 0.2rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.page__body ul,
.page__body ol {
  font-size: 0.875rem;
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.page__body li {
  margin-bottom: 0.25rem;
}

.styled-list {
  list-style: none;
  padding-left: 1.5rem;
  line-height: 2;
}

.styled-list li {
  position: relative;
  margin-bottom: 1.5rem;
}

.styled-list li::before {
  content: "▪";
  position: absolute;
  left: -1.25rem;
}

.pub-tag {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #59AEB3;
  margin-left: 0.5rem;
}

.corner-mascot {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 83px;
  height: auto;
  pointer-events: none;
  z-index: 50;
  animation: scaleUpIn 0.8s ease;
}

.corner-mascot--small {
  width: 70.5px;
}

.corner-mascot.is-exiting {
  animation: moveToRight 0.8s ease forwards;
}

.page__body strong {
  font-weight: 600;
}

.btn-row {
  display: flex;
  gap: 2.5rem;
  margin-top: 1.5rem;
}

.page__body a.btn-outline {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  border: 1px solid #59AEB3;
  border-radius: 0;
  color: #59AEB3;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.page__body a.btn-outline:hover {
  background: #59AEB3;
  color: var(--bg);
  text-decoration: none;
}

.page__body a {
  color: var(--link);
}

.page__body .forg-logo {
  display: block;
  width: 140px;
  margin-top: 1rem;
}

.resume-embed {
  display: block;
  width: 100%;
  height: 85vh;
  border: 1px solid var(--border);
  background: #ffffff;
}

.resume-fallback {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 0.75rem;
}

.page__body a:hover {
  color: var(--link-hover);
}

.page__body img {
  max-width: 100%;
}

/* Stub pages */
.stub-notice {
  color: var(--text-light);
  font-style: italic;
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: 2rem;
}

/* ============================================================
   MOBILE (<=768px)
   ============================================================ */

@media (max-width: 768px) {
  :root {
    --masthead-height: 64px;
  }

  .site-title {
    font-size: 15.5pt;
  }

  .nav-toggle {
    display: flex;
  }

  .masthead__inner nav {
    margin-right: 0;
  }

  .site-nav {
    display: none;
    position: fixed;
    top: var(--masthead-height);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    z-index: 90;
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav li {
    border-bottom: 1px solid var(--border);
  }

  .site-nav li:last-child {
    border-bottom: none;
  }

  .site-nav li a {
    display: block;
    padding: 1rem 1.5rem;
  }

  .page-container {
    flex-direction: column;
  }

  .sidebar {
    position: static;
    width: 100%;
    max-height: none;
    overflow: visible;
    padding: 1.5rem 1.25rem 1rem;
  }

  .author__avatar {
    max-width: 240px;
    margin: 0;
  }

  .main-content {
    padding: 1rem 1.25rem 3rem;
  }

  .corner-mascot {
    display: none;
  }
}
