/* ============================================
   Cloud Operator Dashboard — Gaurav Portfolio
   ============================================ */

@import url("https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600&family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  --bg-console: #080c10;
  --bg-primary: #0b1017;
  --bg-panel: #111820;
  --bg-card: #151d28;
  --bg-inset: #0d1219;

  --text-primary: #e8edf4;
  --text-muted: #8b9cb3;
  --text-subtle: #5c6b7f;
  --text-mono: #a8bdd4;

  --accent: #22d3ee;
  --accent-dim: rgba(34, 211, 238, 0.1);
  --accent-glow: rgba(34, 211, 238, 0.35);

  --border: #1e2a3a;
  --border-bright: #2d3f56;

  --success: #34d399;
  --success-dim: rgba(52, 211, 153, 0.15);
  --warning: #fbbf24;
  --warning-dim: rgba(251, 191, 36, 0.12);

  --pulse: #34d399;

  --radius: 6px;
  --radius-lg: 10px;
  --radius-avatar: 16px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 24px rgba(34, 211, 238, 0.08);
  --shadow-avatar: 0 12px 40px rgba(34, 211, 238, 0.14), 0 4px 20px rgba(0, 0, 0, 0.5);

  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 2.5rem;

  --font-sans: "Inter", system-ui, sans-serif;
  --font-mono: "Fira Code", Consolas, monospace;

  --max-width: 1600px;
  --page-padding: 40px;
  --status-height: 34px;
  --header-height: 60px;
}

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

html {
  scroll-behavior: smooth;
}

/* Pinned top shell — status bar + nav never overlap page content */
.app-top {
  position: sticky;
  top: 0;
  z-index: 200;
  width: 100%;
  background: var(--bg-console);
}

body {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--text-primary);
  background-color: var(--bg-console);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: #67e8f9;
}

ul {
  list-style: none;
}

/* ── Top Status Bar (full width) ── */
.status-bar {
  width: 100%;
  height: var(--status-height);
  background: linear-gradient(180deg, #0e141c 0%, #0a0f15 100%);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}

.status-bar__inner {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--page-padding);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.status-bar__left,
.status-bar__center,
.status-bar__right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.status-bar__brand {
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
}

.status-bar__region {
  color: var(--text-subtle);
  padding: 0.1rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg-inset);
}

.status-bar__metric {
  color: var(--text-muted);
}

.status-bar__metric span {
  color: var(--text-mono);
}

.status-bar__pulse {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--success);
  font-weight: 500;
}

.pulse-node {
  position: relative;
  width: 8px;
  height: 8px;
  flex-shrink: 0;
}

.pulse-node::before,
.pulse-node::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--pulse);
}

.pulse-node::before {
  animation: pulse-ring 2s ease-out infinite;
}

.pulse-node::after {
  box-shadow: 0 0 8px var(--pulse);
}

@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 0.9; }
  70% { transform: scale(2.8); opacity: 0; }
  100% { transform: scale(2.8); opacity: 0; }
}

/* ── Site Header (inside app-top) ── */
.site-header {
  width: 100%;
  background: rgba(11, 16, 23, 0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--page-padding);
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-sm);
}

.site-header__brand {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.site-header__brand span {
  color: var(--accent);
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 1;
  gap: 0.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.site-nav::-webkit-scrollbar {
  display: none;
}

.nav-link {
  padding: 0.45rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.nav-link[aria-current="page"] {
  color: var(--accent);
  background: var(--accent-dim);
  border-color: rgba(34, 211, 238, 0.25);
}

.nav-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Main Layout ── */
.page {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--spacing-md) var(--page-padding) var(--spacing-xl);
}

.panel {
  width: 100%;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: var(--spacing-md);
}

.panel__header {
  width: 100%;
  padding: 0.55rem var(--page-padding);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.panel__header::before {
  content: "// ";
  color: var(--accent);
}

.panel__body {
  width: 100%;
  padding: var(--spacing-lg) var(--page-padding);
}

/* ── Hero ── */
.hero__grid {
  display: grid;
  gap: var(--spacing-lg);
  align-items: center;
}

.main-content {
  outline: none;
  scroll-margin-top: 120px;
}

.hero {
  scroll-margin-top: 120px;
}

.avatar-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  width: fit-content;
  margin: 0 auto;
}

.avatar-frame {
  width: 180px;
  height: 220px;
  border-radius: var(--radius-avatar);
  border: 1px solid var(--border);
  background: var(--bg-card);
  overflow: hidden;
  box-shadow: var(--shadow-avatar);
  position: relative;
}

.avatar__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-avatar);
  display: block;
}

