:root {
  color-scheme: light;
  --background: #f0f2ed;
  --surface: #f7f8f3;
  --ink: #192020;
  --muted: #57645f;
  --line: #d2dad2;
  --accent: #286454;
  --tag: #e1e8df;
  --hint-background: #172020;
  --hint-ink: #edf2f0;
  --hint-border: #2a3532;
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --background: #111717;
  --surface: #172020;
  --ink: #edf2f0;
  --muted: #a1adaa;
  --line: #2a3532;
  --accent: #8ccfbc;
  --tag: #202b27;
  --hint-background: #edf2f0;
  --hint-ink: #192020;
  --hint-border: #d2dad2;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

html.page-switching {
  scroll-behavior: auto;
}

#main:focus {
  outline: none;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--ink);
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  font-size: 14px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

a:hover {
  color: var(--accent);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: min(100% - 48px, 780px);
  margin-inline: auto;
}

header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--background);
  border-bottom: 1px solid var(--line);
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.site-nav {
  gap: 20px;
}

.site-nav .nav-links {
  margin-left: auto;
  justify-content: flex-end;
  white-space: nowrap;
}

/* Match the last link's text edge to the profile's container edge. */
.site-nav .nav-links a:last-child {
  justify-content: flex-end;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 25px;
  font-size: 12px;
  color: var(--muted);
}

.nav-links [aria-current] {
  color: var(--ink);
}

.nav-links a[href] {
  position: relative;
  transform-origin: center;
  transition:
    color 180ms ease,
    translate 220ms cubic-bezier(0.2, 0.9, 0.3, 1.15),
    scale 220ms cubic-bezier(0.2, 0.9, 0.3, 1.15);
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 7px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transform: scaleX(0);
  opacity: 0;
  transition:
    transform 220ms ease,
    opacity 180ms ease;
}

.nav-links a[aria-current]::after,
.nav-links a:focus-visible::after {
  transform: scaleX(1);
  opacity: 1;
}

@media (hover: hover) {
  .nav-links a:hover {
    translate: 0 -2px;
    scale: 1.06;
  }
  .nav-links a:hover::after {
    transform: scaleX(1);
    opacity: 1;
  }
}

.nav-links a:active {
  translate: 0 0;
  scale: 0.94;
}

#theme-toggle {
  display: grid;
  place-items: center;
  width: 58px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  cursor: pointer;
  flex-shrink: 0;
}

.theme-track {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 54px;
  height: 28px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--tag);
}

.theme-track svg {
  position: relative;
  z-index: 1;
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.theme-thumb {
  /* Give the slider its own moving snapshot during the circular page reveal.
     Browsers without view transitions retain the ordinary CSS transform transition. */
  view-transition-name: theme-toggle-thumb;
  position: absolute;
  left: 3px;
  top: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px #0002;
  transform: translateX(0);
  transition:
    transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1),
    background-color 240ms ease;
}

.theme-sun {
  view-transition-name: theme-toggle-sun;
  color: #8a5c00;
}

.theme-moon {
  view-transition-name: theme-toggle-moon;
  color: var(--muted);
}

:root[data-theme='dark'] .theme-thumb {
  transform: translateX(26px);
  background: #344940;
}

:root[data-theme='dark'] .theme-moon {
  color: #fff;
}

:root[data-theme='dark'] .theme-sun {
  color: var(--muted);
}

/* Animate theme colors only during a switch, without changing layout. */
.theme-changing
  :is(
    body,
    header,
    footer,
    .project-card,
    .project-preview,
    .project-card-footer,
    .project-role,
    .project-summary,
    .project-period,
    .contact-section,
    .chat-panel,
    .chat-heading,
    .chat-assistant,
    .chat-user,
    .chat-input-box,
    .chat-panel input,
    .chat-emoji-picker,
    .theme-track
  ) {
  transition:
    background-color 240ms ease,
    color 240ms ease,
    border-color 240ms ease;
}

main {
  padding-bottom: 20px;
}

section {
  margin-block: 56px;
}

.hero {
  padding-top: 18px;
  margin-bottom: 65px;
}

.hero-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 288px;
  grid-template-areas: 'copy portrait';
  gap: 26px;
  align-items: start;
}

.hero-copy {
  grid-area: copy;
  min-width: 0;
}

.hero-copy h1 {
  margin: 2rem 0 1.15rem;
}

@media (max-width: 760px) {
  .hero-top {
    grid-template-columns: minmax(0, 1fr) 144px;
    grid-template-areas: 'heading portrait' 'intro intro';
    column-gap: 12px;
    row-gap: 0;
  }

  .hero-copy {
    display: contents;
  }

  .hero-heading {
    grid-area: heading;
    display: flow-root;
    min-width: 0;
  }

  .hero-copy h1 {
    margin-top: 1.15rem;
    margin-bottom: 0;
    font-size: clamp(22px, 6vw, 30px);
  }

  .hero-copy .job-title {
    margin-top: 1.15rem;
  }

  .hero-copy .introduction {
    grid-area: intro;
    margin-top: 1.15rem;
  }

  .hero .profile-portrait {
    width: 144px;
    margin-inline: 0;
    align-self: start;
    border-radius: 14px;
  }
}

.eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
}

.location {
  display: flex;
  align-items: center;
  gap: 8px;
}

.location.spotify-instruction {
  position: relative;
  display: block;
  width: fit-content;
  max-width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--hint-border);
  border-radius: 16px 16px 16px 4px;
  background: var(--hint-background);
  color: var(--hint-ink);
  box-shadow: 0 4px 14px #00000012;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.75;
  letter-spacing: 0.03em;
  text-transform: none;
}
.spotify-instruction::after {
  content: '';
  position: absolute;
  left: 14px;
  bottom: -6px;
  width: 10px;
  height: 10px;
  background: var(--hint-background);
  border-right: 1px solid var(--hint-border);
  border-bottom: 1px solid var(--hint-border);
  transform: rotate(45deg);
}
@media (max-width: 760px) {
  .location.spotify-instruction {
    padding: 9px 10px;
    border-radius: 12px 12px 12px 4px;
  }
}
.text-type {
  position: relative;
  display: inline-block;
  min-width: 0;
  white-space: pre-wrap;
}
.text-type__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.text-type__measure {
  visibility: hidden;
}
.text-type__content {
  position: absolute;
  inset: 0;
}
.text-type__caret {
  display: inline-block;
  width: 0;
}
.text-type__cursor {
  position: absolute;
  top: 0;
  left: 0;
  white-space: pre;
  pointer-events: none;
  color: currentColor;
  transition: transform 120ms ease-out;
}
.text-type__blink {
  display: inline-block;
  animation: text-type-blink 1s ease-in-out infinite;
}
.text-type__shape {
  display: inline-block;
  margin-left: 0.06em;
  background-color: currentColor;
  width: 0.56em;
  height: max(2px, 0.075em);
  vertical-align: -0.12em;
  border-radius: 1px;
}
.text-type--paused .text-type__blink {
  animation-play-state: paused;
}
@keyframes text-type-blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .text-type__cursor {
    transition: none;
  }
  .text-type__blink {
    animation: none;
  }
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

