:root {
  --color-accent: rgb(0, 114, 206);
  --color-bg: #ffffff;
  --color-text: #0e1a2b;
  --color-muted: #6a7a96;
  --color-surface: #f5f7fb;
  --hero-media-height: 500px;
  --hero-media-max-width: 1500px;
  --layout-content-max-width: 1000px;
  --tech-card-media-height: 200px;
  --tech-card-border-radius: 10px;
  
  --post-font-base: clamp(0.85rem, 0.9vw + 0.6rem, 1rem);

  --post-card-font-base: 0.85rem;
  --post-scale-title: 1.8;
  --post-scale-h2: 1.3;
  --post-scale-h3: 1.15;
  --post-scale-meta: 0.9;

  --post-card-scale-title: 1.35;
  --post-card-scale-meta: 0.95;
  --post-card-scale-desc: 1;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  font-size: 0.85rem;
}

img {
  max-width: 100%;
  display: block;
}

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

a:hover {
  text-decoration: underline;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid #e5e9f2;
  backdrop-filter: blur(8px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  color: inherit;
}

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

.brand img {
  height: 40px;
  width: auto;
}

nav {
  display: flex;
  gap: 1rem;
  font-weight: 600;
}

nav a {
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 1.05rem;
}

nav a.active,
nav a:hover {
  background: var(--color-surface);
}

main {
  min-height: 80vh;
}

.hero {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #000;
}

.hero-slider {
  position: relative;
  width: 100%;
  height: var(--hero-media-height);
  overflow: hidden;
}

.hero-media {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  position: relative;
}

.hero-media-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.9s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-media-slide.active {
  opacity: 1;
}

.hero-media-slide video,
.hero-media-slide img,
.hero-media-slide .hero-media-placeholder {
  width: min(100%, var(--hero-media-max-width));
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 1rem;
  padding: 3rem 4rem;
  background: linear-gradient(90deg, rgba(0, 0, 0, 1.0) 0%, rgba(0, 0, 0, 0) 50%);
  color: white;
  transition: background 0.25s ease;
}

.hero:hover .hero-overlay,
.hero-slider:hover .hero-overlay,
.hero-overlay:hover {
  background: linear-gradient(90deg, rgba(0, 0, 0, 1.0) 0%, rgba(0, 0, 0, 0.3) 50%);
}

.hero-overlay h1 {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
}

.hero-overlay .markdown {
  width: 100%;
  max-width: 100%;
}

.hero-overlay .markdown p {
  margin: 0;
  max-width: 100%;
  font-size: 1rem;
  color: #e6e9f5;
}

.hero-overlay .markdown strong {
  color: var(--color-accent);
  font-weight: 700;
  font-size: 1.2em;
}

.slider-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  background: rgba(0, 0, 0, 0.55);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.slider-control:hover {
  transform: translateY(-50%) scale(1.05);
}

.hero-slider:hover .slider-control,
.carousel:hover .slider-control {
  opacity: 1;
}

.slider-control.prev {
  left: 1.5rem;
}

.slider-control.next {
  right: 1.5rem;
}

.section {
  padding: 3rem 2rem;
}

#core-tech {
  padding-bottom: 1.5rem;
}

.about-section {
  border-top: 1px solid #e5e9f2;
}

.section-header {
  max-width: var(--layout-content-max-width);
  margin: 0 auto 1.5rem auto;
}

.section-header h2,
.section-header h1 {
  margin: 0 0 0.25rem 0;
  font-size: clamp(1.2rem, 2vw, 1.6rem);
}

.section-header p {
  margin: 0;
  color: var(--color-muted);
}

.about-section .about-content {
  max-width: var(--layout-content-max-width);
  margin: 0 auto;
}

.about-section p {
  margin: 0 0 1rem 0;
  color: var(--color-text);
  font-size: var(--post-font-base);
  line-height: 1.9;
  text-indent: 0.5em;
}

.about-section .about-highlight,
.about-section .about-content strong {
  color: var(--color-accent);
  font-weight: 700;
}

.carousel {
  position: relative;
  max-width: var(--layout-content-max-width);
  margin: 0 auto;
  overflow: hidden;
  border-radius: 0;
  border: none;
  background: transparent;
  padding: 1.5rem 0 0;
}

