﻿:root {
    --bg: #f6f7fb;
    --surface: #FFFFFF;
    --ink: #0F1B2D;
    --muted: #566379;
    --line: #D8E0EB;
    --accent: #1f6feb;
    --accent-ink: #FFFFFF;
    --accent-soft: #DCE8FD;
    --focus: #E8590C;
    --hash: #5B5BD6;
    --hash-soft: #E6E6FA;
    --office: #C2410C;
    --office-soft: #FDE9DD;
    --web: #0B7A8C;
    --web-soft: #DDF1F4;
    --hi: #f53526;
    --radius: 14px;
    --head: "Sora",system-ui,sans-serif;
    --body: "IBM Plex Sans",system-ui,sans-serif;
    color-scheme: light;
}

    :root:not([data-theme="light"]) {
    }

@media (prefers-color-scheme:dark) {
    :root:not([data-theme="light"]) {
        --bg: #0C1522;
        --surface: #142133;
        --ink: #E8EEF7;
        --muted: #9AA9BF;
        --line: #243650;
        --accent: #5a9bff;
        --accent-ink: #06142B;
        --accent-soft: #172A47;
        --focus: #FFA04D;
        --hash: #9A9AFF;
        --hash-soft: #25254F;
        --office: #FF9F6B;
        --office-soft: #3E2418;
        --web: #35C4D8;
        --web-soft: #12343F;
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --bg: #0C1522;
    --surface: #142133;
    --ink: #E8EEF7;
    --muted: #9AA9BF;
    --line: #243650;
    --accent: #5a9bff;
    --accent-ink: #06142B;
    --accent-soft: #172A47;
    --focus: #FFA04D;
    --hash: #9A9AFF;
    --hash-soft: #25254F;
    --office: #FF9F6B;
    --office-soft: #3E2418;
    --web: #35C4D8;
    --web-soft: #12343F;
    color-scheme: dark;
}

* {
    box-sizing: border-box
}

html {
    scroll-behavior: smooth
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--ink);
    font: 400 1rem/1.6 var(--body);
    -webkit-font-smoothing: antialiased;
    min-width: 370px;
}

a {
    color: inherit;
    text-decoration: none
}

:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
    border-radius: 6px
}

.wrap {
    width: min(1120px,100% - 2.5rem);
    margin-inline: auto
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: color-mix(in srgb,var(--bg) 88%,transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line)
}

.bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 64px
}

.brand {
    display: flex;
    align-items: center;
    gap: .10rem;
    font: 700 1.15rem var(--head);
    letter-spacing: -.01em
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--ink);
    color: var(--bg);
    display: grid;
    place-items: center;
    font: 700 1.2rem var(--display);
    position: relative
}

    .brand-mark::after {
        content: "";
        position: absolute;
        right: -3px;
        bottom: -3px;
        width: 11px;
        height: 11px;
        border-radius: 50%;
        background: var(--hi);
        border: 2px solid var(--bg)
    }

nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: .25rem
}

    nav a {
        padding: .5rem .85rem;
        border-radius: 8px;
        color: var(--muted);
        font-weight: 500
    }

        nav a:hover, nav a[aria-current="page"] {
            color: var(--ink);
            background: var(--surface)
        }

.dropdown {
    position: relative
}

.dd-toggle {
    display: flex;
    align-items: center;
    gap: .35rem;
    border: 0;
    background: transparent;
    font: 500 1rem var(--body);
    color: var(--muted);
    padding: .5rem .85rem;
    border-radius: 8px;
    cursor: pointer
}

    .dd-toggle:hover, .dropdown.open .dd-toggle {
        color: var(--ink);
        background: var(--surface)
    }

    .dd-toggle.active {
        color: var(--ink);
        background: var(--surface)
    }

nav .dd-menu a[aria-current="page"] {
    background: var(--accent-soft);
    font-weight: 500
}

.dd-toggle svg {
    transition: transform .15s
}

.dropdown.open .dd-toggle svg {
    transform: rotate(180deg)
}

.dd-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 240px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: .4rem;
    box-shadow: 0 14px 34px rgba(15,27,45,.16)
}

.dropdown.open .dd-menu {
    display: block
}

nav .dd-menu a {
    display: block;
    padding: .55rem .8rem;
    border-radius: 8px;
    color: var(--ink);
    white-space: nowrap
}

    nav .dd-menu a:hover {
        background: var(--accent-soft);
        color: var(--ink)
    }

.dd-divider {
    height: 1px;
    background: var(--line);
    margin: .35rem .5rem
}

@media (max-width:720px) {
    .dropdown {
        width: 100%
    }

    .dd-toggle {
        width: 100%;
        justify-content: space-between;
        padding: .75rem
    }

    .dd-menu {
        position: static;
        box-shadow: none;
        border: 0;
        background: transparent;
        padding: 0 0 .25rem .75rem;
        min-width: 0
    }
}

