/* ===========================================
   steipete.me-style portfolio
   Exact visual match using plain HTML/CSS
   =========================================== */

@import url('variables.css');
@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:wght@400;700&display=swap');

/* Atkinson Hyperlegible — same typeface steipete.me uses */
/* Local woff files as primary, Google Fonts CDN as fallback */
@font-face {
  font-family: 'Atkinson';
  src: url('../fonts/atkinson-regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Atkinson';
  src: url('../fonts/atkinson-bold.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

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

/* ==================== BASE ==================== */
html {
  overflow-y: scroll;
  scroll-behavior: smooth;
}

body {
  font-family: 'Atkinson', 'Atkinson Hyperlegible', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: var(--foreground);
  background-color: var(--background);
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: color-mix(in srgb, var(--accent) 75%, transparent);
  color: var(--background);
}

/* ==================== LINKS ==================== */
a {
  color: inherit;
  text-decoration: none;
  outline-offset: 1px;
}

a:focus-visible {
  outline: 2px dashed var(--accent);
  outline-offset: 1px;
  text-decoration: none;
}

button:focus-visible {
  outline: 2px dashed var(--accent);
  outline-offset: 1px;
}

/* ==================== LAYOUT ==================== */
section,
footer,
header {
  max-width: 48rem; /* same as Tailwind max-w-3xl */
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
  width: 100%;
}

main {
  flex: 1;
}

/* ==================== HR ==================== */
.hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 0 auto;
  width: calc(100% - 2rem);
  max-width: calc(48rem - 2rem);
}

/* ==================== SKIP TO CONTENT ==================== */
.skip-to-content {
  position: absolute;
  top: -100%;
  left: 4rem;
  z-index: 50;
  background: var(--background);
  padding: 0.5rem 0.75rem;
  color: var(--accent);
  transition: all 0.15s ease;
}

.skip-to-content:focus {
  top: 1rem;
}

/* ==================== HEADER / NAV ==================== */
.nav-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.top-nav {
  position: relative;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 0;
  background: var(--background);
}

.site-title {
  font-size: 1.5rem;
  line-height: 1.75rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--foreground);
  text-decoration: none;
}

.site-title:hover {
  color: var(--accent);
}

/* Desktop nav */
nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

nav ul li a {
  display: block;
  padding: 0.5rem 0.5rem;
  font-weight: 500;
  color: var(--foreground);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

nav ul li a.active-nav {
  text-decoration: underline;
  text-decoration-style: wavy;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  text-decoration-color: var(--accent);
}

/* Theme toggle button in nav */
.theme-btn {
  position: relative;
  width: 2rem;
  height: 2rem;
  padding: 0;
  background: none;
  border: none;
  color: var(--foreground);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-btn:hover svg {
  stroke: var(--accent);
}

.theme-btn svg {
  width: 1.25rem;
  height: 1.25rem;
  stroke: var(--foreground);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.15s ease;
}

/* Show/hide sun and moon */
.icon-moon { display: block; }
.icon-sun  { display: none; }
html[data-theme="dark"] .icon-moon { display: none; }
html[data-theme="dark"] .icon-sun  { display: block; }

/* Hamburger */
.menu-btn {
  display: none;
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--foreground);
  align-self: flex-end;
}

.menu-btn svg {
  width: 1.5rem;
  height: 1.5rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

.menu-icon { display: block; }
.close-icon { display: none; }

/* ==================== HERO ==================== */
.hero {
  padding: 1.5rem 1rem 1rem;
}

.hero-inner {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 1rem;
}

.hero-avatar-link {
  display: block;
  flex-shrink: 0;
}

.hero-avatar {
  width: 10rem;
  height: 10rem;
  border-radius: 50%;
  object-fit: cover;
  transition: all 0.3s ease;
}

.hero-avatar-link:hover .hero-avatar {
  transform: scale(1.05);
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.hero-text {
  flex: 1;
}

.hero-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.hero h1 {
  display: inline;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
}

.hero-tagline {
  margin-top: 0.25rem;
  color: var(--foreground);
  line-height: 1.6;
}

/* Social icons row */
.hero-socials {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  margin-top: 1rem;
}

.social-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  color: var(--foreground);
  text-decoration: none;
  transition: all 0.15s ease;
  border-radius: 0.25rem;
}

.social-icon-btn:hover {
  transform: rotate(6deg);
  color: var(--accent);
}

.social-icon-btn svg {
  width: 1.5rem;
  height: 1.5rem;
  stroke: currentColor;
  fill: transparent;
  stroke-width: 2;
  opacity: 0.9;
}

/* Filled SVG icons (GitHub, LinkedIn, Scholar) */
.social-icon-btn .icon-filled {
  fill: currentColor;
  stroke: none;
}

/* ==================== SECTIONS ==================== */
.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  margin-bottom: 0;
  padding: 3rem 0 1.5rem;
}

/* ==================== POST CARDS ==================== */
.post-list {
  list-style: none;
  padding: 0;
}

.post-card {
  margin: 2rem 0;
}

.post-card-title {
  font-size: 1.125rem;
  font-weight: 500;
}

.post-card-title a {
  color: var(--accent);
  text-decoration: none;
}

.post-card-title a:hover {
  text-decoration: underline;
  text-decoration-style: solid;
  text-underline-offset: 4px;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  opacity: 0.8;
}

.post-card-meta .reading-time {
  font-style: italic;
}

.post-card-desc {
  opacity: 0.8;
  line-height: 1.6;
}

/* "All Posts" link-button */
.all-posts-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 1rem;
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
  border-radius: 0.25rem;
  transition: background 0.15s ease;
}

.all-posts-btn:hover {
  background: var(--muted);
}

.all-posts-btn svg {
  width: 1rem;
  height: 1rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.all-posts-center {
  text-align: center;
  margin: 2rem 0;
}

/* ==================== ABOUT PAGE ==================== */
.about-hero {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 2rem 1rem;
}

.about-avatar {
  width: 10rem;
  height: 10rem;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.about-bio {
  flex: 1;
}

.about-bio p {
  margin-bottom: 0.75rem;
  line-height: 1.7;
}

.about-bio a {
  color: var(--accent);
  text-decoration: none;
}

.about-bio a:hover {
  text-decoration: underline;
  text-decoration-style: solid;
  text-underline-offset: 4px;
}

/* Section headings on about page */
.about-section {
  padding: 0 1rem;
  margin-bottom: 2.5rem;
}

.about-section h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* News list */
.news-list {
  list-style: none;
}

.news-list li {
  display: flex;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9375rem;
}

.news-list li:last-child {
  border-bottom: none;
}

.news-date {
  flex-shrink: 0;
  width: 5.5rem;
  font-size: 0.8125rem;
  opacity: 0.7;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Interest tags */
.interests {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.interest-tag {
  background: var(--muted);
  padding: 0.3rem 0.75rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
}

/* Timeline */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.timeline-item {
  display: flex;
  gap: 1.5rem;
}

.timeline-date {
  flex-shrink: 0;
  width: 7.5rem;
  font-size: 0.875rem;
  opacity: 0.7;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  padding-top: 2px;
}

.timeline-content h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.timeline-content p {
  font-size: 0.9375rem;
  margin-bottom: 0.15rem;
}

.timeline-detail {
  opacity: 0.65;
  font-size: 0.8125rem !important;
}

/* Publications */
.publications-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.publication {
  padding: 1.25rem;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
}

.pub-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.pub-title a {
  color: var(--foreground);
  text-decoration: none;
}

.pub-title a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-style: solid;
  text-underline-offset: 4px;
}

.pub-authors {
  font-size: 0.875rem;
  opacity: 0.7;
  margin-bottom: 0.25rem;
}

.pub-authors .me {
  opacity: 1;
  font-weight: 600;
  color: var(--foreground);
}

.pub-authors a {
  opacity: 1;
  color: var(--foreground);
  text-decoration: none;
}

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

.pub-venue {
  font-size: 0.875rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.pub-abstract {
  font-size: 0.875rem;
  opacity: 0.8;
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.pub-links {
  display: flex;
  gap: 0.5rem;
}

.pub-links a {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  color: var(--foreground);
  transition: all 0.15s ease;
}

.pub-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Thesis */
.thesis-item {
  padding: 1.25rem;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
}

.thesis-item h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.thesis-meta {
  font-size: 0.875rem;
  opacity: 0.7;
  margin-bottom: 0.15rem;
}

.thesis-advisor {
  font-size: 0.875rem;
  opacity: 0.8;
  margin-bottom: 0.75rem;
}

.thesis-item a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
}

.thesis-item a:hover {
  text-decoration: underline;
  text-decoration-style: solid;
  text-underline-offset: 4px;
}

/* Contact grid */
.contact-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.contact-link {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  text-decoration: none;
  color: var(--foreground);
  transition: border-color 0.15s ease;
}

.contact-link:hover {
  border-color: var(--accent);
}

.contact-label {
  font-size: 0.6875rem;
  font-weight: 600;
  opacity: 0.6;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.2rem;
}

.contact-value {
  font-size: 0.875rem;
}

/* ==================== POSTS PAGE ==================== */
.page-title {
  font-size: 1.5rem;
  font-weight: 600;
  padding: 2rem 0 0.5rem;
}

.year-group {
  margin-bottom: 2rem;
}

.year-label {
  font-size: 0.875rem;
  font-weight: 600;
  opacity: 0.6;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0;
  margin-bottom: 0.5rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--border);
}

.blog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.5rem;
}

.blog-tag {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  opacity: 0.7;
}

/* ==================== ARTICLE / POST PAGE ==================== */
.post-article {
  max-width: 48rem;
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

.post-header {
  padding: 2rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.post-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  opacity: 0.7;
}

.post-article section {
  margin-bottom: 2rem;
}

.post-article h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.post-article h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

.post-article p {
  margin-bottom: 0.75rem;
  line-height: 1.75;
}

.post-article ul,
.post-article ol {
  margin-bottom: 0.75rem;
  padding-left: 1.5rem;
  line-height: 1.75;
}

.post-article li {
  margin-bottom: 0.4rem;
}

.post-article a {
  color: var(--accent);
}

.post-article a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.post-article .references {
  font-size: 0.875rem;
  line-height: 1.7;
  opacity: 0.85;
}

.post-article .references li {
  margin-bottom: 0.6rem;
}

/* KaTeX overrides to match site theme */
.post-article .katex {
  font-size: 1.05em;
  color: var(--foreground);
}

.post-article .katex-display {
  margin: 1.25rem 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.25rem 0;
}

/* ==================== FOOTER ==================== */
footer.site-footer {
  margin-top: auto;
}

.footer-inner {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  padding: 1.5rem 1rem;
  gap: 0.5rem;
}

.footer-socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem;
}

.footer-copy {
  font-size: 0.875rem;
  opacity: 0.7;
  white-space: nowrap;
}

.footer-copy a {
  color: var(--foreground);
  text-decoration: none;
}

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

/* ==================== UTILITIES ==================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* View transition for theme switching */
:root {
  view-transition-name: root;
}
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.25s;
}

/* ==================== RESPONSIVE ==================== */

/* Desktop: show nav items in a row, hide hamburger */
@media (min-width: 640px) {
  nav ul,
  nav ul.hidden {
    display: flex !important;
    position: static;
    flex-direction: row;
    width: auto;
    padding: 0;
    background: transparent;
    gap: 1.25rem;
  }

  .menu-btn {
    display: none !important;
  }

  .hero h1 {
    font-size: 1.875rem;
    margin: 1rem 0;
  }

  .hero-avatar {
    width: 10rem;
    height: 10rem;
  }

  .footer-inner {
    flex-direction: row-reverse;
    justify-content: space-between;
    padding: 1rem;
  }

  .social-icon-btn {
    padding: 0.25rem;
  }

  .social-icon-btn svg {
    width: 1.35rem;
    height: 1.35rem;
  }
}

@media (max-width: 639px) {
  .menu-btn {
    display: flex;
  }

  nav ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--background);
    z-index: 100;
    flex-direction: column;
    padding: 0.5rem 1rem 1rem;
    width: 11rem;
    margin-left: auto;
    margin-right: auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  nav ul.hidden {
    display: none;
  }

  nav ul.open {
    display: grid;
  }

  nav ul li a {
    display: block;
    padding: 0.75rem 1rem;
    text-align: center;
    font-weight: 500;
  }

  .menu-icon.hidden,
  .close-icon.hidden {
    display: none;
  }

  .hero-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .hero-avatar {
    width: 8rem;
    height: 8rem;
    margin: 0 auto;
  }

  .hero-title-row {
    justify-content: center;
  }

  .hero-socials {
    justify-content: center;
  }

  .about-hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .about-avatar {
    width: 8rem;
    height: 8rem;
  }

  .timeline-item {
    flex-direction: column;
    gap: 0.25rem;
  }

  .timeline-date {
    width: auto;
  }

  .contact-links {
    grid-template-columns: 1fr;
  }
}
