@font-face {
  font-family: "Fixel Variable";
  src: url("./FixelVariable/FixelVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Fixel Variable";
  src: url("./FixelVariable/FixelVariableItalic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

/* Skip link — visible only on keyboard focus */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 9999;
  padding: 0.5rem 1rem;
  background: #111;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 600;
}

.skip-link:focus {
  top: 1rem;
}

html {
  overflow-x: clip;
}

body {
  --cursor-wand:
    url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI5NiIgaGVpZ2h0PSI5NiI+PGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNjYsLTMwKSBzY2FsZSgtMSwxKSI+PHRleHQgeD0iMCIgeT0iNzgiIGZvbnQtc2l6ZT0iNzgiPvCfqoQ8L3RleHQ+PC9nPjwvc3ZnPg=="),
    auto;
  margin: 0;
  padding: 2vw;
  padding-bottom: 4rem;
  min-height: 100vh;
  font-family:
    "Fixel Variable",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  opacity: 1;
  transition: opacity 0.2s ease;
  overflow-x: hidden;
  font-size: clamp(1.25rem, 0.5rem + 1.5vw, 1.5rem);
  font-weight: 600;
  color: #111;
  position: relative;
}

a {
  color: currentColor;
  text-decoration: underline;
  text-decoration-style: double;
}
.js body {
  opacity: 0;
}

.js body.is-ready {
  opacity: 1;
}

.page-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  max-width: 1440px;
  align-items: flex-start;
}

.primary {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  column-gap: 0.5rem;
  flex: 1 1 300px;
  min-width: 0;
}

.primary > * {
  display: inline-flex;
  max-width: 100%;
  flex-wrap: wrap;
}
.flow-break {
  flex-basis: 100%;
}

.flow-break--gap {
  height: 1em;
}

.flow-trigger {
  transition: all 240ms ease-in-out;
}

.flow-trigger:not(.triggered) {
  color: inherit;
  cursor: var(--cursor-wand);
  user-select: none;
}

.flow-trigger:not(.triggered):hover {
  transform: scale(1.01);
  color: white;
}

.flow-trigger:not(.triggered):active {
  transform: translateY(3px);
}

.flow-line:not(.flow-trigger) {
  user-select: none;
}

.rabbit-trigger {
  display: inline-flex;
}

.char {
  display: inline-block;
  will-change: transform;
}

.exploded {
  opacity: 1;
  pointer-events: none;
}

.assembled {
  opacity: 1;
}

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

.content-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.4em);
}

.assembled .content-trigger {
  cursor: var(--cursor-wand);
}

@supports (-webkit-text-stroke: 3px black) {
  .assembled .content-trigger,
  .flow-trigger:not(.triggered) {
    -webkit-text-fill-color: white;
    -webkit-text-stroke: 1px black;
  }
  .assembled .content-trigger.marker {
    -webkit-text-fill-color: black;
    -webkit-text-stroke: 0;
  }
}

/* Easter egg trigger links — stable styling across browsers */
.confetti,
.rabbit-trigger,
.ripple-trigger,
.prism-trigger,
.fly-trigger,
.float-trigger,
.levitate-trigger,
.sparkle-trigger,
.powerpoint-trigger {
  cursor: var(--cursor-wand);
  color: inherit;
  text-decoration: none;
}

.assembled .confetti,
.assembled .rabbit-trigger,
.assembled .ripple-trigger,
.assembled .prism-trigger,
.assembled .fly-trigger,
.assembled .float-trigger,
.assembled .levitate-trigger,
.assembled .sparkle-trigger,
.assembled .powerpoint-trigger,
.content-panel .confetti,
.content-panel .rabbit-trigger,
.content-panel .ripple-trigger,
.content-panel .prism-trigger,
.content-panel .fly-trigger,
.content-panel .float-trigger,
.content-panel .levitate-trigger,
.content-panel .sparkle-trigger,
.content-panel .powerpoint-trigger {
  color: #ff4fe2;
  text-decoration: underline;
  text-decoration-style: solid;
  text-decoration-color: currentColor;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  animation: trigger-hue-dance 3s linear infinite;
}

