@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url(vendor/fonts/jetbrains-mono-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url(vendor/fonts/jetbrains-mono-latin-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url(vendor/fonts/jetbrains-mono-vietnamese-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB;
}

@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url(vendor/fonts/source-serif-4-latin-opsz-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url(vendor/fonts/source-serif-4-latin-ext-opsz-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url(vendor/fonts/source-serif-4-vietnamese-opsz-normal.woff2) format('woff2-variations');
  unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB;
}

/* These two cannot be the same value. overflow-x:hidden makes an element a
   scroll container; harmless on <html>, whose overflow propagates to the
   viewport, but on <body> it puts a scrollport between the sticky window
   chrome and the viewport, and the chrome stops sticking. `clip` clips
   without ever creating one. Do not collapse these into one rule. */
html {
  overflow-x: hidden;
}

body {
  overflow-x: clip;
}

:root {
  --bg: #1c1917;
  --panel: #242020;
  --panel-border: #3a322d;
  --text: #efe8e8;
  --text-dim: #a89f9a;
  --accent: #dc8100;
  --mascot-ink: #1c1917;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --font-serif: "Source Serif 4", Georgia, serif;
}

body[data-mode="light"] {
  --bg: #f6f1ea;
  --panel: #ffffff;
  --panel-border: #e6ddd1;
  --text: #241f1d;
  --text-dim: #6b625c;
  --accent: #b56800;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.6;
  transition: background 0.2s ease, color 0.2s ease;
  min-height: 100vh;
}

.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.025) 0px,
    rgba(255, 255, 255, 0.025) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
}

.topbar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: clamp(720px, 86vw, 1320px);
  margin: 0 auto;
  padding: 24px 24px 0;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-dim);
}

.prompt-sep {
  color: var(--accent);
}

.theme-icon-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

main {
  position: relative;
  z-index: 1;
  max-width: clamp(720px, 86vw, 1320px);
  margin: 0 auto;
  padding: 40px 24px 80px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 34px;
  align-items: start;
}

main > * {
  grid-column: 1 / -1;
  min-width: 0;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--accent);
  margin: 0 0 10px;
}

h1 {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(32px, 6vw, 46px);
  line-height: 1.15;
  margin: 0 0 20px;
  letter-spacing: -0.01em;
}

.cursor {
  display: inline-block;
  width: 0.5em;
  height: 0.85em;
  margin-left: 6px;
  background: var(--accent);
  vertical-align: -0.1em;
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.hero article {
  max-width: 640px;
}

.hero article p {
  margin: 0 0 14px;
  color: var(--text);
}

.hero article a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.signoff {
  color: var(--text-dim);
  font-style: italic;
}

.hero-footnote {
  margin: 4px 0 14px;
  font-size: 13px;
  color: var(--text-dim);
  font-style: italic;
}

.blog-click-wrap {
  display: inline-block;
}

.chip-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 22px 0 24px;
}

.crumbs {
  display: block;
  margin-bottom: 18px;
}

.status-strip {
  display: block;
  padding: 16px 20px;
  margin: 0;
}

.status-strip-title {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
}

.status-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
}

.status-list li {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.status-label {
  flex: 0 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.status-leader {
  flex: 1 1 auto;
  min-width: 0;
  border-bottom: 1px dotted var(--panel-border);
}

.status-value {
  flex: 0 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: right;
  color: var(--text-dim);
  font-style: italic;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  align-self: center;
}

.status-dot-green {
  background: #4fd1a5;
  box-shadow: 0 0 6px rgba(79, 209, 165, 0.6);
}

.status-dot-yellow {
  background: #febc2e;
  box-shadow: 0 0 6px rgba(254, 188, 46, 0.6);
}

.status-dot-red {
  background: #ff5f57;
  box-shadow: 0 0 6px rgba(255, 95, 87, 0.6);
}

@media (max-width: 430px) {
  .status-list {
    font-size: 12px;
  }
}

.status-strip .status-dot {
  animation: status-pulse 2.6s ease-in-out infinite;
}

.status-strip .status-dot-red {
  animation-duration: 1s;
}

@keyframes status-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.45;
    transform: scale(0.8);
  }
}

.status-strip .status-list li {
  cursor: pointer;
  border-radius: 6px;
  padding: 2px 6px;
  margin: 0 -6px;
  transition: background 0.15s ease;
}

.status-strip .status-list li:hover,
.status-strip .status-list li:focus-visible {
  background: color-mix(in srgb, var(--text) 7%, transparent);
}

.status-strip.status-armed .status-list li {
  opacity: 0;
  transform: translateX(-8px);
}

.status-strip.is-live .status-list li {
  animation: status-row-in 0.42s ease forwards;
}

