/* Bean journey, gear upkeep, taste profile, the timer and its pour figure.
   Loaded after the files above it in index.html: keep the order. */

/* ---- Bean journey ------------------------------------------------------------------------------ */

.dialed-journey {
    position: relative;
    margin: var(--dialed-space-3) 0;
    padding: 0;
    list-style: none;
}

.dialed-journey::before {
    content: "";
    position: absolute;
    top: 0.75rem;
    bottom: 0.75rem;
    left: 0.4375rem;
    width: 2px;
    background: var(--colorNeutralStroke2);
}

.dialed-journey-step {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: var(--dialed-space-3);
    padding: var(--dialed-space-2) 0;
}

.dialed-journey-dot {
    flex: none;
    width: 1rem;
    height: 1rem;
    margin-top: 0.125rem;
    border: 2px solid var(--colorBrandStroke1);
    border-radius: var(--borderRadiusCircular);
    background: var(--colorBrandBackground);
}

.dialed-journey-step.upcoming .dialed-journey-dot {
    background: var(--colorNeutralBackground1);
    border-style: dashed;
}

.dialed-journey-step.upcoming .dialed-journey-what {
    color: var(--colorNeutralForeground3);
}

.dialed-journey-text {
    display: flex;
    flex-direction: column;
}

.dialed-journey-what {
    font-weight: var(--dialed-weight-semibold);
}

.dialed-journey-bag h3 {
    margin: var(--dialed-space-4) 0 var(--dialed-space-1);
    font-size: var(--dialed-text-m);
    font-weight: var(--dialed-weight-semibold);
}

/* ---- Gear upkeep ------------------------------------------------------------------------------- */

.dialed-chip-warning {
    border-color: var(--colorPaletteMarigoldBorder2);
    background: var(--colorPaletteMarigoldBackground2);
    color: var(--colorPaletteMarigoldForeground2);
}

.dialed-upkeep {
    display: grid;
    gap: var(--dialed-space-2);
    margin: var(--dialed-space-3) 0;
}

.dialed-upkeep p {
    margin: 0;
}

a.dialed-banner {
    color: inherit;
    text-decoration: none;
}

.dialed-drift {
    margin-bottom: var(--dialed-space-3);
    border-inline-start: 4px solid var(--colorBrandStroke1);
}

.dialed-drift p {
    margin: var(--dialed-space-1) 0 0;
}

.dialed-content h2.dialed-drift-title {
    margin: 0;
    font-size: var(--dialed-text-m);
    font-weight: 600;
}

/* ---- Taste profile ----------------------------------------------------------------------------- */

.dialed-taste-profile {
    display: grid;
    gap: var(--dialed-space-2);
    margin-bottom: var(--dialed-space-3);
}

.dialed-taste-row {
    display: grid;
    grid-template-columns: 4.5rem 1fr 4.5rem;
    align-items: center;
    gap: var(--dialed-space-2);
}

.dialed-taste-end {
    font-size: var(--dialed-text-s);
    color: var(--colorNeutralForeground2);
}

.dialed-taste-end:last-child {
    text-align: end;
}

.dialed-taste-track {
    position: relative;
    height: 0.5rem;
    border-radius: var(--dialed-radius-pill);
    background: var(--colorNeutralBackground6);
}

.dialed-taste-track::before {
    content: "";
    position: absolute;
    inset-block: -0.25rem;
    inset-inline-start: 50%;
    width: 2px;
    background: var(--colorNeutralStroke1);
}

.dialed-taste-fill {
    position: absolute;
    inset-block: 0;
    border-radius: var(--dialed-radius-pill);
    background: var(--colorBrandBackground);
}

.dialed-taste-fill.left {
    inset-inline-end: 50%;
}

.dialed-taste-fill.right {
    inset-inline-start: 50%;
}

.dialed-roast-tip {
    margin-bottom: var(--dialed-space-3);
}

.dialed-roast-tip p {
    margin: var(--dialed-space-1) 0 0;
}

.dialed-content h2.dialed-roast-tip-title {
    margin: 0;
    font-size: var(--dialed-text-m);
    font-weight: 600;
}

/* ---- Brew timer: focus mode, readable from across the counter -------------------------------------- */

.dialed-timer-focus .dialed-page-header,
.dialed-timer-focus .dialed-timer-steps,
.dialed-timer-focus .dialed-timer-voice {
    display: none;
}

.dialed-timer-focus .dialed-timer-clock {
    font-size: clamp(5rem, 34vw, 16rem);
    line-height: 1;
}

.dialed-timer-focus .dialed-timer-step {
    font-size: var(--dialed-text-xl, 2rem);
}

.dialed-timer-focus .dialed-timer-target {
    font-size: var(--dialed-text-l);
}

