/* Palette and type follow the IROS poster: white page, ManiLadder blue
   (#0253DE) for headings, orange (#DA5203) for outlines and accents,
   Tiro Telugu serif throughout. */
:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --ink: #111111;
  --muted: #5c5c5c;
  --line: #e3ded9;
  --blue: #0253de;
  --blue-soft: #e8efff;
  --orange: #da5203;
  --orange-soft: #fff7f3;
  --orange-line: #f0c9b3;
  --level-1: #6bbc94;
  --level-2: #f6be47;
  --level-3: #fa9641;
  --level-4: #de655d;
  --font: "Tiro Telugu", Georgia, "Times New Roman", serif;
  --shadow: 0 10px 30px rgba(2, 83, 222, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.45;
}

button,
input,
select {
  font: inherit;
}

/* ---- Header ------------------------------------------------------------ */

.site-header {
  position: relative;
  background: var(--bg);
}

/* Poster divider under the author row: orange that fades out at both ends. */
.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent 0%, var(--orange) 32%, var(--orange) 74%, transparent 100%);
}

.header-inner {
  max-width: 1480px;
  margin: 0 auto;
  padding: 56px 32px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-copy {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

h1 {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  text-align: center;
}

.wordmark {
  display: block;
  width: min(560px, 82vw);
  height: auto;
}

.hero-tagline {
  display: block;
  max-width: 1000px;
  margin: 0 auto;
  font-size: clamp(1.45rem, 2.9vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
  text-wrap: balance;
}

.accent-blue {
  color: var(--blue);
}

.accent-orange {
  color: var(--orange);
}

.accent-blue,
.accent-orange {
  white-space: nowrap;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

/* ---- Sections ---------------------------------------------------------- */

main {
  max-width: 1480px;
  margin: 0 auto;
  padding: 24px 32px 64px;
}

.intro-section,
.controls-section,
.gallery-section {
  margin-top: 34px;
}

.gallery-heading {
  margin-top: 56px;
}

.section-heading {
  margin-bottom: 18px;
}

/* Poster section title: bold blue serif over a blue-to-white rule. */
.section-heading h2 {
  display: inline-block;
  min-width: min(420px, 100%);
  padding-bottom: 8px;
  color: var(--blue);
  font-size: clamp(1.6rem, 2.6vw, 2.4rem);
  font-weight: 700;
  line-height: 1.1;
  border-bottom: 3px solid transparent;
  border-image: linear-gradient(90deg, var(--blue), rgba(2, 83, 222, 0)) 1;
}

.intro-video-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--orange-soft);
  border: 2px solid var(--orange);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.intro-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #111;
}

.intro-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  color: var(--orange);
  font-size: clamp(1.6rem, 4vw, 3.6rem);
  font-weight: 700;
  text-align: center;
}

.intro-video-shell.has-intro .intro-placeholder {
  display: none;
}

/* ---- Filters ----------------------------------------------------------- */

.controls-section {
  position: sticky;
  top: 12px;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  align-items: end;
  gap: 14px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.94);
  border: 2px solid var(--orange);
  border-radius: 18px;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.search-box {
  display: grid;
  gap: 6px;
}

.search-box span {
  color: var(--blue);
  font-size: 0.95rem;
  font-weight: 700;
}

.search-box input {
  width: 100%;
  min-height: 42px;
  padding: 0 15px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: none;
}

.search-box input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(2, 83, 222, 0.16);
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.segmented button {
  min-height: 42px;
  padding: 0 16px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  transition: border-color 140ms ease, color 140ms ease;
}

.segmented button:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.segmented.compact button {
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.92rem;
}

.segmented button[aria-pressed="true"] {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

/* ---- Level blocks ------------------------------------------------------ */

.level-block {
  margin-top: 52px;
}

.level-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 3px solid transparent;
  border-image: linear-gradient(90deg, var(--blue), rgba(2, 83, 222, 0)) 1;
}

.level-heading h2 {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--blue);
  font-size: clamp(1.6rem, 2.3vw, 2.3rem);
  line-height: 1.1;
}

.level-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 2px 14px 0;
  color: #fff;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
}

.level-badge-1 { background: var(--level-1); }
.level-badge-2 { background: var(--level-2); color: #4a3500; }
.level-badge-3 { background: var(--level-3); }
.level-badge-4 { background: var(--level-4); }

.level-count {
  color: var(--orange);
  font-size: 1rem;
  font-weight: 700;
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px 18px;
  margin: 24px 0;
}

.type-cell {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.cell-select {
  width: 100%;
  min-height: 38px;
  padding: 0 34px 0 12px;
  color: var(--ink);
  background-color: #fff;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--orange) 50%),
    linear-gradient(135deg, var(--orange) 50%, transparent 50%);
  background-position:
    calc(100% - 17px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  border: 1px solid var(--orange-line);
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.cell-select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(2, 83, 222, 0.16);
}

.type-stage {
  min-width: 0;
}

.cell-empty {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  color: var(--orange);
  background: var(--orange-soft);
  border: 2px dashed var(--orange);
  border-radius: 14px;
  font-weight: 700;
}

.type-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 700;
}

.domain-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 1px 9px 0;
  color: #fff;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
}

.domain-rigid_body {
  background: var(--blue);
}

.domain-deformable {
  background: var(--orange);
}

/* ---- Task cards: poster's orange rounded outline ----------------------- */

.task-card {
  min-width: 0;
  background: var(--panel);
  border: 2px solid var(--orange);
  border-radius: 14px;
  overflow: hidden;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.task-card:hover {
  box-shadow: 0 14px 32px rgba(218, 82, 3, 0.14);
  transform: translateY(-2px);
}

.task-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #111;
  overflow: hidden;
}

.task-media video,
.task-media .missing-video {
  width: 100%;
  height: 100%;
}

.task-media video {
  display: block;
  object-fit: cover;
  background: #111;
}

/* Empty slot mirrors the poster's dashed "Contact" box. */
.missing-video {
  display: grid;
  place-items: center;
  padding: 18px;
  color: var(--orange);
  background: var(--orange-soft);
  border-bottom: 2px dashed var(--orange);
  font-weight: 700;
  text-align: center;
}

.task-body {
  padding: 12px 14px 12px;
}

.task-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

@media (max-width: 1180px) {
  .controls-section {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  main,
  .header-inner {
    padding-left: 16px;
    padding-right: 16px;
  }

  .level-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 12px;
  }

  .controls-section {
    position: static;
  }

  .intro-video-shell {
    border-radius: 16px;
  }
}

@media (max-width: 520px) {
  .level-grid {
    grid-template-columns: 1fr;
  }

  .segmented button {
    flex: 1 1 auto;
  }
}