h1 {
  font-size: clamp(30px, 5vw, 40px);
  line-height: 1.2;
  letter-spacing: -1.8px;
  margin: 17px 0 11px;
  font-weight: 750;
}

.name-word {
  display: inline-block;
  white-space: nowrap;
}

:is(.name-word, .name-ending) > .encrypted-segment {
  white-space: nowrap;
}

.name-ending {
  display: inline-flex;
  align-items: center;
  gap: 0.2em;
  white-space: nowrap;
  vertical-align: baseline;
}

.profile-badge {
  display: block;
  flex: 0 0 0.65em;
  width: 0.65em;
  height: 0.65em;
  transform: translateY(0.08em);
}

:root[data-theme='dark'] :is(.skill-logo, .skill-preview-logo)[src$='vercel.svg'] {
  filter: invert(1);
}

.job-title {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.profile-portrait {
  grid-area: portrait;
  position: relative;
  display: block;
  width: 288px;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1;
  margin-inline-start: auto;
  padding: 0;
  border-radius: 20px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-touch-callout: none;
}

.profile-portrait[data-active='true'] {
  background: transparent;
  border-color: transparent;
}

.profile-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 61%;
  opacity: 1;
  visibility: hidden;
  transform: none;
  pointer-events: none;
  transition: none;
}

.profile-photo[data-profile-photo]:not([data-profile-photo='default']) {
  object-position: 50% 50%;
  object-fit: contain;
}

/* The artwork stays visible until the pixel transition selects a portrait. */
.profile-photo[data-visible='true'] {
  visibility: visible;
}

.introduction {
  max-width: 660px;
  margin: 2rem 0 0;
  font-size: 15px;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 1.15rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 550;
}

.button.primary {
  background: var(--ink);
  color: var(--background);
  border-color: var(--ink);
}

.button:hover {
  opacity: 0.8;
}

.social-links {
  display: flex;
  gap: 16px;
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 13px;
  margin-bottom: 23px;
  gap: 16px;
}

h2 {
  font-size: 17px;
  letter-spacing: -0.4px;
  margin: 0;
}

section > p {
  color: var(--muted);
}

.text-link {
  display: inline-block;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

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

.project-card {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 24px;
  background: var(--surface);
}

.project-card:first-child {
  grid-column: 1 / -1;
}

h3 {
  font-size: 17px;
  letter-spacing: -0.4px;
  line-height: 1.5;
  margin: 15px 0 8px;
}

.project-card:first-child h3 {
  font-size: 24px;
}

.project-card p {
  color: var(--muted);
  margin: 0 0 18px;
  font-size: 13px;
}

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

.project-note {
  font-size: 11px;
}

.project-image {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  object-position: top;
  border: 1px solid var(--line);
  border-radius: 7px;
  margin-top: 18px;
}

.skill-logo {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
}

:root[data-theme='dark'] .skill-logo[src$='github.svg'] {
  filter: invert(1);
}

.timeline-item {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
}

.timeline-item h3 {
  margin: 0;
  font-size: 14px;
}

.timeline-item p {
  margin: 2px 0;
  font-size: 12px;
}

.timeline-item .muted,
.date {
  font-size: 11px;
}

.date {
  color: var(--muted);
  white-space: nowrap;
}

.award-card {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 25px;
  align-items: center;
}

.award-card h3 {
  font-size: 18px;
}

.award-card p {
  color: var(--muted);
  font-size: 12px;
}

.certificate-preview {
  display: block;
  justify-self: center;
  width: min(100%, 360px);
  min-width: 0;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.certificate-preview img {
  width: 100%;
  height: auto;
  aspect-ratio: 768 / 527;
  object-fit: contain;
  border-radius: 2px;
}

.certificate-open {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.certificate-preview {
  cursor: pointer;
  color: inherit;
}

/* Image-only certificate lightbox: no surrounding panel or caption. */
html.certificate-viewer-open {
  overflow: hidden;
}

#certificate-viewer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 68px 54px 48px;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: hidden;
}

#certificate-viewer[open] {
  display: grid;
  place-items: center;
  grid-template-rows: minmax(0, 1fr);
}

#certificate-viewer::backdrop {
  background: #000e;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.certificate-close {
  position: absolute;
  top: -48px;
  right: -8px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #fff;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
}

.certificate-close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.certificate-full {
  display: block;
  width: auto;
  height: auto;
  max-width: min(880px, calc(100vw - 108px));
  max-height: calc(100dvh - 116px);
  min-width: 0;
  min-height: 0;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 16px 50px #0008;
}

.certificate-visual,
.photo-visual {
  position: relative;
  width: fit-content;
  max-width: 100%;
}

@media (max-width: 600px) {
  #certificate-viewer {
    padding: 64px 18px 28px;
  }
  .certificate-full {
    max-width: calc(100vw - 36px);
    max-height: calc(100dvh - 92px);
    border-radius: 10px;
  }
}

.contact-section {
  padding: 34px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.contact-section h2 {
  font-size: 26px;
  margin: 10px 0;
  letter-spacing: -1px;
}

.contact-section p {
  max-width: 560px;
  font-size: 13px;
  margin-bottom: 22px;
}

.contact-links {
  display: flex;
  gap: 23px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
  margin-top: 20px;
}

footer {
  border-top: 1px dashed var(--line);
  padding-block: 24px 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 11px;
}

footer strong {
  color: var(--ink);
  font-weight: 500;
}

footer p {
  margin: 3px 0;
}

.page-intro {
  margin: 60px 0 35px;
}

.page-intro p {
  color: var(--muted);
  max-width: 600px;
}

.detailed-grid {
  grid-template-columns: 1fr;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 15px;
  padding: 8px 16px;
  background: var(--ink);
  color: var(--background);
  z-index: 20;
}

.skip-link:focus {
  top: 12px;
}

.back-home {
  display: inline-block;
  margin-top: 27px;
  color: var(--accent);
  font-size: 12px;
}

.back-home + .page-intro {
  margin-top: 28px;
}

.gallery-intro {
  margin-bottom: 22px;
  font-size: 13px;
}

.gallery-expand {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #192020b3;
  color: white;
  line-height: 26px;
  font-size: 15px;
}

/* Compact image-only gallery viewer; dark overlay is shared in both themes. */
html.photo-viewer-open {
  overflow: hidden;
}

#photo-viewer {
  --gallery-photo-max-height: min(48dvh, 360px);
  width: min(520px, calc(100% - 48px));
  height: auto;
  max-height: calc(100dvh - 80px);
  margin: auto;
  padding: 48px 36px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  overflow: visible;
}

#photo-viewer[open] {
  display: grid;
  place-items: center;
}

#photo-viewer::backdrop {
  background: #000d;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

