:root {
    --ink: #06090f;
    --chrome: #0e1520;
    --panel: rgba(10, 15, 22, 0.82);
    --rule: #1c2635;
    --bracket: #3e4c60;
    --text: #dbe3ec;
    --text-muted: #6f7f93;
    --violet: #a78bfa;
    --cyan: #4fd8e8;
    --amber: #f5b25e;
    --mint: #5fe3a1;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* {
    box-sizing: border-box;
}

html {
    height: 100%;
    background-color: var(--ink);
    background-image:
        radial-gradient(58rem 40rem at 12% -8%, rgba(167, 139, 250, 0.12), transparent 65%),
        radial-gradient(46rem 34rem at 96% 108%, rgba(79, 216, 232, 0.09), transparent 60%);
    background-attachment: fixed;
}

body {
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
    min-height: 100%;
    overflow-wrap: break-word;
}

#lattice {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.w {
    max-width: 640px;
    margin: 0 auto;
    padding: 4.5rem 1.25rem 3.5rem;
}

a:focus-visible,
.email-btn:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 3px;
    border-radius: 2px;
}

/* ── Terminal shell ── */
.term {
    background: var(--panel);
    border: 1px solid var(--rule);
    border-radius: 10px;
    overflow: hidden;
    -webkit-backdrop-filter: blur(7px);
    backdrop-filter: blur(7px);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.04) inset,
        0 30px 70px -30px rgba(0, 0, 0, 0.9),
        0 0 90px -50px rgba(167, 139, 250, 0.6);
    animation: boot 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes boot {
    from { opacity: 0; transform: translateY(14px) scale(0.985); }
    to   { opacity: 1; transform: none; }
}

.term-bar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.8rem;
    background: linear-gradient(180deg, #141c28, var(--chrome));
    border-bottom: 1px solid var(--rule);
    -webkit-user-select: none;
    user-select: none;
}

.t-dots {
    display: flex;
    gap: 6px;
}

