:root {
    --ink: #203c35;
    --leaf: #3f765b;
    --mint: #dcebd8;
    --pollen: #f4d16b;
    --coral: #e97959;
    --sky: #c6e2df;
    --paper: #f8f5ec;
    --line: rgba(32, 60, 53, 0.24);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: "Manrope", sans-serif;
}

.project-header {
    position: relative;
    overflow: hidden;
    padding: 0 6vw;
    background: var(--pollen);
}

.project-navigation {
    display: grid;
    grid-template-columns: repeat(3, 1fr) 96px repeat(3, 1fr);
    align-items: center;
    width: min(1180px, 100%);
    min-height: 92px;
    margin: auto;
    gap: 38px;
}

.project-navigation>a:not(.project-brand) {
    color: var(--ink);
    font-family: "DM Mono", monospace;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-decoration: none;
    text-transform: uppercase;
}

.project-navigation>a[href="project.html"] {
    padding: 10px 12px;
    background: var(--coral);
    color: white;
    text-align: center;
    border-radius: 999px;
}

.project-navigation>a[href="project.html"]:hover {
    background: var(--ink);
    color: white;
}

.project-navigation>a:nth-child(2),
.project-navigation>a:nth-child(3) {
    text-align: right;
}

.project-navigation>a:nth-child(5) {
    text-align: left;
}

.project-navigation>a:nth-child(6) {
    text-align: right;
}

.project-navigation>a:nth-child(7) {
    text-align: right;
}

.project-navigation>a[href="project.html"] {
    justify-self: center;
    width: max-content;
    text-align: center;
}

.project-navigation .project-brand {
    grid-column: 4;
}

.project-navigation .is-current {
    color: var(--coral);
}

.project-brand {
    display: grid;
    width: 96px;
    height: 96px;
    place-items: center;
    overflow: hidden;
    border: 2px solid var(--ink);
    border-radius: 50%;
    background: var(--coral);
}

.project-brand img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.wave-line {
    position: absolute;
    right: 0;
    bottom: -18px;
    left: 0;
    height: 36px;
    border-top: 2px solid var(--ink);
    border-radius: 50%;
    transform: rotate(-2deg) scaleX(1.08);
}

.project-main {
    width: min(1120px, 88vw);
    margin: auto;
    padding: 105px 0 95px;
}

.project-intro {
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    gap: 60px;
    align-items: end;
}

.eyebrow,
.metric-label,
.chart-title span,
.chart-axis,
.field span,
.note-mark {
    font-family: "DM Mono", monospace;
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.eyebrow {
    margin: 0 0 18px;
    color: var(--coral);
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
h3 {
    font-family: "Fraunces", serif;
    font-weight: 700;
}

h1 {
    margin-bottom: 24px;
    font-size: clamp(3.6rem, 8vw, 7.4rem);
    line-height: 0.86;
    letter-spacing: -0.02em;
}

h1 em {
    color: var(--leaf);
    font-style: normal;
}

.intro-text {
    max-width: 350px;
    margin-bottom: 0;
    font-size: 1.05rem;
    line-height: 1.6;
}

.intro-note {
    padding: 25px 0 4px 28px;
    border-left: 1px solid var(--ink);
}

.note-mark {
    display: block;
    margin-bottom: 25px;
    color: var(--coral);
}

.intro-note p {
    margin: 0;
    font-family: "Fraunces", serif;
    font-size: 1.65rem;
    line-height: 1.13;
}

.control-panel {
    display: grid;
    grid-template-columns: 1fr 1fr auto auto;
    gap: 12px;
    align-items: end;
    margin-top: 75px;
    padding: 25px;
    border: 1px solid var(--ink);
    background: var(--mint);
}

.field {
    display: grid;
    gap: 9px;
}

.field span {
    color: var(--leaf);
}

.field select,
.field input {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--ink);
    border-radius: 0;
    background: var(--paper);
    color: var(--ink);
    font: 500 0.86rem "Manrope", sans-serif;
    padding: 0 13px;
}

.load-button,
.clear-button {
    min-height: 46px;
    padding: 0 19px;
    border: 1px solid var(--ink);
    border-radius: 0;
    font: 500 0.68rem "DM Mono", monospace;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    cursor: pointer;
}

.load-button {
    background: var(--coral);
    color: white;
}

.clear-button {
    background: var(--paper);
    color: var(--ink);
}

.load-button:hover,
.clear-button:hover {
    transform: translateY(-2px);
}

.load-button:disabled {
    cursor: wait;
    opacity: 0.6;
}

.status-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    min-height: 58px;
    padding: 21px 2px 13px;
    border-bottom: 1px solid var(--line);
    font: 0.68rem "DM Mono", monospace;
    text-transform: uppercase;
}