.status-strip.is-live .status-list li:nth-child(1) {
  animation-delay: 0.02s;
}
.status-strip.is-live .status-list li:nth-child(2) {
  animation-delay: 0.12s;
}
.status-strip.is-live .status-list li:nth-child(3) {
  animation-delay: 0.22s;
}
.status-strip.is-live .status-list li:nth-child(4) {
  animation-delay: 0.32s;
}
.status-strip.is-live .status-list li:nth-child(5) {
  animation-delay: 0.42s;
}

@keyframes status-row-in {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .status-strip .status-dot {
    animation: none;
  }
  .status-strip.status-armed .status-list li {
    opacity: 1;
    transform: none;
  }
  .status-strip.is-live .status-list li {
    animation: none;
  }
}

.blog-preview {
  margin-top: 0;
  padding: 16px 18px;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: var(--panel);
}

.blog-preview-label {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
}

.skeleton-lines {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.blog-preview-caption {
  margin: 12px 0 0;
  font-family: var(--font-mono);
  font-size: 12px;
  font-style: italic;
  color: var(--text-dim);
}

.cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 12px;
}

jelly-divider {
  display: block;
  margin: 40px 0;
}

jelly-card {
  display: block;
}

jelly-input,
jelly-textarea {
  display: block;
  width: 100% !important;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0;
}

jelly-button {
  max-width: 100%;
  margin: 0;
}

@media (max-width: 560px) {
  jelly-button {
    display: block;
    width: 100% !important;
  }

  jelly-button::part(button) {
    width: 100%;
  }

  .blog-click-wrap {
    display: block;
    width: 100%;
  }
}

section > .eyebrow {
  margin-top: 0;
}

.countdown-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px;
}

.countdown-schedule {
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px dashed var(--panel-border);
}

.build-status-card {
  display: flex;
  flex-direction: column;
  padding: 24px;
}

.build-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.build-log {
  min-height: 123px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 3px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-dim);
}

.build-log-line {
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  animation: build-log-in 0.22s ease;
}

.build-log-line.is-ok {
  color: #4fd1a5;
}

.build-log-line.is-warn {
  color: var(--accent);
}

@keyframes build-log-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .build-log-line {
    animation: none;
  }
}

