@font-face {
  font-family: "Ubuntu Mono";
  src: url("assets/fonts/UbuntuMono-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Ubuntu Mono";
  src: url("assets/fonts/UbuntuMono-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #ffacc5;
  --panel: #fff1e8;
  --ink: #111111;
  --ink-soft: rgba(17, 17, 17, 0.72);
  --shadow: rgba(17, 17, 17, 0.14);
  --outline-width: 4px;
  --tail-seam-overlap: 4px;
  --tail-join-offset: 3px;
  --background-tile-width: 104px;
  --background-tile-height: 160px;
  --background-drift-x: 52px;
  --background-drift-y: 80px;
  --panel-open-height: 28rem;
  --panel-content-height: 28rem;
  --panel-tail-height: 2.85rem;
  --panel-shift-x: 0px;
  --panel-shift-y: 0px;
  --tab-tail-height: 1.8rem;
  --tail-offset: 50%;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html.no-js-page {
  overflow-y: auto;
}

body {
  margin: 0;
  height: 100svh;
  min-height: 100svh;
  font-family: "Ubuntu Mono", monospace;
  color: var(--ink);
  background: var(--bg);
  overflow: hidden;
}

.background-pattern {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.background-pattern__layer {
  position: absolute;
  inset: -12rem;
  background-image: url("assets/fluer-transparent-104x160.png");
  background-position: 0 0;
  background-repeat: repeat;
  background-size: var(--background-tile-width) var(--background-tile-height);
  animation: background-glide 10s linear infinite;
  will-change: transform;
}

@keyframes background-glide {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(var(--background-drift-x), var(--background-drift-y), 0);
  }
}

button,
a {
  font: inherit;
}

.page-shell {
  position: relative;
  height: 100svh;
  display: flex;
  justify-content: center;
  overflow: hidden;
}

.portfolio {
  width: min(100%, 48rem);
  height: 100svh;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: clamp(1rem, 3vw, 2rem) clamp(1rem, 4vw, 2.5rem) 0;
  position: relative;
  overflow: hidden;
}

.logo-slot {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 0;
  padding-top: clamp(0.5rem, 3vw, 1.75rem);
  max-height: 14rem;
  overflow: hidden;
  transition:
    flex-basis 260ms ease,
    opacity 260ms ease,
    transform 260ms ease,
    height 260ms ease,
    max-height 260ms ease,
    padding-top 260ms ease;
}

.logo-slot__image {
  flex: 0 0 auto;
  align-self: flex-start;
  width: calc(100% - clamp(0rem, 1.5vw, 0.75rem));
  max-width: 100%;
  max-height: 100%;
  height: auto;
  display: block;
  margin-inline: auto;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.panel-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: visible;
}

.message-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  border: var(--outline-width) solid var(--ink);
  border-radius: 1.45rem 1.45rem 1.15rem 1.45rem;
  background: var(--panel);
  box-shadow: 0 1rem 2rem var(--shadow);
  padding: clamp(1rem, 3vw, 1.4rem);
  opacity: 0;
  translate: var(--panel-shift-x) var(--panel-shift-y);
  transform: scale(0.22);
  transform-origin: var(--tail-offset) calc(100% + var(--panel-tail-height));
  transition: opacity 260ms ease, transform 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
  isolation: isolate;
}

.message-panel__tail {
  position: absolute;
  left: 0;
  bottom: calc(-1 * var(--panel-tail-height));
  width: 100%;
  height: calc(var(--panel-tail-height) + var(--tail-seam-overlap));
  overflow: visible;
  pointer-events: none;
}

.message-panel__tail-fill {
  fill: var(--panel);
}

.message-panel__tail-line {
  fill: none;
  stroke: var(--ink);
  stroke-width: var(--outline-width);
  stroke-linecap: round;
  stroke-linejoin: round;
}

.message-panel__header {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.message-panel__eyebrow {
  margin: 0;
  text-transform: lowercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

.message-panel__title {
  margin: 0;
  width: 100%;
  font-size: clamp(1.4rem, 4vw, 1.8rem);
  text-align: right;
}

.message-panel__body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 0.3rem;
  line-height: 1.5;
}

.message-panel__body > :first-child {
  margin-top: 0;
}

.message-panel__body > :last-child {
  margin-bottom: 0;
}

.message-panel__body h1,
.message-panel__body h2,
.message-panel__body h3 {
  margin-top: 1.15rem;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.message-panel__body p,
.message-panel__body ul,
.message-panel__body ol,
.message-panel__body blockquote {
  margin: 0 0 0.9rem;
}

.message-panel__body ul,
.message-panel__body ol {
  padding-left: 1.25rem;
}

.message-panel__body a {
  color: inherit;
  text-decoration-thickness: 0.12em;
}

.message-panel__body img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 1rem 0;
  border: 2px solid var(--ink);
  border-radius: 0.9rem;
}

.message-panel__body a[data-expand-image] {
  display: block;
  cursor: zoom-in;
}

.message-panel__body a[data-expand-image] img {
  cursor: zoom-in;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 2rem);
}

.image-lightbox[hidden] {
  display: none;
}

.image-lightbox__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(17, 17, 17, 0.78);
  cursor: zoom-out;
}

.image-lightbox__dialog {
  position: relative;
  z-index: 1;
  width: calc(100vw - 2rem);
  max-height: calc(100svh - 2rem);
  display: grid;
  gap: 0.75rem;
  justify-items: end;
}

.image-lightbox__close {
  border: var(--outline-width) solid var(--ink);
  border-radius: 999px;
  background: var(--panel);
  color: inherit;
  font: inherit;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
  box-shadow: 0 0.7rem 1.2rem var(--shadow);
}

.image-lightbox__image {
  display: block;
  width: auto;
  max-width: calc(100vw - 2rem);
  max-height: calc(100svh - 5rem);
  height: auto;
  border: var(--outline-width) solid var(--ink);
  border-radius: 1rem;
  background: var(--panel);
  box-shadow: 0 1.1rem 2rem rgba(17, 17, 17, 0.3);
  cursor: zoom-out;
}

body[data-lightbox-open="true"] {
  overflow: hidden;
}

body.no-js-page {
  min-height: 100svh;
  overflow-x: hidden;
  overflow-y: auto;
}

.no-js-page__shell {
  min-height: 100svh;
  height: auto;
  padding: clamp(1rem, 3vw, 2rem) 0;
  overflow: visible;
}

.no-js-page__layout {
  height: auto;
  min-height: calc(100svh - clamp(2rem, 6vw, 4rem));
  gap: clamp(0.8rem, 2vw, 1.4rem);
  overflow: visible;
}

.no-js-page__logo {
  flex: 0 0 auto;
  height: auto;
  max-height: none;
  opacity: 1;
  transform: none;
  padding-top: clamp(0.25rem, 2vw, 1rem);
}

.no-js-page__content {
  flex: 0 0 auto;
  min-height: auto;
  border: var(--outline-width) solid var(--ink);
  border-radius: 1.45rem;
  background: var(--panel);
  box-shadow: 0 1rem 2rem var(--shadow);
  padding: clamp(1rem, 3vw, 1.5rem);
  overflow: visible;
}

.no-js-page__content img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 1rem 0;
  border: 2px solid var(--ink);
  border-radius: 0.9rem;
}

