@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap");

:root {
  color-scheme: dark;
  --bg: #071127;
  --panel: rgba(6, 14, 28, 0.78);
  --accent: #7be3ff;
  --accent-strong: #b8fff6;
  --text: #eaf6ff;
  --muted: #9fc0dd;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Space Grotesk", sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

#app {
  position: relative;
  min-height: 100vh;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: radial-gradient(circle at top, rgba(20, 40, 85, 0.55), rgba(3, 8, 20, 0.95));
  z-index: 3;
  padding: 2rem;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.overlay.hidden {
  opacity: 0;
  visibility: hidden;
}

.hero {
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.25rem;
  font-size: 0.8rem;
  color: var(--accent);
}

h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.1;
}

.subhead {
  color: var(--muted);
  font-size: 1.1rem;
}

.start-btn {
  align-self: center;
  padding: 0.9rem 2.4rem;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: linear-gradient(120deg, rgba(108, 227, 255, 0.3), rgba(168, 255, 241, 0.5));
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  z-index: 3;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(108, 227, 255, 0.35);
}

.content {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  pointer-events: auto;
}

.content .section {
  pointer-events: auto;
  opacity: 0;
  transform: translateY(10px) scale(0.995);
  transition: opacity 0.45s cubic-bezier(.2,.9,.2,1), transform 0.45s cubic-bezier(.2,.9,.2,1);
  display: none;
}

.content .visible {
  display: block;
}

.content .section.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  display: block;
}

.section {
  padding: 3.5rem 1.5rem;
  width: 75%;
}

