/* ==========================================================================
   OPSCODE // Ultra-Minimal Mysterious Linux Terminal
   ========================================================================== */

:root {
  color-scheme: only dark;

  --bg-void: #040607;
  --bg-tty: rgba(7, 11, 13, 0.88);
  --text-primary: #dceee6;
  --text-secondary: #98b4a9;
  --text-muted: #7b9a8f;

  --accent-linux: #39ff88;
  --accent-ai: #5eead4;
  --accent-aws: #fbbf24;
  --text-on-accent: #031109;

  --border-subtle: #1c2f2d;
  --border-control: #3f6a5f;

  --scrollbar-thumb: #4b7a6c;
  --scrollbar-track: #05090a;

  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background-color: var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.6;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
  scrollbar-width: thin;
}

body {
  margin: 0;
  min-height: 100dvh;
  background-color: var(--bg-void);
  background-image:
    radial-gradient(ellipse 65% 45% at 50% 45%, rgba(57, 255, 136, 0.07), transparent 70%);
  color: var(--text-primary);
  overflow-x: clip;
  position: relative;
}

@supports not (scrollbar-color: auto) {
  html {
    scrollbar-width: auto;
  }

  html::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }

  html::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
  }

  html::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
  }
}

::selection {
  background-color: var(--accent-linux);
  color: var(--text-on-accent);
}

.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

:where(a:any-link, button):focus-visible {
  outline: 2px solid var(--accent-linux);
  outline-offset: 3px;
}

/* Ambient Effects */
.ambient-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.34;
}

.crt-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0) 0px,
      rgba(0, 0, 0, 0) 2px,
      rgba(0, 0, 0, 0.24) 3px,
      rgba(0, 0, 0, 0.24) 4px
    ),
    radial-gradient(circle at center, transparent 50%, rgba(1, 3, 4, 0.8) 100%);
  opacity: 0.5;
}

html.fx-paused .ambient-canvas,
html.fx-paused .crt-overlay {
  opacity: 0;
}

/* Page Frame */
.shell-page {
  position: relative;
  z-index: 2;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

/* Top & Bottom Micro-Bars */
.top-bar,
.bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 3vw, 2rem);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.top-bar__id,
.top-bar__right {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--accent-linux);
  box-shadow: 0 0 8px var(--accent-linux);
}

@media (prefers-reduced-motion: no-preference) {
  html:not(.fx-paused) .pulse-dot {
    animation: pulse-dot 3s ease-in-out infinite;
  }
}

@keyframes pulse-dot {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.28;
  }
}

.quiet-btn {
  min-block-size: 2rem;
  min-inline-size: 2rem;
  padding: 0.2rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border-control);
  border-radius: 3px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.quiet-btn:hover {
  color: var(--accent-linux);
  border-color: var(--accent-linux);
  background: rgba(57, 255, 136, 0.06);
}

/* Center Stage */
.terminal-stage {
  display: grid;
  place-items: center;
  padding: 1.5rem clamp(1rem, 4vw, 2rem);
}

.tty {
  width: min(100%, 580px);
  padding: clamp(1.6rem, 4vw, 2.6rem);
  background-color: var(--bg-tty);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.74),
    0 0 42px rgba(57, 255, 136, 0.05);
  backdrop-filter: blur(8px);
}

.tty__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.6rem;
}

.tty__brand {
  margin: 0;
  display: inline-flex;
  align-items: center;
  font-size: clamp(1.5rem, 3.4vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #effaf5;
}

.tty__sigil {
  color: var(--accent-linux);
  margin-right: 0.5rem;
  text-shadow: 0 0 14px rgba(57, 255, 136, 0.5);
}

.cursor {
  display: inline-block;
  width: 0.55ch;
  height: 1.05em;
  margin-left: 0.35rem;
  background-color: var(--accent-linux);
  opacity: 0.85;
}

@media (prefers-reduced-motion: no-preference) {
  html:not(.fx-paused) .cursor {
    animation: cursor-blink 1.25s steps(1, end) infinite;
  }
}

@keyframes cursor-blink {
  0%, 49% {
    opacity: 0.85;
  }
  50%, 100% {
    opacity: 0;
  }
}

.tty__domains {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.d-linux {
  color: var(--accent-linux);
}

.d-ai {
  color: var(--accent-ai);
}

.d-aws {
  color: var(--accent-aws);
}

.d-sep {
  color: var(--text-muted);
}

.tty__statement {
  margin-bottom: 1.75rem;
  font-size: 0.96rem;
}

.tty__statement p {
  margin: 0.2rem 0;
}

.tty__statement .muted {
  color: var(--text-secondary);
}

.tty__divider {
  height: 1px;
  background: linear-gradient(90deg, var(--border-control), var(--border-subtle) 65%, transparent);
  margin-bottom: 1.5rem;
}

.tty__contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.mail-link {
  color: var(--accent-linux);
  font-size: clamp(0.95rem, 2.2vw, 1.1rem);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px dashed rgba(57, 255, 136, 0.55);
  padding-bottom: 2px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.mail-link:hover {
  color: #8cffbc;
  border-bottom-color: #8cffbc;
}

@media (pointer: coarse) {
  .quiet-btn {
    min-block-size: 2.6rem;
    padding-inline: 0.8rem;
  }
}

@media (forced-colors: active) {
  .ambient-canvas,
  .crt-overlay {
    display: none;
  }

  .tty {
    border: 1px solid CanvasText;
    background: Canvas;
    color: CanvasText;
    box-shadow: none;
  }

  .quiet-btn {
    border: 1px solid ButtonText;
    background: ButtonFace;
    color: ButtonText;
  }

  .cursor {
    background-color: CanvasText;
  }

  :where(a:any-link, button):focus-visible {
    outline: 3px solid Highlight;
    outline-offset: 2px;
  }
}