.status-row p {
    margin: 0;
}

#status-message {
    min-width: 0;
    color: var(--leaf);
}

#status-message.is-error {
    color: var(--coral);
}

#measurement-count {
    color: rgba(32, 60, 53, 0.62);
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 28px;
}

.metric-card {
    min-height: 115px;
    padding: 15px;
    border: 1px solid var(--ink);
}

.metric-temperature,
.metric-humidity {
    min-height: 115px;
}

.metric-temperature {
    background: #f5c8b3;
}

.metric-humidity {
    background: var(--sky);
}

.metric-wind {
    background: #d9e7b6;
}

.metric-luminosity {
    background: var(--pollen);
}

.metric-label {
    display: block;
    margin-bottom: 10px;
}

.metric-card strong {
    font-family: "Fraunces", serif;
    font-size: clamp(2.6rem, 5vw, 4.2rem);
    line-height: 0.9;
}

.metric-unit {
    margin-left: 7px;
    font: 0.86rem "DM Mono", monospace;
}

.metric-detail {
    display: block;
    margin-top: 8px;
    color: rgba(32, 60, 53, 0.7);
    font-size: 0.72rem;
}

.condition-signal {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: center;
    margin-top: 28px;
    padding: 14px;
    border: 1px solid var(--ink);
    background: var(--pollen);
}

.condition-signal h2 {
    margin: 0 0 7px;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    line-height: 1;
}

.condition-signal p:last-child {
    max-width: 340px;
    margin: 0;
    font-size: 0.86rem;
    line-height: 1.5;
}

.traffic-light-column {
    display: grid;
    justify-items: center;
    gap: 10px;
}

.traffic-light {
    display: grid;
    gap: 6px;
    width: 60px;
    padding: 8px;
    border: 3px solid var(--ink);
    border-radius: 42px;
    background: #203c35;
    box-shadow: 7px 7px 0 var(--coral);
}

.traffic-light-lamp {
    display: block;
    width: 38px;
    aspect-ratio: 1;
    border: 2px solid rgba(255, 255, 255, 0.42);
    border-radius: 50%;
    opacity: 0.28;
    transition: opacity 220ms ease, box-shadow 220ms ease, transform 220ms ease;
}

.lamp-red {
    background: #e6534f;
}

.lamp-yellow {
    background: #f4d16b;
}

.lamp-green {
    background: #62c979;
}

.traffic-light[data-state="red"] .lamp-red,
.traffic-light[data-state="yellow"] .lamp-yellow,
.traffic-light[data-state="green"] .lamp-green {
    opacity: 1;
    box-shadow: 0 0 18px currentColor, 0 0 6px currentColor;
    transform: scale(1.08);
}

.traffic-light[data-state="red"] .lamp-red {
    color: #e6534f;
}

.traffic-light[data-state="yellow"] .lamp-yellow {
    color: #f4d16b;
}

.traffic-light[data-state="green"] .lamp-green {
    color: #62c979;
}

.learn-more-button {
    color: var(--ink);
    font: 700 0.68rem "DM Mono", monospace;
    letter-spacing: 0.06em;
    text-decoration: none;
    text-transform: uppercase;
}

.learn-more-button span {
    display: inline-block;
    margin-left: 5px;
    color: var(--coral);
    font-size: 1rem;
    transition: transform 180ms ease;
}

.learn-more-button:hover span {
    transform: translateY(3px);
}

.learn-more-section {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: clamp(35px, 8vw, 110px);
    align-items: start;
    margin-top: 145px;
    padding: 75px 0 10px;
    border-top: 2px solid var(--ink);
}

.learn-more-heading h2 {
    margin: 0;
    font-size: clamp(2.8rem, 5vw, 5rem);
    line-height: 0.9;
}

.learn-more-heading h2 em {
    color: var(--leaf);
    font-style: normal;
}

.condition-guide {
    display: grid;
    gap: 13px;
}

.guide-card {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 18px;
    align-items: start;
    padding: 20px 22px;
    border: 1px solid var(--ink);
    background: white;
}

.guide-light {
    display: block;
    width: 20px;
    aspect-ratio: 1;
    margin-top: 3px;
    border: 2px solid var(--ink);
    border-radius: 50%;
}

.guide-green .guide-light {
    background: #62c979;
    box-shadow: 0 0 12px rgba(98, 201, 121, 0.75);
}