.icon-btn {
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    cursor: pointer;
    font-size: larger;
}

    .icon-btn:hover {
        border-color: var(--accent)
    }

.menu-btn {
    display: none
}

@media (max-width:720px) {
    .menu-btn {
        display: grid;
        margin-left: auto
    }

    nav {
        display: none;
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        flex-direction: column;
        align-items: stretch;
        background: var(--bg);
        border-bottom: 1px solid var(--line);
        padding: .75rem 1.25rem 1rem;
        margin: 0
    }

        nav.open {
            display: flex
        }

        nav a {
            padding: .75rem
        }
}

/* Hero */
.hero {
    padding: clamp(2.5rem,5vw,5.5rem) 0 2rem
}

    .hero h1 {
        font: 700 clamp(2.2rem,6vw,4rem)/1.05 var(--head);
        letter-spacing: -.03em;
        margin: 0 0 1rem; /*max-width:14ch;*/
    }

    .hero p {
        color: var(--muted);
        font-size: 1.15rem;
        max-width: 46ch;
        margin: 0 0 1.75rem
    }

.search {
    display: flex;
    align-items: center;
    gap: .6rem;
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    padding: .35rem .5rem .35rem 1rem;
    max-width: 560px;
    transition: border-color .15s,box-shadow .15s
}

    .search:focus-within {
        border-color: var(--accent);
        box-shadow: 0 0 0 4px var(--accent-soft)
    }

    .search svg {
        flex: none;
        color: var(--muted)
    }

    .search input {
        flex: 1;
        min-width: 0;
        border: 0;
        background: transparent;
        color: var(--ink);
        font: inherit;
        font-size: 1.05rem;
        padding: .7rem 0;
        outline: none
    }

        .search input::placeholder {
            color: var(--muted)
        }

.kbd {
    font: 500 .8rem var(--body);
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: .1rem .45rem;
    background: var(--bg)
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: 1rem
}

.chip {
    border: 1px solid var(--line);
    background: transparent;
    color: var(--ink);
    font: 500 .9rem var(--body);
    padding: .4rem .9rem;
    border-radius: 999px;
    cursor: pointer
}

    .chip:hover {
        border-color: var(--accent)
    }

    .chip[aria-pressed="true"] {
        background: var(--ink);
        color: var(--bg);
        border-color: var(--ink)
    }

/* Tool groups */
main {
    padding-bottom: 4rem
}

.group {
    margin-top: 2.5rem
}

    .group[hidden], .tool[hidden] {
        display: none
    }

.group-head {
    display: flex;
    align-items: baseline;
    gap: .75rem;
    margin-bottom: 1rem
}

    .group-head h2 {
        font: 600 1.3rem var(--head);
        margin: 0;
        letter-spacing: -.01em
    }

    .group-head span {
        color: var(--muted);
        font-size: .95rem
    }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill,minmax(min(100%,320px),1fr));
    gap: 1rem
}

.tool {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1.15rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: border-color .15s,transform .15s
}

    .tool:hover {
        border-color: var(--tint);
        transform: translateY(-2px)
    }

    .tool .ico {
        flex: none;
        width: 46px;
        height: 46px;
        border-radius: 12px;
        display: grid;
        place-items: center;
        background: var(--tint-soft);
        color: var(--tint)
    }

    .tool h3 {
        font: 600 1.05rem var(--head);
        margin: 0 0 .15rem
    }

    .tool p {
        margin: 0;
        color: var(--muted);
        font-size: .95rem;
        line-height: 1.45
    }

.g-hash {
    --tint: var(--hash);
    --tint-soft: var(--hash-soft)
}

.g-office {
    --tint: var(--office);
    --tint-soft: var(--office-soft)
}

.g-web {
    --tint: var(--web);
    --tint-soft: var(--web-soft)
}

.empty {
    display: none;
    margin-top: 2.5rem;
    padding: 2rem;
    border: 1.5px dashed var(--line);
    border-radius: var(--radius);
    text-align: center;
    color: var(--muted)
}

    .empty.show {
        display: block
    }

.soon {
    margin-top: 3rem;
    padding: 1.5rem;
    border-radius: var(--radius);
    background: var(--accent);
    color: var(--accent-ink);
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1.5rem;
    justify-content: space-between;
    align-items: center
}

    .soon strong {
        font: 600 1.2rem var(--head)
    }

    .soon a {
        font-weight: 500;
        text-decoration: underline;
        text-underline-offset: 3px
    }

/* Tool sections */
#toolSections {
    display: grid;
    gap: 1.25rem;
    margin-top: 3.5rem
}