.no-js-page__content a img {
  cursor: default;
}

.no-js-page__section + .no-js-page__section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid rgba(17, 17, 17, 0.14);
}

.no-js-page__section h2 {
  margin: 0 0 0.9rem;
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  text-align: right;
}

.no-js-page__content > :first-child,
.no-js-page__section > :first-child {
  margin-top: 0;
}

.no-js-page__content > :last-child,
.no-js-page__section > :last-child {
  margin-bottom: 0;
}

.no-js-page__character {
  flex: 0 0 auto;
}

.message-panel__body code {
  background: rgba(17, 17, 17, 0.08);
  padding: 0.08rem 0.2rem;
  border-radius: 0.25rem;
}

.message-panel__body::-webkit-scrollbar {
  width: 0.65rem;
}

.message-panel__body::-webkit-scrollbar-thumb {
  background: rgba(17, 17, 17, 0.35);
  border-radius: 999px;
}

.tab-row {
  flex: 0 0 auto;
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.45rem, 2vw, 0.9rem);
  align-items: end;
}

.tab {
  position: relative;
  height: 5.3rem;
  border: var(--outline-width) solid var(--ink);
  border-radius: 1rem 1rem 0.8rem 1rem;
  background: var(--panel);
  color: inherit;
  cursor: pointer;
  padding: 0.75rem 0.65rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.1;
  box-shadow: 0 0.7rem 1.2rem var(--shadow);
  transform-origin: var(--tab-tail-offset, 50%) calc(100% + var(--tab-tail-height));
  transition:
    transform 240ms ease,
    opacity 220ms ease,
    height 260ms ease,
    padding 260ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease,
    filter 220ms ease;
  isolation: isolate;
}

