/* Profile hierarchy; retain the approved theme and narrow chat drawer. */
.profile-page{--profile-gutter:clamp(24px,4vw,56px);min-height:100dvh;display:flex;flex-direction:column}
.profile-header,.profile-main,.profile-footer{width:100%;max-width:1040px;margin-inline:auto;padding-inline:var(--profile-gutter)}
.profile-header{padding-block:36px 30px;display:flex;align-items:center;justify-content:space-between;gap:28px;border-bottom:1px solid var(--hair)}
.profile-identity{min-width:0}
.profile-identity h1{margin:0;font-size:34px;line-height:1.2;letter-spacing:-.025em}
.profile-header .brand{font-size:inherit;text-decoration:none}
.profile-role{margin:12px 0 0;font-family:var(--sans);font-size:15px;line-height:1.6;color:var(--sub)}
.profile-role>span{display:inline-block}
.profile-role .role-divider{margin:0 .35em}
.profile-resume{flex:none;display:inline-flex;align-items:center;min-height:44px;font-size:15px;white-space:nowrap;text-underline-offset:3px}
.profile-launcher-slot{display:contents}
.profile-main{flex:1;padding-block:clamp(48px,6vh,80px) 48px}
.profile-main .intro{max-width:760px}
.profile-overview{display:flex;align-items:center;gap:28px;margin-bottom:36px}
.profile-main .portrait{width:96px;height:96px;object-fit:cover;border-radius:50%;flex:none}
.profile-summary{min-width:0;font-size:16px;line-height:1.55}
.profile-summary p{margin:9px 0 0}
.profile-summary .profile-specialty{max-width:none;font-family:var(--sans);font-size:clamp(28px,2.4vw,36px);line-height:1.25;font-weight:600;letter-spacing:-.025em;margin:0;color:var(--ink)}
.profile-summary .profile-location{font-size:15px;color:var(--sub);margin-top:9px}
.profile-main .lede{font-size:22px;line-height:1.65;max-width:49ch;margin:0}
.profile-main .experience{border-top:1px solid var(--hair);border-bottom:1px solid var(--hair);padding:24px 0;margin:34px 0}
.profile-main .eyebrow{font-family:var(--mono);font-size:11px;font-weight:400;line-height:1.5;letter-spacing:1px;text-transform:uppercase;color:var(--sub);margin:0}
.profile-main .experience p{font-size:17px;font-weight:500;line-height:1.8;margin:12px 0 0}
.profile-main .intro-note{font-size:18px;color:var(--sub);max-width:49ch;line-height:1.6;margin:0}
.profile-actions{display:flex;gap:20px;align-items:center;margin-top:24px;font-size:16px;flex-wrap:wrap}
.profile-actions .button{display:inline-flex;align-items:center;justify-content:center;min-height:52px;padding:13px 28px;border:1px solid var(--accent);font:inherit;font-weight:600;cursor:pointer;text-decoration:none}
.profile-footer{padding-block:24px 28px;display:flex;justify-content:space-between;gap:14px;color:var(--sub);font-size:12px;flex-wrap:wrap}
@media(max-width:760px){
  .profile-header{padding-block:28px 24px;gap:16px}
  .profile-identity h1{font-size:28px}
  .profile-role{font-size:14px;margin-top:10px}
  .profile-role>span{display:block}
  .profile-role .role-divider{display:none}
  .profile-resume{font-size:14px}
  .profile-main{padding-block:36px}
  .profile-overview{gap:20px;margin-bottom:28px}
  .profile-main .portrait{width:80px;height:80px}
  .profile-summary{font-size:15px}
  .profile-summary .profile-specialty{font-size:26px}
  .profile-summary .profile-location{font-size:14px;margin-top:8px}
  .profile-main .lede{font-size:19px}
  .profile-main .experience{padding:20px 0;margin:28px 0}
  .profile-main .experience p{font-size:16px}
  .profile-main .intro-note{font-size:16px}
}
@media(max-width:560px){
  .profile-header{display:block}
  .profile-resume{margin-top:10px}
  .profile-overview{align-items:flex-start;gap:16px}
  .profile-main .portrait{width:72px;height:72px}
  .profile-summary .profile-specialty{font-size:24px}
  .profile-footer{padding-block:20px 24px}
}
@media(max-width:360px){
  .profile-overview{gap:14px}
  .profile-main .portrait{width:64px;height:64px}
  .profile-summary .profile-specialty{font-size:22px}
}

