:root {
    --bg: #f8f4ff;
    --bg-soft: #ece4ff;
    --surface: #ffffff;
    --surface-soft: #f9f5ff;
    --line: #e4d9ff;
    --ink: #251f3f;
    --muted: #706790;
    --violet: #7654f6;
    --violet-700: #5f3edc;
    --ok: #2f7f57;
    --warn: #9c6d23;
    --radius-xl: 26px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --shadow: 0 16px 34px rgba(72, 43, 161, 0.11);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body.theme-violet {
    min-height: 100vh;
    font-family: "Nunito Sans", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at 0% 0%, #fff 0%, transparent 35%),
        radial-gradient(circle at 100% 100%, var(--bg-soft) 0%, transparent 30%),
        var(--bg);
}

#scene-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.5;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-weight: 800; letter-spacing: -0.015em; }

.frame {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px clamp(14px, 4vw, 56px) 30px;
}

.ribbon {
    position: sticky;
    top: 10px;
    z-index: 20;
}

.ribbon {
    width: min(1140px, 100%);
    margin-inline: auto;
}

.ribbon,
.board-head,
.hero-shell,
.social-cluster,
.masonry,
.tile,
.contact-shell,
.empty-state {
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    box-shadow: var(--shadow);
}

.ribbon { padding: 10px 14px; }

.ribbon .identity,
.ribbon .links,
.ribbon .ribbon-action {
    display: flex;
    align-items: center;
}

.ribbon {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
}

.identity {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    padding-inline: 7px;
}

.identity-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    object-fit: cover;
    display: block;
    border: 1px solid var(--line);
    background: #fff;
    padding: 2px;
}

.links,
.footer-nav,
.cluster,
.chip-row,
.cta-pack,
.social-cluster {
    display: flex;
    gap: 10px;
}

.links {
    justify-content: center;
    flex-wrap: wrap;
}

.link,
.btn,
.social-pill {
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 8px 13px;
    font-weight: 700;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}

.link { color: var(--muted); }

.menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-soft);
    padding: 8px;
    cursor: pointer;
    justify-content: center;
    align-items: center;
    gap: 4px;
    flex-direction: column;
}

.menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: var(--ink);
}

.link:hover,
.link.active {
    color: var(--ink);
    border-color: var(--line);
    background: var(--surface-soft);
}

.ribbon-action { justify-content: flex-end; }

.btn-primary-ui {
    background: var(--violet);
    border-color: var(--violet);
    color: #fff;
}

.btn-primary-ui:hover {
    background: var(--violet-700);
    border-color: var(--violet-700);
    color: #fff;
}

.btn-secondary-ui {
    background: var(--surface-soft);
    border-color: var(--line);
    color: var(--ink);
}

.btn-secondary-ui:hover { background: #efe8ff; }

.content {
    width: min(1140px, 100%);
    margin-inline: auto;
    flex: 1;
}

.hero-shell {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    gap: 12px;
    padding: 12px;
}

.hero-side,
.hero-main,
.contact-side,
.contact-form,
.tile-body {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface-soft);
}

.hero-side,
.hero-main,
.contact-side,
.contact-form { padding: 16px; }

.hero-side {
    display: grid;
    justify-items: center;
    gap: 14px;
    align-content: start;
}

.avatar-wrap {
    width: min(245px, 100%);
    aspect-ratio: 1 / 1.14;
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
}

.avatar-wrap img { width: 100%; height: 100%; object-fit: cover; }

.thought-badge {
    position: relative;
    width: 100%;
    max-width: 320px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    color: var(--muted);
    padding: 12px 14px;
    line-height: 1.6;
}

.thought-badge::before {
    content: "";
    position: absolute;
    left: 22px;
    top: -9px;
    width: 13px;
    height: 13px;
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
    background: #fff;
    transform: rotate(45deg);
}

.hero-main h1 { font-size: clamp(2.5rem, 7vw, 4.2rem); line-height: .92; }
.role { margin: 8px 0 10px; color: var(--muted); font-weight: 700; }
.bio, .muted { color: var(--muted); line-height: 1.64; }

.cluster,
.cta-pack,
.chip-row { flex-wrap: wrap; }
.cta-pack { margin-top: 14px; }

