/* ---- About page — fire scene + terminal typing ---- */

.about-page {
  min-height: 100dvh;
  height: 100dvh;
  background: var(--bg);
  color: #fff;
  overflow: hidden;
}

.about-scene {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  contain: strict;
  content-visibility: auto;
}

.about-stage-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--stage-base);
  background-size: 200% 200%;
  animation: stage-gradient 24s ease-in-out infinite;
  contain: layout paint;
}

.about-scene--settled .splash__heat,
.about-scene--settled .fire-ember,
.about-scene--settled .about-stage-bg,
.about-scene--settled .stage-bg__blob,
.about-scene--settled .stage-wave {
  animation-play-state: paused;
}

.about-scene--settled .splash__heat,
.about-scene--settled .fire-ember {
  opacity: 0;
  transition: opacity 0.4s ease;
}

.about-chrome {
  position: relative;
  z-index: 2;
  width: min(var(--chrome-content-max), 100%);
  flex-shrink: 0;
}

.about-chrome .story-toolbar {
  padding: max(0.35rem, env(safe-area-inset-top)) 0 0.375rem;
}

.terminal-animate-check {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.terminal-animate-check__input {
  width: 0.85rem;
  height: 0.85rem;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.terminal-animate-check__input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.terminal-animate-check__label {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.42);
  letter-spacing: 0.02em;
  white-space: nowrap;
  text-transform: lowercase;
}

.terminal-animate-check:has(.terminal-animate-check__input:checked) .terminal-animate-check__label {
  color: rgba(255, 255, 255, 0.72);
}

.about-main {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  max-width: var(--chrome-shell-max);
  height: 100dvh;
  min-height: 0;
  margin: 0 auto;
  padding:
    0
    var(--chrome-inline-pad)
    max(0.75rem, env(safe-area-inset-bottom));
  box-sizing: border-box;
}

.terminal {
  width: min(var(--chrome-content-max), 100%);
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-top: 0;
  opacity: 1;
  border: 1px solid rgba(251, 191, 36, 0.28);
  border-radius: 14px;
  background: rgba(12, 4, 0, 0.96);
  box-shadow:
    0 0 0 1px rgba(127, 29, 29, 0.45) inset,
    0 18px 48px rgba(0, 0, 0, 0.55);
  contain: layout style paint;
  animation: about-terminal-in 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}

.terminal--awaiting-input .terminal__body {
  cursor: default;
}

@keyframes about-terminal-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.terminal__chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-shrink: 0;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid rgba(127, 29, 29, 0.45);
  background: rgba(69, 10, 10, 0.35);
}

.terminal__chrome-start {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  flex: 1 1 auto;
}