.tab__tail {
  position: absolute;
  left: 0;
  bottom: calc(-1 * var(--tab-tail-height));
  width: 100%;
  height: calc(var(--tab-tail-height) + var(--tail-seam-overlap));
  overflow: visible;
  pointer-events: none;
  transition: opacity 180ms ease, transform 240ms ease;
}

.tab__tail-fill {
  fill: var(--panel);
  transition: opacity 180ms ease, transform 240ms ease;
}

.tab__tail-line {
  fill: none;
  stroke: var(--ink);
  stroke-width: var(--outline-width);
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: opacity 180ms ease, transform 240ms ease;
}

.tab__label {
  font-size: clamp(0.9rem, 2.7vw, 1.15rem);
  transition: opacity 180ms ease, transform 240ms ease, font-size 220ms ease;
}

.character-slot {
  flex: 0 0 auto;
  width: min(100%, 26rem);
  height: clamp(8.5rem, 21svh, 12rem);
  margin: 0 auto;
  overflow: hidden;
}

.character-slot__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.portfolio[data-state="active"] {
  gap: clamp(0.45rem, 1.6vw, 0.75rem);
  padding-top: clamp(0.45rem, 1.6vw, 0.9rem);
}

.portfolio[data-state="active"] .logo-slot {
  flex: 0 0 0;
  height: 0;
  opacity: 0;
  transform: translateY(-0.75rem) scale(0.96);
  max-height: 0;
  padding-top: 0;
  pointer-events: none;
}

.portfolio[data-state="active"] .message-panel {
  height: min(var(--panel-content-height), var(--panel-open-height));
  max-height: var(--panel-open-height);
}