#photo-full {
  width: auto;
  height: auto;
  max-width: min(448px, calc(100vw - 120px));
  max-height: var(--gallery-photo-max-height);
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 12px 35px #0008;
}

#photo-viewer button {
  position: absolute;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #fff;
  line-height: 1;
  cursor: pointer;
}

#photo-viewer button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.photo-close {
  top: -48px;
  right: -8px;
  font-size: 32px;
}

.photo-previous,
.photo-next {
  top: calc(50% + 24px);
  transform: translateY(-50%);
  font-size: 36px;
}

.photo-previous {
  left: -8px;
}
.photo-next {
  right: -8px;
}

@media (max-width: 600px) {
  #photo-viewer {
    --gallery-photo-max-height: min(40dvh, 280px);
    width: calc(100% - 40px);
    padding: 48px 24px 0;
  }
  #photo-full {
    max-width: calc(100vw - 88px);
  }
}

/* Resume activation */
.resume-gate {
  padding: clamp(24px, 5vw, 48px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  text-align: center;
}

.resume-gate p {
  margin: 0;
}

.resume-gate[hidden] {
  display: none;
}

.chat-resume-link {
  display: inline-block;
  margin-top: 10px;
  font-weight: 600;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.resume-viewer {
  margin-bottom: 55px;
}

.resume-page {
  margin: 0 0 28px;
}

.resume-page figcaption {
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 10px;
}

.resume-page img {
  width: 100%;
  background: white;
  border: 1px solid var(--line);
  border-radius: 5px;
}

@media (max-width: 600px) {
  .container {
    width: calc(100% - 36px);
  }
  nav {
    height: 64px;
  }
  .site-nav {
    gap: 12px;
  }
  .nav-links {
    gap: 10px;
    font-size: 10px;
  }
  h1 {
    font-size: 30px;
    letter-spacing: -1.2px;
  }
  .location {
    font-size: 8px;
    letter-spacing: 0.7px;
  }
  .location.spotify-instruction {
    font-size: 8px;
  }
  .job-title {
    font-size: 11px;
  }
  .introduction {
    font-size: 14px;
  }
  .social-links {
    margin-left: 0;
    width: 100%;
    margin-top: 8px;
  }
  .project-grid,
  .award-card {
    grid-template-columns: 1fr;
  }
  .project-card {
    padding: 20px;
  }
  section {
    margin-block: 42px;
  }
  .timeline-item {
    gap: 12px;
  }
  .date {
    font-size: 10px;
  }
  .contact-section {
    padding: 24px;
  }
  .contact-section .button {
    font-size: 11px;
    max-width: 100%;
  }
  footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Interaction springs are driven by motion.js. */
.button,
button,
.social-link,
.text-link,
.back-home,
.nav-links a {
  transition:
    color 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    box-shadow 220ms ease,
    translate 160ms ease,
    scale 140ms ease;
}

.button:hover {
  opacity: 1;
  box-shadow: 0 5px 18px #32756924;
}

@media (hover: hover) {
  .button:hover,
  .social-link:hover,
  .text-link:hover,
  .back-home:hover {
    translate: 0 -1px;
  }
}

.button:active,
button:not(.profile-portrait):not(.skill-badge):active {
  scale: 0.97;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.social-logo {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

:root[data-theme='dark'] .social-logo[src$='github.svg'] {
  filter: invert(1);
}

/* Spotify lives beside the profile's social links; only the selected player loads. */
.spotify-launcher {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.social-links {
  flex-wrap: wrap;
  align-items: center;
}

.spotify-logo {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
}

.spotify-launcher .spotify-logo {
  width: 21px;
  height: 21px;
}

:root[data-theme='dark'] .spotify-logo {
  filter: invert(1);
}

.spotify-open,
.spotify-open body {
  overflow: hidden;
}

#robiner-spotify-dialog {
  color-scheme: dark;
  --ink: #f5f7f6;
  --muted: #c0c8c5;
  --accent: #d3e6df;
  --surface: #ffffff0b;
  --line: #ffffff30;
  --tag: #ffffff0b;
  width: min(600px, calc(100% - 32px));
  max-height: calc(100dvh - 40px);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(ellipse at 0 0, #ffffff0e, transparent 58%),
    linear-gradient(135deg, #242a2bce, #101719d9);
  color: var(--ink);
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-backdrop-filter: blur(18px) saturate(115%);
  backdrop-filter: blur(18px) saturate(115%);
  box-shadow:
    0 24px 70px #00000055,
    inset 0 1px 0 #ffffff30,
    inset 0 0 22px #ffffff03;
}

#robiner-spotify-dialog .spotify-logo {
  filter: invert(1);
}

#robiner-spotify-dialog::backdrop {
  background: #03080b66;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  #robiner-spotify-dialog {
    background: #202728;
  }
}

.spotify-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.spotify-heading .eyebrow {
  font-size: 9px;
}

.spotify-heading h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 0;
  font-size: 22px;
}

.spotify-close {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  font-size: 25px;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 #ffffff20;
}

.spotify-choices > p {
  margin: 18px 0;
}

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

.spotify-choice {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(135deg, #ffffff0d, #ffffff06);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  min-width: 0;
  box-shadow: inset 0 1px 0 #ffffff18;
}

.spotify-choice:hover,
.spotify-choice:focus-visible {
  border-color: var(--accent);
  background: #ffffff12;
  box-shadow: 0 6px 18px #00000025;
}

.spotify-cover {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 8px;
  background: var(--tag);
}

.spotify-choice strong {
  display: block;
  margin: 12px 0 4px;
  overflow-wrap: anywhere;
  font-size: 15px;
}

.spotify-choice > span {
  font-size: 11px;
  color: var(--muted);
}

.spotify-back {
  margin-top: 18px;
  border: 0;
  padding: 8px 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
}

#spotify-selected-title {
  margin: 12px 0 4px;
  font-size: 18px;
}

.spotify-play-help {
  margin: 0 0 14px;
  font-size: 12px;
}

.spotify-embed {
  min-height: 352px;
  border-radius: 12px;
  background: var(--surface);
}

.spotify-embed iframe {
  display: block;
  width: 100%;
  height: 352px;
  border: 0;
  border-radius: 12px;
}

.spotify-external {
  display: inline-block;
  margin-top: 14px;
  font-size: 12px;
}

#robiner-spotify-dialog [hidden] {
  display: none;
}

@media (max-width: 600px) {
  #robiner-spotify-dialog {
    position: fixed;
    inset: 0;
    width: min(600px, calc(100% - 24px));
    max-width: 600px;
    max-height: calc(
      100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 24px
    );
    margin: auto;
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px));
    border-radius: 20px;
  }
  #robiner-spotify-dialog {
    -webkit-backdrop-filter: blur(12px) saturate(115%);
    backdrop-filter: blur(12px) saturate(115%);
  }
  .spotify-playlist-grid {
    gap: 12px;
  }
  .spotify-choice {
    padding: 10px;
  }
  .spotify-choice strong {
    font-size: 13px;
  }
  .spotify-heading h2 {
    font-size: 19px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #robiner-spotify-dialog[open] {
    animation: none;
  }
}

