:root {
    color-scheme: dark;
    --bg: #101010;
    --panel-strong: rgba(255, 255, 255, .12);
    --line: rgba(255, 255, 255, .16);
    --text: #f7f4ed;
    --muted: #b9b2a7;
    --soft: rgba(247, 244, 237, .72);
    --green: #6af0a0;
    --blue: #4cc9f0;
    --pink: #ff4fa3;
    --amber: #ffca3a;
    --shadow: 0 24px 80px rgba(0, 0, 0, .38);
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    min-height: 100svh;
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        linear-gradient(128deg, rgba(255, 79, 163, .18), transparent 27%),
        linear-gradient(236deg, transparent 45%, rgba(106, 240, 160, .14) 69%, transparent 100%),
        linear-gradient(180deg, #171414 0%, var(--bg) 48%, #0d0d0c 100%);
    overflow-x: hidden;
}

body::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    content: "";
    background:
        repeating-linear-gradient(90deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 72px),
        repeating-linear-gradient(0deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 72px),
        linear-gradient(105deg, transparent 0 18%, rgba(76, 201, 240, .14) 18% 18.5%, transparent 18.5% 100%),
        linear-gradient(115deg, transparent 0 78%, rgba(255, 202, 58, .12) 78% 78.5%, transparent 78.5% 100%);
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, .86), transparent 88%);
    pointer-events: none;
}

a {
    color: inherit;
}

button,
input {
    font: inherit;
}

h1,
h2,
h3,
p {
    letter-spacing: 0;
}

.shell {
    width: min(1180px, calc(100% - clamp(24px, 5vw, 56px)));
    min-height: 100vh;
    min-height: 100svh;
    margin: 0 auto;
    padding: clamp(18px, 3vw, 30px) 0 38px;
    display: grid;
    grid-template-rows: auto minmax(280px, .85fr) auto;
    gap: clamp(18px, 3vw, 26px);
}

.topbar,
.section-heading,
.group-heading,
.clock {
    display: flex;
    align-items: center;
}

.topbar {
    justify-content: space-between;
    gap: 18px;
}

.identity {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
}

.identity > div {
    min-width: 0;
}

.mark {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .15), rgba(255, 255, 255, .04)),
        linear-gradient(135deg, rgba(106, 240, 160, .22), rgba(255, 79, 163, .15));
    box-shadow: var(--shadow);
    color: #fff;
    font-size: .82rem;
    font-weight: 800;
}

.eyebrow,
.clock-label,
.group-count,
.link-domain {
    margin: 0;
    color: var(--muted);
    font-size: .78rem;
}

h1 {
    margin: 0;
    font-size: 2.2rem;
    line-height: 1;
    overflow-wrap: anywhere;
}

.clock {
    gap: 12px;
    justify-content: flex-end;
    min-width: 190px;
    text-align: right;
}

.clock-time {
    margin: 0;
    color: var(--text);
    font-size: 2.75rem;
    font-weight: 800;
    line-height: 1;
}

.clock-label {
    margin-top: 4px;
}

.search-panel {
    width: 100%;
    align-self: center;
    display: grid;
    gap: clamp(18px, 3vw, 22px);
    padding: clamp(20px, 4vw, 44px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, .055)),
        rgba(10, 10, 10, .46);
    box-shadow: var(--shadow);
    backdrop-filter: blur(22px);
}

.bookmarks-section {
    align-self: start;
    min-width: 0;
}

.search-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
}

.search-header > div:first-child {
    min-width: 0;
}

.kicker {
    margin: 0 0 8px;
    color: var(--green);
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.search-title {
    margin: 0;
    max-width: 720px;
    font-size: 5.7rem;
    line-height: .92;
    overflow-wrap: anywhere;
}

.bookmark-total {
    width: 96px;
    min-height: 72px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .07);
    text-align: center;
}

.bookmark-total strong {
    display: block;
    color: var(--amber);
    font-size: 1.7rem;
    line-height: 1;
}

.bookmark-total span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: .74rem;
}

.search-form {
    display: grid;
    gap: 14px;
}

.input-wrap {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) auto;
    align-items: center;
    min-height: 70px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .22);
    overflow: hidden;
}

.search-glyph {
    position: relative;
    width: 18px;
    height: 18px;
    margin-left: 22px;
    border: 3px solid #171717;
    border-radius: 50%;
}

.search-glyph::after {
    position: absolute;
    width: 9px;
    height: 3px;
    right: -8px;
    bottom: -4px;
    content: "";
    background: #171717;
    border-radius: 999px;
    transform: rotate(45deg);
}

.search-input {
    width: 100%;
    min-width: 0;
    height: 70px;
    border: 0;
    outline: 0;
    color: #121212;
    background: transparent;
    font-size: 1.55rem;
    font-weight: 700;
}

