:root {
  color-scheme: dark;
  --bg: #05070d;
  --ink: #f4fbff;
  --muted: #92a6ba;
  --cyan: #26f3ff;
  --green: #9cff68;
  --coral: #ff6b5f;
  --gold: #ffd166;
  --panel: rgba(8, 16, 27, 0.64);
  --line: rgba(255, 255, 255, 0.18);
}

* {
  box-sizing: border-box;
}

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

body {
  overflow: hidden;
  background:
    linear-gradient(115deg, rgba(38, 243, 255, 0.12), transparent 28%),
    linear-gradient(250deg, rgba(255, 107, 95, 0.10), transparent 34%),
    #05070d;
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body.cv-page {
  overflow-y: auto;
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, transparent, black 16%, black 82%, transparent);
}

.vanta-field {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100vw;
  height: 100vh;
  opacity: 0.15;
  pointer-events: none;
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.035),
    rgba(255, 255, 255, 0.035) 1px,
    transparent 1px,
    transparent 7px
  );
  opacity: 0.18;
}

.background-audio {
  display: none;
}

.shell {
  position: relative;
  z-index: 3;
  display: grid;
  min-height: 100vh;
  padding: clamp(18px, 3vw, 42px);
  grid-template-rows: auto 1fr auto;
}

.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.copyright {
  text-transform: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 38px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.055);
  box-shadow: 0 0 24px rgba(38, 243, 255, 0.18);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero {
  align-self: center;
  justify-self: center;
  width: min(1120px, 100%);
  text-align: center;
}

h1 {
  margin: 0;
  color: var(--ink);
  font-size: 5rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  text-shadow:
    0 0 18px rgba(38, 243, 255, 0.62),
    0 0 55px rgba(255, 107, 95, 0.20);
}

.linkedin-float {
  position: fixed;
  top: clamp(16px, 2.2vw, 28px);
  right: clamp(16px, 2.4vw, 30px);
  z-index: 5;
  display: grid;
  justify-items: end;
  gap: 10px;
}

.projects-panel {
  margin-top: 24px;
}

.projects-drawer {
  width: min(960px, 100%);
  margin: 0 auto;
  border: 1px solid rgba(38, 243, 255, 0.32);
  background: rgba(8, 16, 27, 0.62);
  box-shadow: 0 0 32px rgba(38, 243, 255, 0.12);
  backdrop-filter: blur(16px);
  text-align: left;
}

.projects-drawer > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  cursor: pointer;
  list-style: none;
}

.projects-drawer > summary::-webkit-details-marker {
  display: none;
}

.projects-title {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.projects-hint {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.projects-drawer[open] .projects-hint {
  color: var(--green);
}

.projects-drawer-content {
  max-height: min(46vh, 440px);
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(38, 243, 255, 0.9) rgba(7, 14, 24, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 14px 16px 16px;
}

.projects-drawer-content::-webkit-scrollbar {
  width: 10px;
}

.projects-drawer-content::-webkit-scrollbar-track {
  background: linear-gradient(180deg, rgba(7, 14, 24, 0.96), rgba(4, 9, 18, 0.96));
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.projects-drawer-content::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(38, 243, 255, 0.92), rgba(156, 255, 104, 0.85));
  border-radius: 12px;
  border: 2px solid rgba(7, 14, 24, 0.95);
  box-shadow: 0 0 16px rgba(38, 243, 255, 0.35);
}

.projects-drawer-content::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(156, 255, 104, 0.95), rgba(38, 243, 255, 0.95));
  box-shadow: 0 0 22px rgba(156, 255, 104, 0.35);
}

.projects-group + .projects-group {
  margin-top: 16px;
}

