/* idk just some styling, makes it fullscreen n stuff */
* { box-sizing: border-box; }

@font-face {
  font-family: 'JetBrainsMono NF ExtraBold';
  src: url('../ceess/fonts/JetBrainsMonoNerdFont-ExtraBold.woff2') format('woff2');
  font-weight: 800;
  font-display: swap;
}

html, body {
  margin: 0;
  height: 100%;
  height: 100dvh;
  width: 100%;
  position: fixed;
  overscroll-behavior: none;
  background: #05050b;
  overflow: hidden;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  font-family: 'Courier New', Courier, monospace;
  -webkit-user-select: none;
  user-select: none;
}

canvas#sky {
  position: fixed;
  inset: 0;
  display: block;
  touch-action: none;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 6; /* above .floaters so the jukebox doesnt get text over the top of it */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 24px;
  pointer-events: none;
  opacity: 0;
  animation: fadein 1.2s ease forwards;
  animation-delay: 0.2s;
}

.term-box {
  position: relative; /* anchors the overlaid prompt bar to the box's own bottom edge */
  pointer-events: auto;
  width: min(90vw, 440px);
  background: #030305;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 0 0 0.5px #f2f3ff,
    0 0 0 4px #000000,
    0 0 0 4.5px #f2f3ff;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              height 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.6s ease;
}

/* bigger screen state - .overlay centers this box so growing w/h just
   expands out evenly on all 4 corners, no transforms needed */
.term-box.expanded {
  width: min(94vw, 960px);
  box-shadow:
    0 0 0 0.5px #f2f3ff,
    0 0 0 4px #000000,
    0 0 0 4.5px #f2f3ff;
}