.build-figures {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  padding-top: 12px;
  border-top: 1px dashed var(--panel-border);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.build-figures b {
  color: var(--text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

#build-progress {
  width: 100%;
}

.build-status-caption {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
  font-style: italic;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  text-align: center;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat .num {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(22px, 5vw, 32px);
}

.stat .label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.progress-row {
  margin-top: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-row .year-progress {
  flex: 1;
}

.year-progress {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  height: 10px;
  border: none;
  border-radius: 999px;
  background: var(--panel-border);
  overflow: hidden;
}

.year-progress::-webkit-progress-bar {
  background: var(--panel-border);
  border-radius: 999px;
}

.year-progress::-webkit-progress-value {
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.year-progress::-moz-progress-bar {
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.progress-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
}

jelly-alert {
  display: block;
  margin-bottom: 20px;
}

.cert-shelf {
  display: block;
  padding: 28px 20px;
}

.cert-grid {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  justify-content: center;
}

.cert-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.cert-frame {
  background: #ffffff;
  padding: 16px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(220, 129, 0, 0.35);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.35));
  transition: transform 0.15s ease;
  line-height: 0;
}

.cert-item:hover .cert-frame {
  transform: translateY(-3px);
}

.cert-caption {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: center;
  color: var(--text);
  max-width: 160px;
}

.cert-sub {
  display: block;
  margin-top: 2px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 10px;
}

.cert-joke-label {
  margin: 20px 0 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-style: italic;
  color: var(--text-dim);
  text-align: center;
}

.joke-badge-grid {
  display: flex;
  align-items: stretch;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

.joke-badge {
  width: 128px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 14px 10px 10px;
  text-align: center;
}

.joke-badge-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
  text-align: center;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  margin-bottom: 6px;
}

.joke-badge-title {
  margin: 0;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  line-height: 1.3;
  color: var(--text);
}

.joke-badge-level {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.joke-badge-issuer {
  margin-top: auto;
  padding-top: 6px;
  width: 100%;
  border-top: 1px dashed var(--panel-border);
  font-family: var(--font-mono);
  font-style: italic;
  font-size: 9px;
  color: var(--text-dim);
}

.trophy-grid {
  display: flex;
  align-items: stretch;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

.trophy-badge {
  width: 128px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 14px 10px 10px;
  text-align: center;
  transition: opacity 0.2s ease, filter 0.2s ease;
}

.trophy-badge.locked {
  opacity: 0.4;
  filter: grayscale(1);
}

.trophy-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--panel-border);
  width: 100%;
}

.trophy-share-btn,
.reset-progress-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.trophy-share-btn:hover,
.trophy-share-btn:focus-visible,
.reset-progress-btn:hover,
.reset-progress-btn:focus-visible {
  color: var(--accent);
}

.guestbook-card {
  display: block;
  padding: 24px;
}

.guestbook-split {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.guestbook-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#guestbook-submit {
  align-self: flex-start;
  margin-top: 2px;
}

.guestbook-entries {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.guestbook-entry {
  padding: 12px 14px;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: var(--bg);
}

.guestbook-entry.is-reply {
  margin-left: 18px;
  border-style: dashed;
  opacity: 0.85;
}

.guestbook-entry.is-reply .guestbook-entry-name {
  color: var(--text-dim);
}

.guestbook-entry.is-reply .guestbook-entry-name::after {
  content: " \2022 unverified";
  font-weight: 400;
  opacity: 0.7;
}

.guestbook-entry-name {
  margin: 0 0 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

.guestbook-entry-message {
  margin: 0;
  font-size: 15px;
  color: var(--text);
  word-break: break-word;
}

.guestbook-entry-time {
  margin: 6px 0 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}

@media (max-width: 400px) {
  .guestbook-card {
    padding: 24px 14px;
  }
}

.guestbook-empty {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  margin: 0;
  padding: 24px 18px;
  text-align: center;
  border: 1px dashed var(--panel-border);
  border-radius: 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
  font-style: italic;
}

.guestbook-statusbar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--panel-border);
}

.pages-caption {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
}

@media (min-width: 620px) {
  .guestbook-statusbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
  }
}

.page2-reveal {
  display: none;
  margin-top: 16px;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 28px 16px;
  text-align: center;
  border: 1px dashed var(--panel-border);
  border-radius: 12px;
  font-family: var(--font-mono);
}

.page2-reveal.show {
  display: flex;
}

.page2-reveal .code {
  font-size: 42px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.page2-reveal p {
  margin: 0;
  font-size: 13px;
  color: var(--text-dim);
}

.undo-hint {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
  margin: 0 0 20px;
}

.undo-tap {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.undo-tap:hover,
.undo-tap:focus-visible {
  color: var(--text);
}

jelly-kbd {
  margin: 0 2px;
}

@keyframes glitch-shake {
  0% {
    transform: translate(0, 0);
  }
  20% {
    transform: translate(-2px, 1px);
  }
  40% {
    transform: translate(2px, -1px);
  }
  60% {
    transform: translate(-1px, 2px);
  }
  80% {
    transform: translate(1px, -2px);
  }
  100% {
    transform: translate(0, 0);
  }
}

body.glitching .topbar,
body.glitching main,
body.glitching footer {
  animation: glitch-shake 0.35s steps(2, end);
}

.term-dock {
  position: fixed;
  z-index: 4;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  transform: translateX(-50%) scale(0.72);
  transform-origin: 50% 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 9px 15px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
  background: var(--chrome);
  border: 1px solid var(--chrome-border);
  border-radius: 6px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.16s ease, transform 0.24s cubic-bezier(0.34, 1.4, 0.64, 1),
    visibility 0s linear 0.24s;
}

body.term-minimized .term-dock {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) scale(1);
  transition-delay: 0.13s, 0.13s, 0s;
}

.term-dock-glyph {
  color: var(--accent);
}

.term-dock-label {
  max-width: min(68vw, 22rem);
  overflow: hidden;
  white-space: nowrap;
}

.term-dock-label-text {
  display: inline-block;
  white-space: nowrap;
  padding-right: 14px;
}

.term-dock-label.is-scrolling {
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 16px), transparent 100%);
  mask-image: linear-gradient(90deg, #000 calc(100% - 16px), transparent 100%);
}

.term-dock-label.is-scrolling .term-dock-label-text {
  animation: dock-marquee var(--dock-marquee, 8s) ease-in-out infinite;
}

@keyframes dock-marquee {
  0%,
  18% {
    transform: translateX(0);
  }
  48%,
  66% {
    transform: translateX(var(--dock-shift, 0px));
  }
  96%,
  100% {
    transform: translateX(0);
  }
}

.term-dock-dot {
  width: 14px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
}

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

body.term-minimized .jelly-mascot {
  opacity: 0;
  pointer-events: none;
}

body.term-minimized .undo-toast {
  bottom: calc(max(18px, env(safe-area-inset-bottom)) + 64px);
}

.undo-toast {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%) translateY(12px);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 15px;
  padding: 13px 22px;
  border-radius: 11px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: calc(100vw - 48px);
  text-align: center;
}

#rm-rf-dialog h2 {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 18px;
}

#rm-rf-dialog p {
  margin: 0;
}

#rm-rf-dialog::part(dialog) {
  overflow: hidden;
}

.dialog-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
}

.context-menu-trigger {
  position: fixed;
  width: 0;
  height: 0;
  pointer-events: none;
}

.undo-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.confetti-burst {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -12px;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  opacity: 0.9;
  animation-name: confetti-fall;
  animation-timing-function: ease-in;
  animation-fill-mode: forwards;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 0.9;
  }
  100% {
    transform: translateY(105vh) rotate(360deg);
    opacity: 0;
  }
}