.t-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.t-dot-red    { background: #ff5f57; }
.t-dot-yellow { background: #febc2e; }
.t-dot-green  { background: #28c840; }

.term-title,
.term-meta {
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    white-space: nowrap;
}

.term-title {
    text-align: center;
}

.term-meta {
    text-align: right;
    opacity: 0.65;
}

.term-body {
    padding: 2rem 1.75rem 1.5rem;
}

/* ── Header ── */
header {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    margin-bottom: 2.75rem;
}

.prompt {
    color: var(--mint);
    font-size: 1.15rem;
    font-weight: bold;
    -webkit-user-select: none;
    user-select: none;
}

h1 {
    font-size: clamp(1.3rem, 5.5vw, 1.6rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.35;
    margin: 0;
}

.type {
    display: inline-block;
    width: 19ch;
    overflow: hidden;
    white-space: nowrap;
    vertical-align: bottom;
    animation: type 0.85s steps(19, end) 0.35s backwards;
}

@keyframes type {
    from { width: 0; }
}

.cursor {
    display: inline-block;
    width: 0.55em;
    height: 1.05em;
    background: var(--cyan);
    box-shadow: 0 0 12px rgba(79, 216, 232, 0.55);
    vertical-align: -0.16em;
    flex-shrink: 0;
    animation: blink 1.1s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0; }
}

/* ── Session blocks ── */
.block {
    margin-bottom: 2.5rem;
    animation: rise 0.5s ease both;
}

.b1 { animation-delay: 0.5s; }
.b2 { animation-delay: 0.65s; }
.b3 { animation-delay: 0.8s; }

.end {
    animation: rise 0.5s ease 0.95s both;
    margin: 0;
}

@keyframes rise {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

.cmd {
    margin: 0 0 0.9rem;
    font-size: 0.9rem;
}

.sh {
    color: var(--mint);
    margin-right: 0.45rem;
    -webkit-user-select: none;
    user-select: none;
}

.flag  { color: var(--text-muted); }
.path  { color: var(--amber); }

.out {
    border-left: 1px solid var(--rule);
    padding-left: 1.35rem;
    margin-left: 0.3rem;
}

/* ── Identity card ── */
.card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.6rem;
    align-items: center;
}

.avatar-wrap a {
    --hex: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    display: block;
    width: 124px;
    height: 124px;
    padding: 2px;
    clip-path: var(--hex);
    background: conic-gradient(from 200deg, var(--violet), var(--cyan), var(--mint), var(--violet));
    filter: drop-shadow(0 0 16px rgba(167, 139, 250, 0.3));
    transition: filter 0.3s ease, transform 0.3s ease;
}

.avatar-wrap a:hover {
    filter: drop-shadow(0 0 26px rgba(79, 216, 232, 0.5));
    transform: translateY(-3px);
}

.avatar-wrap img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    clip-path: var(--hex);
}

/* ── Bio ── */
.hobbies {
    font-size: 1.3rem;
    letter-spacing: 0.1em;
    margin: 0 0 0.7rem;
}

.hobbies a,
.hobbies span {
    display: inline-block;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.hobbies a:hover,
.hobbies a:focus-visible {
    transform: scale(1.25) translateY(-3px);
}

.bio p {
    margin: 0.4rem 0;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.highlight {
    color: var(--cyan);
    font-weight: bold;
    text-shadow: 0 0 20px rgba(79, 216, 232, 0.35);
}

/* ── Links ── */
.links-section {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.links-group {
    display: flex;
    align-items: baseline;
    gap: 0.9rem;
    flex-wrap: wrap;
}

.group-label {
    color: var(--amber);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    min-width: 108px;
    flex-shrink: 0;
    opacity: 0.75;
}

.links {
    display: flex;
    flex-wrap: wrap;
    gap: 0 0.35rem;
}

.links a {
    color: var(--violet);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}

.links a::before { content: '['; color: var(--bracket); }
.links a::after  { content: ']'; color: var(--bracket); }

.links a:visited {
    color: var(--violet);
}

.links a:hover,
.links a:focus-visible {
    color: var(--cyan);
    border-bottom-color: var(--cyan);
}

#update-time {
    color: var(--text-muted);
    font-size: 0.78rem;
}

/* ── Footer ── */
.footer {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.7rem;
}

.email-btn {
    color: var(--cyan);
    cursor: pointer;
    border: 1px dashed var(--rule);
    padding: 0.35rem 1rem;
    border-radius: 4px;
    font-size: 0.88rem;
    font-family: var(--font-mono);
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    -webkit-user-select: none;
    user-select: none;
}

.email-btn:hover {
    border-color: var(--cyan);
    background: rgba(79, 216, 232, 0.07);
    box-shadow: 0 0 24px -8px rgba(79, 216, 232, 0.7);
}

.email-btn.revealed {
    border-style: solid;
    border-color: var(--mint);
    color: var(--mint);
    cursor: default;
    box-shadow: none;
    background: rgba(95, 227, 161, 0.06);
}

.email-btn a {
    color: inherit;
    text-decoration: none;
}

.copy {
    color: var(--text-muted);
    font-size: 0.78rem;
    margin: 0;
}

.privacy {
    color: var(--text-muted);
    font-size: 0.68rem;
    margin: 0;
    opacity: 0.72;
}

/* ── Narrow screens ── */
@media (max-width: 560px) {
    .w { padding: 2.5rem 0.9rem; }
    .term-body { padding: 1.6rem 1.15rem 1.25rem; }
    .term-bar { grid-template-columns: auto 1fr; }
    .term-meta { display: none; }
    .term-title { text-align: right; }
    .out { padding-left: 1rem; }

    .card {
        grid-template-columns: 1fr;
        justify-items: start;
        gap: 1.1rem;
    }

    .group-label { min-width: 0; }
    .links-group { gap: 0.5rem; }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    .term,
    .block,
    .end,
    .type {
        animation: none;
    }

    .type { width: auto; }

    .cursor {
        animation: none;
    }

    .avatar-wrap a,
    .hobbies a,
    .links a,
    .email-btn {
        transition: none;
    }
}
