:root {
  --font-family: "IBM Plex Mono", "JetBrains Mono", monospace;
  --display-font: "Bricolage Grotesque", "Avenir Next", sans-serif;

  --background-color: #0f121a;
  --window-bg-color: #161b27;
  --text-color: #eef3ff;
  --prompt-user-color: #7ff3b4;
  --prompt-path-color: #7fcfff;
  --prompt-symbol-color: #eef3ff;
  --command-echo-color: #dce7ff;
  --output-color: #eef3ff;
  --error-color: #ff6e84;
  --link-color: #90e9ff;
  --header-bg: #1a2435;
  --highlight-color: #ffd184;
  --scrollbar-thumb-color: #405a77;
  --scrollbar-track-color: #1a2332;
  --caret-color: #eef3ff;
  --font-size: 1em;
  --footer-text-color: #9caec6;
  --power-prompt-text-color: #a2dfff;

  --power-button-size: 88px;
  --power-button-icon-svg-size: 28px;
  --power-button-bg-start: #e4f4ff;
  --power-button-bg-end: #9bc8e8;
  --power-button-border-color: #4e7592;
  --power-button-icon-color: #10324b;
  --power-button-glow-color: rgba(126, 210, 255, 0.46);
  --power-light-strip-color: transparent;
  --power-light-strip-width: 4.5px;
  --power-button-threshold-flash-opacity: 0.72;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  position: relative;
  padding: 24px clamp(14px, 3.6vw, 38px) 84px;
  font-family: var(--font-family);
  font-size: var(--font-size);
  color: var(--text-color);
  background: radial-gradient(circle at 12% -18%, rgba(255, 168, 86, 0.34) 0%, rgba(255, 168, 86, 0) 42%),
    radial-gradient(circle at 88% 14%, rgba(99, 196, 255, 0.24) 0%, rgba(99, 196, 255, 0) 38%),
    radial-gradient(circle at 52% 120%, rgba(134, 156, 255, 0.2) 0%, rgba(134, 156, 255, 0) 40%),
    linear-gradient(150deg, #0f131b 0%, #0a0f17 52%, #070b12 100%);
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  pointer-events: none;
  z-index: -2;
  border-radius: 999px;
  filter: blur(70px);
  opacity: 0.3;
}

body::before {
  width: 220px;
  height: 220px;
  top: 16%;
  right: 8%;
  background: rgba(104, 189, 255, 0.55);
  animation: drift-orb 14s ease-in-out infinite;
}

body::after {
  width: 280px;
  height: 280px;
  left: 8%;
  bottom: 10%;
  background: rgba(255, 169, 99, 0.42);
  animation: drift-orb 18s ease-in-out infinite reverse;
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image: linear-gradient(rgba(131, 164, 204, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(131, 164, 204, 0.06) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at center, black 40%, transparent 96%);
}

.control-room {
  width: min(1280px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 14px;
  animation: rise-in 0.7s ease both;
}

.top-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr);
  gap: 16px;
  align-items: center;
  padding: clamp(14px, 1.8vw, 22px);
  border-radius: 16px;
  border: 1px solid rgba(167, 196, 224, 0.3);
  background: linear-gradient(160deg, rgba(18, 24, 37, 0.84), rgba(13, 19, 30, 0.68));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 18px 34px rgba(0, 0, 0, 0.38), 0 0 28px rgba(255, 169, 99, 0.1);
  backdrop-filter: blur(12px);
}

.chip {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.13em;
  color: #ffce8c;
}

.top-bar h1 {
  margin: 8px 0 0;
  font-family: var(--display-font);
  font-size: clamp(1.32rem, 2.2vw, 2.08rem);
  letter-spacing: 0.01em;
}

.top-copy {
  margin: 0;
  color: rgba(227, 236, 250, 0.86);
  font-size: 0.95rem;
}

.top-copy code {
  color: #ffd79c;
}

.main-bay {
  display: grid;
  grid-template-columns: minmax(230px, 0.85fr) minmax(0, 2.15fr);
  gap: 14px;
}

.dock-panel {
  border-radius: 16px;
  border: 1px solid rgba(163, 192, 220, 0.28);
  background: linear-gradient(180deg, rgba(17, 24, 36, 0.86), rgba(13, 20, 32, 0.68));
  padding: 16px;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.28);
}

.dock-title {
  margin: 0 0 10px;
  font-family: var(--display-font);
  font-size: 1rem;
  color: #ffcf95;
}

.dock-panel ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  font-size: 0.9rem;
}

.dock-panel li {
  border: 1px solid rgba(164, 194, 224, 0.18);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  padding: 9px 10px;
  color: rgba(227, 238, 255, 0.9);
}

