:root {
    color-scheme: light;
    --page: #f5f7fb;
    --surface: #ffffff;
    --ink: #111827;
    --muted: #5f6b7a;
    --line: #dce3ec;
    --blue: #2563eb;
    --blue-dark: #1d4ed8;
    --cyan: #0891b2;
    --green: #15803d;
    --shadow: 0 18px 48px rgba(15, 23, 42, 0.09);
}

* { box-sizing: border-box; }

html {
    min-width: 280px;
    min-height: 100%;
    background: var(--page);
    scroll-behavior: smooth;
}

body {
    min-width: 280px;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    color: var(--ink);
    background: var(--page);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.section-inner,
.header-inner,
.content-inner,
.faq-inner,
.footer-inner {
    width: min(100% - 32px, 1080px);
    margin-inline: auto;
}

.site-header {
    position: relative;
    z-index: 5;
    min-height: 68px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
}

.header-inner {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.site-logo {
    color: var(--ink);
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
    text-decoration: none;
}

.site-logo span { color: var(--blue); }

.home-link {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: #334155;
    background: var(--surface);
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    transition: border-color 160ms ease, color 160ms ease, background-color 160ms ease;
}

.home-link:hover {
    border-color: #b8c4d3;
    color: var(--blue-dark);
    background: #f8fafc;
}

.timer-hero {
    padding: 68px 0 142px;
    border-bottom: 1px solid #173d76;
    color: #ffffff;
    background: #15345f;
    text-align: center;
}

.hero-label,
.section-label,
.setup-kicker {
    margin: 0 0 12px;
    color: #bcecf4;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.timer-hero h1 {
    margin: 0;
    font-size: clamp(40px, 8vw, 72px);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: 0;
}

.hero-copy {
    max-width: 650px;
    margin: 18px auto 0;
    color: #dce9f8;
    font-size: clamp(16px, 2.3vw, 19px);
    line-height: 1.65;
}

.timer-section {
    position: relative;
    z-index: 2;
    margin-top: -92px;
    padding-bottom: 78px;
}

.timer-tool {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(290px, 0.65fr);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.timer-share {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.share-button {
    min-width: 0;
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
    color: #334155;
    background: var(--surface);
    font-size: 13px;
    font-weight: 850;
    text-align: center;
    text-decoration: none;
    transition: transform 140ms ease, border-color 140ms ease, background-color 140ms ease;
}

.share-button:hover { transform: translateY(-1px); }
.share-button:active { transform: translateY(0); }
.share-primary { border-color: var(--blue); color: #ffffff; background: var(--blue); }
.share-primary:hover { border-color: var(--blue-dark); background: var(--blue-dark); }
.share-whatsapp { border-color: #137a42; color: #ffffff; background: #137a42; }
.share-whatsapp:hover { background: #0f6837; }
.share-x { border-color: #111827; color: #ffffff; background: #111827; }
.share-x:hover { background: #000000; }
.share-copy:hover { border-color: #aebccc; background: #ffffff; }

.timer-stage {
    min-width: 0;
    padding: clamp(26px, 5vw, 54px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-right: 1px solid var(--line);
    background: #fbfcfe;
}

.timer-readout {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: start;
    gap: clamp(4px, 1vw, 12px);
    font-variant-numeric: tabular-nums;
}

.time-unit { min-width: 0; text-align: center; }

.time-unit > span {
    display: block;
    width: 100%;
    color: var(--ink);
    font-size: clamp(44px, 8vw, 78px);
    font-weight: 850;
    line-height: 1;
    letter-spacing: 0;
}

.seconds-unit > span { color: var(--cyan); }

.time-unit small {
    display: block;
    margin-top: 10px;
    color: #718096;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.time-separator {
    padding-top: 0.04em;
    color: #9aa8b9;
    font-size: clamp(38px, 7vw, 68px);
    font-weight: 700;
    line-height: 1;
}

.progress-track {
    width: 100%;
    height: 6px;
    margin-top: 30px;
    overflow: hidden;
    border-radius: 3px;
    background: #dfe7f0;
}

.progress-track span {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: var(--blue);
    transform: scaleX(1);
    transform-origin: left center;
    transition: transform 180ms linear, background-color 180ms ease;
}

.timer-status {
    min-height: 22px;
    margin: 15px 0 0;
    color: var(--muted);
    font-size: 14px;
    font-weight: 750;
    text-align: center;
}

.timer-actions {
    display: grid;
    grid-template-columns: minmax(150px, 1.4fr) 1fr 1fr;
    gap: 10px;
    margin-top: 18px;
}

.timer-actions button {
    min-width: 0;
    min-height: 50px;
    padding: 0 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 850;
    transition: transform 140ms ease, border-color 140ms ease, background-color 140ms ease, color 140ms ease;
}

.timer-actions button:hover { transform: translateY(-1px); }
.timer-actions button:active { transform: translateY(0); }

.timer-actions button:focus-visible,
.preset-grid button:focus-visible,
.home-link:focus-visible,
.sound-control:has(input:focus-visible) {
    outline: 3px solid rgba(37, 99, 235, 0.22);
    outline-offset: 2px;
}

.primary-button {
    border: 1px solid var(--blue);
    color: #ffffff;
    background: var(--blue);
}

.primary-button:hover { border-color: var(--blue-dark); background: var(--blue-dark); }
.primary-button.is-running { border-color: #b45309; background: #b45309; }

.secondary-button {
    border: 1px solid var(--line);
    color: #334155;
    background: var(--surface);
}

.secondary-button:hover { border-color: #b8c4d3; background: #f4f7fa; }
.timer-is-running .progress-track span { background: var(--cyan); }
.timer-is-done .timer-stage { box-shadow: inset 0 0 0 2px rgba(21, 128, 61, 0.2); }
.timer-is-done .timer-status { color: var(--green); }

.timer-setup {
    min-width: 0;
    padding: clamp(24px, 4vw, 36px);
    background: var(--surface);
}

.setup-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.setup-kicker { margin-bottom: 5px; color: var(--blue); }
.setup-heading h2 { margin: 0; font-size: 21px; line-height: 1.2; }

.sound-control {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: #475569;
    background: #f8fafc;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
}

.sound-control input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--blue);
}

.timer-inputs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 25px;
}

.timer-inputs label { min-width: 0; }

.timer-inputs label > span {
    display: block;
    margin-bottom: 7px;
    color: #64748b;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 0.05em;
    text-align: center;
    text-transform: uppercase;
}

.timer-inputs input {
    width: 100%;
    min-width: 0;
    height: 48px;
    padding: 0 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    outline: 0;
    color: var(--ink);
    background: #f8fafc;
    font-size: 18px;
    font-weight: 850;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.timer-inputs input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.13);
    background: #ffffff;
}

.preset-block {
    margin-top: 26px;
    padding-top: 23px;
    border-top: 1px solid var(--line);
}

.preset-block > p {
    margin: 0 0 10px;
    color: #64748b;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.preset-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.preset-grid button {
    min-width: 0;
    min-height: 40px;
    padding: 0 7px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: #334155;
    background: #ffffff;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
    transition: border-color 140ms ease, color 140ms ease, background-color 140ms ease;
}

.preset-grid button:hover { border-color: #9fb3ca; color: var(--blue-dark); background: #f3f7fc; }

.content-section { padding: 4px 0 82px; }

.content-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
    gap: clamp(32px, 6vw, 72px);
    align-items: start;
}

.content-copy .section-label,
.faq-section .section-label { color: var(--blue); }

.content-copy h2,
.faq-section h2 {
    margin: 0;
    color: var(--ink);
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.14;
    letter-spacing: 0;
}

.content-copy p:not(.section-label) {
    margin: 20px 0 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.75;
}

.use-list {
    padding: 25px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.use-list h2 { margin: 0 0 18px; font-size: 20px; }

.use-list ul {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.use-list li {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-top: 1px solid var(--line);
    color: #364152;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
}

.use-list li span { color: var(--cyan); font-size: 12px; font-weight: 900; }

.faq-section {
    padding: 76px 0 84px;
    border-top: 1px solid var(--line);
    background: #ffffff;
}

.faq-inner { max-width: 800px; }
.faq-list { margin-top: 30px; border-top: 1px solid var(--line); }
.faq-list details { border-bottom: 1px solid var(--line); }

.faq-list summary {
    position: relative;
    padding: 21px 42px 21px 0;
    color: #1f2937;
    cursor: pointer;
    font-size: 16px;
    font-weight: 850;
    list-style: none;
}

.faq-list summary::-webkit-details-marker { display: none; }

.faq-list summary::after {
    content: "+";
    position: absolute;
    top: 50%;
    right: 5px;
    color: var(--blue);
    font-size: 23px;
    font-weight: 500;
    transform: translateY(-50%);
}

.faq-list details[open] summary::after { content: "−"; }

.faq-list details p {
    max-width: 680px;
    margin: -4px 0 21px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.7;
}

.site-footer {
    padding: 30px 0;
    border-top: 1px solid var(--line);
    background: var(--page);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.footer-inner p { margin: 0; color: #697586; font-size: 13px; }

@media (max-width: 850px) {
    .timer-tool,
    .content-inner { grid-template-columns: 1fr; }

    .timer-stage {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .timer-setup { padding: 27px; }
}

@media (max-width: 560px) {
    .section-inner,
    .header-inner,
    .content-inner,
    .faq-inner,
    .footer-inner { width: min(100% - 22px, 1080px); }

    .site-header,
    .header-inner { min-height: 62px; }
    .timer-hero { padding: 48px 0 118px; }
    .timer-section { margin-top: -78px; padding-bottom: 58px; }
    .timer-stage { padding: 27px 13px 22px; }
    .timer-readout { gap: 2px; }
    .time-unit > span { font-size: clamp(38px, 15vw, 58px); }
    .time-separator { font-size: clamp(34px, 13vw, 50px); }
    .time-unit small { margin-top: 8px; font-size: 9px; }
    .progress-track { margin-top: 23px; }
    .timer-actions { grid-template-columns: 1fr 1fr; }
    .primary-button { grid-column: 1 / -1; }
    .timer-setup { padding: 23px 13px 25px; }
    .setup-heading { padding-inline: 2px; }
    .timer-inputs { gap: 6px; }
    .timer-inputs input { height: 46px; font-size: 17px; }
    .preset-grid { gap: 6px; }
    .content-section { padding-bottom: 60px; }
    .content-inner { gap: 34px; }
    .faq-section { padding: 58px 0 64px; }

    .footer-inner {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }
}

@media (max-width: 390px) {
    .timer-share { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 330px) {
    .timer-stage { padding-inline: 9px; }
    .time-unit > span { font-size: 36px; }
    .time-separator { font-size: 31px; }
    .timer-actions button { padding-inline: 8px; font-size: 13px; }

    .setup-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