.terminal__chrome-end {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.terminal__dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.terminal__dot--red { background: #ef4444; }
.terminal__dot--amber { background: #fbbf24; }
.terminal__dot--green { background: #22c55e; }

.terminal__title {
  margin-left: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.terminal__body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: auto;
  padding: 1rem 1.1rem 1.25rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(249, 115, 22, 0.35) transparent;
}

.terminal__output {
  display: block;
  flex: 0 0 auto;
  margin: 0;
  font-family: var(--font-mono);
  font-size: clamp(0.72rem, 2.4vw, 0.8125rem);
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.terminal__focus-pad {
  display: none;
  flex: 1 1 auto;
  min-height: 2.5rem;
}

.terminal--awaiting-input .terminal__focus-pad {
  display: block;
  cursor: text;
}

.terminal__line {
  min-height: 1.65em;
}

.terminal__line--cmd {
  color: #fbbf24;
}

.terminal__prompt {
  color: #f97316;
  font-weight: 600;
}

.terminal__input-buffer {
  color: #fef9c3;
}

.terminal__input-field {
  flex: 1 1 8rem;
  min-width: 8rem;
  min-height: 1.65em;
  margin: 0;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: #fef9c3;
  font-family: var(--font-mono);
  font-size: max(16px, clamp(0.72rem, 2.4vw, 0.8125rem));
  line-height: inherit;
  caret-color: #fbbf24;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.terminal__line--input {
  display: flex;
  flex-wrap: nowrap;
  align-items: baseline;
  gap: 0;
  scroll-margin-bottom: max(1rem, env(safe-area-inset-bottom));
}

html.about-keyboard-open .terminal__body {
  scroll-padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

html.about-keyboard-open .terminal__focus-pad {
  cursor: text;
}

.terminal__line--hint-line {
  color: rgba(255, 255, 255, 0.48);
}

.terminal__hint-text {
  color: rgba(255, 255, 255, 0.48);
}

.terminal__hint-cmd {
  color: #fbbf24;
  font-weight: 600;
}

.terminal__line--hint {
  color: rgba(255, 255, 255, 0.48);
  font-style: italic;
}

.terminal__line--head {
  color: #fef9c3;
  font-weight: 600;
}

.terminal__line--text {
  color: rgba(255, 255, 255, 0.82);
}

.terminal__line--dim {
  color: rgba(255, 255, 255, 0.28);
}

.terminal__line--accent {
  color: #f97316;
  font-weight: 600;
}

.terminal__link {
  color: inherit;
  font-weight: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(249, 115, 22, 0.45);
  text-underline-offset: 0.18em;
}

.terminal__line--actions {
  margin-top: 0.125rem;
}

.terminal__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.terminal__action {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-sans, inherit);
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  text-decoration: none;
  padding: 0.3rem 0.62rem;
  border-radius: 999px;
  border: 1px solid transparent;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.terminal__action:hover {
  filter: brightness(1.08);
  text-decoration: none;
}

.terminal__action--github {
  background: linear-gradient(
    135deg,
    #7f1d1d 0%,
    #991b1b 52%,
    rgba(153, 27, 27, 0.92) 100%
  );
  border-color: rgba(249, 115, 22, 0.38);
  box-shadow:
    0 3px 14px rgba(127, 29, 29, 0.42),
    inset 0 1px 0 rgba(251, 191, 36, 0.14);
}

.terminal__action--demo {
  color: #ecfeff;
  background: linear-gradient(135deg, rgba(8, 145, 178, 0.9), rgba(20, 184, 166, 0.74));
  border-color: rgba(103, 232, 249, 0.34);
  box-shadow: 0 4px 14px rgba(8, 145, 178, 0.26);
}

.terminal__link:hover {
  color: #fbbf24;
  text-decoration-color: currentColor;
}

.terminal__line--out {
  color: #86efac;
}

.terminal__cursor {
  display: inline-block;
  color: #fbbf24;
  animation: about-cursor-blink 0.9s step-end infinite;
}

.terminal__cursor--static {
  animation: none;
}

@keyframes about-cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.about-footer {
  width: min(var(--chrome-content-max), 100%);
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  margin-top: 0;
  animation: about-terminal-in 0.55s ease 0.45s both;
}

.about-footer__link {
  font-size: 0.75rem;
  color: #fbbf24;
  text-decoration: none;
  transition: color 0.2s ease;
}

.about-footer__link:hover {
  color: #fef9c3;
}

html.page-hidden .about-scene .splash__heat,
html.page-hidden .about-scene .fire-ember,
html.page-hidden .about-scene .about-stage-bg,
html.page-hidden .about-scene .stage-bg__blob,
html.page-hidden .about-scene .stage-wave,
html.page-hidden .about-page .logo__t,
html.page-hidden .about-page .logo__t--flip,
html.page-hidden .terminal__cursor {
  animation-play-state: paused;
}

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

  .terminal__cursor,
  .about-page .logo__t,
  .about-page .logo__t--flip,
  .about-scene .fire-ember,
  .about-scene .splash__heat,
  .about-stage-bg,
  .about-stage-bg .stage-bg__blob,
  .about-stage-bg .stage-wave {
    animation: none !important;
  }

  .about-scene--settled .splash__heat,
  .about-scene--settled .fire-ember {
    opacity: 0;
  }
}

@media (max-width: 640px) {
  .about-main {
    padding-inline: var(--chrome-inline-pad);
  }

  .terminal__body {
    padding-inline: 0.85rem;
    -webkit-overflow-scrolling: touch;
  }

  .terminal-animate-check__label {
    display: none;
  }

  .terminal__chrome {
    padding-inline: 0.65rem;
    gap: 0.5rem;
  }
}

html.about-keyboard-open .about-main {
  height: var(--about-vv-height, 100dvh);
  min-height: 0;
  max-height: var(--about-vv-height, 100dvh);
}

html.about-keyboard-open .terminal {
  flex: 1 1 auto;
  min-height: 0;
}

html.about-keyboard-open .about-footer {
  display: none;
}

html.about-keyboard-open .terminal__body {
  scroll-padding-bottom: max(1rem, env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
}