.dock-panel code {
  color: #ffd6a0;
}

.terminal-frame {
  position: relative;
  border-radius: 20px;
  padding: 14px;
  border: 1px solid rgba(168, 196, 225, 0.3);
  background: linear-gradient(145deg, rgba(16, 22, 34, 0.9), rgba(10, 16, 26, 0.88));
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.42), 0 0 42px rgba(255, 169, 99, 0.08);
  min-height: min(76vh, 780px);
}

.terminal-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(circle at 16% 8%, rgba(255, 175, 107, 0.18), transparent 45%),
    radial-gradient(circle at 90% 94%, rgba(103, 188, 255, 0.16), transparent 45%);
}

#terminal {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  min-height: 62vh;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(176, 204, 233, 0.24);
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.18)), var(--window-bg-color);
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.4), 0 0 28px rgba(124, 198, 255, 0.14), 0 0 24px rgba(255, 164, 93, 0.08);
  transform-origin: center center;
  transition: box-shadow 0.25s ease;
}

#terminal:hover {
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.48), 0 0 44px rgba(123, 194, 255, 0.22), 0 0 30px rgba(255, 164, 93, 0.15);
}

#terminal.shutting-down {
  animation: vertical-off 0.55s forwards cubic-bezier(0.55, 0.085, 0.68, 0.53);
}

#terminal.powering-on {
  animation: vertical-on 0.62s forwards cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes vertical-off {
  0% {
    transform: scaleY(1);
    opacity: 1;
  }
  70% {
    transform: scaleY(0.02);
    opacity: 0.8;
  }
  100% {
    transform: scaleY(0);
    opacity: 0;
    filter: brightness(2);
  }
}

@keyframes vertical-on {
  0% {
    transform: scaleY(0) scaleX(1.02);
    opacity: 0;
  }
  40% {
    transform: scaleY(0.02) scaleX(1.01);
    opacity: 0.7;
  }
  100% {
    transform: scaleY(1) scaleX(1);
    opacity: 1;
  }
}

@keyframes drift-orb {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(12px, -10px, 0) scale(1.08);
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#terminal-header {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(188, 223, 255, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)), var(--header-bg);
}

.dot {
  height: 11px;
  width: 11px;
  margin-right: 7px;
  border-radius: 50%;
  display: inline-block;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.72;
  }
  50% {
    transform: scale(1.12);
    opacity: 1;
  }
}

.dot.red {
  background: #ff6d72;
}

.dot.yellow {
  background: #ffd26f;
  animation-delay: 0.2s;
}

.dot.green {
  background: #62e9b6;
  animation-delay: 0.4s;
}

.title {
  margin-left: 10px;
  font-size: 0.82rem;
  color: rgba(219, 236, 255, 0.72);
}

#terminal-body {
  flex-grow: 1;
  padding: 14px;
  background: rgba(0, 0, 0, 0.18);
  overflow-y: auto;
  word-wrap: break-word;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb-color) var(--scrollbar-track-color);
}

#terminal-body::-webkit-scrollbar {
  width: 8px;
}

#terminal-body::-webkit-scrollbar-track {
  background: var(--scrollbar-track-color);
  border-radius: 4px;
}

#terminal-body::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-thumb-color);
  border-radius: 4px;
  border: 2px solid var(--scrollbar-track-color);
}

.terminal-line {
  display: flex;
  margin-bottom: 2px;
}

.prompt {
  margin-right: 8px;
  white-space: nowrap;
}

.prompt-user {
  color: var(--prompt-user-color);
}

.prompt-path,
.output-path {
  color: var(--prompt-path-color);
}

.prompt-symbol {
  color: var(--prompt-symbol-color);
}

#command-input-container {
  display: flex;
  width: 100%;
  align-items: center;
}

.command-input-wrapper {
  position: relative;
  flex-grow: 1;
  min-width: 0;
}

.command-inline-suggestion {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  white-space: pre;
  color: rgba(214, 230, 255, 0.38);
  font-family: var(--font-family);
  font-size: var(--font-size);
  transform: translateX(var(--suggestion-offset, 0ch));
  z-index: 0;
}

#command-input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-color);
  font-family: var(--font-family);
  font-size: var(--font-size);
  outline: none;
  padding: 0;
  animation: caret-blink 1.2s step-end infinite;
  position: relative;
  z-index: 1;
}

@keyframes caret-blink {
  0%,
  100% {
    caret-color: var(--caret-color);
  }
  50% {
    caret-color: transparent;
  }
}