/* ---- Pour figure ------------------------------------------------------------------------------ */

.dialed-pour-figure {
    width: min(14rem, 50vw);
    height: auto;
}

.dialed-pour-vessel {
    fill: none;
    stroke: var(--colorNeutralForeground3);
    stroke-width: 2;
    stroke-linejoin: round;
}

.dialed-pour-water {
    fill: var(--colorBrandBackground);
    opacity: 0.45;
    transform-origin: 0 122px;
    transform-box: view-box;
}

.dialed-pour-bed {
    fill: var(--colorNeutralForeground3);
    opacity: 0.35;
}

.dialed-pour-kettle {
    fill: var(--colorNeutralForeground3);
}

.dialed-pour-stream {
    stroke: var(--colorBrandForeground1);
    stroke-width: 3;
    stroke-linecap: round;
}

.dialed-pour-dot {
    fill: var(--colorBrandForeground1);
}

.dialed-pour-track {
    fill: none;
    stroke: var(--colorBrandForeground1);
    stroke-width: 1;
    stroke-dasharray: 2 3;
    opacity: 0.5;
}

.dialed-pour-figure.small {
    width: 3rem;
}

.dialed-pour-cup {
    fill: none;
    stroke: var(--colorNeutralForeground3);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dialed-pour-cup-coffee {
    fill: var(--colorBrandBackground);
    transform-origin: 0 158px;
    transform-box: view-box;
}

.dialed-pour-crema {
    fill: var(--colorNeutralForegroundOnBrand);
    opacity: 0.4;
}

.dialed-pour-drip {
    stroke: var(--colorBrandForeground1);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-dasharray: 2 5;
}

.dialed-pour-steam {
    fill: none;
    stroke: var(--colorNeutralForeground3);
    stroke-width: 2;
    stroke-linecap: round;
    opacity: 0.7;
}

@media (prefers-reduced-motion: no-preference) {
    .dialed-pour-water,
    .dialed-pour-cup-coffee {
        transition: transform 0.8s ease;
    }

    .dialed-pour-figure.animated .dialed-pour-drip {
        animation: dialed-pour-flow 0.6s linear infinite;
    }

    .dialed-pour-steam {
        animation: dialed-pour-puff 2.4s ease-out infinite;
    }

    .dialed-pour-figure.animated .dialed-pour-stream {
        stroke-dasharray: 5 4;
        animation: dialed-pour-flow 0.5s linear infinite;
    }

    .dialed-pour-figure.animated.dialed-pour-pulse .dialed-pour-stream {
        animation: dialed-pour-flow 0.5s linear infinite, dialed-pour-pulse 1.2s ease-in-out infinite;
    }

    .dialed-pour-figure.animated.dialed-pour-spiral .dialed-pour-orbit {
        animation: dialed-pour-spin 2.4s linear infinite;
    }

    .dialed-pour-figure.animated.dialed-pour-circles .dialed-pour-orbit {
        animation: dialed-pour-spin 3.2s linear infinite;
    }
}

@keyframes dialed-pour-flow {
    to { stroke-dashoffset: -18; }
}

@keyframes dialed-pour-puff {
    0% { opacity: 0; transform: translateY(4px); }
    40% { opacity: 0.8; }
    100% { opacity: 0; transform: translateY(-6px); }
}

@keyframes dialed-pour-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.15; }
}

@keyframes dialed-pour-spin {
    to { transform: rotate(360deg); }
}

.dialed-routine h2 {
    margin: 0 0 var(--dialed-space-1);
}

.dialed-routine-figures {
    display: flex;
    flex-wrap: wrap;
    gap: var(--dialed-space-3);
    margin: var(--dialed-space-2) 0;
    padding: 0;
    list-style: none;
}

.dialed-routine-figures li {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: var(--dialed-text-s);
}

/* On the timer the drawing is smaller, so the step and the buttons stay on the first screen. */
.dialed-timer .dialed-pour-figure {
    width: min(9rem, 40vw);
    overflow: visible;
}

.dialed-timer .dialed-timer-step {
    line-height: 1.2;
    text-align: center;
}

/* ---- Bag screen: tips in one collapsed row ------------------------------------------------------ */

.dialed-tips {
    margin-bottom: var(--dialed-space-3);
}

.dialed-tips > summary {
    display: flex;
    align-items: center;
    min-height: var(--dialed-touch-target);
    padding: 0 var(--dialed-space-3);
    border: 1px solid var(--colorNeutralStroke2);
    border-radius: var(--dialed-radius-m);
    background: var(--colorNeutralBackground1);
    font-weight: var(--dialed-weight-semibold);
    cursor: pointer;
}