.social-cluster {
    margin-top: 10px;
    padding: 10px;
    flex-wrap: wrap;
}

.social-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-color: var(--line);
    background: var(--surface-soft);
    color: var(--muted);
}

.social-pill i { color: var(--violet); }

.board-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 10px;
    padding: 16px 18px;
    margin-bottom: 10px;
}

.board-head h1 { font-size: clamp(2.1rem, 6vw, 3.2rem); line-height: .95; }
.board-head p { color: var(--muted); font-weight: 700; margin-bottom: 5px; }

.masonry {
    display: grid;
    gap: 10px;
    padding: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tile {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    overflow: hidden;
    display: grid;
    grid-template-rows: 180px auto;
}

.tile-media {
    border-bottom: 1px solid var(--line);
    background: var(--surface-soft);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tile-media img { width: 100%; height: 100%; object-fit: cover; }
.tile-placeholder { font-size: 2.2rem; color: var(--muted); }

.tile-body { padding: 14px; display: grid; gap: 10px; border: 0; border-radius: 0; }

.tile-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: .72rem;
    color: var(--muted);
}

.tile-body h2 { font-size: 1.55rem; line-height: .95; }

.chip-row span {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    padding: 6px 10px;
    font-size: .82rem;
}

.contact-shell {
    display: grid;
    grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
    gap: 10px;
    padding: 10px;
}

.profile-mini {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.profile-mini img {
    width: 58px;
    height: 58px;
    border-radius: 14px;
    border: 1px solid var(--line);
    object-fit: cover;
}

.profile-mini h2 { font-size: 1.65rem; line-height: .95; }

.contact-line {
    border-top: 1px solid var(--line);
    padding-top: 12px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.contact-form { display: grid; gap: 12px; }

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

.field { display: grid; gap: 6px; }
label { font-size: .92rem; font-weight: 700; }

input,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fff;
    padding: 10px 11px;
    font-family: "Nunito Sans", sans-serif;
    color: var(--ink);
}

input:focus,
textarea:focus {
    outline: none;
    border-color: #b79fff;
    box-shadow: 0 0 0 3px rgba(118, 84, 246, .15);
}

.alert {
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    padding: 10px 12px;
    font-weight: 700;
}

.alert.danger { color: #8c2f4f; background: #fce8ef; border-color: #f0c6d6; }
.alert.success { color: var(--ok); background: #e7f6ed; border-color: #bfe2cd; }

.empty-state {
    text-align: center;
    padding: 22px;
    color: var(--muted);
}

.error-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    box-shadow: var(--shadow);
    padding: 22px;
    display: grid;
    gap: 12px;
    text-align: center;
}

.error-panel h1 {
    font-size: clamp(2rem, 6vw, 3rem);
}

.error-panel p {
    color: var(--muted);
    line-height: 1.6;
}

.error-panel .cluster {
    justify-content: center;
}

.link-inline {
    color: var(--violet);
    font-weight: 700;
}

.footer {
    width: min(1140px, 100%);
    margin: auto auto 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-size: .92rem;
}

.footer-nav { flex-wrap: wrap; }

[data-reveal] {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .4s ease, transform .4s ease;
}

[data-reveal].is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 980px) {
    .ribbon {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "identity toggle"
            "links links"
            "action action";
        border-radius: 20px;
        align-items: center;
        gap: 10px;
    }
    .identity { grid-area: identity; }
    .menu-toggle { grid-area: toggle; display: inline-flex; }
    .ribbon .links {
        grid-area: links;
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        padding-top: 4px;
    }
    .ribbon.is-open .links {
        display: flex;
    }
    .ribbon .links .link {
        text-align: center;
        width: 100%;
    }
    .ribbon .ribbon-action {
        grid-area: action;
        width: 100%;
        justify-content: center;
        padding-top: 2px;
    }
    .hero-shell,
    .contact-shell { grid-template-columns: 1fr; }
    .masonry { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
    .frame { padding-inline: 12px; }

    .hero-shell,
    .board-head,
    .masonry,
    .contact-shell,
    .hero-side,
    .hero-main,
    .contact-side,
    .contact-form,
    .tile-body { padding: 14px; }

    .grid-2 { grid-template-columns: 1fr; }
    .footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }

    [data-reveal] {
        opacity: 1;
        transform: none;
    }
}