.avatar__img[hidden] {
  display: none;
}

.avatar__fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 3rem;
  font-weight: 600;
  color: var(--accent);
  background: linear-gradient(160deg, var(--bg-card) 0%, var(--bg-inset) 100%);
  border-radius: var(--radius-avatar);
}

.avatar__fallback[hidden] {
  display: none;
}

.terminal-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--success);
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.terminal-badge__prompt {
  color: var(--text-subtle);
}

.cursor-blink {
  display: inline-block;
  width: 0.5em;
  height: 1em;
  background: var(--accent);
  margin-left: 1px;
  vertical-align: text-bottom;
  animation: cursor-blink 1.1s step-end infinite;
}

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

.hero__name {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 0.3rem;
}

.hero__role {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  margin-bottom: var(--spacing-sm);
}

.hero__headline {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: var(--spacing-md);
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--bg-inset);
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: pointer;
  min-height: 40px;
  color: var(--text-primary);
  background: var(--bg-inset);
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  border-color: var(--border-bright);
  background: var(--bg-card);
  text-decoration: none;
}

.btn--primary {
  color: var(--accent);
  border-color: var(--border-bright);
  background: var(--bg-card);
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.06);
}

.btn--primary:hover {
  border-color: var(--accent);
  color: #67e8f9;
  box-shadow: var(--shadow-glow);
}

.btn--ghost {
  color: var(--text-muted);
  background: var(--bg-inset);
}

.btn--ghost:hover {
  border-color: var(--border-bright);
  color: var(--text-primary);
}

/* ── Page Sections (tab panels) ── */
.page-section {
  display: none;
  animation: fade-in 0.2s ease;
  scroll-margin-top: 120px;
}

.page-section[data-active="true"] {
  display: block;
}

.page-section--enter {
  animation: section-reveal 0.35s ease;
}

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

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

.section-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.3rem;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--spacing-md);
}

.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--spacing-lg) 0;
}

/* ── About ── */
.about__layout {
  display: grid;
  gap: var(--spacing-lg);
  align-items: start;
  grid-template-columns: 1fr;
}

.about__text p {
  color: var(--text-muted);
  margin-bottom: var(--spacing-sm);
  max-width: 62ch;
}

.about__text p:last-child {
  margin-bottom: 0;
}

.about__text strong {
  color: var(--text-primary);
  font-weight: 600;
}

.about__metrics {
  width: 100%;
}

.metrics-row {
  display: grid;
  gap: var(--spacing-sm);
}

.metrics-row--sidebar {
  grid-template-columns: 1fr;
}

.metric-card {
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.metric-card__label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.2rem;
}

.metric-card__value {
  font-size: 0.875rem;
  font-weight: 600;
}

.metric-card__value--accent {
  color: var(--accent);
}

/* ── Cards ── */
.card-grid {
  display: grid;
  gap: var(--spacing-sm);
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  border-color: var(--border-bright);
  box-shadow: var(--shadow-glow);
}

.card__title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: var(--spacing-xs);
}

.card__desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: var(--spacing-sm);
  line-height: 1.55;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 0.2rem 0.5rem;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(34, 211, 238, 0.18);
  border-radius: 3px;
}

/* ── Experience ── */
.experience-stack {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.experience-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
}