.command-echo {
  color: var(--command-echo-color);
}

.output {
  color: var(--output-color);
  white-space: pre-wrap;
}

.output-error {
  color: var(--error-color);
}

.output-link {
  color: var(--link-color);
  text-decoration: underline;
  cursor: pointer;
}

.output-link:hover {
  filter: brightness(1.16);
}

.output-highlight {
  color: var(--highlight-color);
}

.ascii-art {
  color: var(--prompt-user-color);
  font-family: "IBM Plex Mono", "Noto Sans Devanagari", monospace;
  white-space: pre;
  margin-bottom: 10px;
  line-height: 1.1;
}

.output-avatar img {
  max-width: 100px;
  max-height: 100px;
  border-radius: 50%;
  border: 2px solid var(--prompt-path-color);
  margin: 10px 0;
  display: block;
}

#power-button-area {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease;
}

#power-button-area.visible {
  opacity: 1;
}

#power-on-btn {
  width: var(--power-button-size);
  height: var(--power-button-size);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  color: var(--power-button-icon-color);
  background: linear-gradient(to bottom, var(--power-button-bg-start) 0%, var(--power-button-bg-end) 100%);
  border: 1px solid var(--power-button-border-color);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(255, 255, 255, 0.2) inset,
    inset 0 -2px 2px rgba(0, 0, 0, 0.2), inset 0 2px 1px rgba(255, 255, 255, 0.5);
  transition: transform 0.1s ease-out, box-shadow 0.15s ease-out;
}

#power-button-icon-svg {
  width: var(--power-button-icon-svg-size);
  height: var(--power-button-icon-svg-size);
  fill: currentColor;
  position: relative;
  z-index: 2;
}

#power-button-light-strip-svg {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
  z-index: 1;
  pointer-events: none;
}

@keyframes rgb-light-strip-animation {
  0% {
    stroke: hsl(0, 100%, 60%);
  }
  16% {
    stroke: hsl(60, 100%, 60%);
  }
  33% {
    stroke: hsl(120, 100%, 60%);
  }
  50% {
    stroke: hsl(180, 100%, 60%);
  }
  66% {
    stroke: hsl(240, 100%, 60%);
  }
  83% {
    stroke: hsl(300, 100%, 60%);
  }
  100% {
    stroke: hsl(0, 100%, 60%);
  }
}

#power-button-light-strip-circle {
  fill: none;
  stroke: var(--power-light-strip-color);
  stroke-width: var(--power-light-strip-width);
  transition: stroke-dashoffset 1s cubic-bezier(0.35, 0, 0.25, 1);
}

#power-button-light-strip-circle.active {
  animation: rgb-light-strip-animation 3s linear infinite;
}

#power-button-light-strip-circle.retracting {
  transition: stroke-dashoffset 0.3s cubic-bezier(0.6, 0.04, 0.98, 0.335), stroke 0.1s linear;
  animation: none;
}

@keyframes pulse-button-glow-animation {
  0%,
  100% {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(255, 255, 255, 0.2) inset,
      inset 0 -2px 2px rgba(0, 0, 0, 0.2), inset 0 2px 1px rgba(255, 255, 255, 0.5), 0 0 0 0 var(--power-button-glow-color);
  }
  50% {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(255, 255, 255, 0.2) inset,
      inset 0 -2px 2px rgba(0, 0, 0, 0.2), inset 0 2px 1px rgba(255, 255, 255, 0.5), 0 0 16px 7px var(--power-button-glow-color);
  }
}

#power-button-area.visible #power-on-btn:not(.interaction-held):not(.threshold-met) {
  animation: pulse-button-glow-animation 2.2s infinite ease-in-out;
}

#power-on-btn.interaction-held {
  transform: scale(0.95) translateY(1px);
}

#power-on-btn.interaction-held #power-button-icon-svg {
  transform: scale(0.9);
}

@keyframes threshold-flash-animation {
  0%,
  100% {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), inset 0 2px 3px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2),
      0 0 0 0 hsla(0, 0%, 100%, 0);
    transform: scale(0.95) translateY(1px);
  }
  50% {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), inset 0 2px 3px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2),
      0 0 0 9px hsla(0, 0%, 100%, var(--power-button-threshold-flash-opacity));
    transform: scale(1.03);
  }
}

#power-on-btn.threshold-met {
  animation: threshold-flash-animation 0.35s ease-out forwards;
}

#power-on-prompt {
  margin-top: 16px;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--power-prompt-text-color);
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

#power-button-area.visible #power-on-prompt {
  opacity: 0.88;
}