.skill-badge {
  cursor: pointer;
  touch-action: pan-y pinch-zoom;
  user-select: none;
}

.skill-badge:hover,
.skill-badge:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 6px 16px #32756920;
}

.skill-badge img {
  pointer-events: none;
  user-select: none;
}

.robiner-reveal {
  opacity: 0;
  translate: 0 14px;
  transition:
    opacity 550ms ease var(--reveal-delay, 0ms),
    translate 650ms cubic-bezier(0.16, 1, 0.3, 1) var(--reveal-delay, 0ms);
}

.robiner-reveal.is-visible {
  opacity: 1;
  translate: 0 0;
}

#photo-viewer[open] {
  animation: robiner-dialog-in 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

#photo-full {
  animation: robiner-photo-in 250ms ease;
}

/* The first gallery file has black letterbox bars baked into its portrait image.
   Crop to its centered square photo so the subject stays a useful size in the viewer. */
#photo-full[src*='personal-moment'] {
  width: min(var(--gallery-photo-max-height), calc(100vw - 112px), 440px);
  height: min(var(--gallery-photo-max-height), calc(100vw - 112px), 440px);
  margin-inline: auto;
  object-fit: cover;
}

@keyframes robiner-dialog-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes robiner-photo-in {
  from {
    opacity: 0.3;
  }
  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .robiner-reveal {
    opacity: 1;
    translate: none;
  }
}

/* Portfolio assistant. The live provider is configured on the server. */
.robiner-chat {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

#robiner-chat-launcher {
  box-shadow: 0 6px 24px #142b2926;
}

.chat-panel {
  width: min(360px, calc(100vw - 48px));
  margin: 0;
  background: var(--background);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 16px 48px #142b2933;
  overflow: hidden;
}

.chat-panel:not([hidden]) {
  animation: robiner-dialog-in 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-heading {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.chat-heading strong {
  font-size: 13px;
}

.chat-heading p {
  color: var(--muted);
  font-size: 11px;
  margin: 2px 0 0;
}

.chat-close {
  display: grid;
  place-items: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--muted);
  background: none;
  border: 0;
  font-size: 24px;
  cursor: pointer;
}

.chat-heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.chat-heading > div:first-child {
  min-width: 0;
}

.chat-reset {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  border-radius: 6px;
  padding: 5px 7px;
  min-height: 32px;
  font-size: 10px;
  white-space: nowrap;
  cursor: pointer;
}

.chat-reset:disabled {
  opacity: 0.5;
  cursor: wait;
}

.chat-log {
  height: min(290px, 38dvh);
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-message {
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 12px;
  max-width: 92%;
  white-space: pre-wrap;
  text-align: left;
  overflow-wrap: anywhere;
  margin: 0;
  flex-shrink: 0;
}

.chat-assistant {
  background: var(--tag);
  align-self: flex-start;
}

.chat-user {
  background: var(--ink);
  color: var(--background);
  align-self: flex-end;
}

.chat-suggestions {
  padding: 0 14px;
  display: flex;
  gap: 8px;
}

.chat-suggestions button {
  border: 1px solid var(--line);
  color: var(--muted);
  background: none;
  padding: 5px 9px;
  font-size: 10px;
  border-radius: 20px;
  cursor: pointer;
}

.chat-status {
  min-height: 17px;
  color: var(--muted);
  font-size: 10px;
  margin: 6px 16px;
  flex-shrink: 0;
}

.chat-panel form {
  display: grid;
  grid-template-columns: 34px 34px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 3px;
  padding: 8px;
  border-top: 1px solid var(--line);
}

.chat-input-box {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
}

.chat-input-box:focus-within {
  border-color: var(--accent);
}

.chat-panel input {
  width: 100%;
  min-width: 0;
  padding: 9px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  outline: none;
}

.chat-composer-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 1px;
  padding: 1px;
  border-radius: 24px;
  background: #303335;
}

.chat-composer {
  position: relative;
  flex-shrink: 0;
}

/* Desktop attachments remain in the composer; phones send selected photos directly. */
.chat-attach-photo,
.chat-record-voice,
.chat-discard-voice {
  display: grid;
  place-items: center;
  width: 34px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  touch-action: manipulation;
}

.chat-attach-photo svg,
.chat-record-voice svg,
.chat-discard-voice svg {
  width: 23px;
  height: 23px;
}

.chat-attach-photo:hover,
.chat-record-voice:hover,
.chat-discard-voice:hover {
  background: var(--tag);
  color: var(--ink);
}

.chat-attach-photo:disabled,
.chat-record-voice:disabled,
.chat-voice-play:disabled {
  opacity: 0.45;
  cursor: default;
}

.chat-panel form.is-voice-mode {
  grid-template-columns: 34px minmax(0, 1fr) 40px;
}

.is-voice-mode .chat-attach-photo,
.is-voice-mode .chat-record-voice,
.is-voice-mode .chat-input-box,
.chat-discard-voice[hidden],
.chat-voice-slot[hidden] {
  display: none;
}

.chat-voice-slot {
  min-width: 0;
}

.chat-voice-capsule {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 44px;
  padding: 5px 10px 5px 5px;
  border-radius: 28px;
  background: var(--accent);
  color: var(--background);
}

.chat-voice-play {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--background);
  color: var(--accent);
  font-size: 15px;
  cursor: pointer;
  touch-action: manipulation;
}

.chat-voice-play:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.chat-voice-wave {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  flex: 1;
  min-width: 0;
  height: 24px;
  overflow: hidden;
}

.chat-voice-wave i {
  display: block;
  flex: 1 0 2px;
  max-width: 3px;
  min-height: 3px;
  border-radius: 3px;
  background: currentColor;
  opacity: 0.65;
  transition: height 100ms linear;
}

.chat-voice-wave i.is-played {
  opacity: 1;
}

.chat-voice-time {
  flex-shrink: 0;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.chat-voice-review summary {
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}

.chat-message .chat-voice-capsule {
  min-width: min(225px, 100%);
  background: var(--accent);
}

.chat-attachments:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 12px;
  max-height: min(180px, calc(var(--chat-visible-height, 100dvh) * 0.24));
  overflow-y: auto;
}

.chat-attachment-preview {
  position: relative;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  flex-shrink: 0;
  width: 64px;
  height: 64px;
}

.chat-photo-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 6px;
}

.chat-add-photo {
  width: 64px;
  height: 64px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--tag);
  color: var(--ink);
  font-size: 30px;
  cursor: pointer;
}

.chat-remove-attachment {
  position: absolute;
  right: -7px;
  top: -7px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: var(--background);
  font-size: 20px;
  cursor: pointer;
}