.assembled .rabbit-trigger,
.content-panel .rabbit-trigger {
  animation-delay: 0s;
}
.assembled .ripple-trigger,
.content-panel .ripple-trigger {
  animation-delay: -1s;
}
.assembled .prism-trigger,
.content-panel .prism-trigger {
  animation-delay: -2s;
}
.assembled .confetti,
.content-panel .confetti {
  animation-delay: -0.5s;
}
.assembled .fly-trigger,
.content-panel .fly-trigger {
  animation-delay: -1.5s;
}
.assembled .float-trigger,
.content-panel .float-trigger {
  animation-delay: -2.5s;
}
.assembled .levitate-trigger,
.content-panel .levitate-trigger {
  animation-delay: -2.2s;
}
.assembled .sparkle-trigger,
.content-panel .sparkle-trigger {
  animation-delay: -0.8s;
}
.assembled .powerpoint-trigger,
.content-panel .powerpoint-trigger {
  animation-delay: -1.7s;
}

.confetti:hover,
.rabbit-trigger:hover,
.ripple-trigger:hover,
.prism-trigger:hover,
.fly-trigger:hover,
.float-trigger:hover,
.levitate-trigger:hover,
.sparkle-trigger:hover,
.powerpoint-trigger:hover {
  text-decoration-style: wavy;
  animation-play-state: paused;
}

@keyframes trigger-hue-dance {
  0% {
    color: #ff4fe2;
  }
  25% {
    color: #ffb300;
  }
  50% {
    color: #00d4ff;
  }
  75% {
    color: #7cff4f;
  }
  100% {
    color: #ff4fe2;
  }
}

@media (prefers-reduced-motion: reduce) {
  .assembled .confetti,
  .assembled .rabbit-trigger,
  .assembled .ripple-trigger,
  .assembled .prism-trigger,
  .assembled .fly-trigger,
  .assembled .float-trigger,
  .assembled .levitate-trigger,
  .assembled .sparkle-trigger,
  .content-panel .confetti,
  .content-panel .rabbit-trigger,
  .content-panel .ripple-trigger,
  .content-panel .prism-trigger,
  .content-panel .fly-trigger,
  .content-panel .float-trigger,
  .content-panel .levitate-trigger,
  .content-panel .sparkle-trigger {
    animation: none;
    color: #ff4fe2;
  }
}

.content-panel {
  display: none;
  flex-direction: column;
  backdrop-filter: blur(20px);
  position: relative;
  border-radius: 10px;
  font-size: clamp(1rem, 0.55rem + 0.6vw, 1.2rem);
  font-weight: 500;
  line-height: 1.5;
}

.content-panel.is-visible {
  display: flex;
}

/* Override flex to block so float/shape-outside works for the portrait cutout */
.content-panel[data-content="anna-meister"].is-visible,
.content-panel[data-content="keynote"].is-visible {
  display: block;
}

.anna-portrait-cutout {
  float: right;
  width: 40%;
  height: auto;
  shape-outside: url(Anna_457.png);
  shape-margin: 1rem;
  margin: 0 0 0.5rem 1rem;
}

.magic-impact-portrait {
  float: right;
  width: 40%;
  height: auto;
  margin: 0 0 0.5rem 1rem;
}

.content-panel p {
  padding: 0;
  margin: 0 0 0.75em 0;
}

.content-panel p:last-child {
  margin-bottom: 0;
}

.secondary {
  flex: 1 1 300px;
  min-width: 0;
}

.content-trigger {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  cursor: pointer;
  align-self: flex-start;
  background-color: transparent;
  border: none;
  font-size: inherit;
  font-weight: 500;
  padding: 0;
  margin: 0;
}

@media (max-width: 1024px) {
  .primary,
  .secondary {
    flex-basis: 100%;
  }
}

.quick-contact {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  border-top: 1px dashed;
  text-align: left;
  background-color: white;
  z-index: 999;
  padding: 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: #111;
}

/* Focus styles for keyboard navigation */
:focus-visible {
  outline: 2px solid #111;
  outline-offset: 2px;
  border-radius: 2px;
}

.marker:focus-visible::before {
  clip-path: inset(0);
}

.flow-trigger:focus-visible {
  outline-offset: 4px;
}