.log-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.log-entry {
  display: block;
  padding: 4px 20px;
}

.log-entry summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 0;
  font-family: var(--font-mono);
  font-size: 14px;
}

.log-entry summary::-webkit-details-marker {
  display: none;
}

.log-entry summary::before {
  content: "▸";
  color: var(--text-dim);
  display: inline-block;
  transition: transform 0.15s ease;
}

.log-entry details[open] summary::before {
  transform: rotate(90deg);
}

.log-title {
  color: var(--text);
  flex: 1 1 auto;
  min-width: 0;
}

.log-date {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--text-dim);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.log-gap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-style: italic;
  color: var(--text-dim);
}

.log-gap::before,
.log-gap::after {
  content: "";
  flex: 1 1 auto;
  border-top: 1px dashed var(--panel-border);
}

.log-body {
  margin: 0 0 16px;
  padding-left: 24px;
  color: var(--text-dim);
  font-size: 15px;
}

footer {
  position: relative;
  z-index: 1;
  max-width: clamp(720px, 86vw, 1320px);
  margin: 0 auto;
  padding: 0 24px 48px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
}

footer a {
  color: var(--accent);
  text-decoration: none;
}

.foot-line {
  margin: 4px 0 0;
}

.mobile-only {
  display: none;
}

@media (hover: none) and (pointer: coarse) {
  .desktop-only {
    display: none;
  }
  .mobile-only {
    display: inline;
  }
}

@media (max-width: 480px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .cursor {
    animation: none;
    opacity: 1;
  }
  * {
    transition: none !important;
  }
}

.hero {
  display: grid;
  gap: 22px;
}

.hero-side {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (min-width: 1200px) {
  .hero {
    grid-template-columns: minmax(0, 7fr) minmax(420px, 5fr);
    column-gap: 40px;
    align-items: start;
  }

  .hero-head {
    grid-column: 1 / -1;
  }
}

@media (min-width: 900px) {
  main {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .countdown,
  .build-status {
    grid-column: span 6;
    align-self: stretch;
    display: flex;
    flex-direction: column;
  }

  .countdown > jelly-card,
  .build-status > jelly-card {
    flex: 1;
  }

  .build-status-card {
    justify-content: center;
  }

  .guestbook-split {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: 28px;
    align-items: stretch;
  }

  .guestbook-entries {
    max-height: 340px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--panel-border) transparent;
  }

  .certs-split {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 28px;
    align-items: start;
  }

  .joke-column .cert-joke-label {
    margin-top: 0;
    text-align: left;
  }

  .joke-column .joke-badge-grid {
    justify-content: flex-start;
  }

  .log-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
  }

  main > jelly-divider {
    display: none;
  }

  footer {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 22px;
  }

  .foot-line {
    margin: 0;
  }

  footer > .eyebrow {
    margin: 0;
  }
}

::selection {
  background: var(--accent);
  color: #1c1917;
}

.terminal-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: none;
}

.terminal-line {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-dim);
  white-space: pre-wrap;
  word-break: break-word;
}

.terminal-line-cmd {
  color: var(--text);
}

.terminal-cmd {
  color: var(--accent);
}

.terminal-input-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex: none;
}

.terminal-prompt {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  white-space: nowrap;
}

.terminal-field {
  position: relative;
  display: flex;
  flex: 1;
  min-width: 0;
}

.terminal-input {
  flex: 1;
  padding: 0;
  background: none;
  border: none;
  outline: none;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  min-width: 0;
  caret-color: transparent;
}

.terminal-caret {
  position: absolute;
  top: 0;
  left: 0;
  display: none;
  white-space: pre;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  color: var(--bg);
  background: var(--accent);
  pointer-events: none;
  animation: terminal-caret-blink 1.1s steps(1) infinite;
}

@keyframes terminal-caret-blink {
  50% {
    opacity: 0;
  }
}

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

.terminal-ruler-box {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
}

.terminal-ruler {
  display: inline-block;
  white-space: pre;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
}

.terminal-keybar {
  display: none;
}

@media (hover: none) and (pointer: coarse) {
  .terminal-keybar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--panel-border);
  }
}

.terminal-keybar[hidden] {
  display: none;
}

.terminal-key {
  flex: 1 1 auto;
  min-width: 46px;
  min-height: 36px;
  padding: 6px 10px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  font: 500 12px/1 var(--font-mono);
  color: var(--text-dim);
  cursor: pointer;
}

.terminal-key:active {
  background: var(--panel-border);
  color: var(--text);
}

.terminal-key:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.jelly-mascot {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 5;
  cursor: pointer;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.4));
}

.jelly-mascot:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 50%;
}

.mascot-body {
  fill: var(--accent);
}

