:root {
  color-scheme: dark;
  font-family: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  background: #505a9e;
  color: #fff;
  --corner-space: clamp(.85rem, 2.6vw, 2rem);
  --corner-top: max(var(--corner-space), env(safe-area-inset-top));
  --corner-right: max(var(--corner-space), env(safe-area-inset-right));
  --corner-bottom: max(var(--corner-space), env(safe-area-inset-bottom));
  --corner-left: max(var(--corner-space), env(safe-area-inset-left));
  --name-inset: max(1.5rem, calc(var(--corner-left) + .65rem));
  --corner-font-size: .72rem;
}

* { box-sizing: border-box; }
body { margin: 0; }

.installation {
  --aperture-diameter: min(45vh, 35vw);
  --aperture-diameter: min(45dvh, 35vw);
  --zoom-duration: 1600ms;
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: clip;
}

.room, .atmosphere, .field, .grain {
  position: absolute;
  inset: 0;
}

.atmosphere {
  animation: tint 58s ease-in-out infinite;
}

.field {
  --room-wall: #545ba1;
  --room-shadow: #414d93;
  --room-wash: #9290c0;
  --room-floor: #5678b6;
  --circle-glow: #dd9ac6;
  --circle-light: #ddafd3;
  --circle-center: #e5b7d6;
  --circle-edge: #d7a3cc;
  --wall: var(--room-wall);
  --shadow: var(--room-shadow);
  --wash: var(--room-wash);
  --floor: var(--room-floor);
  --glow: var(--circle-glow);
  --light: var(--circle-light);
  --light-center: var(--circle-center);
  --light-edge: var(--circle-edge);
  background:
    radial-gradient(ellipse at 48% 109%, var(--floor), color-mix(in srgb, var(--floor) 65%, transparent) 27%, transparent 60%),
    radial-gradient(ellipse at 50% 28%, var(--wash), color-mix(in srgb, var(--wash) 66%, var(--wall)) 34%, transparent 72%),
    linear-gradient(170deg, var(--wall), var(--shadow));
}

.atmosphere[data-colors-swapped] .field {
  --wall: var(--circle-light);
  --shadow: var(--circle-edge);
  --wash: var(--circle-center);
  --floor: var(--circle-light);
  --glow: var(--room-wash);
  --light: var(--room-wall);
  --light-center: var(--room-wash);
  --light-edge: var(--room-shadow);
}

.field--monochrome, .field--orange, .field--amber, .field--cobalt {
  opacity: 0;
}

.field--monochrome {
  --room-wall: #292929;
  --room-shadow: #141414;
  --room-wash: #5a5a5a;
  --room-floor: #464646;
  --circle-glow: #aeaeae;
  --circle-light: #dedede;
  --circle-center: #f3f3f3;
  --circle-edge: #d4d4d4;
}

.field--orange {
  --room-wall: #c15f13;
  --room-shadow: #753513;
  --room-wash: #e28b39;
  --room-floor: #bb6a21;
  --circle-glow: #ffb34f;
  --circle-light: #6bb5da;
  --circle-center: #88c7e8;
  --circle-edge: #5099c4;
}

.field--amber {
  --room-wall: #3a342d;
  --room-shadow: #241d1a;
  --room-wash: #504437;
  --room-floor: #62412a;
  --circle-glow: #d3974e;
  --circle-light: #906032;
  --circle-center: #593b42;
  --circle-edge: #ffdd87;
}

.field--cobalt {
  --room-wall: #103f9f;
  --room-shadow: #111959;
  --room-wash: #195bc3;
  --room-floor: #1e75bd;
  --circle-glow: #75b8e2;
  --circle-light: #d8ce78;
  --circle-center: #f1e7aa;
  --circle-edge: #b9a94a;
}

.halo, .aperture, .circle-trigger {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: calc(-50% + var(--circle-offset-x, 0px)) calc(-50% + var(--circle-offset-y, 0px));
  transform: scale(var(--circle-squash-x, 1), var(--circle-squash-y, 1));
}

.aperture, .circle-trigger {
  border-radius: var(--circle-contour, 50%);
  transition: border-radius 210ms ease-out;
}

.zoom-departure .aperture, .zoom-preview .aperture {
  border-radius: 50%;
  transition: none;
}