.term-title {
  padding: 14px 20px 12px;
  text-align: left;
  font-family: 'JetBrainsMono NF ExtraBold';
  font-size: clamp(0.78rem, 1.6vw, 0.95rem);
  letter-spacing: 0.03em;
  color: #9eaaff;
  border-bottom: 1px solid rgba(158, 170, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
}

.term-title-text {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.term-home-btn {
  display: none;
  flex: 0 0 auto;
  background: none;
  border: 2px solid rgba(187, 127, 130, 0.35);
  color: #bb7f82;
  font-family: inherit;
  font-size: 1.05em;
  letter-spacing: 0.03em;
  padding: 4px 9px;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.term-home-btn:hover,
.term-home-btn:focus-visible {
  opacity: 1;
  border-color: rgba(187, 127, 130, 0.75);
  background: rgba(187, 127, 130, 0.1);
}

.term-box.expanded .term-home-btn {
  display: inline-block;
}

.term-bio {
  padding: 14px 20px 12px;
  /* extra bottom padding is only added by JS (see updatePromptBarLayout) when
     the content actually overflows and the prompt bar becomes an overlay */
  text-align: left;
  max-width: none;
  width: 100%;
  margin: 0;
  font-size: clamp(0.82rem, 1.3vw, 0.95rem);
  line-height: 1.7;
  color: rgba(238, 240, 255, 0.65);
  max-height: min(46vh, 300px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y; /* re-enables touch scrolling here despite html/body's touch-action: none */
  scrollbar-width: none;
  -ms-overflow-style: none;
  transition: max-height 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* fixed height here, not just a cap, so it reads as an actual bigger
   terminal right away instead of just "room to grow" */
.term-box.expanded .term-bio {
  max-width: none;
  max-height: min(70vh, 640px);
  height: min(70vh, 640px);
}

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

.term-bio p {
  margin: 0;
}

.term-output {
  margin-top: 10px;
}

/* --- projects: gallery cards, wrapped + centered like the 88x31 grid --- */
.gallery-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.gallery-card {
  flex: 0 0 auto;
  width: min(72vw, 250px);
  border: 1px solid rgba(158, 170, 255, 0.25);
  background: rgba(158, 170, 255, 0.04);
  padding: 12px 14px 14px;
  opacity: 0;
  transform: translateY(4px);
  transition: border-color 0.2s ease, background 0.2s ease,
              opacity 0.25s ease, transform 0.25s ease;
}

.gallery-card.gallery-card-visible {
  opacity: 1;
  transform: translateY(0);
}

.gallery-card:hover {
  border-color: rgba(158, 170, 255, 0.55);
  background: rgba(158, 170, 255, 0.08);
}

.gallery-card-title {
  color: #9eaaff;
  font-weight: 700;
  font-size: 0.92em;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-dot {
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  background: #bb7f82;
}

.gallery-card-meta {
  margin-top: 5px;
  font-size: 0.72em;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: rgba(238, 240, 255, 0.4);
}

.term-bio .gallery-card-desc {
  margin: 8px 0 0;
  font-size: 0.85em;
  line-height: 1.55;
  color: rgba(238, 240, 255, 0.65);
  white-space: normal;
}

.badge-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: left;
  gap: 10px;
  padding-bottom: 8px;
}

.badge-slot {
  flex: 0 0 auto;
  width: 88px;
  height: 31px;
  border: 1px dashed rgba(158, 170, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  letter-spacing: 0.02em;
  color: rgba(238, 240, 255, 0.35);
  background: rgba(158, 170, 255, 0.03);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.badge-slot.badge-visible {
  opacity: 1;
  transform: translateY(0);
}

.contact-list {
  border-top: 1px solid rgba(158, 170, 255, 0.15);
}

.contact-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 9px 2px;
  border-bottom: 1px solid rgba(158, 170, 255, 0.15);
  text-decoration: none;
  color: inherit;
  transition: background 0.2s ease, padding-left 0.2s ease;
}

.contact-row:hover,
.contact-row:focus-visible {
  background: rgba(158, 170, 255, 0.06);
  padding-left: 8px;
}

.contact-label {
  flex: 0 0 auto;
  width: 5.5em;
  color: #9eaaff;
  font-size: 0.85em;
}

.contact-value {
  color: #bb7f82;
  font-size: 0.88em;
  border-bottom: 1px solid rgba(187, 127, 130, 0.4);
}

.contact-row:hover .contact-value,
.contact-row:focus-visible .contact-value {
  color: #d99ea1;
  border-color: rgba(187, 127, 130, 0.8);
}

.placeholder-box {
  border: 1px dashed rgba(238, 240, 255, 0.25);
  padding: 20px 16px;
  text-align: center;
  font-style: italic;
  letter-spacing: 0.02em;
  font-size: 0.85em;
  color: rgba(238, 240, 255, 0.4);
  line-height: 1.7;
}

.cursor {
  display: inline-block;
  width: 0.5em;
  height: 1.05em;
  margin-left: 2px;
  color: #bb7f82;
  background: currentColor;
  box-sizing: content-box;
  vertical-align: text-bottom;
  position: relative;
  top: -0.12em;
  animation: flash 2s ease-in-out infinite;
}

@keyframes flash {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.15; }
}

.term-prompt {
  margin-top: 14px;
  font-family: 'JetBrainsMono NF ExtraBold', 'Courier New', monospace;
  color: #9eaaff;
}

.term-prompt .typed-cmd {
  color: #bb7f82;
}

/* by default the live prompt line just sits in normal flow, left-aligned,
   right after whatever content is in .term-bio - it only gets pulled out
   into an overlaid bar (see .bio-scrolling below) once there's actually too
   much content for .term-bio to show without scrolling */
.term-prompt-bar {
  position: static;
  text-align: left;
  padding: 8px 20px 14px;
  pointer-events: auto;
}

/* .term-bio has overflowed into a scrollbar - pin the prompt bar over its
   bottom edge instead, so .term-bio scrolls underneath it instead of the
   prompt line scrolling away out of view */
.term-box.bio-scrolling .term-prompt-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  text-align: left;
  padding: 30px 20px 14px;
  pointer-events: none; /* lets clicks/touches fall through to .term-bio so scrolling still works under here */
  background: linear-gradient(to bottom,
    rgba(3, 3, 5, 0) 0%,
    rgba(3, 3, 5, 0.85) 60%,
    #030305 100%);
}

.term-prompt-bar .term-prompt {
  margin-top: 0;
  pointer-events: auto; /* the prompt line itself stays tappable, for focusing input */
}

/* output from a typed command */
.term-line {
  margin-top: 6px;
  line-height: 1.7;
}

.term-hint {
  color: rgba(238, 240, 255, 0.3);
  font-size: 0.86em;
  font-style: italic;
}

.term-key {
  color: #9eaaff;
}

.term-err {
  color: #bb7f82;
}

.term-help {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 2px 16px;
  font-size: 0.92em;
}

.term-help-desc {
  color: rgba(238, 240, 255, 0.5);
}

/* real keystrokes land here, the prompt line is just painted html */
.term-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  background: transparent;
  color: transparent;
  font-size: 16px; /* stops ios zooming when it takes focus */
}

.term-title-text .typed-cmd {
  color: #bb7f82;
}

.floaters {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.floater {
  position: absolute;
  pointer-events: auto;
  background: none;
  border: none;
  margin: 0;
  padding: 6px 10px;
  font-family: 'JetBrainsMono NF ExtraBold', 'Courier New', monospace;
  font-size: clamp(1.6rem, 3.4vw, 2.1rem);
  text-decoration: underline;
  letter-spacing: 0.04em;
  color: #bb7f82;
  text-shadow: 0 0 10px rgba(187, 127, 130, 0.35);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.9s ease, color 0.25s ease, text-shadow 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}

.floater.floater-visible {
  opacity: 1;
}

.floater:hover,
.floater:focus-visible {
  color: #d99ea1;
  text-shadow: 0 0 16px rgba(187, 127, 130, 0.7);
}

.floater:active {
  color: #f2c1c4;
}

.floater:focus-visible {
  outline: 1px solid rgba(187, 127, 130, 0.6);
  outline-offset: 4px;
}

.floater[disabled] {
  cursor: default;
  opacity: 0.35 !important;
}

/* hidden when a category's open, !important beats the fade-in's opacity:1 */
.floater.term-hidden {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.9s ease;
}

@keyframes floaterSway {
  0%   { transform: translate(0, 0) rotate(0deg); }
  25%  { transform: translate(8px, -10px) rotate(2deg); }
  50%  { transform: translate(-6px, 6px) rotate(-1.5deg); }
  75%  { transform: translate(6px, 8px) rotate(1.5deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

@keyframes fadein {
  to { opacity: 1; }
}
/*
@media (prefers-reduced-motion: reduce) {
  .overlay { animation: none; opacity: 1; }
}
*/