.guide-yellow .guide-light {
    background: var(--pollen);
    box-shadow: 0 0 12px rgba(244, 209, 107, 0.85);
}

.guide-red .guide-light {
    background: #e6534f;
    box-shadow: 0 0 12px rgba(230, 83, 79, 0.7);
}

.guide-card h3 {
    margin: 0 0 7px;
    font-size: 1.3rem;
}

.guide-card p {
    max-width: 520px;
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.55;
}

.monarca-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
    gap: clamp(45px, 8vw, 105px);
    align-items: start;
    margin-top: 75px;
}

.monarch-info-stack {
    display: grid;
    gap: 18px;
}

.monarch-info-card {
    padding: 25px 23px 28px;
    border: 1.5px solid var(--ink);
    border-radius: 7px;
    color: var(--ink);
}

.info-card-one {
    background: var(--butter);
}

.info-card-two {
    background: #d7eadb;
}

.info-card-three {
    background: #f3d6c8;
}

.monarch-info-card h2 {
    max-width: 580px;
    margin: 32px 0 15px;
    font-size: clamp(1.45rem, 2.5vw, 2.15rem);
    line-height: 1.05;
}

.monarch-info-card p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.58;
}

.monarca-side-note {
    position: sticky;
    top: 32px;
    padding: 28px 28px 34px;
    border: 1.5px solid var(--ink);
    border-radius: 7px;
    background: var(--sky);
}

.monarca-side-note .eyebrow {
    color: var(--ink);
}

.monarca-side-note h2 {
    margin: 35px 0 18px;
    font-size: clamp(2rem, 3.5vw, 3.3rem);
    line-height: 0.95;
}

.monarca-side-note h2 em {
    color: var(--coral);
    font-style: normal;
}

.monarca-side-note>p:last-child {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
}

.monarca-light-actions {
    display: flex;
    align-items: center;
    gap: 27px;
    margin-top: 25px;
}

.monarca-learn-more {
    color: var(--ink);
    font: 700 0.68rem "DM Mono", monospace;
    letter-spacing: 0.06em;
    text-decoration: none;
    text-transform: uppercase;
}

.monarca-learn-more span {
    display: inline-block;
    margin-left: 5px;
    color: var(--coral);
    font-size: 1rem;
    transition: transform 180ms ease;
}

.monarca-learn-more:hover span {
    transform: translateX(3px);
}

.monarca-traffic-light {
    display: grid;
    gap: 10px;
    width: 72px;
    padding: 12px 11px;
    border: 3px solid var(--ink);
    border-radius: 36px;
    background: var(--ink);
    box-shadow: 6px 6px 0 var(--coral);
}

.monarca-lamp {
    display: block;
    width: 44px;
    aspect-ratio: 1;
    border: 2px solid rgba(248, 245, 236, 0.35);
    border-radius: 50%;
}

.monarca-lamp.lamp-red {
    background: #e6534f;
    box-shadow: 0 0 14px rgba(230, 83, 79, 0.65);
}

.monarca-lamp.lamp-yellow {
    background: var(--pollen);
    box-shadow: 0 0 14px rgba(244, 209, 107, 0.75);
}

.monarca-lamp.lamp-green {
    background: #62c979;
    box-shadow: 0 0 14px rgba(98, 201, 121, 0.65);
}

.steam-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(250px, 0.65fr);
    gap: clamp(45px, 7vw, 90px);
    align-items: start;
    margin-top: 75px;
}

.steam-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.steam-info-card {
    min-height: 285px;
    padding: 23px 21px 25px;
    border: 1.5px solid var(--ink);
    border-radius: 7px;
}

.steam-card-one,
.steam-card-six {
    background: var(--pollen);
}

.steam-card-two,
.steam-card-seven {
    background: var(--mint);
}

.steam-card-three,
.steam-card-eight {
    background: var(--sky);
}

.steam-card-four,
.steam-card-nine {
    background: #f3d6c8;
}

.steam-card-five,
.steam-card-ten {
    background: #e8dfd0;
}

.steam-info-card h2 {
    margin: 32px 0 15px;
    font-size: clamp(1.35rem, 2.1vw, 1.85rem);
    line-height: 1.05;
}

.steam-info-card p {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.55;
}

.steam-info-card strong {
    color: var(--leaf);
}

.steam-side-note {
    position: sticky;
    top: 32px;
    padding: 28px 28px 34px;
    border: 1.5px solid var(--ink);
    border-radius: 7px;
    background: var(--leaf);
    color: white;
}

