/* breathe.css — loaded only on the Breathe page */

/* Local tokens: supplement site vars with breathe-specific ones */
:root {
    --gh-surface: rgba(0, 0, 0, 0.45);
    --gh-fg-2: #9a9d9a;
    --gh-fg-3: #6e7270;
    --gh-border: rgba(192, 192, 192, 0.16);
    --gh-warm: #f4d27a;
    --gh-font-serif: "Noto Serif", Georgia, serif;
    --gh-font-sans: "Noto Sans", system-ui, sans-serif;
}

[data-theme="light"] {
    --gh-surface: rgba(255, 255, 255, 0.55);
    --gh-fg-2: #555;
    --gh-fg-3: #777;
    --gh-border: rgba(0, 0, 0, 0.12);
    --gh-warm: #c98a00;
}

/* Override main grid so the stage spans full width */
main.container {
    display: block;
}

/* Stage: 2-column grid (orb | console) */
.breathe-stage {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 2rem;
    width: 100%;
    padding: 0.5rem 0 2rem;
    align-items: start;
}

@media (max-width: 840px) {
    .breathe-stage {
        grid-template-columns: 1fr;
    }
}

/* Orb column */
.orb-wrap {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 1rem;
    padding-top: 0.5rem;
}

.orb-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
}

#orb {
    width: 100%;
    height: 100%;
    display: block;
}

#orb canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.breathe-hint {
    font-family: var(--gh-font-serif);
    font-style: italic;
    font-size: 0.85rem;
    color: var(--gh-fg-2);
    margin: 0 0 0.25rem;
    line-height: 1.4;
}

/* Console column */
.console {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding-top: 0.5rem;
}

.panel {
    background: var(--gh-surface);
    border: 1px solid var(--gh-border);
    border-radius: 8px;
    padding: 0.7rem 0.9rem;
}

.label {
    font-family: var(--gh-font-sans);
    font-size: 0.65rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--gh-fg-3);
    display: block;
    border-bottom: 1px solid var(--primary);
    padding-bottom: 0.3rem;
    margin-bottom: 0.55rem;
}

/* Timer */
.timer {
    font-family: var(--gh-font-serif);
    font-weight: 400;
    font-size: 2.4rem;
    line-height: 1;
    color: var(--text-color);
    font-variant-numeric: tabular-nums;
    text-align: center;
    margin: 0.1rem 0 0.6rem;
}

/* Transport controls */
.transport {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 0.65rem;
}

.breathe-stage .btn {
    font-family: var(--gh-font-sans);
    font-size: 0.82rem;
    padding: 0.4rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid var(--primary);
    background: var(--primary);
    color: #fff;
    transition: background 0.15s, transform 0.1s;
    min-width: 76px;
}

.breathe-stage .btn:hover {
    background: var(--primary-hover);
}

.breathe-stage .btn:active {
    transform: translateY(1px);
}

.breathe-stage .btn.ghost {
    background: transparent;
    color: var(--text-color);
    border-color: var(--gh-border);
}

.breathe-stage .btn.ghost:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: transparent;
}

/* Duration slider */
.dur {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--gh-font-sans);
    font-size: 0.78rem;
    color: var(--gh-fg-2);
}

.dur .val {
    color: var(--text-color);
    font-weight: 700;
    white-space: nowrap;
    min-width: 42px;
    text-align: right;
}

.breathe-stage input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    height: 14px;
    background: transparent;
    outline: none;
    margin: 0;
    padding: 0;
    cursor: pointer;
}

.breathe-stage input[type="range"]::-webkit-slider-runnable-track {
    height: 3px;
    background: var(--gh-border);
    border-radius: 2px;
}

.breathe-stage input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    margin-top: -5.5px;
}

.breathe-stage input[type="range"]::-moz-range-track {
    height: 3px;
    background: var(--gh-border);
    border-radius: 2px;
}

.breathe-stage input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: none;
}

/* Progress stats */
.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.15rem;
}

.stat .n {
    font-family: var(--gh-font-serif);
    font-size: 1.4rem;
    line-height: 1;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.stat .n .fire {
    font-size: 1rem;
}

.stat .k {
    font-family: var(--gh-font-sans);
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gh-fg-3);
}

/* Color swatches */
.swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.sw {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.12s, border-color 0.12s;
    padding: 0;
    background-clip: padding-box;
}

.sw:hover {
    transform: scale(1.12);
}

.sw.active {
    border-color: var(--text-color);
}

.sw-custom {
    position: relative;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid transparent;
    background: conic-gradient(#f44, #fa0, #fd0, #4c4, #4cf, #74f, #f4f, #f44);
    cursor: pointer;
}

.sw-custom.active {
    border-color: var(--text-color);
}

.sw-custom input {
    position: absolute;
    inset: -6px;
    width: 38px;
    height: 38px;
    border: 0;
    padding: 0;
    opacity: 0;
    cursor: pointer;
}

/* Session log */
.log {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: 172px;
    overflow-y: auto;
}

.log .row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--gh-border);
    font-size: 0.8rem;
}

.log .row:last-child {
    border-bottom: 0;
}

.log .when {
    color: var(--text-color);
    font-weight: 700;
    font-family: var(--gh-font-sans);
    font-size: 0.78rem;
    white-space: nowrap;
}

.log .detail {
    color: var(--gh-fg-3);
    font-family: var(--gh-font-sans);
    font-size: 0.78rem;
    flex: 1;
}

.log .tag {
    font-family: var(--gh-font-sans);
    font-size: 0.64rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    white-space: nowrap;
}

.log .tag.done {
    color: var(--primary);
    border: 1px solid var(--primary);
}

.log .tag.partial {
    color: var(--gh-warm);
    border: 1px solid var(--gh-warm);
}

.log .empty {
    color: var(--gh-fg-3);
    font-family: var(--gh-font-serif);
    font-style: italic;
    font-size: 0.9rem;
    padding: 0.4rem 0;
}

.log::-webkit-scrollbar {
    width: 5px;
}

.log::-webkit-scrollbar-thumb {
    background: var(--gh-border);
    border-radius: 3px;
}