.confetti:focus-visible,
.rabbit-trigger:focus-visible,
.ripple-trigger:focus-visible,
.prism-trigger:focus-visible,
.fly-trigger:focus-visible,
.levitate-trigger:focus-visible,
.sparkle-trigger:focus-visible {
  outline-color: currentColor;
  outline-offset: 3px;
}

/* Content panel headings */
.content-panel h2 {
  font-size: 1.15em;
  font-weight: 700;
  margin: 0 0 0.75rem 0;
}

/* Marker highlight — hand-drawn brush stroke behind text */
.marker {
  --marker-color: #fbff12;
  position: relative;
  margin: -2px -6px;
  padding: 2px 6px;
}

.marker::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-color: var(--marker-color);
  -webkit-mask-image: url("./brushes/brush-9.svg");
  mask-image: url("./brushes/brush-9.svg");
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  clip-path: inset(0 100% 0 0);
  transition: clip-path 0.3s ease;
}

.assembled .marker::before {
  clip-path: inset(0);
}

.marker--yellow {
  --marker-color: #fbff12;
}
.marker--pink {
  --marker-color: #ff206e;
}
.marker--green {
  --marker-color: #ccff33;
}
.marker--orange {
  --marker-color: #ff8210;
}

/* Interactive marker triggers — three-state decoration.
   Default: marker visible as invitation.
   Hover:   marker hides, wavy underline in the marker's own color.
   Active:  marker and underline gone (plain text).
   Active = .flow-trigger.triggered (one-shot) or
            .content-trigger[aria-expanded="true"] (while panel is open). */

/* Flow-trigger is visible before assembly, so its marker needs an explicit default. */
.flow-trigger .marker::before {
  clip-path: inset(0);
}

/* Hover on an inactive interactive marker: hide brush, show wavy underline. */
.flow-trigger:not(.triggered) .marker:hover::before,
.flow-trigger:not(.triggered):hover .marker::before,
.content-trigger.marker[aria-expanded="false"]:hover::before {
  clip-path: inset(0 100% 0 0);
}

.flow-trigger:not(.triggered):hover .marker,
.content-trigger.marker[aria-expanded="false"]:hover {
  text-decoration: underline wavy var(--marker-color);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

/* Active state: marker and underline gone. */
.flow-trigger.triggered .marker::before,
.content-trigger.marker[aria-expanded="true"]::before {
  clip-path: inset(0 100% 0 0);
  transition: none;
}

.flow-trigger.triggered .marker,
.content-trigger.marker[aria-expanded="true"] {
  text-decoration: none;
}

/* Tap feedback for interactive elements */
.assembled .content-trigger:active,
.confetti:active,
.rabbit-trigger:active,
.ripple-trigger:active,
.prism-trigger:active,
.fly-trigger:active,
.levitate-trigger:active,
.sparkle-trigger:active {
  opacity: 0.7;
  transform: scale(0.97);
}

/* Mobile hint — hidden by default, shown on touch devices after 5s */
.mobile-hint {
  display: none;
}

@media (hover: none) {
  .flow-trigger:not(.triggered) {
    animation: pulse-hint 2s ease-in-out infinite;
  }

  .mobile-hint {
    display: block;
    font-size: 0.85rem;
    font-weight: 400;
    opacity: 0;
    animation: fade-in-hint 0.5s ease 5s forwards;
  }

  .triggered .mobile-hint {
    display: none;
  }
}

@keyframes pulse-hint {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.04);
  }
}

@keyframes fade-in-hint {
  to {
    opacity: 1;
  }
}

/* Mobile bottom-sheet for content panels */
@media (max-width: 1024px) {
  .page-grid.panel-open .primary {
    opacity: 0.3;
    transition: opacity 0.35s ease;
    pointer-events: none;
  }

  .primary {
    transition: opacity 0.35s ease;
  }

  .secondary {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0;
    max-height: 80vh;
    max-height: 80dvh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.35s ease;
    background: white;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
  }

  .secondary.has-visible-panel {
    transform: translateY(0);
  }

  .content-panel {
    padding: 1.5rem;
  }

  .anna-portrait-cutout {
    float: none;
    width: 60%;
    display: block;
    margin: 0 auto 1rem auto;
    shape-outside: none;
  }

  /* Drag handle indicator */
  .secondary::before {
    content: "";
    display: block;
    width: 40px;
    height: 4px;
    background: #ccc;
    border-radius: 2px;
    margin: 0.75rem auto;
    flex-shrink: 0;
  }
}

