body {
  margin: 0;
  padding: 0;
  background: #fff;
}

main {
  font-size: clamp(10px, 1.8vw, 18px);
  font-family: Helvetica, Arial, sans-serif;
  max-width: 1000px;
  width: 97%;
  margin: 10px auto;
  box-sizing: border-box;
}

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

.header {
  font-family: Helvetica, Arial, sans-serif;
  background: #ffffffb9;
  display: flex;
  justify-content: space-between;
  align-items: center;

  position: fixed;
  top: 0;
  left: 0;
  right: 0;

  margin: 0 auto;
  max-width: 1400px;
  width: 97%;

  z-index: 1000;
}

.header #name {
  margin: 20px 0;
  font-size: clamp(14px, 2.3vw, 20px);
}

#name a {
  color: inherit;
  text-decoration: none;
}

#name a:visited {
  color: inherit;
}

.subpage {
  background: transparent;
  font-size: clamp(9px, 1.8vw, 18px);
  text-align: left;
  border: none;
  color: #6d6d6d;
}

.nav {
  display: flex;
  gap: clamp(1px, 2vw, 20px);
  align-items: center;
}

.nav .subpage {
  cursor: pointer;
  transition: transform 0.2s;
}

.nav .subpage:hover {
  transform: translateY(3px);
}

.header.hidden {
  transform: translateY(-120%);
}

.header.animate,
.header.animate.hidden {
  transition: transform 1s ease-in-out;
}

/*-----------------------------------------------------------------*/
/* Hero & Intro                                                     */
/*-----------------------------------------------------------------*/

.main-image {
  aspect-ratio: 5 / 2;
  background: #e0e0e0 url('title.png') no-repeat center center;
  background-size: cover;
  margin-bottom: 20px;
}

.title {
  color: black;
  font-size: clamp(20px, 5vw, 50px);
  font-weight: bold;
}

.intro {
  margin: 50px 0 80px 0;
  font-size: clamp(12px, 2.1vw, 21px);
  color: #6d6d6d;
}

#github {
  color: #0051ff;
  margin: 6px 0 18px 0;
  text-decoration: none;
}

#github:hover {
  color: #333;
}

a:has(#github) {
  text-decoration: none;
}

/*-----------------------------------------------------------------*/
/* Status badges                                                    */
/*-----------------------------------------------------------------*/

.status-badge {
  display: inline-block;
  font-size: clamp(9px, 1.2vw, 11px);
  font-weight: bold;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 2px;
  text-transform: uppercase;
  vertical-align: middle;
  margin-left: 6px;
}

.status-done    { background: #edfaed; color: #276749; }
.status-planned { background: #f2f2f2; color: #888;    }

/*-----------------------------------------------------------------*/
/* Section Titles & Body Text                                       */
/*-----------------------------------------------------------------*/

.section-title {
  font-size: clamp(12px, 2.5vw, 25px);
  font-weight: bold;
  margin: 90px 0 20px 0;
  color: black;
}

.subsection-title {
  font-size: clamp(11px, 2vw, 20px);
  font-weight: bold;
  margin: 44px 0 14px 0;
  color: #222;
}

.text {
  font-size: clamp(10px, 1.6vw, 16px);
  line-height: 1.6;
  color: #636363;
  text-align: justify;
}

.text code, code {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.88em;
  background: #f2f2f2;
  padding: 1px 4px;
  border-radius: 2px;
  color: #333;
}

/*-----------------------------------------------------------------*/
/* Pipeline Diagram                                                 */
/*-----------------------------------------------------------------*/

.diagram-container {
  width: 100%;
  margin: 28px 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.diagram-container svg {
  display: block;
  width: 100%;
  height: auto;
  min-width: 600px;
}

/*-----------------------------------------------------------------*/
/* Image Grids                                                      */
/*-----------------------------------------------------------------*/

.image-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 24px 0;
}

.image-3col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 24px 0;
}

.image-4col {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 24px 0;
}

@media (max-width: 640px) {
  .image-2col  { grid-template-columns: 1fr; }
  .image-3col  { grid-template-columns: 1fr 1fr; }
  .image-4col  { grid-template-columns: 1fr 1fr; }
}

/*-----------------------------------------------------------------*/
/* Decoder diagram container                                       */
/*-----------------------------------------------------------------*/

.decoder-diagram {
  width: 100%;
  margin: 24px 0 8px 0;
  overflow-x: auto;
}

.decoder-diagram svg {
  display: block;
  width: 100%;
  height: auto;
  min-width: 180px;
}

.img-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.img-card img {
  width: 100%;
  height: auto;
  display: block;
}

.img-label {
  font-size: clamp(9px, 1.2vw, 11px);
  color: #888;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/*-----------------------------------------------------------------*/
/* Result rows (multiple examples)                                 */
/*-----------------------------------------------------------------*/

.result-row {
  margin: 32px 0;
}

.result-row-label {
  font-size: clamp(9px, 1.3vw, 12px);
  color: #aaa;
  margin-bottom: 8px;
  font-weight: bold;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/*-----------------------------------------------------------------*/
/* Architecture detail box                                         */
/*-----------------------------------------------------------------*/

.arch-box {
  background: #f8f8f8;
  border-left: 3px solid #000;
  padding: 18px 22px;
  margin: 22px 0;
  font-family: 'Courier New', Courier, monospace;
  font-size: clamp(9px, 1.4vw, 13px);
  color: #333;
  line-height: 1.9;
}

.arch-box b {
  font-family: Helvetica, Arial, sans-serif;
  font-size: clamp(10px, 1.5vw, 14px);
  color: #111;
}

/*-----------------------------------------------------------------*/
/* Technical Stack Table                                           */
/*-----------------------------------------------------------------*/

.tech-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: clamp(9px, 1.5vw, 14px);
}

.tech-table tbody tr {
  border-bottom: 1px solid #eee;
}

.tech-table tbody tr:first-child {
  border-top: 2px solid #000;
}

.tech-table td {
  padding: 9px 14px;
  color: #636363;
  vertical-align: top;
  line-height: 1.5;
}

.tech-table td:first-child {
  font-weight: bold;
  color: #333;
  width: 26%;
  white-space: nowrap;
}

/*-----------------------------------------------------------------*/
/* Roadmap                                                         */
/*-----------------------------------------------------------------*/

.roadmap-list {
  list-style: none;
  margin: 20px 0;
  padding: 0;
}

.roadmap-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
  font-size: clamp(10px, 1.5vw, 14px);
  color: #636363;
  line-height: 1.55;
}

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

.roadmap-num {
  font-weight: bold;
  color: #bbb;
  min-width: 24px;
}

.roadmap-done .roadmap-num {
  color: #276749;
}

.roadmap-done .roadmap-text {
  color: #333;
}

.roadmap-planned .roadmap-text {
  color: #999;
  font-style: italic;
}

/*-----------------------------------------------------------------*/
/* Footer                                                          */
/*-----------------------------------------------------------------*/

.footer {
  font-size: clamp(10px, 1.5vw, 15px);
  line-height: 1.5;
  height: 200px;
  margin: 100px 0 0 0;
  color: #636363;
}