.jelly-mascot .face {
  display: none;
}

.jelly-mascot .ink {
  fill: var(--mascot-ink);
}

.jelly-mascot .line,
.jelly-mascot .line path {
  fill: none;
  stroke: var(--mascot-ink);
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mascot-eyes {
  transition: transform 0.05s linear;
}

@keyframes mascot-bounce {
  0%,
  100% {
    transform: translateY(0) scale(1, 1);
  }
  25% {
    transform: translateY(-9px) scale(0.94, 1.08);
  }
  50% {
    transform: translateY(0) scale(1.08, 0.92);
  }
  75% {
    transform: translateY(-4px) scale(0.98, 1.03);
  }
}

@keyframes mascot-shake {
  0%,
  100% {
    transform: translateX(0) rotate(0deg);
  }
  20% {
    transform: translateX(-4px) rotate(-6deg);
  }
  40% {
    transform: translateX(4px) rotate(6deg);
  }
  60% {
    transform: translateX(-3px) rotate(-4deg);
  }
  80% {
    transform: translateX(2px) rotate(3deg);
  }
}

@keyframes mascot-pop {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.14);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes mascot-tilt {
  0%,
  100% {
    transform: rotate(0deg);
  }
  30% {
    transform: rotate(-11deg);
  }
  70% {
    transform: rotate(9deg);
  }
}

@keyframes mascot-shifty {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-3.5px);
  }
  60% {
    transform: translateX(3.5px);
  }
}

.jelly-mascot.motion-bounce svg,
.jelly-mascot.motion-shake svg,
.jelly-mascot.motion-pop svg,
.jelly-mascot.motion-tilt svg {
  transform-origin: 50% 88%;
}

.jelly-mascot.motion-bounce svg {
  animation: mascot-bounce 0.75s ease;
}

.jelly-mascot.motion-shake svg {
  animation: mascot-shake 0.6s ease;
}

.jelly-mascot.motion-pop svg {
  animation: mascot-pop 0.45s ease;
}

.jelly-mascot.motion-tilt svg {
  animation: mascot-tilt 0.9s ease;
}

.jelly-mascot.motion-shifty .mascot-eyes {
  animation: mascot-shifty 1.6s ease;
}

@keyframes mascot-squish {
  0% {
    transform: scale(1, 1);
  }
  30% {
    transform: scale(1.16, 0.82);
  }
  55% {
    transform: scale(0.9, 1.12);
  }
  80% {
    transform: scale(1.05, 0.96);
  }
  100% {
    transform: scale(1, 1);
  }
}

.jelly-mascot.wobble svg {
  animation: mascot-squish 0.5s ease;
  transform-origin: 50% 90%;
}

@media (max-width: 520px) {
  .jelly-mascot {
    width: 42px;
    height: 42px;
    right: 14px;
    bottom: 14px;
  }
  .jelly-mascot svg {
    width: 42px;
    height: 42px;
  }
}

@media print {
  body > * {
    display: none !important;
  }
  body::before {
    content: "You just printed a website with no content. Bold move. There was never going to be anything here to put on paper.";
    display: block;
    font-family: monospace;
    font-size: 16px;
    line-height: 1.6;
    padding: 80px 60px;
    color: #000;
  }
}

:root {
  --desktop-bg: #131110;
  --desktop-dot: rgba(255, 255, 255, 0.045);
  --chrome: #2b2523;
  --chrome-border: #3a322d;
  --titlebar-h: 42px;
  --tabstrip-h: 36px;
  --frame-inset: 16px;
  --btn-hover: rgba(255, 255, 255, 0.09);
  --winbtn: rgba(255, 255, 255, 0.1);
  --winbtn-hover: rgba(255, 255, 255, 0.17);
  --chrome-h: calc(var(--titlebar-h) + var(--tabstrip-h));
}

body[data-mode="light"] {
  --desktop-bg: #ded4c6;
  --desktop-dot: rgba(0, 0, 0, 0.06);
  --chrome: #ece3d7;
  --chrome-border: #d9cdbc;
  --btn-hover: rgba(0, 0, 0, 0.08);
  --winbtn: rgba(0, 0, 0, 0.09);
  --winbtn-hover: rgba(0, 0, 0, 0.15);
}
jelly-dialog:not(:defined),
jelly-menu:not(:defined) {
  display: none;
}

jelly-breadcrumbs:not(:defined),
jelly-skeleton:not(:defined),
jelly-progress:not(:defined) {
  visibility: hidden;
}
.term-shell {
  display: block;
  min-height: 100vh;
  background: var(--bg);
}

.term-body,
.term-viewport {
  display: block;
}