/* Preserve the name and resume positions with the existing grid reservation.
   Mira moves toward the viewport corner as the outer margin grows. */
@media(min-width:561px){
  .profile-header{
    display:grid;grid-template-columns:minmax(0,1fr) max-content 60px;
    grid-template-rows:60px auto;justify-content:space-between;align-items:center;
    column-gap:72px;row-gap:8px;padding-top:calc(24px + env(safe-area-inset-top,0px));
    padding-right:calc(var(--profile-gutter) + env(safe-area-inset-right,0px));
  }
  .profile-identity{display:contents}
  .profile-identity h1{grid-column:1;grid-row:1;justify-self:start}
  .profile-resume{grid-column:2;grid-row:1;justify-self:end}
  .profile-role{grid-column:1/-1;grid-row:2;margin:0}
  .profile-role>span{display:inline-block}
  .profile-role .role-divider{display:inline-block}
  .profile-launcher-slot{display:block;grid-column:3;grid-row:1;width:60px;height:60px}
  .profile-header:has(.chat-fab[hidden]){grid-template-columns:minmax(0,1fr) auto}
  .profile-launcher-slot:has(.chat-fab[hidden]){display:none}
  .profile-page .chat-fab{right:calc(min(96px,max(0px,(100% - 1040px)/2) + var(--profile-gutter)) + env(safe-area-inset-right,0px))}
}

/* Reserve the desktop dock before any page content is painted. */
@media(min-width:1000px){
  .chat-start-open body{padding-right:min(432px,42vw)}
  .chat-start-open body,.chat-start-open .chat-drawer{transition:none}
  .chat-start-open [data-chat-open],.chat-start-open .profile-actions{display:none!important}
}

/* Launchers only appear when there is a chat window to open. */
[data-chat-open][hidden]{display:none!important}
.profile-actions:has(>[data-chat-open][hidden]){display:none}


.chat-compose{align-items:center}.chat-input{font-family:var(--sans);line-height:1.45;resize:vertical;min-height:62px;max-height:160px;border-radius:18px}.msg{overflow-wrap:anywhere}.chat-log{min-height:80px}.chat-drawer[hidden],.chat-drawer [hidden]{display:none!important}
@media(max-width:560px){.chat-input{font-size:16px}}