.circle-trigger {
  width: var(--aperture-diameter);
  min-height: 0;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.circle-trigger:hover { background: transparent; }
.installation[data-circle-dragging] .circle-trigger {
  cursor: grabbing;
  outline: none;
}

.atmosphere.zoom-departure {
  animation: zoom-outgoing var(--zoom-duration) linear both;
}

.zoom-departure :is(.halo, .aperture) {
  animation: zoom-expand var(--zoom-duration) both;
}

.zoom-arrival :is(.halo, .aperture) { visibility: hidden; }

.atmosphere.zoom-preview {
  animation: zoom-preview-fade var(--zoom-duration) ease-out both;
}

.zoom-preview .field { background: none; }

.zoom-preview :is(.halo, .aperture) {
  animation: zoom-appear var(--zoom-duration) both;
}

.zoom-preview .halo {
  animation: zoom-appear var(--zoom-duration) both,
    zoom-halo-fade var(--zoom-duration) ease-out both;
}

@keyframes zoom-expand {
  0% { scale: 1; animation-timing-function: cubic-bezier(.42, 0, .48, 1); }
  68%, 100% { scale: var(--zoom-scale); }
}

@keyframes zoom-outgoing {
  0%, 65% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes zoom-preview-fade {
  from { opacity: 0; }
  38%, 100% { opacity: 1; }
}

@keyframes zoom-halo-fade {
  from { opacity: 0; }
  65%, 100% { opacity: 1; }
}

@keyframes zoom-appear {
  from {
    scale: 0;
    filter: brightness(.78) saturate(1.12);
    animation-timing-function: cubic-bezier(.3, .18, .36, 1);
  }
  to {
    scale: 1;
    filter: none;
  }
}

@keyframes zoom-dissolve {
  from { opacity: 1; }
  to { opacity: 0; }
}

.halo {
  width: calc(var(--aperture-diameter) * 2.25);
  aspect-ratio: 1;
  background: radial-gradient(circle closest-side,
    color-mix(in srgb, var(--glow) 78%, transparent) 0%,
    color-mix(in srgb, var(--glow) 64%, transparent) 27%,
    color-mix(in srgb, var(--glow) 48%, transparent) 42%,
    color-mix(in srgb, var(--glow) 30%, transparent) 53%,
    color-mix(in srgb, var(--glow) 14%, transparent) 64%, transparent 76%);
}

.aperture {
  width: var(--aperture-diameter);
  aspect-ratio: 1;
  background:
    radial-gradient(ellipse at 42% 20%, var(--light-center), transparent 70%),
    linear-gradient(127deg, var(--light-edge), var(--light) 57%, var(--light-edge));
  box-shadow:
    0 0 calc(var(--aperture-diameter) * .17) calc(var(--aperture-diameter) * .055) color-mix(in srgb, var(--glow) 43%, transparent),
    0 0 calc(var(--aperture-diameter) * .38) calc(var(--aperture-diameter) * .11) color-mix(in srgb, var(--glow) 23%, transparent);
}

.field--amber .aperture {
  background: radial-gradient(circle closest-side, var(--light-center), var(--light) 48%, var(--light-edge) 100%);
}

.grain {
  display: none;
}

.room::after {
  position: absolute;
  inset: 0;
  background-image: var(--grain, none);
  background-size: 192px 192px;
  mix-blend-mode: soft-light;
  opacity: .16;
  pointer-events: none;
  content: "";
}

@keyframes tint {
  0%, 100% { filter: hue-rotate(0deg) saturate(1); }
  34% { filter: hue-rotate(6deg) saturate(1.04); }
  68% { filter: hue-rotate(-6deg) saturate(.97); }
}

.controls {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.corner {
  position: absolute;
  pointer-events: auto;
}

.contact {
  --copy-icon-size: 12px;
  top: var(--corner-top);
  left: var(--name-inset);
}

.name {
  margin: 0;
  font-size: var(--corner-font-size);
}

.name, #open-cv {
  font-weight: 400;
  letter-spacing: .035em;
}

#fullscreen, #enable-sound, .linkedin {
  right: var(--corner-right);
  width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
}

#fullscreen {
  top: var(--corner-top);
}

#fullscreen[hidden], #enable-sound[hidden] { display: none; }

#enable-sound {
  right: calc(var(--corner-right) + 44px);
  bottom: var(--corner-bottom);
}

.linkedin {
  bottom: var(--corner-bottom);
  color: inherit;
}

#open-cv {
  bottom: var(--corner-bottom);
  left: calc(var(--name-inset) - .8rem);
}

.cv-toggle-icon {
  display: grid;
  place-items: center;
  width: .9rem;
  height: .9rem;
  font-size: .9rem;
  line-height: 1;
  text-align: center;
}

.cv-toggle-icon::before { display: none; content: "↑"; }
#open-cv[aria-expanded="true"] .cv-toggle-icon::before { content: "×"; }
#open-cv:is([aria-expanded="true"], :hover, :focus-visible) .cv-toggle-icon::before { display: block; }
#open-cv:is([aria-expanded="true"], :hover, :focus-visible) .text-icon { display: none; }

.text-icon {
  position: relative;
  width: 9px;
  height: 11px;
  border: 1px solid currentColor;
  border-radius: 1px;
}

.text-icon::before {
  position: absolute;
  inset: 2px 1px auto;
  height: 1px;
  background: currentColor;
  box-shadow: 0 2px currentColor, 0 4px currentColor;
  content: "";
}

.corner:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 2px;
}

button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: .6rem;
  padding: .55rem .8rem;
  border: 1px solid transparent;
  border-radius: .55rem;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: var(--corner-font-size);
  letter-spacing: .035em;
  cursor: pointer;
}

