:root, [data-theme="light"] {
    --gold: #B8942E;
    --gold-deep: #8A6C1C;
    --gold-soft: rgba(184, 148, 46, 0.16);
    --ink: #12141A;
    --ink-soft: #3A404C;
    --muted: #6B7380;
    --line: rgba(18, 20, 26, 0.1);
    --surface: rgba(255, 255, 255, 0.72);
    --surface-strong: #FFFFFF;
    --base: #E6E9EE;
    --mesh-a: rgba(184, 148, 46, 0.22);
    --mesh-b: rgba(45, 90, 120, 0.12);
    --ok: #1A8F5C;
    --ok-soft: rgba(26, 143, 92, 0.12);
    --warn: #B45309;
    --warn-soft: rgba(180, 83, 9, 0.12);
    --danger: #B42318;
    --danger-soft: rgba(180, 35, 24, 0.12);
    --info: #1D4E89;
    --info-soft: rgba(29, 78, 137, 0.12);
    --radius: 18px;
    --radius-sm: 10px;
    --font: "Figtree", sans-serif;
    --display: "Syne", sans-serif;
    --toggle: rgba(255, 255, 255, 0.85);
    --press: rgba(18, 20, 26, 0.04);
    --halo: rgba(184, 148, 46, 0.35);
}

[data-theme="dark"] {
    --gold: #D4AF37;
    --gold-deep: #B8942E;
    --gold-soft: rgba(212, 175, 55, 0.14);
    --ink: #F2F4F7;
    --ink-soft: #C5CAD3;
    --muted: #8E96A3;
    --line: rgba(242, 244, 247, 0.1);
    --surface: rgba(22, 25, 32, 0.78);
    --surface-strong: #161920;
    --base: #0E1014;
    --mesh-a: rgba(212, 175, 55, 0.14);
    --mesh-b: rgba(70, 130, 160, 0.1);
    --ok: #34D399;
    --ok-soft: rgba(52, 211, 153, 0.14);
    --warn: #FBBF24;
    --warn-soft: rgba(251, 191, 36, 0.14);
    --danger: #F87171;
    --danger-soft: rgba(248, 113, 113, 0.14);
    --info: #7DB4E8;
    --info-soft: rgba(125, 180, 232, 0.14);
    --toggle: rgba(22, 25, 32, 0.9);
    --press: rgba(255, 255, 255, 0.04);
    --halo: rgba(212, 175, 55, 0.28);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: var(--font);
    color: var(--ink);
    background: var(--base);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

.atmosphere {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 80% 50% at 50% -5%, var(--mesh-a), transparent 60%),
        radial-gradient(ellipse 55% 40% at 100% 80%, var(--mesh-b), transparent 55%),
        radial-gradient(ellipse 40% 30% at 0% 60%, var(--gold-soft), transparent 50%),
        var(--base);
    animation: mesh-drift 18s ease-in-out infinite alternate;
}

.atmosphere::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.35;
    background-image:
        linear-gradient(rgba(18, 20, 26, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(18, 20, 26, 0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 20%, transparent 75%);
}

[data-theme="dark"] .atmosphere::after {
    background-image:
        linear-gradient(rgba(242, 244, 247, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(242, 244, 247, 0.04) 1px, transparent 1px);
}

@keyframes mesh-drift {
    from { filter: hue-rotate(0deg) saturate(1); }
    to { filter: hue-rotate(8deg) saturate(1.08); }
}

@media (prefers-reduced-motion: reduce) {
    .atmosphere { animation: none; }
    .reveal, .action, .tool, .jb-option, .jb-info-toggle, .cert-row { animation: none !important; transition: none !important; }
}

.shell {
    position: relative;
    z-index: 1;
    width: min(100%, 28rem);
    margin: 0 auto;
    padding: max(1rem, env(safe-area-inset-top)) 1.15rem max(2rem, env(safe-area-inset-bottom));
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    margin-bottom: 0.5rem;
}

.lang-switch {
    position: relative;
    display: inline-block;
}
.lang-switch-toggle {
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    min-height: 2.5rem;
    padding: 0.28rem 0.55rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--toggle);
    color: var(--muted);
    cursor: pointer;
    user-select: none;
    backdrop-filter: blur(12px);
    transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}
.lang-switch-toggle::-webkit-details-marker { display: none; }
.lang-switch-toggle:hover {
    color: var(--ink);
    border-color: var(--gold);
}
.lang-switch[open] .lang-switch-toggle {
    color: var(--ink);
    border-color: var(--gold);
    background: color-mix(in srgb, var(--gold) 14%, var(--toggle));
}
.lang-switch[open] .lang-chev { transform: rotate(180deg); }
.lang-flag {
    font-size: 1.2rem;
    line-height: 1;
}
.lang-chev {
    display: block;
    flex-shrink: 0;
    transition: transform 160ms ease;
}
.lang-switch-menu {
    position: absolute;
    top: calc(100% + 0.35rem);
    right: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 2.85rem;
    padding: 0.3rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-strong, var(--toggle));
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}
.lang-switch-option {
    appearance: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 2.1rem;
    padding: 0.25rem;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: background 160ms ease, border-color 160ms ease;
}
.lang-switch-option:hover {
    background: color-mix(in srgb, var(--gold) 12%, transparent);
}
.lang-switch-option.active {
    background: color-mix(in srgb, var(--gold) 18%, transparent);
    border-color: color-mix(in srgb, var(--gold) 35%, transparent);
}
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--toggle);
    color: var(--muted);
    cursor: pointer;
    backdrop-filter: blur(12px);
    transition: color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.theme-toggle:hover { color: var(--ink); border-color: var(--gold); }