.job-header {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-sm);
  border-bottom: 1px solid var(--border);
}

.job-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
}

.role-title {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-subtle);
  white-space: nowrap;
}

.job-bullets li {
  position: relative;
  padding-left: 1rem;
  margin-bottom: 0.45rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.job-bullets li:last-child {
  margin-bottom: 0;
}

.job-bullets li strong {
  color: var(--text-primary);
  font-weight: 600;
}

.job-bullets li::before {
  content: ">";
  position: absolute;
  left: 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
}

@media (min-width: 768px) {
  .job-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }
}

.deploy-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--success);
  margin-bottom: var(--spacing-xs);
}

.deploy-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
}

/* ── Certifications ── */
.cert-list {
  display: grid;
  gap: var(--spacing-xs);
}

.cert-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-xs);
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.cert-row__name {
  font-size: 0.875rem;
  font-weight: 500;
}

.badge {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
}

.badge--ok {
  background: var(--success-dim);
  color: var(--success);
  border: 1px solid rgba(52, 211, 153, 0.25);
}

.badge--pending {
  background: var(--warning-dim);
  color: var(--warning);
  border: 1px solid rgba(251, 191, 36, 0.25);
}

.badge--edu {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(34, 211, 238, 0.2);
}

/* ── Resume ── */
.resume-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
}

.resume-viewer {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 520px;
}

.resume-viewer__frame {
  width: 100%;
  height: 75vh;
  min-height: 520px;
  border: none;
  display: block;
  background: #fff;
}

/* ── Contact ── */
.contact-grid {
  display: grid;
  gap: var(--spacing-md);
}

.contact-info {
  display: grid;
  gap: var(--spacing-sm);
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.contact-item__icon {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  min-width: 3.5rem;
  padding-top: 0.1rem;
}

.contact-item__label {
  font-size: 0.7rem;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.15rem;
}

.contact-item__value {
  font-size: 0.9rem;
  color: var(--text-primary);
}

.contact-form {
  display: grid;
  gap: var(--spacing-sm);
}

.form-group label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--text-primary);
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

.form-note {
  font-size: 0.78rem;
  color: var(--text-subtle);
  font-family: var(--font-mono);
}

/* ── Footer ── */
.footer {
  width: 100%;
  border-top: 1px solid var(--border);
  padding: var(--spacing-md) var(--page-padding);
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-subtle);
  margin-top: var(--spacing-lg);
}

.footer__inner {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer a {
  color: var(--text-muted);
}

/* ── Responsive ── */
@media (min-width: 640px) {
  .card-grid--skills {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }

  .card-grid--projects {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-grid {
    grid-template-columns: 1fr 1.2fr;
  }
}

@media (min-width: 1200px) {
  .card-grid--skills {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 900px) {
  .about__layout {
    grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr);
    gap: var(--spacing-xl);
  }

  .about__metrics {
    position: sticky;
    top: calc(var(--status-height) + var(--header-height) + 24px);
  }
}

@media (min-width: 768px) {
  .hero__grid {
    grid-template-columns: auto 1fr;
    gap: var(--spacing-xl);
  }

  .avatar-container {
    margin: 0;
  }

  .avatar-frame {
    width: 200px;
    height: 240px;
  }

  .avatar__fallback {
    font-size: 3.25rem;
  }

  .hero__name {
    font-size: 2.5rem;
  }

  .section-title {
    font-size: 1.65rem;
  }
}

@media (max-width: 600px) {
  :root {
    --page-padding: 24px;
  }

  .status-bar__center {
    display: none;
  }

  .site-header__inner {
    flex-direction: column;
    height: auto;
    padding: 0.65rem var(--page-padding);
    gap: 0.5rem;
  }

  .site-nav {
    width: 100%;
    justify-content: flex-start;
  }

  .panel__body {
    padding: var(--spacing-md) var(--page-padding);
  }

  .panel__header {
    padding: 0.55rem var(--page-padding);
  }
}
