/* ==========================================================================
   studyhardforfree
   ========================================================================== */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* --- Theme tokens -------------------------------------------------------- */

:root {
    --bg: #1a2e22;
    --text: #c8d8ce;
    --text-muted: #4e7a5e;
    --accent: #7db87d;
    --accent-dim: rgba(125, 184, 125, 0.12);
    --transition: 0.5s;
}

[data-theme="latte"] {
    --bg: #261a11;
    --text: #ddd2c6;
    --text-muted: #6d5a49;
    --accent: #c4956a;
    --accent-dim: rgba(196, 149, 106, 0.12);
}

/* --- Base ---------------------------------------------------------------- */

html, body { height: 100%; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition) ease, color var(--transition) ease;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- Layout -------------------------------------------------------------- */

main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.pomodoro {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

/* --- Cup Scene ----------------------------------------------------------- */

.cup-scene {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

#cupCanvas {
    width: 1000px;
    height: 1000px;
}

/* --- Timer --------------------------------------------------------------- */

.timer-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.session-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
    opacity: 0.65;
    transition: color var(--transition) ease;
}

.time {
    font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
    font-size: 54px;
    font-weight: 300;
    letter-spacing: 0.06em;
    line-height: 1;
    color: var(--text);
    transition: color var(--transition) ease;
}

/* --- Options ------------------------------------------------------------- */

.options-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.06em;
    cursor: pointer;
    padding: 6px 20px;
    transition: color 0.25s ease, opacity 0.25s ease;
    user-select: none;
    opacity: 0.7;
}

.options-toggle:hover {
    color: var(--text);
    opacity: 1;
}

.options-tray {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.options-tray.open {
    grid-template-rows: 1fr;
}

.options-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding-top: 10px;
    min-height: 0;
    overflow: hidden;
}

.controls {
    display: flex;
    gap: 12px;
}

.control-btn {
    background: none;
    border: 1px solid var(--text-muted);
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    font-weight: 400;
    padding: 9px 22px;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
    letter-spacing: 0.02em;
    user-select: none;
}

.control-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
}

.control-btn:active { transform: scale(0.97); }

#startPause { min-width: 90px; }

.theme-toggle {
    display: flex;
    border: 1px solid var(--text-muted);
    border-radius: 6px;
    overflow: hidden;
}

.theme-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.02em;
    padding: 9px 18px;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease;
    user-select: none;
}

.theme-btn + .theme-btn { border-left: 1px solid var(--text-muted); }

.theme-btn.active {
    background: var(--accent-dim);
    color: var(--text);
}

.theme-btn:hover:not(.active) { color: var(--text); }

/* --- Responsive ---------------------------------------------------------- */

@media (max-height: 780px) {
    #cupCanvas { width: 480px; height: 480px; }
    .time { font-size: 42px; }
    .pomodoro { gap: 14px; }
}

@media (max-width: 520px) {
    #cupCanvas { width: 360px; height: 360px; }
    .time { font-size: 42px; }
    .options-inner { gap: 10px; }
    .control-btn { padding: 9px 16px; font-size: 12px; }
}