button[hidden] { display: none; }
button:hover { background: #27235040; }
button:focus-visible { outline: 1px solid currentColor; outline-offset: 2px; }

#open-cv { border: 0; }
#open-cv:hover, #fullscreen:hover, #enable-sound:hover, .linkedin:hover { background: transparent; opacity: .8; }

#copy-email {
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  letter-spacing: inherit;
  vertical-align: top;
}

.contact-label { display: grid; align-items: center; }
.contact-name, .contact-email { grid-area: 1 / 1; justify-self: start; }

.contact-name, .contact-email {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  white-space: nowrap;
}

.contact-email { visibility: hidden; }

.mail-icon {
  position: relative;
  width: 12px;
  height: 9px;
  overflow: hidden;
  border: 1px solid currentColor;
  border-radius: 1px;
}

.mail-icon::before {
  position: absolute;
  top: -5px;
  left: 50%;
  width: 8px;
  height: 8px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: translateX(-50%) rotate(45deg);
  content: "";
}

/* Keep both labels in the same grid cell so the button stays under the pointer. */
#copy-email:is(:hover, :focus-visible) .contact-name,
.contact[data-feedback] .contact-name {
  visibility: hidden;
}

#copy-email:is(:hover, :focus-visible) .contact-email,
.contact[data-feedback] .contact-email {
  visibility: visible;
}

.copy-icon {
  position: relative;
  width: var(--copy-icon-size);
  height: var(--copy-icon-size);
  flex: 0 0 auto;
}

.copy-icon::before,
.copy-icon::after {
  position: absolute;
  width: 7px;
  height: 8px;
  border: 1px solid currentColor;
  border-radius: 1px;
  content: "";
}

.copy-icon::before { inset: 0 0 auto auto; border-left-color: transparent; border-bottom-color: transparent; }
.copy-icon::after { inset: auto auto 0 0; }

.contact[data-feedback="copied"] .copy-icon::before { content: none; }

.contact[data-feedback="copied"] .copy-icon::after {
  inset: 2px auto auto 1px;
  width: 9px;
  height: 5px;
  border-width: 0 0 1px 1px;
  border-radius: 0;
  transform: rotate(-45deg);
}

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

.icon { width: 14px; height: 14px; position: relative; flex-shrink: 0; }
.fullscreen-icon i {
  position: absolute;
  width: 5px;
  height: 5px;
  border: 0 solid currentColor;
}
.fullscreen-icon i:nth-child(1) { top: 0; left: 0; border-width: 1px 0 0 1px; }
.fullscreen-icon i:nth-child(2) { top: 0; right: 0; border-width: 1px 1px 0 0; }
.fullscreen-icon i:nth-child(3) { bottom: 0; left: 0; border-width: 0 0 1px 1px; }
.fullscreen-icon i:nth-child(4) { bottom: 0; right: 0; border-width: 0 1px 1px 0; }
.is-fullscreen .fullscreen-icon i { transform: rotate(180deg); }

.cv {
  --cv-gutter: clamp(1.25rem, 2.8vw, 3rem);
  --cv-top-limit: calc(var(--corner-top) + 3rem);
  --cv-bottom: calc(var(--corner-bottom) + 3.25rem);
  position: fixed;
  inset: auto auto var(--cv-bottom) 0;
  z-index: 1;
  width: calc(100% / 3);
  height: auto;
  max-width: none;
  max-height: calc(100dvh - var(--cv-top-limit) - var(--cv-bottom));
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  overscroll-behavior: contain;
  overflow-y: auto;
}

.cv:focus { outline: none; }

.cv-content {
  position: relative;
  padding: .35rem max(var(--cv-gutter), env(safe-area-inset-right))
    .35rem var(--name-inset);
}

.cv-experience {
  display: grid;
  gap: 1.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.cv h2 {
  margin: 0 0 .2rem;
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.35;
}

.cv p {
  margin: 0;
  font-size: var(--corner-font-size);
  line-height: 1.55;
}

.cv .cv-description { margin-top: .35rem; }

.cv-company a {
  color: inherit;
  text-decoration: none;
}

.cv-company a::after {
  content: "↗";
  content: "↗" / "";
  display: inline-block;
  margin-inline-start: .35em;
  visibility: hidden;
}

.cv-company a:is(:hover, :focus-visible)::after { visibility: visible; }

.cv[open] [data-stream] span {
  animation: reveal-word 95ms ease-out var(--word-delay) both;
}

@keyframes reveal-word {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-aspect-ratio: 1/1) {
  .installation { --aperture-diameter: 48vw; }
}

@media (max-width: 719px) {
  .cv {
    --cv-gutter: 1.5rem;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .installation { --zoom-duration: 180ms; }
  .aperture, .circle-trigger { transition: none; }
  .atmosphere { animation-play-state: paused; }
  .cv[open] [data-stream] span { animation: none; }
  .zoom-arrival :is(.halo, .aperture) { visibility: visible; }
  .zoom-departure :is(.halo, .aperture) { animation: none; }
  .atmosphere.zoom-preview { display: none; }
  .atmosphere.zoom-departure { animation: zoom-dissolve var(--zoom-duration) ease both; }
}