.steam-side-note .eyebrow {
    color: var(--pollen);
}

.steam-letters {
    display: flex;
    gap: 7px;
    margin-top: 35px;
}

.steam-letters span {
    display: grid;
    width: 37px;
    height: 37px;
    place-items: center;
    border: 1px solid white;
    border-radius: 50%;
    font: 700 0.85rem "DM Mono", monospace;
}

.steam-side-note h2 {
    margin: 38px 0 18px;
    color: white;
    font-size: clamp(2rem, 3.4vw, 3.2rem);
    line-height: 0.95;
}

.steam-side-note h2 em {
    color: var(--pollen);
    font-style: normal;
}

.steam-side-note>p:last-child {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
}

.construction-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(250px, 0.75fr);
    gap: clamp(45px, 7vw, 90px);
    align-items: start;
    margin-top: 75px;
}

.construction-steps {
    display: grid;
    gap: 18px;
}

.construction-group {
    display: grid;
    gap: 20px;
}

.construction-group+.construction-group {
    margin-top: 28px;
}

.construction-group>h2 {
    margin: 0;
    font-size: clamp(1.7rem, 3vw, 2.6rem);
    line-height: 1;
}

.construction-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.construction-card {
    min-width: 0;
    min-height: 265px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--ink);
    font: inherit;
    perspective: 1000px;
    cursor: pointer;
    text-align: left;
}

.construction-card-inner {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    min-height: 265px;
    transition: transform 650ms;
    transform-style: preserve-3d;
}

.construction-card:hover .construction-card-inner,
.construction-card.is-flipped .construction-card-inner {
    transform: rotateY(180deg);
}

.construction-card-face {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px 18px;
    border: 1.5px solid var(--ink);
    border-radius: 7px;
    backface-visibility: hidden;
}

.construction-card-front {
    background: var(--pollen);
}

.construction-group-code .construction-card-front {
    background: var(--mint);
}

.construction-group-prototype .construction-card-front {
    background: var(--sky);
}

.construction-card-back {
    justify-content: center;
    background: var(--leaf);
    color: white;
    font-family: "Fraunces", serif;
    font-size: 1rem;
    line-height: 1.35;
    transform: rotateY(180deg);
}

.construction-card strong {
    font-family: "Fraunces", serif;
    font-size: clamp(1.2rem, 2vw, 1.7rem);
    line-height: 1.05;
}

.construction-card .card-number,
.construction-card .card-prompt {
    font-family: "DM Mono", monospace;
    font-size: 0.68rem;
}

.construction-card .card-prompt {
    color: var(--coral);
}

.construction-side-note {
    position: sticky;
    top: 32px;
    padding: 28px 28px 34px;
    border: 1.5px solid var(--ink);
    border-radius: 7px;
    background: var(--coral);
    color: white;
}

.construction-side-note .eyebrow {
    color: var(--ink);
}

.construction-diagram {
    display: grid;
    gap: 10px;
    justify-items: center;
    margin: 35px auto 40px;
}

.diagram-node {
    display: grid;
    width: min(150px, 100%);
    min-height: 48px;
    place-items: center;
    border: 1px solid white;
    border-radius: 4px;
    font: 0.7rem "DM Mono", monospace;
    letter-spacing: 0.08em;
}

.diagram-center {
    background: white;
    color: var(--coral);
}

.diagram-line {
    display: block;
    width: 1px;
    height: 18px;
    background: white;
}

.construction-side-note h2 {
    margin: 0 0 18px;
    color: white;
    font-size: clamp(2rem, 3.4vw, 3.2rem);
    line-height: 0.95;
}

.construction-side-note h2 em {
    color: var(--pollen);
    font-style: normal;
}

.construction-side-note>p:last-child {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
}

.charts-section {
    padding-top: 125px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    gap: 40px;
    align-items: end;
    margin-bottom: 42px;
}

.section-heading h2 {
    margin-bottom: 0;
    font-size: clamp(2.6rem, 5vw, 4.8rem);
    line-height: 0.9;
}