.dialed-tips[open] > summary {
    margin-bottom: var(--dialed-space-3);
}

/* ---- Brew timer controls like a music player -------------------------------------------------------- */

.dialed-transport {
    position: sticky;
    bottom: calc(-1 * var(--dialed-space-4));
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--dialed-space-4);
    align-self: stretch;
    margin: var(--dialed-space-2) calc(-1 * var(--dialed-space-4)) calc(-1 * var(--dialed-space-4));
    padding: var(--dialed-space-3) var(--dialed-space-4);
    background: var(--colorNeutralBackground1);
    border-top: 1px solid var(--colorNeutralStroke2);
}

.dialed-transport-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.25rem;
    height: 3.25rem;
    padding: 0;
    border: 1px solid var(--colorNeutralStroke1);
    border-radius: 50%;
    background: var(--colorNeutralBackground1);
    color: var(--colorNeutralForeground1);
    cursor: pointer;
}

.dialed-transport-button:active {
    background: var(--colorNeutralBackground1Pressed);
}

.dialed-transport-button[aria-pressed="true"]:not(.dialed-transport-main) {
    border-color: var(--colorBrandStroke1);
    color: var(--colorBrandForeground1);
}

.dialed-transport-main {
    width: 5.5rem;
    height: 5.5rem;
    border-color: transparent;
    background: var(--colorBrandBackground);
    color: var(--colorNeutralForegroundOnBrand);
}

.dialed-transport-main:active {
    background: var(--colorBrandBackgroundPressed);
}

.dialed-transport-button svg {
    width: 1.5rem;
    height: 1.5rem;
}

.dialed-transport-main svg {
    width: 2.5rem;
    height: 2.5rem;
}

/* ---- Espresso figure (grind, WDT, shot) --------------------------------------------------------- */

.dialed-espresso-grinder {
    fill: var(--colorNeutralForeground3);
}

.dialed-espresso-grain {
    fill: var(--colorNeutralForeground1);
    opacity: 0;
}

.dialed-espresso-mound {
    fill: var(--colorNeutralForeground1);
    opacity: 0.55;
    transform-origin: 60px 122px;
    transform-box: view-box;
}

.dialed-espresso-needle {
    transform-origin: 60px 30px;
    transform-box: view-box;
}

.dialed-espresso-needle-line {
    fill: none;
    stroke: var(--colorNeutralForeground3);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (prefers-reduced-motion: no-preference) {
    .dialed-espresso-figure.animated .dialed-espresso-grain {
        animation: dialed-espresso-fall 0.9s ease-in infinite;
    }

    .dialed-espresso-figure.animated .dialed-espresso-mound {
        animation: dialed-espresso-grow 4s ease-out infinite;
    }

    .dialed-espresso-figure.animated .dialed-espresso-needle {
        animation: dialed-espresso-swing 1.1s ease-in-out infinite alternate;
    }
}

@keyframes dialed-espresso-fall {
    0% { opacity: 0.9; transform: translateY(0); }
    100% { opacity: 0.9; transform: translateY(36px); }
}

@keyframes dialed-espresso-grow {
    0% { transform: scaleY(0.2); }
    100% { transform: scaleY(1); }
}

@keyframes dialed-espresso-swing {
    from { transform: rotate(-16deg); }
    to { transform: rotate(16deg); }
}

.dialed-espresso-prep {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--dialed-space-2);
    text-align: center;
}

.dialed-espresso-prep .dialed-chips {
    justify-content: center;
}

/* Streak cup and level title (Statistics and Home): two quiet tiles, brown, no backgrounds behind the icon. */
.dialed-streak-level {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: var(--dialed-space-3);
    margin: var(--dialed-space-4) 0;
}

.dialed-streak-tile,
.dialed-level-tile {
    display: flex;
    flex-direction: column;
    gap: var(--dialed-space-1);
    padding: var(--dialed-space-4);
    border-radius: var(--dialed-radius-l);
    background: var(--colorNeutralBackground1);
    box-shadow: var(--dialed-shadow-card);
}

.dialed-streak-tile {
    align-items: center;
    text-align: center;
}

.dialed-streak-cup {
    display: inline-flex;
    color: var(--colorBrandForeground1);
}

.dialed-streak-days {
    font-family: var(--dialed-font-display);
    font-size: var(--dialed-text-3xl);
    line-height: 1;
}

.dialed-level-title {
    font-family: var(--dialed-font-display);
    font-size: var(--dialed-text-xl);
}

.dialed-level-tile .dialed-meter {
    margin: var(--dialed-space-2) 0;
}

@media (max-width: 22rem) {
    .dialed-streak-level {
        grid-template-columns: 1fr;
    }
}
