/* Dock and Say hi form, shared with the home page */
.dock {
    display: inline-flex; align-items: flex-end; gap: 1.1rem; margin-top: 2.5rem;
    background: var(--dock-bg); border: 1px solid var(--dock-line); border-radius: 22px;
    padding: 0.7rem 1.1rem 0.55rem;
    -webkit-backdrop-filter: blur(18px) saturate(1.6); backdrop-filter: blur(18px) saturate(1.6);
    box-shadow: 0 12px 34px -14px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  }
.dock a { display: grid; justify-items: center; gap: 0.3rem; text-decoration: none; font-family: var(--pill); font-size: 0.8125rem; color: var(--ink); }
.dock .ic { width: 54px; height: 54px; display: block; filter: drop-shadow(0 1px 1px rgba(20, 16, 50, 0.18)) drop-shadow(0 6px 10px rgba(20, 16, 50, 0.22)); transition: transform .25s cubic-bezier(.3,1.6,.5,1); transform-origin: 50% 100%; }
.dock .ic svg { width: 100%; height: 100%; display: block; }
.dock a:hover .ic, .dock a:focus-visible .ic { transform: translateY(-8px) scale(1.15); }
@media (max-width: 720px) {
  .dock { margin-top: 1.75rem; gap: 0.7rem; }
}
.dock a { font-size: 0.8125rem; }
.dock {
    position: fixed; z-index: 40; left: 0; right: 0; width: max-content; margin: 0 auto;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
@media (max-width: 720px) {
  .dock { bottom: calc(12px + env(safe-area-inset-bottom, 0px)); margin: 0 auto; }
}
.dock { gap: 0.75rem; padding: 0.5rem 0.8rem 0.4rem; border-radius: 18px; }
.dock a { font-size: 0.6875rem; gap: 0.2rem; }
.dock .ic { width: 40px; height: 40px; filter: drop-shadow(0 1px 1px rgba(20, 16, 50, 0.14)) drop-shadow(0 4px 6px rgba(20, 16, 50, 0.16)); }
.dock .ic svg { overflow: visible; }
.dock a:hover .ic, .dock a:focus-visible .ic { transform: translateY(-3px); }
.dock .fp, .dock .strip, .dock .letter, .dock .flap, .dock .flap-open {
    transform-box: fill-box; transition: transform .45s cubic-bezier(.3,1.4,.5,1);
  }
.dock .fp { transform-origin: 50% 100%; }
.dock a:hover .fp1, .dock a:focus-visible .fp1 { transform: translate(-4px, -11px) rotate(-10deg); }
.dock a:hover .fp2, .dock a:focus-visible .fp2 { transform: translate(4px, -9px) rotate(9deg); transition-delay: .06s; }
.dock a:hover .strip, .dock a:focus-visible .strip { transform: translateY(12px); transition-duration: .7s; }
.dock .flap { transform-origin: 50% 0; transition-duration: .2s; transition-timing-function: ease-in; }
.dock a:hover .flap, .dock a:focus-visible .flap { transform: scaleY(0); }
.dock .flap-open { transform-origin: 50% 100%; transform: scaleY(0); transition-duration: .25s; }
.dock a:hover .flap-open, .dock a:focus-visible .flap-open { transform: scaleY(1); transition-delay: .18s; }
.dock a:hover .letter, .dock a:focus-visible .letter { transform: translateY(-12px); transition-delay: .28s; }
@media (prefers-reduced-motion: reduce) {
  .dock .fp, .dock .strip, .dock .letter, .dock .flap, .dock .flap-open, .dock .ic { transition: none; }
}
.dock .letter { opacity: 0; transition: transform .45s cubic-bezier(.3,1.4,.5,1), opacity .12s ease; }
.dock a:hover .letter, .dock a:focus-visible .letter { opacity: 1; transition-delay: .22s, .22s; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.headline .letter {
    display: inline-block; color: var(--name-a);
    opacity: 0; transform: translateY(0.35em); filter: blur(8px);
    transition: opacity 560ms ease, filter 560ms ease, transform 560ms cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: calc(var(--i) * 85ms);
  }
.headline.is-lit .letter { opacity: 1; transform: none; filter: none; }
.headline.is-clipped .letter { opacity: 1; transform: none; filter: none; color: transparent; transition: color 700ms ease; transition-delay: 0s; }
.headline.is-settled .letter { color: var(--name-a); transition: color 900ms ease; transition-delay: 0s; }
.dock .lbl { padding: 0.05rem 0.4rem; border-radius: 5px; line-height: 1.35; transition: background-color .15s ease, color .15s ease; }
.dock a.is-selected .lbl { background: #2f7cf6; color: #ffffff; font-weight: 500; }
.dock a.is-selected .ic { transform: translateY(-3px); }
.dock a.is-selected .fp1 { transform: translate(-4px, -11px) rotate(-10deg); }
.dock a.is-selected .fp2 { transform: translate(4px, -9px) rotate(9deg); transition-delay: .06s; }
.dock a.is-selected .strip { transform: translateY(12px); transition-duration: .7s; }
.dock a.is-selected .flap { transform: scaleY(0); }
.dock a.is-selected .flap-open { transform: scaleY(1); transition-delay: .18s; }
.dock a.is-selected .letter { transform: translateY(-12px); opacity: 1; transition-delay: .22s, .22s; }
.mail { border: 0; padding: 0; background: transparent; max-width: calc(100vw - 24px); width: 580px; overflow: visible; color: var(--ink); }
.mail::backdrop { background: rgba(20, 18, 16, 0.28); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.mail-win {
    margin: 0; background: var(--pill-bg); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
    box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.35), 0 8px 20px -8px rgba(0, 0, 0, 0.15);
    font-family: var(--pill); font-size: 0.9375rem;
  }
.mail[open] .mail-win { animation: mail-open .38s cubic-bezier(.2, .9, .3, 1.1) both; transform-origin: 50% 100%; }
@keyframes mail-open { from { opacity: 0; transform: translateY(40px) scale(.86); } to { opacity: 1; transform: none; } }
.mail-trap { position: absolute; left: -9999px; }
.mail-bar {
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0.5rem;
    padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--line);
    background: linear-gradient(var(--card), var(--pill-bg));
  }
.lights { display: flex; gap: 8px; }
.light { width: 12px; height: 12px; border-radius: 50%; border: 0; padding: 0; display: block; box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.18); }
.light.red { background: #ff5f57; cursor: pointer; }
.light.amber { background: #febc2e; }
.light.green { background: #28c840; }
.mail-title { margin: 0; font-family: var(--pill); font-style: normal; font-weight: 600; font-size: 0.875rem; letter-spacing: 0; color: var(--ink); }
.mail-send {
    justify-self: end; width: 30px; height: 30px; border-radius: 8px; border: 0; cursor: pointer;
    display: grid; place-items: center; background: transparent; color: var(--meta); transition: background .15s, color .15s;
  }
.mail-send svg { width: 18px; height: 18px; fill: currentColor; }
.mail-send:hover { background: var(--card); color: #2f7cf6; }
.mail-send:disabled { opacity: .5; cursor: progress; }
.mail-body { display: grid; }
.mail-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 1rem; border-bottom: 1px solid var(--line); min-width: 0; }
.mail-k { color: var(--meta); flex: none; min-width: 3.6rem; font-size: 0.875rem; }
.mail-to { display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px; background: rgba(47, 124, 246, 0.12); color: #2a6bd8; font-size: 0.8125rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mail input, .mail textarea { font: inherit; color: var(--ink); background: transparent; border: 0; outline: none; width: 100%; min-width: 0; }
.mail input::placeholder, .mail textarea::placeholder { color: var(--meta); opacity: .8; }
.mail textarea { min-height: 200px; resize: vertical; padding: 0.9rem 1rem 1rem; line-height: 1.6; }
.mail-row:focus-within { background: rgba(47, 124, 246, 0.04); }
.mail .is-invalid { box-shadow: inset 3px 0 0 #e5484d; }
.mail-error { margin: 0; padding: 0.7rem 1rem; font-size: 0.8125rem; color: #b42318; background: #fff1f0; border-top: 1px solid #ffd7d4; line-height: 1.5; }
.mail-error button { font: inherit; font-weight: 500; color: inherit; background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }
.mail-done { padding: 3rem 1.5rem 3.25rem; text-align: center; display: grid; justify-items: center; gap: 0.4rem; }
.mail-done-ic { width: 44px; height: 44px; border-radius: 50%; background: #2f7cf6; color: #fff; display: grid; place-items: center; font-size: 1.3rem; margin-bottom: 0.4rem; }
.mail-done-h { margin: 0; font-family: var(--serif); font-style: italic; font-size: 1.9rem; color: var(--ink); }
.mail-done-p { margin: 0; color: var(--text); }
@media (prefers-color-scheme: dark) {
  :root:not([data-kh-theme="light"]) .mail-error { background: #3a1d1b; border-color: #5b2a27; color: #ffb4ab; }
}
:root[data-kh-theme="dark"] .mail-error { background: #3a1d1b; border-color: #5b2a27; color: #ffb4ab; }
@media (max-width: 600px) {
  .mail textarea { min-height: 160px; }
  .mail-k { min-width: 3.2rem; }
}
@media (prefers-reduced-motion: reduce) {
  .mail[open] .mail-win { animation: none; }
}

  .dock a:hover .strip, .dock a:focus-visible .strip, .dock a.is-selected .strip { transform: translateY(41px); }

  /* Say hi: waving hand */
  .dock .hand { transform-box: view-box; transform-origin: 36px 58px; }
  .dock .wave-lines { opacity: 0; transition: opacity .2s ease; }
  .dock a:hover .hand, .dock a:focus-visible .hand, .dock a.is-selected .hand { animation: wave 1.1s ease-in-out; }
  .dock a:hover .wave-lines, .dock a:focus-visible .wave-lines, .dock a.is-selected .wave-lines { opacity: 1; animation: wave-lines .55s ease-in-out 2 alternate; }
  @keyframes wave { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(16deg); } 30% { transform: rotate(-9deg); } 45% { transform: rotate(16deg); } 60% { transform: rotate(-6deg); } 75% { transform: rotate(10deg); } }
  @keyframes wave-lines { from { transform: translate(0, 0); } to { transform: translate(-1.5px, -1.5px); } }
  @media (prefers-reduced-motion: reduce) { .dock .hand, .dock .wave-lines { animation: none !important; } }

  /* Say hi: the real wave emoji */
  .dock .ic-emoji { display: grid; place-items: center; }
  .dock .wave-emoji {
    display: block; font-size: 33px; line-height: 1;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Twemoji Mozilla", sans-serif;
    transform-origin: 70% 85%;
  }
  .dock a:hover .wave-emoji, .dock a:focus-visible .wave-emoji, .dock a.is-selected .wave-emoji { animation: wave-e 1.1s ease-in-out; }
  @keyframes wave-e { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(18deg); } 30% { transform: rotate(-10deg); } 45% { transform: rotate(18deg); } 60% { transform: rotate(-6deg); } 75% { transform: rotate(10deg); } }
  @media (prefers-reduced-motion: reduce) { .dock .wave-emoji { animation: none !important; } }

/* Animated face in the header */
.face-link { display: inline-flex; align-items: center; text-decoration: none; border: 0; line-height: 0; }
.face { width: 46px; height: 46px; overflow: visible; filter: drop-shadow(0 2px 3px rgba(40, 30, 30, .12)); transform-origin: 50% 85%; }
.face .hair { fill: #e7c17f; }
.face .skin { fill: #fde4d2; }
.face .cheek { fill: #f6a5a5; opacity: .55; }
.face .mouth { fill: #6b2f3a; }
.face .tongue { fill: #f2848e; }
.face .heart { fill: #ef5d75; }
.face .x { opacity: 0; transition: opacity .16s ease; }
.face[data-expr="smile"] .x-smile, .face[data-expr="wink"] .x-wink, .face[data-expr="laugh"] .x-laugh,
.face[data-expr="surprised"] .x-surprised, .face[data-expr="love"] .x-love, .face[data-expr="cheeky"] .x-cheeky { opacity: 1; }
.face .eyes { transform-box: fill-box; transform-origin: center; transition: transform .08s ease; }
.face.blink .eyes { transform: scaleY(.12); }
.face.pop { animation: face-pop .45s cubic-bezier(.3,1.6,.5,1); }
@keyframes face-pop { 0% { transform: scale(1); } 35% { transform: scale(1.08) rotate(-4deg); } 100% { transform: scale(1) rotate(0); } }
.face-link:hover .face { transform: rotate(-6deg); }
.face-link:focus-visible { outline: 2px solid #2f7cf6; outline-offset: 4px; border-radius: 50%; }
@media (prefers-reduced-motion: reduce) { .face.pop { animation: none; } .face .x { transition: none; } }

/* Face: black and white only */
.face { filter: none; }
.face .hair, .face .skin { fill: #ffffff; }
.face .cheek { display: none; }
.face .mouth { fill: #1a1a1a; }
.face .tongue { fill: #ffffff; }
.face .heart { fill: #1a1a1a; }
.face .fh { stroke: #1a1a1a; }
.face circle[fill], .face [fill="#3a3236"] { fill: #1a1a1a; }

/* Face: smooth crossfade between expressions, no bounce */
.face.pop { animation: none; }
.face .x { transition: opacity .45s ease-in-out; }
.face .eyes { transition: transform .12s ease-in-out; }
.face { transition: transform .4s ease; }
.face-link:hover .face { transform: rotate(-4deg); }

  /* Dock: macOS-style magnify on hover */
  @media (hover: hover) and (pointer: fine) {
    .dock .ic { transform-origin: 50% 100%; transition: transform .28s cubic-bezier(.2,.8,.3,1); }
    .dock a:hover .ic, .dock a:focus-visible .ic { transform: translateY(-10px) scale(1.45); }
    .dock a:hover + a .ic, .dock a:has(+ a:hover) .ic { transform: translateY(-4px) scale(1.18); }
    .dock a.is-selected:not(:hover) .ic { transform: translateY(-3px); }
    .dock a.is-selected:hover .ic { transform: translateY(-10px) scale(1.45); }
    .dock .lbl { transition: transform .28s cubic-bezier(.2,.8,.3,1), background-color .15s ease, color .15s ease; }
  }
  @media (prefers-reduced-motion: reduce) { .dock a:hover .ic, .dock a:hover + a .ic, .dock a:has(+ a:hover) .ic { transform: none; } }

  @media (hover: hover) and (pointer: fine) {
    .dock a.is-selected:has(+ a:hover) .ic, .dock a:hover + a.is-selected .ic { transform: translateY(-4px) scale(1.18); }
  }

  /* Dock: only the hovered icon magnifies, neighbours stay put */
  @media (hover: hover) and (pointer: fine) {
    .dock a:hover + a .ic, .dock a:has(+ a:hover) .ic { transform: none; }
    .dock a.is-selected:has(+ a:hover) .ic, .dock a:hover + a.is-selected .ic { transform: translateY(-3px); }
  }
@media (min-width: 1280px) {
  /* Largest screens: a slightly bigger dock */
  .dock { gap: 0.95rem; padding: 0.62rem 1rem 0.5rem; border-radius: 22px; }
  .dock a { font-size: 0.8125rem; gap: 0.25rem; }
  .dock .ic { width: 50px; height: 50px; }
  .dock .wave-emoji { font-size: 41px; }
}