.carousel-track {
  display: flex;
  gap: 1rem;
  transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

.carousel-track .tech-card {
  flex: 0 0 calc((100% - 2rem) / 3);
}

@media (max-width: 720px) {
  .carousel-track .tech-card {
    flex: 0 0 calc((100% - 1rem) / 2);
  }
}

@media (max-width: 480px) {
  .carousel-track .tech-card {
    flex: 0 0 100%;
  }
}

.tech-card {
  background: var(--color-surface);
  border-radius: var(--tech-card-border-radius);
  border: none;
  overflow: hidden;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.tech-card video,
.tech-card img {
  width: 100%;
  height: var(--tech-card-media-height);
  object-fit: cover;
  pointer-events: none;
}

.tech-card .content {
  padding: 0.75rem 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.tech-card h3 {
  margin: 0;
}

.tech-card p {
  margin: 0;
  color: var(--color-muted);
}

.tech-card-desc {
  font-size: var(--post-font-base);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tech-card a {
  margin-top: auto;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.carousel-dots {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1rem;
}

.carousel-dots button {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  background: #cbd4e6;
  cursor: pointer;
  padding: 0;
  min-width: 10px;
  touch-action: manipulation;
}

.carousel-dots button.active {
  background: var(--color-accent);
  transform: scale(1.3);
  transition: transform 0.2s ease;
}

.page {
  max-width: var(--layout-content-max-width);
  margin: 0 auto;
  padding: 3rem 2rem;
}

.post-grid {
  display: grid;
  gap: 1.5rem;
}

.post-card {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.25rem;
  padding: 1rem;
  border: none;
  border-radius: 16px;
  background: var(--color-surface);
  box-shadow: none;
  cursor: pointer;
}

.post-page {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.post-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: transparent;
  border-radius: 0;
  padding: 0;
  margin-bottom: 1rem;
}

.post-header h1 {
  margin: 0;
  font-size: calc(var(--post-font-base) * var(--post-scale-title));
}

.post-header-description {
  margin: 0;
  color: var(--color-muted);
  font-size: calc(var(--post-font-base) * 1.05);
}

.post-header .post-meta {
  font-size: calc(var(--post-font-base) * var(--post-scale-meta));
  color: var(--color-muted);
}

.paper-card {
  background: var(--color-surface);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.paper-title {
  font-size: calc(var(--post-font-base) * 0.95);
  line-height: 1.5;
}

.paper-title strong {
  font-weight: 600;
}

.paper-meta {
  font-size: calc(var(--post-font-base) * 0.85);
  color: var(--color-muted);
}

.paper-meta a {
  color: var(--color-accent);
  font-weight: 600;
  margin: 0 0.25rem;
}

.post-header-media {
  display: none;
}

.post-header-media img,
.post-header-media video {
  width: 100%;
  height: auto;
  max-height: 240px;
  border-radius: 16px;
  object-fit: cover;
}

.post-card img,
.post-card video {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 12px;
  pointer-events: none;
}

.post-card h2 {
  margin: 0 0 0.35rem 0;
  font-size: calc(var(--post-card-font-base) * var(--post-card-scale-title));
}

.post-meta {
  color: var(--color-muted);
  font-size: 0.95rem;
}

.post-description {
  margin: 0;
  color: var(--color-muted);
}

.post-card .post-meta,
.post-card .post-description {
  color: var(--color-text);
}

.post-card .post-meta {
  font-size: calc(var(--post-card-font-base) * var(--post-card-scale-meta));
}

.post-card .post-description {
  font-size: calc(var(--post-card-font-base) * var(--post-card-scale-desc));
}

.markdown h2,
.markdown h3 {
  margin-bottom: 0.25rem;
}

.post-page .markdown {
  font-size: var(--post-font-base);
}

.post-page .markdown h2 {
  font-size: calc(var(--post-font-base) * var(--post-scale-h2));
}

.post-page .markdown h3 {
  font-size: calc(var(--post-font-base) * var(--post-scale-h3));
}

.markdown p {
  margin: 0 0 0.75rem 0;
  /* text-indent: 1em; */
}

.markdown ul {
  margin: 0 0 0.75rem 1.25rem;
  color: var(--color-text);
}

.markdown iframe {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: none;
  margin: 1rem 0;
}

.markdown img {
  display: block;
  max-width: 500px;
  width: 100%;
  margin: 1rem auto;
  border-radius: 8px;
}

.markdown em {
  display: block;
  max-width: 500px;
  margin: -0.5rem auto 1rem auto;
  font-size: 0.85em;
  color: var(--color-muted);
  text-align: center;
}

.markdown table {
  margin: 1.5rem auto;
  border-collapse: collapse;
  border: 1px solid #e5e9f2;
}

.markdown table th,
.markdown table td {
  padding: 0.5rem 0.75rem;
  border: 1px solid #e5e9f2;
  text-align: left;
}

.markdown table th {
  background: var(--color-surface);
  font-weight: 600;
}

.markdown table tr:nth-child(even) {
  background: #fafbfc;
}

.team-grid {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.team-section {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.team-section-open {
  background: rgba(0, 114, 206, 0.05);
  border: 1px solid rgba(0, 114, 206, 0.18);
  border-radius: 16px;
  padding: 1rem 1.2rem;
}

.team-open-callout {
  padding: 0.5rem 1rem;
  background: var(--color-surface);
  border-radius: 10px;
  margin-bottom: 0.25rem;
}

.team-open-callout h3 {
  margin: 0 0 0.1rem 0;
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  color: #e0457b;
}

.team-open-callout p {
  margin: 0;
  font-size: clamp(0.88rem, 1.1vw, 1rem);
  color: var(--color-text);
  line-height: 1.8;
}

.team-open-callout a {
  color: var(--color-accent);
}

.team-cards-open {
  grid-template-columns: 1fr !important;
  gap: 0.5rem !important;
}

.team-cards-open .team-card {
  background: white;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  box-shadow: 0 4px 18px rgba(14, 26, 43, 0.07);
  grid-template-columns: 1fr;
}

.team-open-positions {
  padding: 2rem 2.5rem;
  background: var(--color-surface);
  border-radius: 12px;
  margin-bottom: 0.5rem;
}

.team-open-positions h3 {
  margin: 0 0 0.6rem 0;
  font-size: clamp(1.1rem, 1.6vw, 1.4rem);
}

.team-open-positions p {
  margin: 0;
  font-size: clamp(0.9rem, 1.1vw, 1.05rem);
  color: var(--color-text);
  line-height: 1.8;
}

.team-open-positions a {
  color: var(--color-accent);
}

.team-group-label {
  margin: 0 0 0.25rem 0;
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  color: var(--color-text);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.team-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem 2rem;
}

.team-list-section {
  margin-top: 0;
  padding-top: 0.25rem;
}

.team-list-label {
  font-size: clamp(0.9rem, 1.2vw, 1.1rem);
  font-weight: 600;
  color: var(--color-muted);
  margin: 0 0 0.5rem 0;
}

.team-list-section ul {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--color-text);
  font-size: var(--post-font-base);
  line-height: 1.8;
}

.team-list-section a {
  color: var(--color-accent);
}

.team-card {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 2rem;
  align-items: start;
  background: white;
  padding: 0;
  border: none;
  box-shadow: none;
}

.team-card img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: none;
  /* filter: grayscale(50%); */
}

.team-card h3 {
  margin: 0 0 0.2rem 0;
}

.team-card ul {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--color-muted);
}

.repo-list {
  display: grid;
  gap: 1rem;
}

.repo-card {
  border: 1px solid #e5e9f2;
  border-radius: 14px;
  padding: 1.25rem;
  background: white;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-shadow: none;
}

.repo-card h3 {
  margin: 0;
}

.repo-card p {
  margin: 0;
  color: var(--color-muted);
}

.site-footer {
  padding: 1.5rem 2rem;
  border-top: 1px solid #e5e9f2;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--color-muted);
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.footer-content strong {
  color: var(--color-text);
}

/* ── Hamburger toggle ── */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
  z-index: 20;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s 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); }

/* ── Responsive breakpoints ── */
@media (max-width: 1024px) {
  .post-header {
    grid-template-columns: 1fr;
  }

  .post-card {
    grid-template-columns: 1fr;
  }

  .post-card img,
  .post-card video {
    height: 200px;
  }
}

@media (max-width: 720px) {
  /* Header */
  .site-header {
    flex-wrap: wrap;
    padding: 0.75rem 1.25rem;
    gap: 0;
  }

  .brand {
    flex: 1;
  }

  .nav-toggle {
    display: flex;
  }

  #siteNav {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem 0 0.75rem;
    border-top: 1px solid #e5e9f2;
    margin-top: 0.5rem;
  }

  #siteNav.open {
    display: flex;
  }

  #siteNav a {
    padding: 0.6rem 0.5rem;
    font-size: 1rem;
    border-radius: 8px;
  }

  /* Hero */
  .hero-overlay {
    padding: 1.5rem;
  }

  .hero-overlay h1 {
    font-size: clamp(1.1rem, 5vw, 1.6rem);
  }

  /* Sections & page */
  .section {
    padding: 2rem 1.25rem;
  }

  .page {
    padding: 2rem 1.25rem;
  }

  /* Tech carousel */
  .carousel-track .tech-card {
    flex: 0 0 calc((100% - 1rem) / 2);
  }

  .slider-control {
    display: none;
  }

  /* Team */
  .team-cards {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .team-card {
    grid-template-columns: 80px 1fr;
    gap: 1rem;
  }

  .team-card img {
    width: 80px;
    height: 80px;
  }

  .team-open-positions {
    padding: 1.25rem;
  }

  /* Post cards */
  .post-card {
    grid-template-columns: 1fr;
  }

  .post-card img,
  .post-card video {
    height: 180px;
  }
}

@media (max-width: 480px) {
  /* 1-card view on very narrow phones */
  .carousel-track .tech-card {
    flex: 0 0 100%;
  }

  .hero-overlay {
    padding: 1rem;
  }

  .team-card {
    grid-template-columns: 64px 1fr;
    gap: 0.75rem;
  }

  .team-card img {
    width: 64px;
    height: 64px;
  }
}