.chat-attachment-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.chat-user-photo {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  padding: 0;
  background: transparent;
  color: var(--ink);
}

.chat-user-photo img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(230px, 100%);
  max-height: 300px;
  border-radius: 18px;
  object-fit: contain;
}

.chat-user-photo .chat-message-text {
  order: -1;
  max-width: 100%;
  padding: 9px 12px;
  border-radius: 18px;
  background: var(--ink);
  color: var(--background);
}

.chat-message-delivery {
  order: 2;
  color: var(--muted);
  font-size: 10px;
}

@media (max-width: 600px) {
  .chat-user-photo .chat-message-text {
    order: 1;
  }
}

.chat-attachment-preview label,
.chat-voice-review label {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
}

.chat-attachment-preview textarea,
.chat-voice-review textarea {
  display: block;
  width: 100%;
  min-height: 60px;
  margin-top: 4px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--background);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  resize: vertical;
}

.chat-message p {
  margin: 0;
}

.chat-message :is(img, audio, details) + p,
.chat-message details {
  margin-top: 7px;
}

.chat-user-photo :is(img, audio, details) + p {
  margin-top: 0;
}

.chat-message summary {
  cursor: pointer;
  font-size: 11px;
}

.chat-composer form {
  border-top: 0;
}

.chat-compact .chat-attachments:not([hidden]) {
  max-height: 64px;
}

.chat-send,
.chat-emoji-toggle {
  display: grid;
  place-items: center;
  width: 38px;
  height: 44px;
  flex-shrink: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition:
    background 160ms ease,
    scale 160ms ease;
}

.chat-send:disabled {
  opacity: 0.45;
  cursor: default;
}

.chat-send:not(:disabled):hover,
.chat-emoji-toggle:hover,
.chat-emoji-toggle[aria-expanded='true'] {
  background: #ffffff18;
}

.chat-send:not(:disabled):active,
.chat-emoji-toggle:active {
  scale: 0.92;
}

.chat-send:focus-visible,
.chat-emoji-toggle:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -3px;
}

.chat-input-box .chat-emoji-toggle {
  color: var(--muted);
}

.chat-input-box .chat-emoji-toggle:hover,
.chat-input-box .chat-emoji-toggle[aria-expanded='true'] {
  background: var(--tag);
  color: var(--ink);
}

.chat-input-box .chat-emoji-toggle:focus-visible {
  outline-color: var(--accent);
}

.chat-emoji-picker:not([hidden]) {
  position: absolute;
  z-index: 1;
  bottom: 100%;
  left: 8px;
  right: 8px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 3px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--background);
  box-shadow: 0 -4px 18px #0002;
  max-height: min(120px, 26dvh);
  overflow-y: auto;
}

.chat-emoji-picker button {
  min-height: 44px;
  padding: 4px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
  font-size: 24px;
}

.chat-emoji-picker button:hover,
.chat-emoji-picker button:focus-visible {
  background: var(--tag);
}

.chat-suggestions button:disabled {
  opacity: 0.5;
  cursor: wait;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 600px) {
  .robiner-chat {
    right: 16px;
    bottom: 16px;
  }
  #robiner-chat-launcher {
    font-size: 11px;
    padding: 10px 13px;
  }
}

/* Project-specific colors track the current light or dark theme. */
:root {
  --project-background: #f7f8f3;
  --project-border: #cad5d2;
  --project-preview: #e7ede5;
  --project-role: #286452;
  --project-summary: #536772;
  --project-muted: #687980;
  --project-link: #286452;
}

:root[data-theme='dark'] {
  --project-background: #111313;
  --project-border: #465160;
  --project-preview: #202928;
  --project-role: #b6d9f0;
  --project-summary: #a9bdc8;
  --project-muted: #9aaeb8;
  --project-link: #b6c8d4;
}

/* Project cards follow the supplied dashed-border preview format. */
.project-grid,
.project-grid.detailed-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.project-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 11px;
  border: 1px dashed var(--project-border);
  border-radius: 17px;
  background: var(--project-background);
  color: var(--ink);
}

a.project-card:hover {
  color: var(--ink);
}

.project-card:first-child {
  grid-column: auto;
}

.project-preview {
  display: flex;
  align-items: center;
  height: 170px;
  border: 1px solid var(--project-border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--project-preview);
  padding: 0;
}

.project-preview .project-image {
  display: block;
  width: 100%;
  max-height: none;
  height: 100%;
  object-fit: cover;
  border: none;
  border-radius: 0;
  margin: 0;
}

.project-copy {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 13px 8px 12px;
}

.project-card h3,
.project-card:first-child h3 {
  margin: 8px 0 3px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.7px;
}

.project-card .project-role {
  color: var(--project-role);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  margin: 0 0 9px;
}

.project-card .project-summary {
  color: var(--project-summary);
  font-size: 13px;
  line-height: 1.65;
  margin: 0 0 14px;
}

.project-card .project-period {
  color: var(--project-muted);
  font-size: 9px;
  line-height: 1.65;
  margin: 0 0 12px;
}

.project-tools {
  display: flex;
  gap: 13px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 10px;
  align-items: center;
}

.project-tools img {
  width: 21px;
  height: 21px;
  object-fit: contain;
}

:root[data-theme='dark'] .project-tools img[src$='github.svg'] {
  filter: invert(1);
}

.project-card-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 42px;
  margin-top: 7px;
  border-top: 1px solid var(--project-border);
  padding: 8px;
}

.project-visit {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--project-link);
}

.project-visit:hover {
  color: var(--accent);
}

.project-placeholder {
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  background: var(--project-preview);
  border-color: var(--project-border);
  color: var(--muted);
  padding: 20px;
  text-align: center;
  font-size: 10px;
}

.project-card .project-note {
  font-size: 10px;
  color: var(--project-muted);
}

@media (max-width: 760px) {
  .project-grid,
  .project-grid.detailed-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .project-grid,
  .project-grid.detailed-grid {
    grid-template-columns: 1fr;
  }
  .project-preview {
    height: 210px;
  }
  .project-card .project-summary {
    font-size: 14px;
  }
}

/* Fill every project frame; crop overflow rather than leaving empty bands. */
.project-preview--photo .project-image {
  object-fit: cover;
  object-position: center 60%;
}

/* Card zoom is driven by springs; touch scrolling remains native. */
.project-card {
  position: relative;
  transform-origin: center;
  transition:
    opacity 550ms ease var(--reveal-delay, 0ms),
    translate 650ms cubic-bezier(0.16, 1, 0.3, 1) var(--reveal-delay, 0ms),
    box-shadow 220ms ease,
    border-color 220ms ease;
}

.project-card.is-project-active,
.project-card:focus-within {
  z-index: 2;
  border-color: var(--accent);
  box-shadow: 0 10px 26px #3275691a;
}

@media (hover: hover) {
  .project-card:hover {
    z-index: 2;
    border-color: var(--accent);
    box-shadow: 0 10px 26px #3275691a;
  }
}

