@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@600;700&display=swap');

:root {
    --bg-color: #0f172a;
    --card-bg: rgba(255, 255, 255, 0.95);
    --card-border: rgba(255, 255, 255, 0.5);
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #8b5cf6;
    --accent: #ec4899;
    --tertiary: #f43f5e;
    --tertiary-hover: #e11d48;
    --text: #1e293b;
    --muted: #64748b;
    --border: rgba(226, 232, 240, 0.8);
    --ring-bg: rgba(226, 232, 240, 0.6);
    --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --radius: 28px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-color);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

/* Animated background blobs */
.bg-blobs {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s infinite ease-in-out;
}

.blob-1 {
    width: 500px;
    height: 500px;
    background: #6366f1;
    top: -10%;
    left: -10%;
    animation-delay: 0s;
}

.blob-2 {
    width: 400px;
    height: 400px;
    background: #ec4899;
    bottom: -10%;
    right: -10%;
    animation-delay: -7s;
}

.blob-3 {
    width: 350px;
    height: 350px;
    background: #06b6d4;
    top: 40%;
    left: 40%;
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

header {
    text-align: center;
    padding: 3rem 1rem 1.5rem;
}

.logo {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    letter-spacing: -0.02em;
}

.tagline {
    color: rgba(255, 255, 255, 0.75);
    font-size: 1.1rem;
    margin-top: 0.75rem;
    font-weight: 400;
}

main {
    flex: 1;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 0 1.25rem 3rem;
}

.timer-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.timer-card:hover {
    box-shadow: 0 30px 55px -12px rgba(0, 0, 0, 0.25);
}

.timer-visual {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}

.timer-display {
    position: absolute;
    font-family: 'JetBrains Mono', monospace;
    font-size: 2.4rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    padding: 0 0.75rem;
    background: linear-gradient(135deg, #1e293b 0%, #4f46e5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.progress-ring svg {
    width: 280px;
    height: 280px;
    transform: rotate(-90deg);
    filter: drop-shadow(0 4px 12px rgba(99, 102, 241, 0.2));
}

.progress-ring-bg,
.progress-ring-fill {
    fill: none;
    stroke-width: 10;
}

.progress-ring-bg {
    stroke: var(--ring-bg);
}

.progress-ring-fill {
    stroke: url(#ringGradient);
    stroke-linecap: round;
    transition: stroke-dashoffset 0.15s linear;
}

.timer-card.running .progress-ring-fill {
    filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.5));
}

.controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.btn {
    border: none;
    border-radius: 16px;
    padding: 0.95rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: filter 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-sm);
    user-select: none;
}

.btn:focus-visible {
    outline: 3px solid rgba(99, 102, 241, 0.4);
    outline-offset: 3px;
}

.btn:active {
    filter: brightness(0.92);
}

.btn-icon {
    font-size: 0.85em;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    box-shadow: 0 8px 20px -4px rgba(99, 102, 241, 0.35);
}

.btn-secondary {
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    color: #fff;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #db2777 100%);
    box-shadow: 0 8px 20px -4px rgba(139, 92, 246, 0.35);
}

.btn-tertiary {
    background: linear-gradient(135deg, #f43f5e 0%, #fb7185 100%);
    color: #fff;
}

.btn-tertiary:hover {
    background: linear-gradient(135deg, #e11d48 0%, #f43f5e 100%);
    box-shadow: 0 8px 20px -4px rgba(244, 63, 94, 0.35);
}

.btn-set {
    background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    color: #fff;
    padding: 0.85rem 1.75rem;
}

.btn-set:hover {
    background: linear-gradient(135deg, #0891b2 0%, #2563eb 100%);
    box-shadow: 0 8px 20px -4px rgba(6, 182, 212, 0.35);
}

.quick-presets {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(241, 245, 249, 0.6);
    border-radius: 20px;
    border: 1px solid var(--border);
}

.preset-label {
    display: block;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.preset-group {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.preset-btn {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.preset-btn:hover {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 6px 14px -3px rgba(99, 102, 241, 0.28);
}

.preset-btn:focus-visible {
    outline: 2px solid rgba(99, 102, 241, 0.4);
    outline-offset: 2px;
}

.custom-time {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding-top: 1.75rem;
    border-top: 1px solid var(--border);
}

.time-inputs {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}

.input-group input {
    width: 72px;
    padding: 0.75rem 0.5rem;
    border: 2px solid var(--border);
    border-radius: 14px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text);
    background: #fff;
    transition: all 0.2s ease;
}

.input-group input:focus-visible {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

/* Hide number input spinners for cleaner look */
.input-group input::-webkit-outer-spin-button,
.input-group input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.input-group input[type=number] {
    -moz-appearance: textfield;
}

.input-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.separator {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--muted);
    margin-top: -1.2rem;
}

.features {
    margin-top: 3rem;
}

.features h2 {
    font-size: 1.75rem;
    color: #fff;
    text-align: center;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}

.feature-item {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 1.5rem 1rem;
    text-align: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.feature-item:hover {
    background: rgba(255, 255, 255, 0.14);
    box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.2);
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.feature-item h3 {
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.feature-item p {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.85rem;
    line-height: 1.5;
}

footer {
    text-align: center;
    padding: 2rem 1rem;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

@media (max-width: 600px) {
    .logo {
        font-size: 1.6rem;
    }

    .tagline {
        font-size: 0.95rem;
    }

    .timer-card {
        padding: 1.75rem 1.25rem;
        border-radius: 22px;
    }

    .timer-display {
        font-size: 2rem;
    }

    .progress-ring svg {
        width: 240px;
        height: 240px;
    }

    .btn {
        padding: 0.85rem 1.5rem;
    }

    .custom-time {
        flex-direction: column;
    }
}