.tool-section {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: clamp(1.15rem,3vw,1.75rem);
    scroll-margin-top: 84px;
    border-left: 4px solid var(--tint)
}

    .tool-section:target {
        box-shadow: 0 0 0 4px var(--accent-soft)
    }

    .tool-section h2 {
        font: 700 1.4rem var(--head);
        letter-spacing: -.01em;
        margin: 0 0 .25rem
    }

    .tool-section > p {
        color: var(--muted);
        margin: 0 0 1.15rem
    }

.tool-form {
    display: grid;
    gap: 1rem;
    /*max-width: 720px*/
}

    .tool-form select {
        font: inherit;
        color: var(--ink);
        background: var(--bg);
        border: 1.5px solid var(--line);
        border-radius: 10px;
        padding: .7rem .85rem;
        width: 100%
    }

    .tool-form input[type="file"] {
        padding: .55rem
    }

    .tool-form .btn {
        justify-self: start
    }

.result {
    margin-top: 1rem;
    /*max-width: 720px*/
}

    .result pre {
        margin: 0;
        padding: 1rem;
        background: var(--bg);
        border: 1px solid var(--line);
        border-radius: 10px;
        white-space: pre-wrap;
        word-break: break-all;
        font: .92rem/1.5 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
        max-height: 320px;
        overflow: auto
    }

    .result img {
        max-width: 100%;
        height: auto;
        background: #fff;
        padding: .75rem;
        border-radius: 10px;
        border: 1px solid var(--line)
    }

.spinner {
    display: inline-block;
    width: 1.05em;
    height: 1.05em;
    border: 2.5px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    vertical-align: -.17em;
    margin-right: .55rem
}

.loading {
    display: flex;
    align-items: center;
    color: var(--muted);
    padding: .5rem 0
}

    .loading .spinner {
        width: 1.4rem;
        height: 1.4rem;
        color: var(--accent)
    }

@keyframes spin {
    to {
        transform: rotate(360deg)
    }
}

@media (prefers-reduced-motion:reduce) {
    .spinner {
        animation-duration: 1.8s
    }
}

.check {
    display: flex;
    align-items: center;
    gap: .6rem;
    cursor: pointer;
    font-weight: 500;
    width: fit-content
}

    .check input {
        width: 1.2rem;
        height: 1.2rem;
        accent-color: var(--accent);
        cursor: pointer;
        margin: 0
    }

/* On-Progress Dialog  */
.busy-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background: rgba(15,27,45,.6);
    backdrop-filter: blur(3px);
    cursor: progress;
    outline: none
}

    .busy-overlay[hidden] {
        display: none
    }

.busy-box {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: clamp(1.25rem,5vmin,2.5rem) clamp(1.5rem,7vmin,3rem);
    text-align: center;
    box-shadow: 0 24px 60px rgba(0,0,0,.35);
    max-width: 100%
}

    .busy-box .spinner {
        display: block;
        width: clamp(25px,9vmin,80px);
        height: clamp(25px,9vmin,80px);
        border-width: clamp(4px,1.6vmin,9px);
        margin: 0 auto clamp(.75rem,3vmin,1.5rem);
        color: var(--accent)
    }

    .busy-box p {
        margin: 0;
        font: 500 clamp(.95rem,2.4vmin,1.25rem) var(--head)
    }

.result .copy {
    margin-top: .6rem;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--ink);
    font: 500 .9rem var(--body);
    padding: .4rem .9rem;
    border-radius: 8px;
    cursor: pointer
}

    .result .copy:hover {
        border-color: var(--accent)
    }

/* Popup Dialog */
.popup {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: grid;
    place-items: center;
    padding: 1.25rem;
    background: rgba(15,27,45,.6);
    backdrop-filter: blur(3px)
}

    .popup[hidden] {
        display: none
    }

.popup-card {
    width: min(420px,100%);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 2rem 1.75rem 1.5rem;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0,0,0,.35)
}

    .popup-card h3 {
        font: 700 1.35rem var(--head);
        margin: 1rem 0 .4rem;
        letter-spacing: -.01em
    }

    .popup-card p {
        margin: 0 0 1.5rem;
        color: var(--muted)
    }

    .popup-card .btn {
        min-width: 130px
    }

.popup-icon {
    width: 76px;
    height: 76px;
    margin: 0 auto;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: color-mix(in srgb,currentColor 14%,transparent)
}

    .popup-icon.ok {
        color: #2B8A3E
    }

    .popup-icon.fail {
        color: #C92A2A
    }

:root[data-theme="dark"] .popup-icon.ok {
    color: #69DB7C
}

:root[data-theme="dark"] .popup-icon.fail {
    color: #FF8787
}

@media (prefers-color-scheme:dark) {
    :root:not([data-theme="light"]) .popup-icon.ok {
        color: #69DB7C
    }

    :root:not([data-theme="light"]) .popup-icon.fail {
        color: #FF8787
    }
}