#developer-info {
  position: fixed;
  bottom: 12px;
  left: 0;
  width: 100%;
  text-align: center;
  font-size: 0.79rem;
  color: var(--footer-text-color);
  z-index: 5;
  pointer-events: auto;
}

.footer-link {
  color: inherit;
  text-decoration: none;
}

.footer-link:hover {
  text-decoration: underline;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
}

.module {
  border-radius: 16px;
  border: 1px solid rgba(163, 191, 219, 0.24);
  background: linear-gradient(170deg, rgba(17, 24, 36, 0.86), rgba(12, 19, 30, 0.72));
  padding: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 14px 28px rgba(0, 0, 0, 0.24);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.module:hover {
  transform: translateY(-2px);
  border-color: rgba(197, 214, 233, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 18px 34px rgba(0, 0, 0, 0.3);
}

.module-kicker {
  margin: 0;
  color: #ffce8f;
  letter-spacing: 0.11em;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.module-title {
  margin: 8px 0 0;
  font-family: var(--display-font);
  font-size: clamp(1.05rem, 1.8vw, 1.46rem);
  line-height: 1.12;
}

.about-module {
  grid-column: span 12;
}

.about-layout {
  margin-top: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 14px;
}

.about-copy p {
  margin: 0 0 10px;
  color: rgba(225, 235, 251, 0.85);
}

.about-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.metric-card {
  border-radius: 10px;
  border: 1px solid rgba(168, 196, 226, 0.2);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  padding: 10px;
  display: grid;
  gap: 4px;
}

.metric-value {
  font-family: var(--display-font);
  font-size: 1.2rem;
  color: #e6f0ff;
}

.metric-label {
  font-size: 0.76rem;
  color: rgba(212, 224, 241, 0.76);
}

.projects-module {
  grid-column: span 8;
}

.module-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.module-link {
  color: #a6dbff;
  text-decoration: none;
  font-size: 0.82rem;
}

.module-link:hover {
  text-decoration: underline;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.project-card {
  border-radius: 10px;
  border: 1px solid rgba(167, 195, 224, 0.2);
  background: rgba(255, 255, 255, 0.03);
  padding: 11px;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.project-card:hover {
  transform: translateY(-2px);
  border-color: rgba(205, 220, 237, 0.38);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
}

.project-name {
  margin: 0;
  font-family: var(--display-font);
  font-size: 0.98rem;
}

.project-desc {
  margin: 8px 0;
  color: rgba(221, 235, 255, 0.82);
  font-size: 0.86rem;
}

.project-stack {
  margin: 0;
  color: #9ad7ff;
  font-size: 0.78rem;
}

.timeline-module {
  grid-column: span 4;
}

.timeline-list {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.timeline-item {
  border-left: 2px solid rgba(255, 188, 120, 0.48);
  padding: 0 0 0 10px;
}

.timeline-year {
  color: #ffd197;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
}

.timeline-item p {
  margin: 6px 0 0;
  color: rgba(225, 235, 251, 0.84);
  font-size: 0.86rem;
}

.now-module {
  grid-column: span 7;
}

.now-list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: rgba(225, 235, 251, 0.87);
  display: grid;
  gap: 8px;
}

.contact-module {
  grid-column: span 5;
}

.contact-copy {
  margin: 12px 0;
  color: rgba(225, 235, 251, 0.84);
}

.contact-actions {
  display: flex;
  gap: 10px;
}

.cta-primary,
.cta-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.83rem;
  padding: 8px 12px;
}

.cta-primary {
  background: linear-gradient(180deg, #ffd9a6, #f1b978);
  color: #3a2208;
  font-weight: 700;
}

.cta-secondary {
  border: 1px solid rgba(175, 203, 232, 0.42);
  color: #c7e6ff;
}

.cta-primary:hover,
.cta-secondary:hover {
  filter: brightness(1.08);
}

@media (max-width: 1040px) {
  .top-bar,
  .main-bay {
    grid-template-columns: minmax(0, 1fr);
  }

  .terminal-frame {
    min-height: 68vh;
  }

  .dock-panel {
    order: 2;
  }

  .projects-module,
  .timeline-module,
  .now-module,
  .contact-module {
    grid-column: span 12;
  }

  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  body {
    padding: 14px 10px 78px;
  }

  .top-bar,
  .dock-panel,
  .terminal-frame {
    border-radius: 12px;
  }

  .terminal-frame {
    padding: 8px;
  }

  #terminal {
    min-height: 66vh;
    max-height: 74vh;
  }

  #terminal-body {
    padding: 11px;
  }

  .about-layout,
  .about-metrics,
  .project-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .module {
    padding: 14px;
    border-radius: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