.search-input::placeholder {
    color: rgba(18, 18, 18, .46);
}

.search-button {
    min-width: 132px;
    height: 54px;
    margin-right: 8px;
    border: 0;
    border-radius: var(--radius);
    color: #101010;
    background: linear-gradient(135deg, var(--green), var(--blue));
    font-weight: 900;
    cursor: pointer;
    transition: transform .18s ease, filter .18s ease;
}

.search-button:hover,
.search-button:focus-visible {
    filter: brightness(1.04);
    transform: translateY(-1px);
}

.search-engines {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.engine-option {
    min-height: 38px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--soft);
    background: rgba(255, 255, 255, .06);
    cursor: pointer;
}

.engine-option:hover,
.engine-option:focus-visible {
    color: var(--text);
    border-color: rgba(255, 255, 255, .32);
    background: rgba(255, 255, 255, .1);
}

.engine-option.is-active {
    color: #101010;
    border-color: transparent;
    background: linear-gradient(135deg, var(--green), var(--blue));
    font-weight: 900;
}

.section-heading {
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.section-heading h2 {
    margin: 0;
    font-size: 1.1rem;
}

.section-heading span {
    color: var(--muted);
    font-size: .82rem;
}

.bookmark-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    align-items: start;
    gap: 14px;
}

.bookmark-group {
    display: grid;
    gap: 10px;
    min-width: 0;
    align-content: start;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .04);
}

.group-heading {
    justify-content: space-between;
    gap: 12px;
    min-height: 26px;
}

.group-heading h3 {
    margin: 0;
    font-size: .92rem;
}

.bookmark-list {
    display: grid;
    gap: 8px;
    align-content: start;
}

.bookmark-card {
    --accent: var(--blue);
    position: relative;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-height: 66px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        linear-gradient(90deg, color-mix(in srgb, var(--accent) 26%, transparent), transparent 46%),
        rgba(255, 255, 255, .07);
    text-decoration: none;
    overflow: hidden;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.bookmark-card::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    content: "";
    background: var(--accent);
}

.bookmark-card:hover,
.bookmark-card:focus-visible {
    border-color: color-mix(in srgb, var(--accent) 58%, white);
    background:
        linear-gradient(90deg, color-mix(in srgb, var(--accent) 34%, transparent), transparent 52%),
        var(--panel-strong);
    transform: translateY(-2px);
}

.bookmark-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .17);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .1);
    overflow: hidden;
}

.bookmark-icon > * {
    grid-area: 1 / 1;
}

.bookmark-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    z-index: 2;
}

.bookmark-initials {
    color: var(--text);
    font-size: .8rem;
    font-weight: 900;
    z-index: 1;
}

.bookmark-name,
.link-domain {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bookmark-name {
    font-size: .95rem;
    font-weight: 800;
}

.link-domain {
    margin-top: 3px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    border: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

@media (max-width: 980px) {
    .shell {
        grid-template-rows: auto auto auto;
    }

    h1 {
        font-size: 1.85rem;
    }

    .clock-time {
        font-size: 2.25rem;
    }

    .search-title {
        font-size: 4.4rem;
    }

    .bookmark-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .shell {
        width: min(100% - 24px, 1180px);
        padding-top: 18px;
        gap: 18px;
    }

    .topbar,
    .search-header {
        align-items: flex-start;
    }

    .topbar {
        flex-direction: column;
    }

    .clock {
        min-width: 0;
        justify-content: flex-start;
        text-align: left;
    }

    h1 {
        font-size: 1.5rem;
    }

    .clock-time {
        font-size: 1.85rem;
    }

    .search-title {
        font-size: 3.05rem;
    }

    .search-panel {
        padding: 18px;
    }

    .search-header {
        flex-direction: column;
    }

    .bookmark-total {
        width: 100%;
        min-height: 56px;
        place-items: center start;
        padding: 12px;
        text-align: left;
    }

    .input-wrap {
        grid-template-columns: 48px minmax(0, 1fr);
        min-height: 62px;
    }

    .search-glyph {
        margin-left: 18px;
    }

    .search-input {
        height: 62px;
        padding-right: 12px;
        font-size: 1.15rem;
    }

    .search-button {
        grid-column: 1 / -1;
        width: calc(100% - 16px);
        min-width: 0;
        height: 48px;
        margin: 0 8px 8px;
    }

    .search-engines {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .engine-option {
        width: 100%;
    }

    .bookmark-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 380px) {
    .shell {
        width: min(100% - 18px, 1180px);
    }

    .identity {
        gap: 10px;
    }

    .mark {
        width: 38px;
        height: 38px;
    }

    .search-panel {
        padding: 14px;
    }

    .search-title {
        font-size: 2.15rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
