/* ─── Page-level spacing overrides ──────────────────────────────── */
article.project-content {
    padding-bottom: 0;
}

article.project-content .project-image-section:last-child {
    margin-bottom: 0;
}

/* ─── Dashboard layout ───────────────────────────────────────────── */
.oura-section {
    background: #0a0a0a;
    padding: 40px 0 80px;
}

.oura-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 40px;
}

.dashboard {
    display: block;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 48px;
    padding-bottom: 24px;
    border-bottom: 1px solid #1a1a1a;
}

.dashboard-header-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dashboard-devices {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

.dashboard-device-img {
    height: 65px;
    width: auto;
    max-width: 150px;
    opacity: 0.8;
    object-fit: contain;
    display: block;
    transition: opacity 0.3s ease;
}

.dashboard-device-img:hover {
    opacity: 1;
}

.dashboard-device-plus {
    font-size: 2rem;
    font-weight: 200;
    color: #555;
    line-height: 1;
    flex-shrink: 0;
}

.dashboard-date {
    color: #888;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.dashboard-source {
    color: #666;
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* ─── Score cards ────────────────────────────────────────────────── */
.score-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    margin-bottom: 2px;
}

.score-card {
    background: #111;
    padding: 32px;
    position: relative;
    overflow: hidden;
}

.score-card-label {
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #777;
    margin-bottom: 16px;
}

.score-value {
    font-size: 3.5rem;
    font-weight: 200;
    color: #fff;
    line-height: 1;
    margin-bottom: 8px;
}

.score-bar-track {
    height: 2px;
    background: #1a1a1a;
    margin-top: 16px;
}

.score-bar-fill {
    height: 100%;
    width: 0%;
    transition: width 1.2s ease;
}

.score-bar-fill.readiness { background: #7fffb0; }
.score-bar-fill.sleep     { background: #7fb8ff; }
.score-bar-fill.activity  { background: #ffb07f; }

.score-detail {
    font-size: 0.7rem;
    color: #777;
    letter-spacing: 0.05em;
    margin-top: 8px;
}

/* ─── Metric rows ────────────────────────────────────────────────── */
.metric-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px;
    margin-bottom: 2px;
}

.metric-card {
    background: #111;
    padding: 32px;
}

.metric-card-label {
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #777;
    margin-bottom: 20px;
}

/* ─── Sparklines ─────────────────────────────────────────────────── */
.sparkline-container {
    position: relative;
    height: 80px;
    margin-bottom: 12px;
}

.sparkline-container svg {
    width: 100%;
    height: 100%;
}

/* ─── Contributor bars ───────────────────────────────────────────── */
.contributors {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contributor-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.contributor-name {
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    color: #777;
    text-transform: uppercase;
    width: 120px;
    flex-shrink: 0;
}

.contributor-track {
    flex: 1;
    height: 1px;
    background: #1e1e1e;
}

.contributor-fill {
    height: 1px;
    background: #fff;
    width: 0%;
    transition: width 1.2s ease;
}

.contributor-val {
    font-size: 0.65rem;
    color: #666;
    width: 24px;
    text-align: right;
}

/* ─── Heart rate ─────────────────────────────────────────────────── */
.hr-current {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 16px;
}

.hr-bpm {
    font-size: 2.5rem;
    font-weight: 200;
    color: #fff;
}

.hr-unit {
    font-size: 0.7rem;
    color: #777;
    letter-spacing: 0.1em;
}

/* ─── Wide card ──────────────────────────────────────────────────── */
.metric-card-wide {
    background: #111;
    padding: 32px;
    margin-bottom: 2px;
}

/* ─── Stress timeline ────────────────────────────────────────────── */
.stress-timeline {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin-top: 4px;
}

.stress-day-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stress-day-name {
    font-size: 0.58rem;
    color: #666;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    width: 34px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.stress-workout-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #ffb07f;
    flex-shrink: 0;
    display: inline-block;
}

.stress-day-bar {
    flex: 1;
    height: 5px;
    display: flex;
    border-radius: 3px;
    overflow: hidden;
    background: #1a1a1a;
}

.stress-seg {
    height: 100%;
}

.stress-seg-high     { background: #ff6b6b; }
.stress-seg-recovery { background: #7fffb0; }

.stress-day-ratio {
    font-size: 0.55rem;
    color: #444;
    width: 28px;
    text-align: right;
    flex-shrink: 0;
    letter-spacing: 0.03em;
}

/* ─── Stress comparison chart ────────────────────────────────────── */
.comparison-panel {
    background: #0d0d0d;
}

.comparison-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
}

.chart-legend {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 14px;
}

.legend-swatch {
    width: 28px;
    height: 2px;
    border-radius: 1px;
    flex-shrink: 0;
}

.legend-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.legend-label {
    font-size: 0.67rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #ccc;
}

.legend-range {
    font-size: 0.6rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #666;
}

.chart-wrap {
    width: 100%;
    overflow: hidden;
}

.chart-wrap svg {
    width: 100%;
    height: 240px;
    display: block;
}

.chart-y-label {
    margin-top: 10px;
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #555;
    text-align: right;
}

/* ─── Methodology section ────────────────────────────────────────── */
.method-section {
    background: #050505;
    padding: 80px 0;
    border-top: 1px solid #111;
}

.method-header {
    margin-bottom: 48px;
    text-align: center;
}

.method-label {
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #666;
    margin-bottom: 12px;
}

.method-title {
    font-size: 1.4rem;
    font-weight: 300;
    color: #888;
    letter-spacing: 0.05em;
}

.method-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px;
    margin-bottom: 2px;
}

.method-analysis {
    background: #0d0d0d;
    padding: 32px;
    width: 100%;
    box-sizing: border-box;
}

.method-step {
    background: #0d0d0d;
    padding: 32px;
}

.step-number {
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    color: #555;
    margin-bottom: 16px;
}

.step-title {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #aaa;
    margin-bottom: 12px;
}

.step-body {
    font-size: 0.8rem;
    line-height: 1.7;
    color: #666;
    margin-bottom: 20px;
}

.code-block {
    background: #0a0a0a;
    border: 1px solid #1a1a1a;
    border-left: 2px solid #282828;
    padding: 16px;
    overflow-x: auto;
    margin: 0;
}

.code-block code {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.7rem;
    line-height: 1.8;
    color: #555;
    white-space: pre;
}

/* ─── Syntax highlighting ────────────────────────────────────────── */
.c-verb    { color: #7fb8ff; }
.c-url     { color: #888; }
.c-key     { color: #00f5d4; }
.c-str     { color: #7fffb0; }
.c-num     { color: #ffb07f; }
.c-comment { color: #444; font-style: italic; }
.c-punct   { color: #555; }

/* ─── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .score-grid,
    .method-row {
        grid-template-columns: 1fr;
    }

    .metric-row {
        grid-template-columns: 1fr;
    }

    .oura-container {
        padding: 0 24px;
    }

    .comparison-header {
        flex-direction: column;
    }

    .dashboard-devices {
        gap: 12px;
    }

    .dashboard-device-img {
        height: 43px;
        max-width: 100px;
    }

    .dashboard-device-plus {
        font-size: 0.85rem;
    }
}

.image-caption {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 8px;
}