.portfolio[data-panel="open"] .message-panel {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.portfolio[data-state="active"] .tab[data-active="true"] {
  height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  transform: scale(0.18);
  border-color: transparent;
  box-shadow: none;
  pointer-events: none;
}

.portfolio[data-state="active"] .tab[data-active="true"] .tab__tail,
.portfolio[data-state="active"] .tab[data-active="true"] .tab__tail-fill,
.portfolio[data-state="active"] .tab[data-active="true"] .tab__tail-line {
  opacity: 0;
}

.portfolio[data-state="active"] .tab[data-active="true"] .tab__label {
  opacity: 0;
  transform: scale(0.7);
}

.portfolio[data-state="active"] .tab[data-compact="true"] {
  height: 4.4rem;
  transform: scale(0.9);
  filter: saturate(0.85);
}

.portfolio[data-state="active"] .tab[data-compact="true"] .tab__label {
  font-size: clamp(0.8rem, 2.3vw, 0.95rem);
}

.portfolio[data-state="active"][data-panel="closed"] .tab[data-pending="true"] {
  transform: scale(1.03);
  filter: none;
}

.tab:focus-visible,
.message-panel__body:focus-visible,
.message-panel__body a:focus-visible,
.image-lightbox__close:focus-visible {
  outline: 3px solid rgba(17, 17, 17, 0.22);
  outline-offset: 3px;
}

@media (max-width: 40rem) {
  .portfolio {
    width: 100%;
  }

  .message-panel__body {
    min-height: 0;
  }

  .tab {
    padding-inline: 0.45rem;
  }

  .no-js-page__shell {
    padding-block: 0.75rem;
  }

  .no-js-page__layout {
    min-height: calc(100svh - 1.5rem);
  }
}

@media (orientation: landscape) and (max-height: 34rem) {
  .portfolio {
    gap: clamp(0.4rem, 1.7svh, 0.75rem);
    padding: clamp(0.5rem, 1.7svh, 0.9rem) clamp(0.75rem, 2.4vw, 1.25rem) 0;
  }

  .logo-slot {
    padding-top: clamp(0.2rem, 0.9svh, 0.55rem);
    max-height: clamp(3.25rem, 15svh, 5rem);
  }

  .logo-slot__image {
    width: auto;
  }

  .message-panel {
    padding: clamp(0.75rem, 2.1svh, 1rem);
  }

  .message-panel__header {
    gap: 0.5rem;
    margin-bottom: 0.55rem;
  }

  .message-panel__eyebrow {
    font-size: clamp(0.72rem, 2.4svh, 0.85rem);
  }

  .message-panel__title {
    font-size: clamp(1.05rem, 3.8svh, 1.35rem);
  }

  .message-panel__body {
    font-size: clamp(0.78rem, 2.2svh, 0.9rem);
    line-height: 1.32;
  }

  .message-panel__body h1,
  .message-panel__body h2,
  .message-panel__body h3 {
    margin-top: 0.8rem;
    margin-bottom: 0.35rem;
    font-size: 1em;
    line-height: 1.15;
  }

  .message-panel__body p,
  .message-panel__body ul,
  .message-panel__body ol,
  .message-panel__body blockquote {
    margin-bottom: 0.55rem;
  }

  .message-panel__body ul,
  .message-panel__body ol {
    padding-left: 1rem;
  }

  .message-panel__body img {
    margin-block: 0.7rem;
  }

  .tab-row {
    gap: clamp(0.3rem, 1.4svh, 0.5rem);
  }

  .tab {
    height: clamp(3.15rem, 13svh, 4.1rem);
    padding: 0.45rem 0.4rem 0.75rem;
  }

  .tab__label {
    font-size: clamp(0.72rem, 2.9svh, 0.95rem);
  }

  .character-slot {
    width: min(100%, 18rem);
    height: clamp(4.75rem, 19svh, 6.75rem);
  }

  .portfolio[data-state="active"] {
    gap: clamp(0.3rem, 1.15svh, 0.55rem);
    padding-top: clamp(0.2rem, 0.9svh, 0.5rem);
  }

  .portfolio[data-state="active"] .tab[data-compact="true"] {
    height: clamp(2.85rem, 11svh, 3.55rem);
    transform: scale(0.94);
  }

  .portfolio[data-state="active"] .tab[data-compact="true"] .tab__label {
    font-size: clamp(0.68rem, 2.35svh, 0.85rem);
  }
}

@media (orientation: landscape) and (max-height: 28rem) {
  .message-panel__title {
    font-size: clamp(0.95rem, 3.3svh, 1.15rem);
  }

  .message-panel__body {
    font-size: clamp(0.74rem, 1.95svh, 0.84rem);
    line-height: 1.26;
  }

  .message-panel__body p,
  .message-panel__body ul,
  .message-panel__body ol,
  .message-panel__body blockquote {
    margin-bottom: 0.45rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .background-pattern__layer,
  .logo-slot,
  .message-panel,
  .tab {
    animation: none;
    transition-duration: 1ms;
  }
}
