/* ==========================================================
   Zoom panels (about / resume / contact) + shiny border
   ========================================================== */
[hidden] { display: none !important; }

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

/* ---------- Scene zoom + scrim ---------- */
#scrim {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(6, 7, 10, 0.6);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}
.panel-open #scrim { opacity: 1; pointer-events: auto; }

.stage { transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.8s ease; }
.panel-open .stage { transform: scale(1.35); opacity: 0.3; }
.panel-open, .panel-open body { overflow: hidden; }

/* the box that morphs into the panel hides while it is open */
.node.morphing .glass { opacity: 0; transition: none; }

/* ---------- Panel shell ---------- */
.panel {
    position: fixed;
    z-index: 61;
    left: 0;
    top: 0;
    width: 0;
    height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    color: var(--ink);
    background: linear-gradient(135deg, rgba(30, 33, 44, 0.93), rgba(14, 16, 23, 0.93));
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 22px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.panel-head {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.2rem 0.9rem 1.6rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.panel-title {
    font-size: 0.78rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ink-dim);
}
.panel-x {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.06);
    color: var(--ink);
    font: inherit;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}
.panel-x:hover { background: rgba(255, 255, 255, 0.16); transform: rotate(90deg); }
.panel-x:focus-visible, .pbtn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.8rem clamp(1.25rem, 4vw, 2.8rem) 2.6rem;
    opacity: 0;
    transition: opacity 0.35s ease;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}
.panel.ready .panel-body,
.panel.ready .panel-head { opacity: 1; }

/* ---------- Typewriter ---------- */
.tw { margin: 0 0 1.1rem; line-height: 1.7; font-size: 1.12rem; color: var(--ink); }
.tw-big { font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; margin-bottom: 1.4rem; }
.tw .w { display: inline-block; }
.tw .c { opacity: 0; }
.tw .c.on { opacity: 1; }
.tw .c.cur { box-shadow: 0.1em 0 0 0 #b69cff; animation: blink 0.9s steps(1) infinite; }
@keyframes blink { 50% { box-shadow: none; } }

.after { opacity: 0; transform: translateY(8px); transition: opacity 0.6s ease, transform 0.6s ease; }
.after.in { opacity: 1; transform: none; }

.skip-hint {
    margin: 1.6rem 0 0;
    font-size: 0.8rem;
    color: var(--ink-dim);
    opacity: 0.7;
    transition: opacity 0.4s ease;
}
.skip-hint.gone { opacity: 0; }

/* ---------- Chips / buttons ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.4rem; }
.chip {
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    font-size: 0.85rem;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.pbtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0.7rem 1.3rem;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--ink);
    text-decoration: none;
    cursor: pointer;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04));
    transition: transform 0.2s ease, background 0.2s ease;
}
.pbtn:hover { transform: translateY(-2px); background: linear-gradient(135deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.07)); }

/* ---------- Shiny border: light runs around the edge ---------- */
@property --a {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}
.shiny { position: relative; }
.shiny::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1.5px;
    pointer-events: none;
    background: conic-gradient(from var(--a), transparent 0 55%, #b69cff 72%, #ffffff 86%, transparent 100%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    animation: spin 3.2s linear infinite;
}
@keyframes spin { to { --a: 360deg; } }

/* ---------- Stagger-in for resume + contact ---------- */
.stagger > * { opacity: 0; }
.panel.ready .stagger > * { animation: rise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(var(--i, 0) * 90ms + 120ms); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- Resume layout ---------- */
.r-top h2 { margin: 0; font-size: clamp(1.8rem, 3.4vw, 2.5rem); letter-spacing: -0.02em; }
.r-sub { margin: 0.4rem 0 1rem; color: var(--ink-dim); }
.r-links { display: flex; flex-wrap: wrap; gap: 0.6rem; }

.r-sec { margin-top: 2.2rem; }
.r-sec h3 {
    margin: 0 0 1rem;
    padding-bottom: 0.5rem;
    font-size: 0.78rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #b69cff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.entry {
    display: grid;
    grid-template-columns: 9.5rem 1fr;
    gap: 0.4rem 1.4rem;
    margin-bottom: 1.5rem;
}
.when { font-size: 0.85rem; color: var(--ink-dim); padding-top: 0.2rem; }
.what h4 { margin: 0; font-size: 1.05rem; font-weight: 600; }
.what h4 span { margin-left: 0.6rem; font-weight: 400; font-size: 0.85rem; color: var(--ink-dim); }
.role { margin: 0.15rem 0 0.5rem; color: var(--ink-dim); font-size: 0.92rem; }
.what ul { margin: 0.4rem 0 0; padding-left: 1.1rem; }
.what li { margin-bottom: 0.45rem; line-height: 1.55; font-size: 0.95rem; color: #d3d8e2; }
.skills h4 { margin: 1.1rem 0 0.3rem; font-size: 0.9rem; font-weight: 600; color: var(--ink-dim); }
.skills h4:first-child { margin-top: 0; }

/* ---------- Contact layout ---------- */
.c-wrap h2 { margin: 0 0 0.6rem; font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -0.02em; }
.c-lead { margin: 0 0 1.4rem; color: var(--ink-dim); line-height: 1.6; }
.c-mail {
    margin: 0 0 1.2rem;
    padding: 0.9rem 1rem;
    font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
    font-size: 1rem;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    user-select: all;
    word-break: break-all;
}
.c-actions, .c-socials { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1.2rem; }

/* ---------- Phone ---------- */
@media (max-width: 800px), (max-aspect-ratio: 1/1) {
    .panel-open .stage { transform: none; opacity: 0.25; }
    .entry { grid-template-columns: 1fr; }
    .when { padding-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
    #scrim, .stage, .panel-body, .panel-head, .after, .skip-hint, .pbtn, .panel-x { transition: none; }
    .shiny::before { animation: none; }
    .tw .c.cur { animation: none; }
    .panel.ready .stagger > * { animation: none; opacity: 1; }
}
