/* -------------------------------------------------------
   1) RESET + BASE NORMALIZATION
------------------------------------------------------- */

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

* {
    margin: 0;
    padding: 0;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
}

input,
button,
textarea,
select {
    font: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
    overflow-wrap: break-word;
}

#root,
#__next {
    isolation: isolate;
}


/* -------------------------------------------------------
   2) CSS VARIABLES (THEME)
------------------------------------------------------- */

:root {
    /* Colors */
    --clr-bg: #5b27a8;
    --clr-surface: #341660;
    --clr-surface-hover: #3e1b75;
    --clr-text: #f5f5f5;
    --clr-text-muted: rgba(245, 245, 245, 0.55);
    --clr-accent: #23a7cf;
    --clr-accent-2: #d829cf;
    --clr-border: rgba(255, 255, 255, 0.12);

    /* Typography */
    --font-main: "Inter", system-ui, sans-serif;
    --font-mono: "JetBrains Mono", monospace;

    /* Sizing scale */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 1rem;
    --space-4: 1.5rem;
    --space-5: 2rem;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;

    /* Shadows */
    --shadow-soft: 0 4px 24px rgba(0, 0, 0, 0.25);
}


/* -------------------------------------------------------
   3) TYPOGRAPHY BASE
------------------------------------------------------- */

body {
    font-family: var(--font-main);
    font-size: 16px;
    line-height: 1.6;
    background: var(--clr-bg);
    color: var(--clr-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

h1,
h2,
h3,
h4 {
    font-weight: 600;
    line-height: 1.2;
}

a {
    color: var(--clr-accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}


/* -------------------------------------------------------
   4) UTILITY CLASSES
------------------------------------------------------- */

.flex {
    display: flex;
    align-items: center;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.grid {
    display: grid;
    gap: var(--space-3);
}

.rounded {
    border-radius: var(--radius-lg);
}

.shadow {
    box-shadow: var(--shadow-soft);
}

.text-center {
    text-align: center;
}

.mt-1 {
    margin-top: var(--space-1);
}

.mt-2 {
    margin-top: var(--space-2);
}

.mt-3 {
    margin-top: var(--space-3);
}

.mt-4 {
    margin-top: var(--space-4);
}

.mt-5 {
    margin-top: var(--space-5);
}


/* -------------------------------------------------------
   5) TIMER LAYOUT
------------------------------------------------------- */

.timerContainer {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* The two big number boxes */
.timeBox {
    width: 300px;
    height: 300px;
    background: var(--clr-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--clr-border);
    display: flex;
    justify-content: center;
    align-items: center;
}

.timeBox p {
    font-size: 12rem;
    font-family: var(--font-mono);
    font-weight: 700;
    letter-spacing: -0.04em;
    /* tighten the gap between digits */
    line-height: 1;
}


/* -------------------------------------------------------
   6) INPUTS
------------------------------------------------------- */

input[type="number"] {
    background: var(--clr-surface);
    color: var(--clr-text);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.6rem;
    width: 5rem;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 1.2rem;
    outline: none;
    transition: border-color 0.15s;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

input[type="number"]:focus {
    border-color: var(--clr-accent);
}

/* The colon separator between inputs */
.timerContainer span {
    font-family: var(--font-mono);
    font-size: 1.6rem;
    color: var(--clr-text-muted);
}


/* -------------------------------------------------------
   7) BUTTONS
------------------------------------------------------- */

button {
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 600;
    padding: 0.55rem 1.8rem;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    letter-spacing: 0.03em;
    transition: opacity 0.15s, transform 0.1s;
}

button:active {
    transform: scale(0.97);
}

/* Start / Pause — accent filled */
#startBtn {
    background: var(--clr-accent-2);
    color: #fff;
}

#startBtn:hover {
    opacity: 0.88;
}

/* Reset — ghost style */
#resetBtn {
    background: transparent;
    color: var(--clr-text-muted);
    border: 1px solid var(--clr-border);
}

#resetBtn:hover {
    color: var(--clr-text);
    border-color: rgba(255, 255, 255, 0.3);
}