.projects-group h2 {
  margin: 0 0 8px;
  color: var(--cyan);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.projects-group ol {
  margin: 0;
  padding-left: 20px;
}

.projects-group li {
  margin: 0;
  padding: 0 0 8px;
}

.project-head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.project-abbr {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 22px;
  padding: 0 7px;
  border: 1px solid rgba(38, 243, 255, 0.5);
  color: var(--cyan);
  background: rgba(38, 243, 255, 0.1);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.project-link {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
  border-bottom: 1px solid rgba(38, 243, 255, 0.26);
}

.project-link:hover,
.project-link:focus-visible {
  color: var(--green);
  border-bottom-color: rgba(156, 255, 104, 0.68);
  outline: none;
}

.projects-group strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.projects-group p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.linkedin-icon-link {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(38, 243, 255, 0.55);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(10, 102, 194, 0.78);
  box-shadow: 0 0 30px rgba(38, 243, 255, 0.2);
  text-decoration: none;
}

.cv-button {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(156, 255, 104, 0.55);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(82, 150, 64, 0.78);
  box-shadow: 0 0 30px rgba(156, 255, 104, 0.2);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
}

.cv-button:hover,
.cv-button:focus-visible {
  border-color: var(--cyan);
  outline: none;
  box-shadow: 0 0 34px rgba(38, 243, 255, 0.22);
}


.linkedin-icon-link:hover,
.linkedin-icon-link:focus-visible,
.linkedin-qr-link:hover,
.linkedin-qr-link:focus-visible {
  border-color: var(--green);
  outline: none;
  box-shadow: 0 0 34px rgba(156, 255, 104, 0.22);
}

.linkedin-icon-link span {
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
}

.linkedin-qr-link {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  display: grid;
  place-items: center;
  width: 136px;
  height: 136px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 16, 27, 0.66);
  box-shadow: 0 0 28px rgba(38, 243, 255, 0.16);
  backdrop-filter: blur(18px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.linkedin-float:hover .linkedin-qr-link,
.linkedin-float:focus-within .linkedin-qr-link {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.linkedin-qr {
  display: block;
  width: 112px;
  height: 112px;
}

.audio-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(38, 243, 255, 0.5);
  border-radius: 0;
  color: var(--ink);
  background: rgba(38, 243, 255, 0.08);
  box-shadow: 0 0 26px rgba(38, 243, 255, 0.14);
  cursor: pointer;
  font: inherit;
}

.audio-toggle:hover,
.audio-toggle:focus-visible {
  border-color: var(--green);
  outline: none;
  box-shadow: 0 0 32px rgba(156, 255, 104, 0.22);
}

.audio-bars {
  display: inline-flex;
  align-items: end;
  gap: 3px;
  width: 18px;
  height: 18px;
}

.audio-bars i {
  display: block;
  width: 4px;
  min-height: 6px;
  background: var(--cyan);
  animation: meter 0.8s ease-in-out infinite alternate;
}

.audio-bars i:nth-child(2) {
  min-height: 13px;
  background: var(--green);
  animation-delay: 0.16s;
}

.audio-bars i:nth-child(3) {
  min-height: 9px;
  background: var(--coral);
  animation-delay: 0.28s;
}

body:not(.audio-on) .audio-bars i {
  animation-play-state: paused;
}

@keyframes meter {
  from { transform: scaleY(0.45); }
  to { transform: scaleY(1); }
}

@media (max-width: 1200px) {
  h1 {
    font-size: 4.55rem;
  }
}

@media (max-width: 820px) {
  body {
    overflow-y: auto;
  }

  .shell {
    min-height: 100svh;
  }

  .hud {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero {
    padding: 56px 0 132px;
  }

  h1 {
    font-size: 3.35rem;
    line-height: 1.05;
  }

  .projects-drawer-content {
    max-height: 44svh;
  }

}

@media (max-width: 520px) {
  h1 {
    font-size: 2.05rem;
  }

  .hud-bottom {
    align-items: stretch;
  }

  .audio-toggle {
    width: 100%;
  }

  .linkedin-float {
    top: 12px;
    right: 12px;
  }

  .linkedin-icon-link {
    width: 44px;
    height: 44px;
  }

  .linkedin-qr-link {
    width: 120px;
    height: 120px;
  }

  .linkedin-qr {
    width: 98px;
    height: 98px;
  }

  .linkedin-qr-link {
    width: 120px;
    height: 120px;
  }

  .linkedin-qr {
    width: 98px;
    height: 98px;
  }

}

/* CV Page Styles */
.cv-container {
  min-height: 100vh;
  padding: 40px 20px;
  background: linear-gradient(115deg, rgba(38, 243, 255, 0.08), transparent 28%),
              linear-gradient(250deg, rgba(255, 107, 95, 0.06), transparent 34%),
              #05070d;
  color: var(--ink);
}

.cv-header {
  max-width: 1000px;
  margin: 0 auto 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(38, 243, 255, 0.26);
}

.cv-header h1 {
  margin: 0 0 16px;
  color: var(--cyan);
  font-size: 2.2rem;
  font-weight: 900;
}

.cv-header-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cv-action-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cv-back-link {
  display: inline-block;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  transition: color 200ms ease;
}

.cv-back-link:hover {
  color: var(--cyan);
}

.cv-print-btn {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(38, 243, 255, 0.36);
  border-radius: 8px;
  background: rgba(8, 16, 27, 0.78);
  color: var(--cyan);
  font-size: 1.05rem;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.cv-print-btn:hover {
  border-color: rgba(38, 243, 255, 0.75);
  box-shadow: 0 0 18px rgba(38, 243, 255, 0.28);
  transform: translateY(-1px);
}

.cv-print-btn:active {
  transform: translateY(0);
}

.cv-share-btn {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(96, 255, 184, 0.45);
  border-radius: 8px;
  background: rgba(8, 16, 27, 0.78);
  color: #60ffb8;
  font-size: 1.02rem;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 200ms ease, border-color 200ms ease, opacity 140ms ease;
}

.cv-share-btn:hover {
  border-color: rgba(96, 255, 184, 0.9);
  box-shadow: 0 0 18px rgba(96, 255, 184, 0.28);
  transform: translateY(-1px);
}

.cv-share-btn:active {
  transform: translateY(0);
}

.cv-share-btn:disabled {
  cursor: progress;
  opacity: 0.65;
}

.cv-share-status {
  margin: 10px 0 0;
  min-height: 20px;
  font-size: 0.9rem;
  color: var(--muted);
}

.cv-share-status.is-success {
  color: #7affc4;
}

.cv-share-status.is-error {
  color: var(--coral);
}

.cv-content {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px;
  border: 1px solid rgba(38, 243, 255, 0.18);
  background: rgba(8, 16, 27, 0.48);
  border-radius: 8px;
  backdrop-filter: blur(12px);
  line-height: 1.8;
}

.cv-content h1,
.cv-content h2,
.cv-content h3,
.cv-content h4,
.cv-content h5,
.cv-content h6 {
  color: var(--cyan);
  margin-top: 24px;
  margin-bottom: 12px;
  font-weight: 800;
}

.cv-content h1 {
  font-size: 1.8rem;
}

.cv-content h2 {
  font-size: 1.4rem;
  border-bottom: 1px solid rgba(38, 243, 255, 0.2);
  padding-bottom: 8px;
}

.cv-content h3 {
  font-size: 1.1rem;
}

.cv-content p {
  margin: 12px 0;
  color: var(--ink);
}

.cv-content ul,
.cv-content ol {
  margin: 12px 0;
  padding-left: 24px;
}

.cv-content li {
  margin: 8px 0;
}

.cv-content a {
  color: var(--green);
  text-decoration: none;
  border-bottom: 1px solid rgba(156, 255, 104, 0.3);
  transition: color 200ms ease, border-color 200ms ease;
}

.cv-content a:hover {
  color: var(--cyan);
  border-bottom-color: rgba(38, 243, 255, 0.5);
}

.cv-content code {
  background: rgba(38, 243, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  color: var(--green);
}

.cv-content pre {
  background: rgba(0, 0, 0, 0.3);
  padding: 16px;
  border-radius: 6px;
  border-left: 3px solid var(--cyan);
  overflow-x: auto;
  margin: 16px 0;
}

.cv-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

.cv-content th,
.cv-content td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(38, 243, 255, 0.2);
}

.cv-content th {
  background: rgba(38, 243, 255, 0.1);
  color: var(--cyan);
  font-weight: 800;
}

.cv-login-form {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.cv-login-card {
  width: 100%;
  max-width: 400px;
  padding: 40px;
  border: 1px solid rgba(38, 243, 255, 0.26);
  background: rgba(8, 16, 27, 0.68);
  border-radius: 8px;
  backdrop-filter: blur(16px);
  box-shadow: 0 0 32px rgba(38, 243, 255, 0.1);
}

.cv-login-card h2 {
  margin: 0 0 16px;
  color: var(--cyan);
  font-size: 1.6rem;
  font-weight: 900;
  text-align: center;
}

@media print {
  * {
    background: transparent !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  html,
  body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    background: white !important;
    color: #000 !important;
    font-size: 12pt;
    line-height: 1.5;
  }

  .vanta-field,
  .scanlines,
  .background-audio,
  .linkedin-float,
  .hud,
  .shell > header,
  .shell > footer {
    display: none !important;
  }

  .cv-print-btn,
  .cv-share-btn,
  .cv-share-status,
  .cv-back-link {
    display: none !important;
  }

  body.cv-page {
    background: white !important;
    color: #000 !important;
  }

  .cv-container {
    background: white !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    max-width: 100% !important;
  }

  .cv-header {
    display: none !important;
  }

  .cv-content {
    max-width: 100% !important;
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    box-shadow: none !important;
    page-break-inside: avoid;
  }

  .cv-content * {
    background: transparent !important;
    box-shadow: none !important;
  }

  .cv-content h1,
  .cv-content h2,
  .cv-content h3,
  .cv-content h4,
  .cv-content h5,
  .cv-content h6 {
    color: #000 !important;
    page-break-after: avoid;
    page-break-inside: avoid;
  }

  .cv-content p,
  .cv-content li,
  .cv-content td,
  .cv-content th,
  .cv-content a,
  .cv-content span {
    color: #000 !important;
  }

  .cv-content a {
    text-decoration: underline;
  }

  .cv-content table {
    border-collapse: collapse;
    width: 100%;
  }

  .cv-content tr,
  .cv-content td,
  .cv-content th {
    page-break-inside: avoid;
  }

  img {
    max-width: 100%;
    page-break-inside: avoid;
  }

  @page {
    margin: 2cm;
    size: A4;
  }
}

.cv-login-card p {
  margin: 0 0 24px;
  color: var(--muted);
  text-align: center;
  font-size: 0.95rem;
}

.cv-error {
  padding: 12px 16px;
  margin-bottom: 24px;
  background: rgba(255, 107, 95, 0.1);
  border: 1px solid rgba(255, 107, 95, 0.5);
  border-radius: 4px;
  color: var(--coral);
  font-size: 0.9rem;
  text-align: center;
}

.cv-form-group {
  margin-bottom: 20px;
}

.cv-form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--cyan);
  font-size: 0.95rem;
  font-weight: 600;
}

.cv-form-group input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(38, 243, 255, 0.4);
  background: rgba(10, 20, 35, 0.6);
  border-radius: 6px;
  color: var(--ink);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.cv-form-group input:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 12px rgba(38, 243, 255, 0.2);
}

.cv-form-group input::placeholder {
  color: var(--muted);
}

.cv-submit-btn {
  width: 100%;
  padding: 12px 20px;
  border: 1px solid rgba(156, 255, 104, 0.5);
  background: rgba(82, 150, 64, 0.78);
  border-radius: 6px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: border-color 200ms ease, background 200ms ease, box-shadow 200ms ease;
}

.cv-submit-btn:hover,
.cv-submit-btn:focus-visible {
  border-color: var(--cyan);
  background: rgba(82, 150, 64, 0.95);
  box-shadow: 0 0 20px rgba(156, 255, 104, 0.2);
  outline: none;
}

@media (max-width: 380px) {
  h1 {
    font-size: 1.5rem;
  }
}