.term-titlebar {
  position: sticky;
  top: 0;
  z-index: 6;
  flex: none;
  height: var(--titlebar-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 7px 0 13px;
  background: var(--chrome);
  border-bottom: 1px solid var(--chrome-border);
  user-select: none;
}

.term-appicon {
  flex: none;
  font-size: 13px;
  line-height: 1;
  color: var(--accent);
}

.term-winbtns {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
}

.term-winbtn {
  position: relative;
  width: 24px;
  height: 24px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--winbtn);
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

/* The visible circle is 24px; this widens the tap target without changing
   the look. Kept narrower than the 8px gap so neighbours never overlap. */
.term-winbtn::after {
  content: "";
  position: absolute;
  inset: -8px -3px;
}

.term-winbtn:hover {
  background: var(--winbtn-hover);
}

.term-winbtn-close:hover {
  background: #c01c28;
  color: #fff;
}

.term-winbtn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.term-winbtn i {
  position: relative;
  display: block;
  width: 10px;
  height: 10px;
}

.term-winbtn-min i::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  width: 10px;
  height: 1px;
  background: currentColor;
}

.term-winbtn-max i::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid currentColor;
}

body.term-zoomed .term-winbtn-max i::before {
  inset: 3px 3px 0 0;
}

body.term-zoomed .term-winbtn-max i::after {
  content: "";
  position: absolute;
  inset: 0 0 3px 3px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
}

.term-winbtn-close i::before,
.term-winbtn-close i::after {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  width: 11px;
  height: 1px;
  background: currentColor;
}

.term-winbtn-close i::before {
  transform: rotate(45deg);
}

.term-winbtn-close i::after {
  transform: rotate(-45deg);
}

.term-window-title {
  margin: 0;
  flex: 1;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.term-dims {
  margin: 0;
  flex: none;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  opacity: 0.65;
  font-variant-numeric: tabular-nums;
}

.term-tabstrip {
  flex: none;
  display: flex;
  align-items: stretch;
  height: var(--tabstrip-h);
  padding: 0 8px;
  background: color-mix(in srgb, var(--chrome) 62%, var(--bg));
  border-bottom: 1px solid var(--chrome-border);
  overflow-x: auto;
  scrollbar-width: none;
}

.term-tabstrip::-webkit-scrollbar {
  display: none;
}

.term-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: none;
  max-width: 15rem;
  padding: 0 12px;
  background: none;
  border: none;
  border-right: 1px solid var(--chrome-border);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  cursor: pointer;
}

.term-tab:first-child {
  border-left: 1px solid var(--chrome-border);
}

.term-tab:hover {
  color: var(--text);
}

