/* Global fix for mobile layout jumps */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
}

/* Layout base */
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.15rem;
  line-height: 1.7;
  color: #e7eaea;
  background: #181f22;
}

/* Grid layout with footer row */
.container {
  display: grid;
  grid-template-columns: 240px 1fr;
  grid-template-areas: "sidebar content";
  min-height: 100vh;
}



/* Sidebar styles */
.sidebar {
  grid-area: sidebar;
  background-color: #124c4c;
  padding: 1.2rem 1rem;
  border-right: 1px solid #263238;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow-y: auto;
}




.sidebar img {
  max-width: 80px;
  margin-bottom: 1rem;
}

.sidebar h1 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
  color: #35e6e6;    
  text-align: center;
  letter-spacing: 1px;
}

.sidebar .tagline {
  font-size: 0.9rem;
  color: #8af6e6;
  text-align: center;
  margin-bottom: 2rem;
}

.sidebar nav ul {
  list-style: none;
  padding: 0;
  text-align: center;
  margin-bottom: 0;
}

.sidebar nav li:last-child {
  margin-bottom: 0;
}

.sidebar nav a {
  color: #41f2e7;          
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.sidebar nav a:hover {
  color: #faffae;           
}

/* Main content styles */
.content {
  grid-area: content;
  padding: 2rem;
  max-width: 720px;
  margin: 0 auto;
  background: none;
}

.content section {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #263238;
}

.content h2 {
  font-size: 1.4rem;
  color: #3bd6cb;           
  margin-bottom: 0.5rem;
  letter-spacing: 0.5px;
}

.content h3 {
  font-size: 1.3rem;
  color: #3bd6cb;          
  margin-bottom: 0.5rem;
  letter-spacing: 0.5px;
}

.content p {
  line-height: 1.7;
  margin-bottom: 1rem;
  font-size: 1rem;
  color: #e7eaea;
}

.content a {
  color: #35e6e6;
  text-decoration: underline dotted;
  transition: color 0.2s;
}
.content a:hover {
  color: #faffae;
}


/* Footer styles */
footer {
  grid-area: footer;
  background-color: #181f22;
  color: #8af6e6;
  font-size: 0.9rem;
  text-align: center;
  padding: 0.7rem 1rem;
  border-top: 1px solid #263238;
  line-height: 1.4;
}

footer a {
  color: #41f2e7;
  text-decoration: underline;
  font-weight: 500;
}
footer a:hover {
  color: #faffae;
}

/* Ensure anchor jumps leave space at top of screen */
.anchor-section,
a[id] {
  scroll-margin-top: 100px;
}

/* Figures and images */
figure {
  background: #1e2529;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.32);
  padding: 1em;
}

figcaption {
  color: #b6dde0;
}


.podcast-links {
  width: 100%;
}

.episodes {
  display: flex;
  justify-content: center; /* Center horizontally */
  align-items: flex-end;
  gap: 1.1em;
  flex-wrap: wrap;
  margin-bottom: 0.7em;
}

.podcast-img {
  width: 108px;
  height: 108px;
  border-radius: 10px;
  box-shadow: 0 1px 7px rgba(0,0,0,0.2);
  margin-bottom: 0.3em;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.ep-caption {
  color: #8af6e6;
  font-size: 0.97em;
  margin-top: 0.3em;
  text-align: center;
}
.podcast-links-caption {
  margin-top: 0.7em;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.sidebar-emoji-banner-desktop {
  margin: .5em 0 1.4em 0;
  text-align: center;
  font-size: 1.2em;
  font-family: 'Menlo', 'Monaco', 'Consolas', 'Liberation Mono', 'Courier New', monospace;
  color: #8af6e6;
  line-height: 1.24;
  letter-spacing: 0.08em;
  user-select: all;
  white-space: pre;
  margin: 0.5em 0 0.3em 0;
}
.sidebar-emoji-banner-desktop { display: block; }
.sidebar-emoji-mobile  { display: none; }

@media (max-width: 768px) {
  .sidebar-emoji-banner-desktop { display: none !important; }
  .sidebar-emoji-mobile {
    display: flex !important;
    width: 100%;
    justify-content: center;
    align-items: center;
    font-size: 1.18em;
    text-align: center;
    font-family: inherit;
    white-space: normal;
    margin: 0.5em 0 0.6em 0;
    padding: 0;
  }
}

@media (max-width: 768px) {
  .sidebar {
    flex-direction: column;
    align-items: center;
  }
}



/* Responsive layout for small screens */
@media (max-width: 768px) {
  .container {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
      "sidebar"
      "content"
      "footer";
    min-height: 100vh;
  }
  .responsive-chart {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;

  /* Optional, for nice padding on mobile: */
  padding-bottom: 1.5rem;
}
.responsive-chart svg, 
.responsive-chart canvas, 
.responsive-chart iframe, 
.responsive-chart img {
  width: 100% !important;
  height: auto !important;
  max-width: 100% !important;
  display: block;
}
figure,
  figure[style*="float:left"],
  figure[style*="float:right"],
  figure.float-left,
  figure.float-right {
    float: none !important;
    display: block;
    margin: 1.2em auto !important;
    max-width: 96vw !important;
    width: 100% !important;
    clear: both !important;
    text-align: center;
  }
  figure img {
    display: block;
    margin: 0 auto;
    width: 100%;
    max-width: 320px;
    height: auto;
  }
  #timeline, .responsive-chart {
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  display: block;
}
  .sidebar {
    position: static;
    grid-area: sidebar;
    height: auto;         
    overflow-y: visible;
    flex-direction: column;
    justify-content: space-between;
    padding: 1rem;
    border-right: none;
    border-bottom: 1px solid #263238;
  }

  .sidebar nav ul {
    display: flex;
    gap: 1rem;
  }

  .sidebar h1,
  .sidebar .tagline {
    display: none;
  }

  .content {
    grid-area: content;
    padding: 1.5rem;
    margin: 0 auto;
  }

  footer {
    grid-area: footer;
  }
}

/* Code blocks */
pre, code {
  background: #21272b;
  color: #faffae;
  border-radius: 6px;
  font-size: 0.78em !important;
  padding: 0.1em 0.2em;
}

/* Misc highlight (e.g., for callouts, under-construction banners) */
.banner,
.highlight {
  background: #21272b;
  color: #faffae;
  border-left: 4px solid #24d7d7;
  border-radius: 10px;
  padding: 0.8em 1.2em;
  margin: 1.2em 0;
}

/* Button */
button, .button {
  background: #3bd6cb;
  color: #181f22;
  border: none;
  border-radius: 8px;
  padding: 0.6em 1.3em;
  font-size: 1em;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
button:hover, .button:hover {
  background: #41f2e7;
  color: #181f22;
}

figcaption {
  font-size: 0.97em;
  color: #b6dde0;          
  margin-top: 0.5em;
  line-height: 1.45;
  font-style: italic;     
  text-align: left;
  background: rgba(28,36,44,0.8);
  padding: 0;
  letter-spacing: 0.01em;
}

figcaption a {
  color: #35e6e6;
  text-decoration: underline dotted;
  font-weight: 500;
}
figcaption a:hover {
  color: #faffae;
}

.callout {
  background: #21272b;
  border-left: 5px solid #24d7d7;
  border-radius: 12px;
  padding: 1em 1.3em 1em 1.2em;
  margin: 2em 0;
  box-shadow: 0 1px 7px rgba(0,0,0,0.22);
  color: #e7eaea;               
  display: flex;
  align-items: flex-start;
  gap: 0.7em;
  font-size: 1.08em;
}
.callout a {
  color: #35e6e6;
  font-weight: 600;
  text-decoration: underline dotted;
  transition: color 0.2s;
}
.callout a:hover {
  color: #faffae;
}
.callout span.emoji {
  font-size: 1.6em;
  line-height: 1;
}
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 999;
  background: #21272b;
  color: #39b7a7;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.17);
  opacity: 0.7;
  transition: opacity 0.2s, background 0.2s;
  text-decoration: none;
}
.back-to-top:hover {
  opacity: 1;
  background: #39b7a7;
  color: #181f22;
}

.polyhedron-demo-container {
  max-width: 380px;
  margin: 2.5rem auto 2.5rem auto;
  padding: 1.2rem 0 2.5rem 0;
  border-radius: 1.25rem;
  background: transparent;
  text-align: center;
  box-shadow: 0 2px 16px #1111;
}

.polyhedron-demo-title {
  margin-bottom: 0.6em;
  font-size: 1.1em;
  letter-spacing: 0.03em;
}

.polyhedron-controls {
  margin-bottom: 0.8em;
  font-size: 0.98em;
}

.polyhedron-canvas {
  width: 280px;
  height: 280px;
  max-width: 98vw;
  max-height: 70vw;
  min-width: 140px;
  min-height: 140px;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  background: transparent;
  border-radius: 1em;
  box-shadow: 0 2px 12px #2223;
  display: flex;
  align-items: center;
  justify-content: center;
}
@media (max-width: 400px) {
  .polyhedron-canvas {
    width: 98vw;
    height: 98vw;
    min-width: 110px;
    min-height: 110px;
  }
}

.project-card {
  width: 100%;
  max-width: 900px;
  margin: 2em auto;
  box-shadow: 0 4px 24px #0002;
  border-radius: 16px;
  background: #181f22;
  color: #e7eaea;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  transition: box-shadow 0.22s;
}
.project-card:hover {
  box-shadow: 0 8px 36px #17999955, 0 2px 10px #0002;
}
.project-card-link {
  display: flex;
  flex-direction: row;
  width: 100%;
  color: inherit;
  text-decoration: none;
}
.project-card-image {
  width: 320px;
  max-width: 38vw;
  max-height: 240px;
  object-fit: contain;
  background: #212830;
  display: block;
}
.project-card-caption {
  flex: 1;
  padding: 1.3em 1.5em 1.1em 1.5em;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.project-card-caption strong {
  font-size: 1.18em;
}
.project-card-caption p {
  margin: 0.7em 0 0.8em 0;
}
.project-card-button {
  display: inline-block;
  margin-top: 0.5em;
  background: #34c3c3;
  color: #181f22;
  font-weight: bold;
  padding: 0.5em 1.2em;
  border-radius: 0.8em;
  font-size: 1em;
  letter-spacing: 0.01em;
}

/* --- Mobile Responsive --- */
@media (max-width: 700px) {
  .project-card,
  .project-card-link {
    flex-direction: column;
    max-width: 98vw;
  }
  .project-card-image {
    width: 100%;
    max-width: 100vw;
    max-height: 180px;
  }
  .project-card-caption {
    padding: 1.1em 0.7em 1em 0.7em;
  }
}