@media (prefers-reduced-motion:no-preference) {
    .popup:not([hidden]) .popup-card {
        animation: pop .28s cubic-bezier(.2,1.2,.4,1) both
    }

    @keyframes pop {
        from {
            opacity: 0;
            transform: scale(.85) translateY(10px)
        }

        to {
            opacity: 1;
            transform: none
        }
    }
}

/* Contact */
.contact {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 2rem 3rem;
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid var(--line);
    scroll-margin-top: 80px
}

.contact-intro h2 {
    font: 700 clamp(1.6rem,3.5vw,2.2rem)/1.15 var(--head);
    letter-spacing: -.02em;
    margin: 0 0 .75rem
}

.contact-intro p {
    color: var(--muted);
    margin: 0;
    max-width: 50ch
}

.contact-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.5rem
}

.field {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    min-width: 0
}

.full {
    grid-column: 1/-1
}

.field label {
    font-weight: 500;
    font-size: .95rem
}

.field input, .field textarea {
    width: 100%;
    font: inherit;
    color: var(--ink);
    background: var(--bg);
    border: 1.5px solid var(--line);
    border-radius: 10px;
    padding: .7rem .85rem;
    transition: border-color .15s,box-shadow .15s
}

.field textarea {
    resize: vertical;
    min-height: 140px
}

    .field input:focus, .field textarea:focus {
        outline: none;
        border-color: var(--accent);
        box-shadow: 0 0 0 4px var(--accent-soft)
    }

.field.invalid input, .field.invalid textarea {
    border-color: #C92A2A
}

.err {
    color: #C92A2A;
    font-size: .88rem;
    min-height: 0
}

:root[data-theme="dark"] .err, :root[data-theme="dark"] .field.invalid input, :root[data-theme="dark"] .field.invalid textarea {
    color: #FF8787;
    border-color: #FF8787
}

:root[data-theme="dark"] .field.invalid input, :root[data-theme="dark"] .field.invalid textarea {
    color: var(--ink)
}

@media (prefers-color-scheme:dark) {
    :root:not([data-theme="light"]) .err {
        color: #FF8787
    }

    :root:not([data-theme="light"]) .field.invalid input, :root:not([data-theme="light"]) .field.invalid textarea {
        border-color: #FF8787
    }
}

.hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden
}

.form-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem 1rem
}

.btn {
    border: 0;
    background: var(--accent);
    color: var(--accent-ink);
    font: 600 1rem var(--head);
    padding: .8rem 1.5rem;
    border-radius: 10px;
    cursor: pointer;
    transition: transform .15s,opacity .15s
}

    .btn:hover {
        transform: translateY(-1px)
    }

    .btn:disabled {
        opacity: .6;
        cursor: wait;
        transform: none
    }

.status {
    margin: 0;
    font-size: .95rem
}

    .status.ok {
        color: #2B8A3E
    }

    .status.fail {
        color: #C92A2A
    }

@media (prefers-color-scheme:dark) {
    :root:not([data-theme="light"]) .status.ok {
        color: #69DB7C
    }

    :root:not([data-theme="light"]) .status.fail {
        color: #FF8787
    }
}

:root[data-theme="dark"] .status.ok {
    color: #69DB7C
}

:root[data-theme="dark"] .status.fail {
    color: #FF8787
}

@media (max-width:820px) {
    .contact {
        grid-template-columns: 1fr
    }

    .contact-intro p {
        max-width: none
    }
}

@media (max-width:520px) {
    .contact-form {
        grid-template-columns: 1fr;
        padding: 1.15rem
    }
}

/* Footer */
main{flex:1 0 auto;padding-bottom:4rem}
footer{flex-shrink:0}
footer {
    border-top: 1px solid var(--line);
    padding: 0.8rem 0;
    color: var(--muted);
    font-size: .92rem
}

    footer .wrap {
        display: flex;
        flex-wrap: wrap;
        gap: .5rem 1.5rem;
        justify-content: space-between
    }

    footer nav {
        margin: 0;
        position: static;
        display: flex;
        flex-direction: row;
        padding: 0;
        border: 0;
        background: none
    }

        footer nav a {
            padding: 0 .5rem 0 0;
            background: none
        }

    footer a:hover {
        color: var(--ink)
    }

/* One-time entrance on the tool grid */
@media (prefers-reduced-motion:no-preference) {
    .hero h1, .hero p, .search {
        animation: rise .5s ease both
    }

    .hero p {
        animation-delay: .07s
    }

    .search {
        animation-delay: .14s
    }

    @keyframes rise {
        from {
            opacity: 0;
            transform: translateY(10px)
        }

        to {
            opacity: 1;
            transform: none
        }
    }
}

@media (prefers-reduced-motion:reduce) {
    * {
        transition: none !important;
        scroll-behavior: auto !important
    }
}