.section-inner {
  max-width: 1100px;
  margin: 0 auto;
  background: var(--panel);
  border: 1px solid rgba(108, 227, 255, 0.2);
  border-radius: 20px;
  padding: 0.5rem;
  backdrop-filter: blur(12px);
  box-shadow: 0 20px 60px rgba(2, 8, 20, 0.4);
  position: relative;
  z-index: 5;
  height: 75vh;
  max-height: calc(100vh - 80px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Box switch animation when changing active section */
.section-inner.switch-animate {
  animation: boxSwitch 420ms ease-out;
}

@keyframes boxSwitch {
  0% {
    transform: translateY(6px) scale(0.995);
    opacity: 0;
    box-shadow: 0 8px 20px rgba(2,8,20,0.18);
  }
  60% {
    transform: translateY(-4px) scale(1.01);
    opacity: 1;
    box-shadow: 0 18px 44px rgba(2,8,20,0.32);
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
    box-shadow: 0 16px 40px rgba(2,8,20,0.28);
  }
}

/* Computer screen chrome */
.console {
    display: flex;
    justify-content: center;
    gap: 1rem;
    height: 100%;
}
.console .screen {
  display: flex;
  flex-direction: column;
  min-height: 220px;
  padding: 0;
}
.screen .titlebar {
  height: 52px;
  background: linear-gradient(180deg, rgba(0,0,0,0.38), rgba(0,0,0,0.24));
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.screen .titlebar .title {
  font-weight: 600;
  color: var(--accent-strong);
}
.screen .titlebar .controls {
  margin-left: auto;
  display: flex;
  gap: 8px;
}
.screen .titlebar .controls .btn {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  box-shadow: 0 2px 6px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.04);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.screen .titlebar .controls .btn:nth-child(1) { background: linear-gradient(180deg,#ff5f56,#ff7b6b); }
.screen .titlebar .controls .btn:nth-child(2) { background: linear-gradient(180deg,#ffbd2e,#ffd56a); }
.screen .titlebar .controls .btn:nth-child(3) { background: linear-gradient(180deg,#28ca41,#6be77a); }
.screen .titlebar .controls .btn:hover { transform: scale(1.08); box-shadow: 0 4px 12px rgba(0,0,0,0.5); }
.screen .titlebar .title { font-size: 0.98rem; letter-spacing: 0.01rem; }
.screen .content-area {
  padding: 18px;
  flex: 1 1 auto;
  overflow: auto;
  margin-bottom: 66px;
}
.screen .taskbar {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 14px;
  height: 64px;
  display: flex;
  align-items: flex-end;
  gap: 28px;
  padding: 10px 14px;
  background: rgba(10,14,22,0.22);
  border-radius: 999px;
  backdrop-filter: blur(8px) saturate(1.05);
  box-shadow: 0 10px 30px rgba(2,8,20,0.45);
}
.taskbar .task-icon {
  width: 46px;
  height: 46px;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border-radius: 12px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text);
  cursor: pointer;
  transition: transform 0.16s cubic-bezier(.2,.9,.2,1), background 0.12s ease;
  transform-origin: bottom center;
}
.taskbar .task-icon .label {
  font-size: 10px;
  margin-top: 4px;
  opacity: 0.9;
}
.taskbar .task-icon:hover { transform: scale(1.28) translateY(-6px); background: rgba(255,255,255,0.06); }
.taskbar .task-icon.active { box-shadow: 0 12px 30px rgba(123,227,255,0.08); transform: scale(1.18) translateY(-4px); }

/* hide global HUD when taskbar is present */
.hud { display: none; }

/* Console / TV styling */
.console {
  display: flex;
  justify-content: center;
  gap: 1rem;
}
.console .screen {
  background: linear-gradient(180deg, rgba(2,6,12,0.95), rgba(0,0,0,0.9));
  border-radius: 12px;
  padding: 2rem;
  width: 100%;
  height: 100%;
  min-height: 320px;
  box-shadow: inset 0 8px 30px rgba(0,0,0,0.6), 0 12px 40px rgba(2,8,20,0.6);
  border: 2px solid rgba(20,40,70,0.35);
  position: relative;
  color: var(--text);
  z-index: 6;
}
.console .screen {
  overflow: hidden;
}

/* TV scanline + subtle glow animation */
.console .screen:before {
  content: "";
  position: absolute;
  left: -40%;
  top: -40%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at 50% 40%, rgba(120,200,255,0.06), transparent 25%),
              linear-gradient(90deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.0) 50%, rgba(255,255,255,0.02) 100%);
  transform: rotate(6deg);
  mix-blend-mode: overlay;
  animation: screenFloat 8s ease-in-out infinite;
  pointer-events: none;
}
.console .screen:after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    180deg,
    rgba(255,255,255,0.01) 0px,
    rgba(255,255,255,0.01) 1px,
    rgba(0,0,0,0) 1px,
    rgba(0,0,0,0) 3px
  );
  opacity: 0.12;
  animation: scan 6s linear infinite;
  pointer-events: none;
}

@keyframes scan {
  from { transform: translateY(-10%); opacity: 0.08; }
  50% { transform: translateY(10%); opacity: 0.14; }
  to { transform: translateY(-10%); opacity: 0.08; }
}

@keyframes screenFloat {
  0% { transform: rotate(5deg) translateY(0); }
  50% { transform: rotate(6deg) translateY(-6px); }
  100% { transform: rotate(5deg) translateY(0); }
}
.console .screen h2 {
  color: var(--accent-strong);
  margin-bottom: 0.6rem;
}
/* Highlighted keywords styling inside panels */
.screen .content-area strong {
  color: var(--accent);
  font-weight: 700;
  padding: 0 0.15rem;
  border-radius: 3px;
  text-shadow: 0 1px 0 rgba(0,0,0,0.45);
}

.screen .content-area strong::selection {
  background: rgba(123,227,255,0.12);
}

/* Skills grid layout and category styling */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem 1.25rem;
  margin-top: 0.6rem;
}
.skill-category {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(123,227,255,0.04);
  padding: 0.85rem 0.95rem;
  border-radius: 10px;
}
.skill-category h3 {
  color: var(--accent-strong);
  font-size: 0.98rem;
  margin-bottom: 0.5rem;
}
.skill-category ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.skill-category li { color: var(--muted); font-size: 0.95rem; }

/* One-line lead style for intro */
.screen .one-liner {
  color: var(--accent-strong);
  font-weight: 600;
  margin-bottom: 0.6rem;
  font-size: 1.02rem;
}
.console:before {
  /* console frame top bar */
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

/* Add small control lights on the top-left of the console */
.section-inner {
  position: relative;
}
.section-inner:before {
  content: "";
  position: absolute;
  top: -12px;
  left: 18px;
  width: 48px;
  height: 10px;
  background: linear-gradient(90deg, rgba(255,90,90,0.9), rgba(255,210,90,0.9), rgba(90,255,180,0.9));
  border-radius: 6px;
  filter: blur(6px);
  opacity: 0.14;
}

/* Make blog cards look like console tiles */
.blog-card {
  background: linear-gradient(180deg, rgba(8,14,24,0.7), rgba(6,12,20,0.6));
  border: 1px solid rgba(108,227,255,0.06);
}

/* TV-like large visual effect for skill/grid and lists */
.screen .skill-grid,
.screen .blog-list {
  margin-top: 0.8rem;
}

@media (max-width: 700px) {
  .section-inner {
    padding: 2rem 1.5rem;
  }

  .content {
    align-items: flex-end;
    padding-bottom: 1.2rem;
  }

  .console .screen {
    min-height: 220px;
    padding: 1.25rem;
    height: auto;
  }

  .section-inner {
    height: auto;
    max-height: none;
    overflow: visible;
    display: block;
  }
}

/* Additional mobile refinements for small phones */
@media (max-width: 520px) {
  .section {
    width: 95%;
    padding: 1rem;
  }

  .section-inner {
    height: auto;
    max-height: none;
    overflow: auto;
    padding: 1rem;
    border-radius: 14px;
  }

  .console .screen {
    padding: 1rem;
    min-height: auto;
  }

  .screen .titlebar {
    height: 44px;
    padding: 0 10px;
  }

  .screen .titlebar .title { font-size: 0.95rem; }
  .screen .titlebar .controls .btn { width: 12px; height: 12px; }

  .screen .content-area { padding: 12px; margin-bottom: 78px; }

  .screen .taskbar {
    left: 8px;
    right: 8px;
    transform: none;
    bottom: 10px;
    height: 56px;
    gap: 10px;
    padding: 8px;
    border-radius: 14px;
    justify-content: center;
  }

  .taskbar .task-icon { width: 40px; height: 40px; }
  .taskbar .task-icon .label { display: none; }

  .one-liner { font-size: 0.98rem; }

  .hero h1 { font-size: clamp(1.4rem, 6vw, 2rem); }
  .start-btn { padding: 0.6rem 1.2rem; font-size: 0.95rem; }
}

.section h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin-bottom: 1rem;
}

.section p {
  color: var(--muted);
  line-height: 1.7;
}

.timeline {
  list-style: none;
  display: grid;
  gap: 1.5rem;
}

.timeline-year {
  color: var(--accent);
  font-weight: 600;
  display: block;
  margin-bottom: 0.4rem;
}

.skill-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.skill h3 {
  font-size: 1rem;
  margin-bottom: 0.6rem;
}

.meter {
  height: 10px;
  background: rgba(108, 227, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
}

.meter span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
}

.blog-list {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.blog-card {
  padding: 1.4rem;
  border-radius: 16px;
  border: 1px solid rgba(108, 227, 255, 0.2);
  background: rgba(6, 16, 35, 0.8);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.blog-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

/* Empty state for lists */
.empty-state {
  color: var(--muted);
  font-style: italic;
  padding: 1rem 0;
}

/* Certification heading highlight */
.cert-list h4 {
  color: #ffb84d;
  background: rgba(255,184,77,0.06);
  padding: 0.35rem 0.6rem;
  border-left: 4px solid #ffb84d;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 0.6rem;
}

.contact-links {
  display: flex;
  gap: 1rem;
  margin-top: 1.2rem;
  flex-wrap: wrap;
}

.contact-links a {
  padding: 0.7rem 1.6rem;
  border-radius: 999px;
  border: 1px solid rgba(108, 227, 255, 0.4);
  color: var(--text);
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.contact-links a:hover {
  background: rgba(108, 227, 255, 0.2);
  border-color: var(--accent);
}

/* HUD styles */
.hud {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 1rem;
  z-index: 5;
  width: min(980px, calc(100% - 2rem));
  display: flex;
  justify-content: center;
}
.hud-inner {
  background: linear-gradient(180deg, rgba(12,20,34,0.5), rgba(6,12,22,0.6));
  border: 1px solid rgba(123,227,255,0.12);
  padding: 0.6rem 1rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  justify-content: space-between;
  backdrop-filter: blur(8px);
}
.hud-title {
  color: var(--accent-strong);
  font-weight: 600;
}
.hud-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.hud-dots {
  display: flex;
  gap: 0.5rem;
}
.hud-btn {
  background: transparent;
  border: 1px solid rgba(123,227,255,0.12);
  color: var(--text);
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  cursor: pointer;
}
.hud-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(123,227,255,0.08);
  cursor: pointer;
}
.hud-dot.active {
  background: var(--accent);
  box-shadow: 0 6px 18px rgba(123,227,255,0.12);
}

@media (max-width: 700px) {
  .section-inner {
    padding: 2rem 1.5rem;
  }

  .content {
    align-items: flex-end;
    padding-bottom: 1.2rem;
  }
}