.term-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.term-tab.is-active {
  background: var(--bg);
  color: var(--text);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.term-tab-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.term-tab-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

.term-tab-close {
  flex: none;
  width: 15px;
  height: 15px;
  line-height: 13px;
  text-align: center;
  border-radius: 4px;
  font-size: 13px;
  opacity: 0;
}

.term-tab:hover .term-tab-close,
.term-tab.is-active .term-tab-close {
  opacity: 0.7;
}

.term-tab-close:hover {
  opacity: 1;
  background: var(--panel-border);
}

.term-tab-new {
  font-size: 15px;
  padding: 0 13px;
}
.term-panes {
  display: contents;
}

.term-pane {
  position: fixed;
  inset: var(--chrome-h) 0 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.term-pane[hidden] {
  display: none;
}

.term-shell-pane {
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: flex-start;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 20px 26px;
  cursor: text;
  scrollbar-width: thin;
  scrollbar-color: var(--panel-border) transparent;
}

.term-shell-pane::-webkit-scrollbar {
  width: 11px;
}

.term-shell-pane::-webkit-scrollbar-track {
  background: transparent;
}

.term-shell-pane::-webkit-scrollbar-thumb {
  background: var(--panel-border);
  background-clip: content-box;
  border: 3px solid transparent;
  border-radius: 999px;
}

.term-overlay {
  position: fixed;
  inset: var(--chrome-h) 0 0;
  z-index: 7;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  font-family: var(--font-mono);
}

.term-overlay[hidden] {
  display: none;
}

.vim-buffer {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 0 18px;
  font-size: 13px;
  line-height: 1.55;
  scrollbar-width: thin;
  scrollbar-color: var(--panel-border) transparent;
}

.vim-row {
  display: flex;
  gap: 14px;
  padding: 0 18px;
}

.vim-num {
  flex: none;
  width: 2.4em;
  text-align: right;
  color: color-mix(in srgb, var(--text-dim) 45%, transparent);
  font-variant-numeric: tabular-nums;
  user-select: none;
}

.vim-row.is-tilde .vim-num {
  text-align: left;
}

.vim-text {
  flex: 1;
  min-width: 0;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-dim);
}

.vim-text.is-heading {
  color: var(--accent);
  font-weight: 700;
}

.vim-text.is-frontmatter {
  color: var(--text);
}

.vim-text.is-comment {
  color: color-mix(in srgb, var(--text-dim) 65%, transparent);
  font-style: italic;
}

.vim-text.is-conflict {
  color: #ff5f57;
  font-weight: 700;
}

.vim-text.is-conflict-mid {
  color: #febc2e;
  font-weight: 700;
}

.vim-text.is-prose {
  color: var(--text);
}

.vim-cursor {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  background: var(--accent);
  vertical-align: -0.15em;
  animation: blink 1.1s steps(1) infinite;
}

.vim-status {
  flex: none;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  padding: 9px 18px;
  font-size: 12px;
  color: var(--text);
  background: var(--panel);
  border-top: 1px solid var(--panel-border);
}

.vim-mode {
  font-weight: 700;
  letter-spacing: 0.04em;
}

.vim-hint {
  color: var(--text-dim);
  font-style: italic;
  text-align: right;
}

.vim-cmdline {
  flex: none;
  display: none;
  align-items: baseline;
  gap: 2px;
  padding: 9px 18px;
  font-size: 12px;
  background: var(--panel);
  border-top: 1px solid var(--panel-border);
}

.vim-cmdline.is-open {
  display: flex;
}

.vim-cmdline.is-open + .vim-status {
  display: none;
}

.vim-colon {
  color: var(--text);
}

.vim-cmd-input {
  flex: 1;
  min-width: 0;
  padding: 0;
  background: none;
  border: none;
  outline: none;
  font: inherit;
  font-family: var(--font-mono);
  color: var(--text);
  caret-color: var(--accent);
}

.vim-echo {
  flex: none;
  padding: 9px 18px;
  font-size: 12px;
  color: #ff5f57;
  background: var(--panel);
  border-top: 1px solid var(--panel-border);
}

.term-overlay[data-state="closed"] {
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 24px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(3px);
}

.term-closed-title {
  margin: 0;
  font-size: 14px;
  color: var(--text);
}

.term-closed-line {
  margin: 0;
  font-size: 13px;
  color: var(--text-dim);
  font-style: italic;
}

.term-reconnect {
  margin-top: 4px;
  padding: 8px 18px;
  font: 500 13px/1 var(--font-mono);
  color: var(--bg);
  background: var(--accent);
  border: none;
  border-radius: 14px;
  cursor: pointer;
}

.term-reconnect:hover {
  filter: brightness(1.08);
}

.term-reconnect:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

@media (max-width: 899px) {
  .term-tabstrip {
    position: sticky;
    top: var(--titlebar-h);
    z-index: 6;
  }

  .term-titlebar,
  .term-tabstrip {
    transition: transform 0.26s cubic-bezier(0.4, 0, 0.2, 1);
  }

  body.term-chrome-hidden .term-titlebar,
  body.term-chrome-hidden .term-tabstrip {
    transform: translateY(calc(-1 * var(--chrome-h)));
  }
  body.term-chrome-snap .term-titlebar,
  body.term-chrome-snap .term-tabstrip {
    transition: none;
  }

  html {
    scroll-padding-top: calc(var(--chrome-h) + 12px);
  }

  .term-tab {
    max-width: 8.5rem;
  }

  .term-winbtn::after {
    inset: -9px -3px;
  }
  html.term-panel-open {
    overflow: hidden;
  }

  body.term-panel-open .jelly-mascot {
    display: none;
  }

  .term-shell-pane {
    padding-bottom: max(26px, env(safe-area-inset-bottom));
  }

  .term-shell {
    transition: transform 0.34s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
  }

  body.term-minimized .term-shell {
    transform: translateY(100vh);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.34s cubic-bezier(0.4, 0, 0.2, 1),
      opacity 0.2s ease 0.08s, visibility 0s linear 0.34s;
  }

  html.term-minimized {
    overflow: hidden;
  }
}

@media (max-width: 899px) and (prefers-reduced-motion: reduce) {
  .term-titlebar,
  .term-tabstrip {
    transition: none;
  }

  body.term-chrome-hidden .term-titlebar,
  body.term-chrome-hidden .term-tabstrip {
    transform: none;
  }
}

.desktop-layer {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 0;
  padding: max(28px, calc(env(safe-area-inset-top) + 14px)) 20px 108px;
  background-color: var(--desktop-bg);
  background-image: radial-gradient(var(--desktop-dot) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

body.term-minimized .desktop-layer {
  opacity: 1;
  pointer-events: auto;
}

.desktop-icons {
  display: grid;
  grid-template-columns: repeat(auto-fill, 84px);
  gap: 22px 12px;
  justify-content: start;
}

.desktop-icon {
  width: 84px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 4px;
  border-radius: 14px;
  cursor: pointer;
  color: var(--text-dim);
  font-family: var(--font-mono);
  -webkit-tap-highlight-color: transparent;
}

.desktop-icon:hover,
.desktop-icon:active {
  background: color-mix(in srgb, var(--text) 8%, transparent);
  color: var(--text);
}

.desktop-icon-glyph {
  font-size: 28px;
  line-height: 1;
  filter: saturate(0.85);
}

.desktop-icon-label {
  font-size: 11px;
  line-height: 1.3;
  text-align: center;
  word-break: break-word;
}

.desktop-caption {
  margin: 30px 4px 0 4px;
  max-width: 42ch;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  opacity: 0.75;
}

@media (min-width: 900px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  body {
    background-color: var(--desktop-bg);
    background-image: radial-gradient(var(--desktop-dot) 1px, transparent 1px);
    background-size: 24px 24px;
  }

  .term-shell {
    position: fixed;
    inset: var(--frame-inset);
    display: flex;
    flex-direction: column;
    min-height: 0;
    border: 1px solid var(--chrome-border);
    border-radius: 8px;
    overflow: hidden;
    z-index: 1;
    box-shadow: 0 26px 60px rgba(0, 0, 0, 0.5);
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
      inset 0.28s cubic-bezier(0.22, 1, 0.36, 1), border-radius 0.28s ease;
  }

  .term-shell.is-zoomed {
    inset: 0;
    border-radius: 0;
  }

  .term-shell.is-minimized {
    transform-origin: 0 100%;
    transform: scale(0.06);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.32s cubic-bezier(0.5, 0, 0.75, 0),
      opacity 0.26s ease 0.06s, visibility 0s linear 0.32s;
  }

  .term-titlebar {
    position: static;
  }

  .term-body {
    position: relative;
    display: block;
    flex: 1;
    min-height: 0;
  }

  .term-viewport {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--panel-border) transparent;
  }

  .term-viewport::-webkit-scrollbar {
    width: 11px;
  }

  .term-viewport::-webkit-scrollbar-track {
    background: transparent;
  }

  .term-viewport::-webkit-scrollbar-thumb {
    background: var(--panel-border);
    background-clip: content-box;
    border: 3px solid transparent;
    border-radius: 999px;
  }

  .term-overlay,
  .term-pane {
    position: absolute;
    inset: 0;
  }

  .scanlines {
    inset: var(--frame-inset);
    border-radius: 8px;
    z-index: 4;
    transition: opacity 0.2s ease;
  }

  body.term-zoomed .scanlines {
    inset: 0;
    border-radius: 0;
  }

  body.term-minimized .scanlines {
    opacity: 0;
  }

  .jelly-mascot {
    right: calc(var(--frame-inset) + 20px);
    bottom: calc(var(--frame-inset) + 20px);
  }

  .undo-toast {
    bottom: calc(var(--frame-inset) + 30px);
  }

  body.term-zoomed .jelly-mascot {
    right: 20px;
    bottom: 20px;
  }

  body.term-zoomed .undo-toast {
    bottom: 30px;
  }

  .term-dock {
    left: var(--frame-inset);
    bottom: var(--frame-inset);
    transform: translateX(0) scale(0.72);
    transform-origin: 0 100%;
  }

  body.term-minimized .term-dock {
    transform: translateX(0) scale(1);
  }

  body.term-minimized .undo-toast {
    bottom: calc(var(--frame-inset) + 78px);
  }

  body.term-minimized .jelly-mascot {
    opacity: 0;
    pointer-events: none;
  }

  .desktop-layer {
    padding: calc(var(--frame-inset) + 28px) 0 calc(var(--frame-inset) + 74px)
      calc(var(--frame-inset) + 28px);
  }

  .topbar {
    padding-top: 18px;
  }
}

jelly-theme:not(:defined) {
  display: contents;
}

jelly-dialog:not(:defined),
jelly-menu:not(:defined),
jelly-menu-item:not(:defined) {
  display: none;
}

jelly-card:not(:defined),
jelly-alert:not(:defined) {
  display: block;
  padding: 16px 20px;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: var(--panel);
}

jelly-button:not(:defined),
jelly-badge:not(:defined),
jelly-kbd:not(:defined) {
  display: inline-block;
  padding: 4px 12px;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  background: var(--panel);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
}

jelly-button:not(:defined) {
  cursor: pointer;
}

jelly-breadcrumbs:not(:defined),
jelly-pagination:not(:defined) {
  display: block;
  font-family: var(--font-mono);
  font-size: 13px;
}

jelly-input:not(:defined),
jelly-textarea:not(:defined) {
  display: block;
  min-height: 38px;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: var(--bg);
}

jelly-skeleton:not(:defined),
jelly-progress:not(:defined) {
  display: block;
  height: 10px;
  border-radius: 999px;
  background: var(--panel-border);
}

jelly-divider:not(:defined) {
  display: block;
  border-top: 1px solid var(--panel-border);
}

jelly-icon-button:not(:defined) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--panel-border);
  border-radius: 50%;
}

jelly-icon-button:not(:defined) svg {
  width: 16px;
  height: 16px;
}