@media (prefers-reduced-motion: reduce) {
  .profile-photo {
    transition: none;
  }
}

@media (max-width: 600px) {
  footer {
    padding-bottom: calc(82px + env(safe-area-inset-bottom, 0px));
  }
  .robiner-chat {
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
  .chat-panel {
    max-height: calc(100dvh - 115px - env(safe-area-inset-bottom, 0px));
  }
}

/* Keep the assistant usable when a phone keyboard or landscape view reduces height. */
.chat-panel:not([hidden]) {
  display: flex;
  flex-direction: column;
}

.chat-log {
  flex: 1 1 auto;
  min-height: 0;
}

.chat-heading,
.chat-suggestions,
.chat-panel form {
  flex-shrink: 0;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.project-visit {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
}

@media (max-width: 600px) {
  .nav-links {
    gap: 8px;
  }
  .nav-links a {
    min-width: 40px;
    justify-content: center;
  }
  #theme-toggle {
    width: 54px;
    height: 44px;
  }
}

@media (max-width: 380px) {
  .nav-links {
    gap: 5px;
    font-size: 9.5px;
  }
  .nav-links a {
    min-width: 0;
  }
}

@media (max-height: 500px) {
  .chat-heading {
    padding: 8px 12px;
  }
  .chat-heading p,
  .chat-suggestions {
    display: none;
  }
  .chat-status {
    margin: 2px 12px;
  }
  .chat-panel form {
    padding: 8px;
  }
}

.chat-panel {
  max-height: calc(100dvh - 110px - env(safe-area-inset-bottom, 0px));
}

/* Visual viewport also accounts for mobile keyboards that overlay the page. */
.robiner-chat {
  bottom: calc(22px + var(--chat-keyboard-offset, 0px));
}

.chat-panel {
  max-height: min(
    620px,
    calc(var(--chat-visible-height, 100dvh) - 110px - env(safe-area-inset-bottom, 0px))
  );
}

.chat-compact .chat-heading {
  padding: 8px 12px;
}

.chat-compact .chat-heading p,
.chat-compact .chat-suggestions {
  display: none;
}

.chat-compact .chat-status {
  margin: 2px 12px;
}

.chat-compact .chat-panel form {
  padding: 8px;
}

@media (max-width: 600px) {
  .robiner-chat {
    bottom: calc(16px + env(safe-area-inset-bottom, 0px) + var(--chat-keyboard-offset, 0px));
  }
}

/* Freeze ordinary page transitions for clean circular snapshots.
   The toggle's named snapshots animate independently below. */
.theme-reveal-active *,
.theme-reveal-active *::before,
.theme-reveal-active *::after {
  transition: none !important;
}

.theme-reveal-active::view-transition {
  pointer-events: none;
}

.theme-reveal-active::view-transition-group(theme-toggle-thumb) {
  z-index: 3;
  animation-duration: 240ms;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
}

.theme-reveal-active::view-transition-old(theme-toggle-thumb),
.theme-reveal-active::view-transition-new(theme-toggle-thumb) {
  animation-duration: 240ms;
}

/* Keep both glyphs above the moving thumb, as in the live switch. */
.theme-reveal-active::view-transition-group(theme-toggle-sun),
.theme-reveal-active::view-transition-group(theme-toggle-moon) {
  z-index: 4;
  animation-duration: 240ms;
}

.theme-reveal-active::view-transition-old(theme-toggle-sun),
.theme-reveal-active::view-transition-new(theme-toggle-sun),
.theme-reveal-active::view-transition-old(theme-toggle-moon),
.theme-reveal-active::view-transition-new(theme-toggle-moon) {
  animation-duration: 240ms;
}

.theme-reveal-active::view-transition-old(root),
.theme-reveal-active::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

.theme-reveal-active::view-transition-old(root) {
  z-index: 1;
}

.theme-reveal-active::view-transition-new(root) {
  z-index: 2;
  animation: robiner-circle-reveal 480ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes robiner-circle-reveal {
  from {
    clip-path: circle(0 at var(--robiner-reveal-x) var(--robiner-reveal-y));
  }
  to {
    clip-path: circle(
      var(--robiner-reveal-radius) at var(--robiner-reveal-x) var(--robiner-reveal-y)
    );
  }
}

/* Keep the page content in its own stacking context. */
#root {
  position: relative;
  z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
  .theme-reveal-active::view-transition-new(root) {
    animation: none;
  }
}

/* Transform/opacity only: the glass itself does not animate its blur. */
#robiner-spotify-dialog[open] {
  animation: robiner-spotify-in 340ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

#robiner-spotify-dialog[open]::backdrop {
  animation: robiner-spotify-backdrop-in 300ms ease both;
}

#robiner-spotify-dialog[open].is-spotify-closing {
  animation: robiner-spotify-out 180ms ease-in both;
  pointer-events: none;
}

#robiner-spotify-dialog[open].is-spotify-closing::backdrop {
  animation: robiner-spotify-backdrop-out 180ms ease-in both;
}

#robiner-spotify-dialog:focus {
  outline: none;
}

.spotify-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  outline: none;
  box-shadow: none;
  transition:
    background-color 180ms ease,
    transform 200ms ease,
    border-color 180ms ease;
}

.spotify-close svg {
  width: 18px;
  height: 18px;
  display: block;
  pointer-events: none;
}

.spotify-close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.spotify-close:active {
  transform: scale(0.94);
}

@media (hover: hover) {
  .spotify-close:hover {
    background: #ffffff17;
    border-color: #ffffff60;
    transform: scale(1.05);
  }
}

#robiner-spotify-dialog[open] :is(.spotify-choices, .spotify-player):not([hidden]) {
  animation: robiner-spotify-content-in 240ms ease-out both;
}

@keyframes robiner-spotify-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes robiner-spotify-out {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
}

@keyframes robiner-spotify-backdrop-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes robiner-spotify-backdrop-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes robiner-spotify-content-in {
  from {
    opacity: 0.3;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 600px) {
  @keyframes robiner-spotify-in {
    from {
      opacity: 0;
      transform: translateY(32px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  @keyframes robiner-spotify-out {
    from {
      opacity: 1;
      transform: translateY(0);
    }
    to {
      opacity: 0;
      transform: translateY(24px);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  #robiner-spotify-dialog[open],
  #robiner-spotify-dialog[open]::backdrop,
  #robiner-spotify-dialog[open].is-spotify-closing,
  #robiner-spotify-dialog[open].is-spotify-closing::backdrop,
  #robiner-spotify-dialog[open] :is(.spotify-choices, .spotify-player):not([hidden]) {
    animation: none;
  }
}

/* A small edge waveform controls the same persistent Spotify iframe. */
.spotify-mini {
  display: none;
}

.spotify-player.is-spotify-parked {
  position: absolute;
  width: 300px;
  height: 352px;
  top: 100%;
  left: 0;
  overflow: hidden;
  pointer-events: none;
}

#robiner-spotify-dialog:has(.is-spotify-parked) {
  overflow: hidden;
}

#robiner-spotify-dialog.is-spotify-mini[open] {
  position: fixed;
  inset: var(--spotify-mini-y, auto) auto auto var(--spotify-mini-x, 16px);
  width: 52px;
  height: 44px;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #000;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  overflow: clip;
  z-index: 12;
  animation: none;
  transform: none;
}

:root[data-theme='dark'] #robiner-spotify-dialog.is-spotify-mini[open] {
  color: #fff;
}

#robiner-spotify-dialog.is-spotify-mini > :is(.spotify-heading, .spotify-choices) {
  display: none;
}

#robiner-spotify-dialog.is-spotify-mini .spotify-player {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 300px;
  height: 352px;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  animation: none !important;
}