.theme-toggle:active { transform: scale(0.94); }
.theme-toggle svg { width: 1.1rem; height: 1.1rem; display: block; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* —— Hero: brand first —— */
.hero {
    text-align: center;
    padding: 0.75rem 0 1.75rem;
}

.mark {
    width: 6.25rem;
    height: 6.25rem;
    margin: 0 auto 1.15rem;
    border-radius: 28%;
    overflow: hidden;
    background: var(--surface-strong);
    box-shadow: 0 0 0 1px var(--line), 0 18px 40px var(--halo);
    animation: mark-in 700ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.mark img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@keyframes mark-in {
    from { opacity: 0; transform: translateY(12px) scale(0.92); }
    to { opacity: 1; transform: none; }
}

.brand {
    margin: 0;
    font-family: var(--display);
    font-weight: 800;
    font-size: clamp(2.15rem, 9vw, 2.65rem);
    letter-spacing: -0.045em;
    line-height: 0.95;
    animation: reveal-up 650ms 80ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.brand span {
    display: inline-block;
    background: linear-gradient(120deg, var(--ink) 40%, var(--gold) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.tagline {
    margin: 0.85rem auto 0;
    max-width: 18rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--ink-soft);
    line-height: 1.45;
    animation: reveal-up 650ms 140ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes reveal-up {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

/* —— Sections —— */
.stack {
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
}

.section {
    animation: reveal-up 650ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.section:nth-child(1) { animation-delay: 200ms; }
.section:nth-child(2) { animation-delay: 280ms; }
.section:nth-child(3) { animation-delay: 360ms; }

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0 0 0.65rem 0.15rem;
}

.section-head h2 {
    margin: 0;
    font-family: var(--display);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

.section-head .hint {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--gold-deep);
}

[data-theme="dark"] .section-head .hint { color: var(--gold); }

/* —— Primary actions (essentials) —— */
.actions {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.action {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.9rem;
    padding: 1.05rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--surface);
    backdrop-filter: blur(14px);
    color: inherit;
    text-decoration: none;
    overflow: hidden;
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.action::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--gold);
    opacity: 0;
    transition: opacity 160ms ease;
}

.action:hover,
.action:focus-visible {
    border-color: rgba(184, 148, 46, 0.45);
    outline: none;
}

.action:hover::before,
.action:focus-visible::before { opacity: 1; }

.action:active { transform: scale(0.985); background: var(--press); }

.action.priority {
    background: linear-gradient(135deg, var(--gold-soft), var(--surface));
    border-color: rgba(184, 148, 46, 0.35);
}

.action.priority::before { opacity: 1; }

.step {
    width: 2.15rem;
    height: 2.15rem;
    border-radius: 9px;
    display: grid;
    place-items: center;
    font-family: var(--display);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--gold-deep);
    background: var(--gold-soft);
    flex-shrink: 0;
}

[data-theme="dark"] .step { color: var(--gold); }

.action.priority .step {
    color: #fff;
    background: linear-gradient(145deg, var(--gold), var(--gold-deep));
}

.action-body { min-width: 0; }

.action-title {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.action-desc {
    margin: 0.2rem 0 0;
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.35;
}

.action-go {
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: var(--surface-strong);
    border: 1px solid var(--line);
    color: var(--muted);
    flex-shrink: 0;
    transition: color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.action:hover .action-go {
    color: var(--gold-deep);
    border-color: rgba(184, 148, 46, 0.4);
    transform: translateX(2px);
}

[data-theme="dark"] .action:hover .action-go { color: var(--gold); }

.action-go img {
    width: 14px;
    height: 14px;
    display: block;
    opacity: 0.7;
}

/* —— Tool grid —— */
.tools {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

.tool {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1rem 0.9rem;
    min-height: 7.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--surface);
    backdrop-filter: blur(14px);
    color: inherit;
    text-decoration: none;
    transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.tool:hover,
.tool:focus-visible {
    border-color: rgba(184, 148, 46, 0.4);
    outline: none;
}

.tool:active { transform: scale(0.98); }

.tool-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 9px;
    display: grid;
    place-items: center;
    background: var(--press);
    border: 1px solid var(--line);
}

.tool-icon img {
    width: 18px;
    height: 18px;
    display: block;
    opacity: 0.75;
}

.tool-meta { margin-top: auto; }

.tool-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.tool-tag {
    display: inline-block;
    margin-top: 0.35rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 0.18rem 0.4rem;
    border-radius: 6px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tag-ok { background: var(--ok-soft); color: var(--ok); }
.tag-warn { background: var(--warn-soft); color: var(--warn); }
.tag-info { background: var(--info-soft); color: var(--info); }
.tag-danger { background: var(--danger-soft); color: var(--danger); }

.tool.wide {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    min-height: 0;
    gap: 0.9rem;
}

.tool.wide .tool-meta { margin-top: 0; flex: 1; min-width: 0; }

/* —— Jailbreak pick (Dopamine | Relaxin) —— */
.jb-pick {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem 0.9rem;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--surface);
    backdrop-filter: blur(14px);
    position: relative;
    z-index: 1;
}

.jb-pick:has(.jb-info[open]) {
    z-index: 8;
}

.jb-pick-head {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    position: relative;
    z-index: 2;
}

.jb-pick-copy {
    flex: 1;
    min-width: 0;
}

.jb-pick-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.jb-pick-hint {
    margin: 0.2rem 0 0;
    font-size: 0.75rem;
    color: var(--muted);
    line-height: 1.35;
}

.jb-info {
    position: relative;
    z-index: 3;
    flex-shrink: 0;
    margin-left: auto;
}

.jb-info[open] {
    z-index: 5;
}

.jb-info-toggle {
    list-style: none;
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--press);
    color: var(--muted);
    cursor: pointer;
    transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.jb-info-toggle::-webkit-details-marker { display: none; }
.jb-info-toggle::marker { content: ""; }

.jb-info-toggle svg {
    width: 1rem;
    height: 1rem;
    display: block;
}

.jb-info-toggle:hover,
.jb-info[open] .jb-info-toggle {
    color: var(--info);
    border-color: color-mix(in srgb, var(--info) 35%, var(--line));
    background: var(--info-soft);
}

.jb-info-panel {
    position: absolute;
    top: calc(100% + 0.4rem);
    right: 0;
    z-index: 6;
    width: min(18.5rem, calc(100vw - 2.5rem));
    padding: 0.85rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-strong);
    box-shadow: 0 12px 28px var(--halo, rgba(0, 0, 0, 0.18));
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.jb-info-block { min-width: 0; }

.jb-info-name {
    margin: 0 0 0.3rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

.jb-info-line {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.4;
}

.jb-info-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.jb-info-list li {
    font-size: 0.8rem;
    line-height: 1.35;
    padding-left: 0.65rem;
    position: relative;
}

.jb-info-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.5em;
    width: 0.28rem;
    height: 0.28rem;
    border-radius: 50%;
    background: var(--gold, #B8942E);
}

.jb-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    position: relative;
    z-index: 1;
}

.jb-option {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.85rem 0.75rem;
    border-radius: calc(var(--radius) - 2px);
    border: 1px solid var(--line);
    background: var(--press);
    color: inherit;
    text-decoration: none;
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.jb-option:hover,
.jb-option:focus-visible {
    border-color: rgba(184, 148, 46, 0.45);
    outline: none;
}

.jb-option:active { transform: scale(0.98); }

.jb-option-name {
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.jb-option-meta {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--muted);
    line-height: 1.3;
}

/* —— Cert vault —— */
.vault {
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--surface);
    backdrop-filter: blur(14px);
    overflow: hidden;
}

.vault > summary {
    list-style: none;
    cursor: pointer;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem;
    user-select: none;
}

.vault > summary::-webkit-details-marker { display: none; }

.vault > summary:hover { background: var(--press); }

.vault-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 9px;
    display: grid;
    place-items: center;
    background: var(--gold-soft);
    border: 1px solid rgba(184, 148, 46, 0.25);
}

.vault-icon img { width: 18px; height: 18px; display: block; }

.vault-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
}

.vault-sub {
    margin: 0.15rem 0 0;
    font-size: 0.75rem;
    color: var(--muted);
}

.vault-chev {
    width: 16px;
    height: 16px;
    opacity: 0.45;
    transition: transform 220ms ease, opacity 160ms ease;
}

.vault[open] > summary .vault-chev {
    transform: rotate(180deg);
    opacity: 0.9;
}

.cert-list {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--line);
    max-height: min(52vh, 22rem);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.cert-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid var(--line);
    transition: background 140ms ease;
}

.cert-row:last-child { border-bottom: none; }
.cert-row:hover,
.cert-row:focus-visible { background: var(--press); outline: none; }
.cert-row:active { background: var(--gold-soft); }

.cert-dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 2px;
    background: var(--gold);
    flex-shrink: 0;
    opacity: 0.7;
}

.cert-name {
    flex: 1;
    min-width: 0;
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cert-badge {
    flex-shrink: 0;
    max-width: 42%;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.35rem;
    border-radius: 5px;
    background: var(--warn-soft);
    color: var(--warn);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cert-go {
    width: 14px;
    height: 14px;
    opacity: 0.35;
    flex-shrink: 0;
}

.foot {
    margin: 1.75rem 0 0;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    opacity: 0.75;
    animation: reveal-up 650ms 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