.chart-explanation {
    max-width: 300px;
    margin-bottom: 5px;
    font-size: 0.86rem;
    line-height: 1.6;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.chart-card {
    min-width: 0;
    padding: 21px 18px 17px;
    border-top: 2px solid var(--ink);
    background: white;
}

.chart-card:nth-child(1) {
    border-top-color: var(--coral);
}

.chart-card:nth-child(2) {
    border-top-color: #5c9ca2;
}

.chart-card:nth-child(3) {
    border-top-color: var(--leaf);
}

.chart-card:nth-child(4) {
    border-top-color: var(--pollen);
}

.chart-title {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
}

.chart-title h3 {
    margin-bottom: 0;
    font-size: 1.45rem;
}

.chart-title span {
    color: var(--leaf);
}

.chart {
    display: block;
    width: 100%;
    height: 220px;
    margin-top: 22px;
    overflow: visible;
}

.chart-axis {
    display: flex;
    justify-content: space-between;
    margin-top: 9px;
    color: rgba(32, 60, 53, 0.55);
    font-size: 0.58rem;
}

.chart-empty {
    display: grid;
    height: 100%;
    place-items: center;
    fill: rgba(32, 60, 53, 0.5);
    font: 0.68rem "DM Mono", monospace;
    text-transform: uppercase;
}

.chart-axis-label {
    fill: var(--ink);
    font: 500 11px "DM Mono", monospace;
    letter-spacing: 0.02em;
}

.chart-y-tick {
    fill: rgba(32, 60, 53, 0.7);
    font: 500 10px "DM Mono", monospace;
}

.latest-section {
    padding-top: 125px;
}

.compact-heading {
    margin-bottom: 0;
    padding-bottom: 27px;
    border-bottom: 1px solid var(--ink);
}

footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 25px 6vw;
    background: var(--ink);
    color: white;
    font: 0.68rem "DM Mono", monospace;
    text-transform: uppercase;
}

footer a {
    color: var(--pollen);
    text-decoration: none;
}

@media (max-width: 800px) {
    .project-navigation {
        grid-template-columns: repeat(3, 1fr) 70px repeat(3, 1fr);
        min-height: 76px;
        gap: 10px;
    }

    .project-navigation .project-brand {
        grid-column: 4;
    }

    .project-brand {
        width: 70px;
        height: 70px;
    }

    .project-navigation>a:not(.project-brand) {
        font-size: 0.57rem;
    }

    .project-intro,
    .section-heading {
        grid-template-columns: 1fr;
        display: grid;
        gap: 28px;
    }

    .control-panel,
    .metric-grid,
    .chart-grid,
    .condition-signal,
    .learn-more-section {
        grid-template-columns: 1fr 1fr;
    }

    .load-button,
    .clear-button {
        width: 100%;
    }
}

@media (max-width: 560px) {
    .project-header {
        padding: 0 4vw;
    }

    .project-navigation {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        min-height: 150px;
        gap: 8px;
    }

    .project-navigation>a:nth-child(1) {
        grid-column: 1;
        grid-row: 1;
        text-align: left;
    }

    .project-navigation .project-brand {
        grid-column: 2 / 4;
        grid-row: 1;
        justify-self: center;
    }

    .project-navigation>a:nth-child(2) {
        grid-column: 1;
        grid-row: 2;
        text-align: left;
    }

    .project-navigation>a:nth-child(3) {
        grid-column: 2;
        grid-row: 2;
        text-align: center;
    }

    .project-navigation>a:nth-child(5) {
        grid-column: 3;
        grid-row: 2;
        text-align: right;
    }

    .project-navigation>a:nth-child(6) {
        grid-column: 4;
        grid-row: 1;
        text-align: right;
    }

    .project-navigation>a:nth-child(7) {
        grid-column: 4;
        grid-row: 2;
        text-align: right;
    }

    .project-main {
        width: 88vw;
        padding-top: 78px;
    }

    h1 {
        font-size: clamp(3.1rem, 16vw, 5rem);
    }

    .control-panel,
    .metric-grid,
    .chart-grid,
    .condition-signal,
    .learn-more-section {
        grid-template-columns: 1fr;
    }

    .monarca-layout {
        grid-template-columns: 1fr;
        margin-top: 50px;
    }

    .monarca-side-note {
        position: static;
    }

    .construction-layout {
        grid-template-columns: 1fr;
        margin-top: 50px;
    }

    .construction-card-grid {
        grid-template-columns: 1fr;
    }

    .construction-side-note {
        position: static;
    }

    .steam-layout {
        grid-template-columns: 1fr;
        margin-top: 50px;
    }

    .steam-info-grid {
        grid-template-columns: 1fr;
    }

    .steam-side-note {
        position: static;
    }

    .traffic-light-column {
        justify-self: center;
    }

    .control-panel {
        margin-top: 55px;
    }

    .status-row,
    footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .charts-section,
    .latest-section {
        padding-top: 90px;
    }
}