#robiner-spotify-dialog.is-spotify-mini .spotify-player > :not(.spotify-embed),
.spotify-player.is-spotify-parked > :not(.spotify-embed) {
  display: none;
}

#robiner-spotify-dialog.is-spotify-mini .spotify-mini {
  display: grid;
}

.spotify-wave-toggle {
  display: grid;
  place-items: center;
  position: relative;
  z-index: 1;
  width: 52px;
  height: 44px;
  padding: 4px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.spotify-wave-toggle:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -2px;
}

.spotify-mini.is-dragging .spotify-wave-toggle {
  cursor: grabbing;
}

.spotify-wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5px;
  height: 24px;
  pointer-events: none;
}

.spotify-wave > span {
  width: 2px;
  height: var(--wave-height, 16px);
  border-radius: 2px;
  background: currentColor;
  transform: scaleY(0.24);
  transition: transform 180ms ease;
}

.spotify-wave > span:nth-child(6n + 1) {
  --wave-height: 8px;
  --wave-delay: -180ms;
}
.spotify-wave > span:nth-child(6n + 2) {
  --wave-height: 14px;
  --wave-delay: -510ms;
}
.spotify-wave > span:nth-child(6n + 3) {
  --wave-height: 10px;
  --wave-delay: -300ms;
}
.spotify-wave > span:nth-child(6n + 4) {
  --wave-height: 21px;
  --wave-delay: -720ms;
}
.spotify-wave > span:nth-child(6n + 5) {
  --wave-height: 24px;
  --wave-delay: -420ms;
}
.spotify-wave > span:nth-child(6n) {
  --wave-height: 16px;
  --wave-delay: -60ms;
}

.spotify-wave > span {
  animation: robiner-spotify-wave 850ms ease-in-out infinite;
  animation-delay: var(--wave-delay);
}

@keyframes robiner-spotify-wave {
  0%,
  100% {
    transform: scaleY(0.25);
  }
  45% {
    transform: scaleY(1);
  }
  75% {
    transform: scaleY(0.5);
  }
}

.spotify-stop {
  margin-right: 18px;
}

@media (max-width: 600px) {
  #robiner-spotify-dialog.is-spotify-mini[open] {
    inset: var(--spotify-mini-y, auto) auto auto var(--spotify-mini-x, 10px);
  }
  #robiner-spotify-dialog.is-spotify-mini.is-spotify-edge-docked[open] {
    inset: auto auto calc(22px + env(safe-area-inset-bottom, 0px)) 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .spotify-wave > span {
    animation: none;
    transform: scaleY(1);
  }
  .spotify-wave > span {
    transition: none;
  }
}

/* Skill-specific illustration previews, with no background animation work. */
.skill-preview-open,
.skill-preview-open body {
  overflow: hidden;
  scrollbar-gutter: stable;
}

#robiner-skill-preview {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(460px, calc(100% - 28px));
  max-width: none;
  max-height: calc(100dvh - 40px);
  padding: 44px 16px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  overflow: visible;
}

#robiner-skill-preview[open] {
  animation: robiner-skill-in 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

#robiner-skill-preview::backdrop {
  background: #000d;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

#robiner-skill-preview[open]::backdrop {
  animation: robiner-skill-backdrop-in 240ms ease both;
}

#robiner-skill-preview.is-closing {
  animation: robiner-skill-out 180ms ease both;
  pointer-events: none;
}

#robiner-skill-preview.is-closing::backdrop {
  animation: robiner-skill-backdrop-out 180ms ease both;
}

.skill-preview-close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  position: absolute;
  top: 0;
  right: 0;
  padding: 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.skill-preview-close svg {
  width: 20px;
  height: 20px;
}

.skill-preview-close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.skill-preview-visual {
  display: grid;
  place-items: center;
  min-height: 160px;
  border-radius: 12px;
  overflow: hidden;
  background: transparent;
}

.has-preview .skill-preview-visual {
  aspect-ratio: 1180 / 912;
  min-height: 0;
  max-height: min(340px, calc(100dvh - 190px));
}

.skill-preview-image {
  display: block;
  width: 100%;
  height: 100%;
  max-height: min(340px, calc(100dvh - 190px));
  object-fit: contain;
  border-radius: 12px;
}

.image-ready .skill-preview-image {
  animation: robiner-skill-image-in 220ms ease both;
}

.skill-preview-empty {
  display: grid;
  place-items: center;
  min-height: 160px;
  width: 100%;
}

.skill-preview-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

#robiner-skill-preview [hidden] {
  display: none;
}

@keyframes robiner-skill-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes robiner-skill-out {
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

@keyframes robiner-skill-image-in {
  from {
    opacity: 0;
    transform: scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes robiner-skill-backdrop-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes robiner-skill-backdrop-out {
  to {
    opacity: 0;
  }
}

@media (max-width: 600px) {
  #robiner-skill-preview {
    padding: 44px 14px 0;
    border-radius: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  #robiner-skill-preview[open],
  #robiner-skill-preview[open]::backdrop,
  .image-ready .skill-preview-image {
    animation: none;
  }
}

/* Official monochrome OpenAI mark uses the matching light/dark variant. */
:root[data-theme='dark'] :is(.skill-logo, .skill-preview-logo)[src$='codex.svg'] {
  filter: invert(1);
}

/* React Bits PixelTransition overlay, sized to the existing portrait. */
.pixelated-image-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
}

.pixelated-image-card:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.pixelated-image-card__default,
.pixelated-image-card__active {
  position: absolute;
  inset: 0;
}

.pixelated-image-card__pixels {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 3;
  pointer-events: none;
}

/* Keep each card's existing grid width and content sizing inside a spotlight deck. */
.project-visit-phone {
  display: none;
}
@media (max-width: 899px) {
  .project-visit-phone {
    display: inline;
  }
  .project-visit-desktop {
    display: none;
  }
}
.project-deck-shell {
  margin-inline: -24px;
  padding: 28px 24px 8px;
  overflow: clip;
}

.project-grid.project-deck,
.project-grid.detailed-grid.project-deck {
  --deck-card-width: calc((100% - 32px) / 3);
  grid-template-columns: minmax(0, 1fr) var(--deck-card-width) minmax(0, 1fr);
  column-gap: 0;
  isolation: isolate;
  touch-action: pan-y pinch-zoom;
}

.project-deck > .project-card,
.project-deck > .project-card:first-child {
  grid-area: 1 / 2;
  transform-origin: center bottom;
  transition:
    transform 500ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 350ms ease,
    border-color 220ms ease;
}

.project-deck > [data-deck-slot='center'] {
  transform: translateY(0) rotate(0deg) scale(1);
  z-index: 30;
  box-shadow: 0 26px 55px -22px #00000038;
}

.project-deck > [data-deck-slot='left'] {
  transform: translateX(-40%) translateY(14px) rotate(-16deg) scale(0.88);
  z-index: 10;
  cursor: pointer;
}

.project-deck > [data-deck-slot='right'] {
  transform: translateX(40%) translateY(14px) rotate(16deg) scale(0.88);
  z-index: 20;
  cursor: pointer;
}

.project-deck > .project-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: var(--project-background);
  opacity: 0;
  transition: opacity 350ms ease;
}

.project-deck > .project-card:not([data-deck-slot='center'])::after {
  opacity: 0.4;
}

.project-deck > .project-card:not([data-deck-slot='center']) a {
  pointer-events: none;
}

.project-deck > .project-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}