/* One identity, a short greeting, and a quiet disclosure. */
.chat-head{align-items:center;padding:12px 18px;gap:10px}
.chat-id{flex-direction:row;align-items:center;gap:10px}
.mira-avatar{display:block;width:38px;height:38px;flex:none;object-fit:contain;border-radius:50%}
.chat-badge{font-family:var(--sans);font-size:11px;line-height:1.3;letter-spacing:0;text-transform:none}
.chat-badge::before{display:none}
.chat-clear{font-family:var(--sans);font-size:11px;letter-spacing:0;text-transform:none;min-height:44px}
.chat-close{width:44px;height:44px}
.msg>.role{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.chat-foot{font-family:var(--sans);font-size:11px;line-height:1.5;letter-spacing:0;padding:0 18px 14px}
.chat-foot>span{display:block}
@media(max-width:560px){.chat-head{padding:10px 14px}.chat-foot{padding:0 14px 12px}}

/* Quiet motion: reveal content once, then respond only to interaction. */
@media(prefers-reduced-motion:no-preference){
  .profile-overview,.profile-main .lede,.profile-main .experience,.profile-main .intro-note,.profile-actions{
    animation:profile-arrive 540ms cubic-bezier(.2,.7,.2,1) both;
  }
  .profile-main .lede{animation-delay:60ms}
  .profile-main .experience{animation-delay:120ms}
  .profile-main .intro-note{animation-delay:180ms}
  .profile-actions{animation-delay:220ms}
  .profile-main :focus-within{animation:none}
  .profile-actions .button,.chat-send,.chip,.act-send{
    transition:transform 180ms ease,box-shadow 180ms ease,background-color 180ms ease,border-color 180ms ease;
  }
  .profile-actions .button:active,.chat-send:not(:disabled):active,.chip:active,.act-send:active{
    transform:translateY(0) scale(.98);
  }
  .mira-avatar.mira-greeting{animation:mira-greet 640ms ease-in-out}
  .chat-drawer.open.is-thinking .mira-avatar{animation:mira-responding 2400ms ease-in-out infinite}
  .chat-arriving{animation:chat-arrive 280ms ease-out both}
}
@media(prefers-reduced-motion:no-preference) and (hover:hover) and (pointer:fine){
  .profile-actions .button:hover,.chat-send:not(:disabled):hover{
    transform:translateY(-2px);box-shadow:0 5px 14px rgb(124 58 205 / .16);
  }
  .chip:hover,.act-send:hover{transform:translateY(-1px)}
  .profile-actions .button:active,.chat-send:not(:disabled):active,.chip:active,.act-send:active{
    transform:translateY(0) scale(.98);
  }
  .chat-fab.show:hover{transform:translateY(-2px)}
  .chat-fab.show:active{transform:scale(.98)}
}
@keyframes profile-arrive{
  from{opacity:0;transform:translateY(8px)}
  to{opacity:1;transform:none}
}
@keyframes mira-greet{
  0%,100%{transform:none}
  35%{transform:rotate(-9deg) scale(1.06)}
  70%{transform:rotate(5deg) scale(1.03)}
}
@keyframes mira-responding{
  0%,100%{transform:scale(1);opacity:1}
  50%{transform:scale(1.065);opacity:.82}
}
@keyframes chat-arrive{
  from{opacity:.35;transform:translateY(5px)}
  to{opacity:1;transform:none}
}
@media(prefers-reduced-motion:reduce){
  .profile-page button,.profile-page a,.chat-input{transition:none}
}

/* A single three-second highlight sequence, after the profile has entered.
   The phrases remain readable throughout and are ordinary text, not links. */
.discipline{display:inline-block;position:relative;white-space:nowrap;color:var(--ink)}
.discipline::after{
  content:"";position:absolute;left:0;right:0;bottom:-3px;height:2px;
  background:var(--accent);border-radius:2px;opacity:0;
  transform:scaleX(0);transform-origin:left;
}
.discipline:nth-child(2){--highlight-step:1}
.discipline:nth-child(3){--highlight-step:2}
@media(prefers-reduced-motion:no-preference){
  .discipline{
    animation:discipline-highlight 1s ease-in-out backwards;
    animation-delay:calc(650ms + var(--highlight-step,0)*1s);
    transition:color 180ms ease,transform 180ms ease;
  }
  .discipline::after{
    animation:discipline-underline 1s ease-in-out backwards;
    animation-delay:calc(650ms + var(--highlight-step,0)*1s);
    transition:transform 180ms ease,opacity 180ms ease;
  }
}
@media(prefers-reduced-motion:no-preference) and (hover:hover) and (pointer:fine){
  .discipline:hover{color:var(--accent);transform:translateY(-2px)}
  .discipline:hover::after{opacity:1;transform:scaleX(1)}
}
@keyframes discipline-highlight{
  0%,100%{color:var(--ink);transform:translateY(0)}
  20%,75%{color:var(--accent);transform:translateY(-2px)}
}
@keyframes discipline-underline{
  0%{opacity:0;transform:scaleX(0)}
  25%,75%{opacity:1;transform:scaleX(1)}
  100%{opacity:0;transform:scaleX(1)}
}

/* Actionable handoffs and recovery, without generic follow-up prompts. */
.chat-text-action{font:inherit;color:var(--accent);background:none;border:0;padding:4px 0;min-height:32px;text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.chat-foot .chat-text-action{color:var(--sub)}
.chat-text-action:hover{color:var(--accent-deep)}
.chat-text-action:focus-visible,.chat-contact-action a:focus-visible,.chat-foot a:focus-visible{outline:2px solid var(--accent);outline-offset:3px;border-radius:2px}
.chat-recovery{font-size:.875rem;margin-top:4px}
.chat-contact-action{margin-top:.6em!important}
.chat-foot [data-copy-status]:empty{display:none}
.chat-foot [data-manual-email]{font:inherit;font-size:16px;width:100%;margin-top:4px;padding:8px;border:1px solid var(--hair-strong);border-radius:6px;background:var(--card);color:var(--ink)}
/* Short windows / on-screen keyboards must not strand the email fallback. */
.chat-log{min-height:0}
.chat-drawer{overflow-y:auto}
.chat-scrim:not(.open),.chat-drawer:not(.open){pointer-events:none}
@media(max-height:520px){.chat-log{padding-top:8px;padding-bottom:8px}}