/* Close button — only visible on mobile bottom-sheet */
.panel-close {
  display: none;
}

@media (max-width: 1024px) {
  .panel-close {
    display: block;
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #111;
    z-index: 1;
  }
}

/* Anna portrait — slides in from left viewport edge on hover */
.anna-hover-portrait {
  position: fixed;
  left: 0;
  bottom: 0;
  max-height: 50vh;
  width: auto;
  z-index: -1;
  pointer-events: none;
  transform: translateX(-100%);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.anna-hover-portrait.is-visible {
  transform: translateX(0);
}

/* Rabbit hop animation — emoji hops across the viewport on click */
.rabbit-runner {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1000;
  pointer-events: none;
  will-change: transform;
}

.rabbit-sprite {
  font-size: 2.5rem;
  display: inline-block;
  animation: rabbit-hop 350ms ease-in-out infinite;
}

@keyframes rabbit-hop {
  0% {
    transform: translateY(0) scaleX(1) scaleY(1);
  }
  25% {
    transform: translateY(-0.6em) scaleX(0.9) scaleY(1.1);
  }
  50% {
    transform: translateY(-1em) scaleX(0.95) scaleY(1.05);
  }
  75% {
    transform: translateY(-0.4em) scaleX(1.05) scaleY(0.95);
  }
  100% {
    transform: translateY(0) scaleX(1.1) scaleY(0.9);
  }
}

/* Fly flight — a 🪰 sprite that darts around the viewport */
.fly-runner {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1000;
  pointer-events: none;
  will-change: transform;
}

.fly-sprite {
  font-size: 2rem;
  display: inline-block;
  animation: fly-buzz 80ms ease-in-out infinite alternate;
  transform-origin: center;
}

@keyframes fly-buzz {
  from {
    transform: translateY(0) rotate(-3deg);
  }
  to {
    transform: translateY(-1px) rotate(3deg);
  }
}

/* Water ripple — concentric circles emanate from the clicked word */
.ripple-container {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.ripple-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  border: 2px solid currentColor;
  transform: translate(-50%, -50%);
  opacity: 0;
  animation: ripple-expand 1800ms ease-out forwards;
}

@keyframes ripple-expand {
  0% {
    width: 0;
    height: 0;
    opacity: 0.6;
    border-width: 2px;
  }
  100% {
    width: 600px;
    height: 600px;
    opacity: 0;
    border-width: 1px;
  }
}

/* Prismatic kaleidoscope — flow-lines during active effect */
.flow-line.prism-active {
  will-change: transform, text-shadow;
}

@media (prefers-reduced-motion: reduce) {
  .ripple-ring {
    animation: none;
  }
}

/* Screen-wide sparkles — spawned on click of .sparkle-trigger */
.sparkle-field {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

.sparkle-field .sparkle {
  position: absolute;
  display: block;
  line-height: 1;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0) rotate(0deg);
  animation: sparkle-twinkle 1.6s ease-in-out forwards;
  will-change: transform, opacity;
}

@keyframes sparkle-twinkle {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0) rotate(0deg);
  }
  25% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(90deg);
  }
  60% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1) rotate(180deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.4) rotate(270deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sparkle-field .sparkle {
    animation: none;
    opacity: 0;
  }
}

.powerpoint-joke {
  position: fixed;
  left: 2.5vw;
  bottom: 2.5vh;
  z-index: 9999;
  pointer-events: none;
  animation: powerpoint-fade 5000ms ease both;
}

.powerpoint-joke img {
  width: 50vw;
  max-height: 50vh;
  height: auto;
  object-fit: contain;
  display: block;
  transform: rotate(-2.5deg);
  transform-origin: bottom left;
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.35),
    0 8px 20px rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

@keyframes powerpoint-fade {
  0%   { opacity: 0; }
  6%   { opacity: 1; }
  92%  { opacity: 1; }
  100% { opacity: 0; }
}