.project-deck > [data-deck-slot='center']:focus-visible,
.project-deck > [data-deck-slot='center'].is-deck-pressed {
  transform: translateY(-7px) scale(1.035);
  z-index: 30;
  border-color: var(--accent);
  box-shadow: 0 34px 65px -22px #00000045;
}

@media (hover: hover) and (pointer: fine) {
  .project-deck > [data-deck-slot='center']:hover {
    transform: translateY(-7px) scale(1.035);
    z-index: 30;
    box-shadow: 0 34px 65px -22px #00000045;
  }
  .project-deck > [data-deck-slot='left']:hover {
    transform: translateX(-45%) translateY(2px) rotate(-12deg) scale(0.92);
    z-index: 25;
  }
  .project-deck > [data-deck-slot='right']:hover {
    transform: translateX(45%) translateY(2px) rotate(12deg) scale(0.92);
    z-index: 25;
  }
  .project-deck > .project-card:hover::after {
    opacity: 0;
  }
}

@media (max-width: 760px) {
  .project-grid.project-deck,
  .project-grid.detailed-grid.project-deck {
    --deck-card-width: calc((100% - 16px) / 2);
  }
}

@media (max-width: 520px) {
  .project-grid.project-deck,
  .project-grid.detailed-grid.project-deck {
    --deck-card-width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .project-deck > .project-card,
  .project-deck > .project-card:hover,
  .project-deck > .project-card:focus-within,
  .project-deck > .project-card.is-deck-pressed {
    transform: none;
    z-index: 1;
  }
  .project-deck > .project-card:not([data-deck-slot='center']) {
    visibility: hidden;
    pointer-events: none;
  }
  .project-deck > [data-deck-slot='center'] {
    z-index: 2;
  }
}

@media (max-width: 600px) {
  .project-deck-shell {
    margin-inline: -18px;
    padding-inline: 18px;
  }
}

/* On phones, keep the entire project and its controls compact enough to browse. */
@media (max-width: 600px) {
  .project-grid.project-deck,
  .project-grid.detailed-grid.project-deck {
    --deck-card-width: min(80%, 280px);
  }
  .project-deck-shell {
    padding-top: 20px;
    padding-bottom: 12px;
  }
  .project-deck > .project-card {
    padding: 9px;
  }
  .project-deck .project-preview {
    height: clamp(112px, 34vw, 140px);
    padding: 0;
  }
  .project-deck .project-copy {
    padding: 8px 6px;
  }
  .project-deck .project-card h3 {
    font-size: 18px;
    margin: 5px 0 3px;
  }
  .project-deck .project-card .project-role {
    font-size: 11px;
    margin-bottom: 7px;
  }
  .project-deck .project-card .project-summary {
    font-size: 12px;
    line-height: 1.55;
    margin-bottom: 9px;
  }
  .project-deck .project-card .project-period {
    font-size: 8px;
    line-height: 1.5;
    margin-bottom: 8px;
  }
  .project-deck .project-tools {
    gap: 10px;
    padding-top: 7px;
  }
  .project-deck .project-tools img {
    width: 18px;
    height: 18px;
  }
  .project-deck .project-card-footer {
    min-height: 34px;
    margin-top: 4px;
    padding: 5px;
  }
  .project-deck .project-visit {
    font-size: 9px;
  }
}

/* Match the wide photo to protect the complete Medicare hardware. */
.project-deck .project-preview--photo {
  height: auto;
  aspect-ratio: 16 / 9;
}

/* Desktop keeps every project visible in the supplied three-column format. */
@media (min-width: 900px) {
  .project-deck-shell {
    margin-inline: 0;
    padding: 0;
    overflow: visible;
  }
  .project-grid.project-desktop,
  .project-grid.detailed-grid.project-desktop {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    align-items: stretch;
  }
  .project-desktop > .project-card {
    grid-column: auto;
    min-height: 500px;
    padding: 10px;
    transform: none;
    transition:
      transform 250ms cubic-bezier(0.22, 1, 0.36, 1),
      box-shadow 250ms ease,
      border-color 220ms ease;
  }
  .project-desktop > .project-card:focus-within {
    transform: translateY(-6px) scale(1.015);
  }
  .project-desktop > .project-card.is-deck-pressed {
    transform: translateY(-2px) scale(0.985);
    border-color: var(--accent);
    box-shadow: 0 6px 16px #32756922;
  }
  .project-desktop .project-preview {
    height: auto;
    aspect-ratio: 16 / 9;
  }
  .project-desktop .project-preview--photo .project-image {
    object-position: center;
  }
  .project-desktop .project-copy {
    padding: 18px 8px 14px;
  }
  .project-desktop .project-role {
    font-size: 13px;
  }
  .project-desktop .project-summary {
    font-size: 14px;
    line-height: 1.65;
  }
  .project-desktop .project-period {
    font-size: 10px;
  }
  .project-desktop .project-card-footer {
    margin-top: 10px;
  }
}

@media (min-width: 900px) and (hover: hover) and (pointer: fine) {
  .project-desktop > .project-card:hover {
    transform: translateY(-6px) scale(1.015);
    box-shadow: 0 16px 32px #32756926;
  }
  .project-desktop > .project-card.is-deck-pressed:hover {
    transform: translateY(-2px) scale(0.985);
  }
}

@media (min-width: 900px) and (prefers-reduced-motion: reduce) {
  .project-desktop > .project-card,
  .project-desktop > .project-card:hover,
  .project-desktop > .project-card:focus-within,
  .project-desktop > .project-card.is-deck-pressed {
    transform: none;
    transition: none;
  }
}
