/* ==========================================================
   Resume & CV pages (resume.html and resume-view.html)
   Loaded after style.css.
   ========================================================== */

.page-main {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 1rem 3rem;
  text-align: center;
}
.page-title {
  margin: 1rem 0 0;
  font-family: var(--font-pixel);
  font-weight: 400;
  font-size: clamp(1.15rem, 3.4vw, 2.1rem);
  line-height: 1.4;
  color: #fff;
  text-shadow:
    0.125em 0.125em 0 color-mix(in srgb, var(--pc) 55%, transparent),
    0 0 6px var(--pc),
    0 0 20px var(--pc),
    0 0 44px color-mix(in srgb, var(--pc) 60%, transparent);
}

/* ==========================================================
   The vault
   ========================================================== */
.vault {
  --door: min(62vw, 40vh, 340px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
  margin-top: 1.75rem;
}
.vault[hidden],
.files[hidden] { display: none; }

.vault__frame {
  --c: var(--cyan);
  position: relative;
  display: grid;
  place-items: center;
  width: calc(var(--door) * 1.22);
  aspect-ratio: 1;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.03) 0 2px, transparent 2px 6px),
    #151231;
  perspective: 1000px;
}
/* The dark, glowing room behind the door */
.vault__frame::before {
  content: "";
  position: absolute;
  width: var(--door);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(45, 226, 255, 0.35), #05030f 70%);
  box-shadow: inset 0 0 30px rgba(45, 226, 255, 0.5);
}
/* Corner rivets on the frame */
.vault__frame::after {
  content: "";
  position: absolute;
  top: 5%;
  left: 5%;
  width: 8px;
  height: 8px;
  background: #8a93c4;
  box-shadow:
    calc(var(--door) * 1.22 * 0.9 - 8px) 0 0 #8a93c4,
    0 calc(var(--door) * 1.22 * 0.9 - 8px) 0 #8a93c4,
    calc(var(--door) * 1.22 * 0.9 - 8px) calc(var(--door) * 1.22 * 0.9 - 8px) 0 #8a93c4;
}

.vault__leaf {
  position: relative;
  z-index: 1;
  width: var(--door);
  aspect-ratio: 1;
  container-type: inline-size;
  transform-origin: left center;
}
.vault__door-art {
  --scale: calc(var(--door) / 64);
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 0 6px var(--cyan)) drop-shadow(0 0 22px rgba(45, 226, 255, 0.45));
  transition: filter 0.2s;
}
.vault__wheel {
  --scale: calc(var(--door) / 64);
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  translate: -50% -50%;
  filter: drop-shadow(0 0 5px var(--cyan));
}

/* Locking bolts: they stick out past the door until it unlocks */
.vault__bolt {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 0;
  width: 16cqi;
  height: 6cqi;
  margin-top: -3cqi;
  transform-origin: 0 50%;
  rotate: var(--a);
  transform: translateX(42cqi);
  background: linear-gradient(#b8c0f0 0 30%, #59618f 30% 70%, #2a2f4a 70%);
  box-shadow: 0 0 6px rgba(45, 226, 255, 0.5);
  transition: transform 0.3s steps(4, end);
}

/* Opening: spin the wheel, pull the bolts, swing the door */
.vault.is-opening .vault__wheel { animation: wheel-spin 1s steps(16, end) both; }
.vault.is-opening .vault__bolt { transform: translateX(28cqi); transition-delay: 0.9s; }
.vault.is-opening .vault__leaf { animation: door-swing 0.9s steps(12, end) 1.25s both; }
.vault.is-opening .vault__form { opacity: 0; transition: opacity 0.3s; }

/* Wrong password: shake and flash red */
.vault.is-denied .vault__frame {
  --c: #ff3b5c;
  animation: vault-shake 0.5s steps(5, end);
}
.vault.is-denied .vault__door-art {
  filter: drop-shadow(0 0 8px #ff3b5c) drop-shadow(0 0 30px rgba(255, 59, 92, 0.75));
}

/* Password form */
.vault__form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  width: min(90vw, 24rem);
}
.vault__label {
  font-family: var(--font-pixel);
  font-size: 0.62rem;
  line-height: 1.5;
  color: var(--ink);
  text-shadow: 0 0 6px var(--cyan);
}
.vault__field {
  --c: var(--cyan);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.8rem 0.9rem;
  background: rgba(5, 3, 15, 0.85);
}
.vault__field:focus-within { --glow: 34px; }
.vault__prompt {
  font-family: var(--font-pixel);
  font-size: 0.75rem;
  color: var(--green);
  text-shadow: 0 0 6px var(--green);
}
.vault__field input {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: none;
  background: none;
  color: var(--green);
  caret-color: var(--green);
  font-family: var(--font-pixel);
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-shadow: 0 0 6px var(--green);
}
.vault__field input:disabled { opacity: 0.5; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.vault__status {
  min-height: 1.5em;
  margin: 0;
  color: var(--ink-dim);
}

/* ==========================================================
   The two file boxes (shown once unlocked)
   ========================================================== */
.files {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  width: min(92vw, 40rem);
  margin-top: 2rem;
}
.files__title {
  margin: 0 0 0.25rem;
  font-family: var(--font-pixel);
  font-weight: 400;
  font-size: clamp(0.85rem, 2.4vw, 1.15rem);
  line-height: 1.5;
  color: #eafff2;
  text-shadow: 0 0 6px var(--green), 0 0 20px var(--green);
}
.file-box {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.25rem;
  padding: 1.4rem 1.6rem;
  background: rgba(10, 6, 30, 0.85);
  color: var(--ink);
  text-align: left;
  text-decoration: none;
  transition: background-color 0.2s, translate 0.2s steps(3, end);
}
.file-box:hover,
.file-box:focus-visible {
  --glow: 40px;
  background: color-mix(in srgb, var(--c) 14%, rgba(10, 6, 30, 0.85));
  translate: 4px 0;
}
.file-box__icon {
  width: clamp(2.5rem, 7vw, 3.5rem);
  filter: drop-shadow(0 0 4px var(--c)) drop-shadow(0 0 12px color-mix(in srgb, var(--c) 60%, transparent));
}
.file-box__icon svg { display: block; width: 100%; height: auto; }
.file-box__name {
  display: block;
  font-family: var(--font-pixel);
  font-size: clamp(1rem, 2.6vw, 1.35rem);
  line-height: 1.4;
  color: #fff;
  text-shadow: 0 0 6px var(--c), 0 0 18px var(--c);
}
.file-box__note {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.5rem;
  color: var(--ink-dim);
  font-size: 1rem;
}
.file-box__note--caution::before {
  content: "";
  flex: none;
  width: 22px;
  height: 12px;
  background: repeating-linear-gradient(135deg, var(--yellow) 0 5px, #141018 5px 10px);
  box-shadow: 0 0 8px rgba(255, 233, 74, 0.5);
}
.file-box__go {
  font-family: var(--font-pixel);
  font-size: 1rem;
  color: var(--c);
  text-shadow: 0 0 8px var(--c);
}

/* Power-on flicker */
.is-off { opacity: 0; }
.is-powering { animation: power-flicker 0.7s steps(1, end) both; }

/* ==========================================================
   Security terminal (wrong password)
   ========================================================== */
.terminal {
  width: min(92vw, 36rem);
  max-width: none;
  padding: 0;
  border: 0;
  overflow: visible;
  background: transparent;
  color: var(--green);
}
.terminal::backdrop {
  background: rgba(30, 0, 8, 0.7);
  backdrop-filter: blur(2px);
}
.terminal__window {
  --c: var(--green);
  background: rgba(3, 12, 7, 0.97);
}
.terminal__bar {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.65rem 0.9rem;
  border-bottom: 2px solid var(--green);
  background: rgba(57, 255, 136, 0.14);
}
.terminal__dots { display: flex; gap: 6px; }
.terminal__dots i { display: block; width: 10px; height: 10px; }
.terminal__dots i:nth-child(1) { background: #ff3b5c; box-shadow: 0 0 6px #ff3b5c; }
.terminal__dots i:nth-child(2) { background: var(--yellow); box-shadow: 0 0 6px var(--yellow); }
.terminal__dots i:nth-child(3) { background: var(--green); box-shadow: 0 0 6px var(--green); }
.terminal__title {
  margin: 0;
  font-family: var(--font-pixel);
  font-weight: 400;
  font-size: 0.58rem;
  color: var(--green);
}
.terminal__screen {
  min-height: 15rem;
  margin: 0;
  padding: 1.1rem 1.2rem;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.28) 0 1px, transparent 1px 3px);
  color: #b6ffd3;
  font-family: var(--font-pixel);
  font-size: 0.62rem;
  line-height: 2.1;
  text-align: left;
  text-shadow: 0 0 6px var(--green);
}
.terminal__line { white-space: pre-wrap; }
.terminal__line--last {
  margin-top: 0.6rem;
  color: #fffbe0;
  text-shadow: 0 0 6px var(--yellow), 0 0 16px var(--yellow);
}
.terminal__cursor {
  display: inline-block;
  width: 0.7em;
  height: 1.1em;
  margin-left: 0.15em;
  vertical-align: text-bottom;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: blink 1s steps(1, end) infinite;
}
.terminal__actions {
  margin: 0;
  padding: 0 1.2rem 1.2rem;
  text-align: right;
}

/* ==========================================================
   Resume viewer
   ========================================================== */
.viewer-head {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem 1.5rem;
  width: min(100%, 52rem);
  margin-top: 1rem;
}
.viewer-head .page-title { margin: 0; }
.viewer-back {
  --c: var(--cyan);
  position: absolute;
  left: 0;
  color: var(--cyan);
}
.viewer-status {
  margin: 2rem 0 0;
  color: var(--ink-dim);
}
.resume-doc {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: min(100%, 52rem);
  margin-top: 1.75rem;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.resume-sheet {
  --c: var(--cyan);
  position: relative;
  overflow: hidden;
  background: #fff;
}
.resume-sheet canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.resume-sheet__text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: pre-wrap;
}
.resume-link {
  position: absolute;
  z-index: 2;
  display: block;
}
.resume-link:hover { background: rgba(45, 226, 255, 0.15); }

/* A dark cover over a section until it powers on */
.power-band {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 3;
  overflow: hidden;
  background: var(--void);
  pointer-events: none;
}
.power-band::after {
  content: "";
  position: absolute;
  top: -4px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--cyan);
  box-shadow: 0 0 12px 3px var(--cyan);
  opacity: 0;
}
.power-band.is-powering { animation: band-flicker 0.65s steps(1, end) forwards; }
.power-band.is-powering::after { animation: scan-sweep 0.65s steps(10, end) forwards; }

/* Printing is turned off for the resume */
.print-block { display: none; }
@media print {
  html, body { background: #fff !important; }
  body::before, body::after { display: none !important; }
  body > :not(.print-block) { display: none !important; }
  .print-block {
    display: block !important;
    padding: 2rem;
    color: #000;
    font: 16pt/1.5 sans-serif;
  }
}

/* ==========================================================
   Animations
   ========================================================== */
@keyframes wheel-spin { to { rotate: 540deg; } }
@keyframes door-swing {
  from { transform: rotateY(0deg); }
  to   { transform: rotateY(-110deg); }
}
@keyframes vault-shake {
  0%, 100% { translate: 0 0; }
  20% { translate: -10px 0; }
  40% { translate: 9px 0; }
  60% { translate: -6px 0; }
  80% { translate: 4px 0; }
}
@keyframes power-flicker {
  0%   { opacity: 0; }
  10%  { opacity: 1; }
  18%  { opacity: 0.2; }
  30%  { opacity: 1; }
  42%  { opacity: 0.4; }
  52%  { opacity: 1; }
  100% { opacity: 1; }
}
@keyframes band-flicker {
  0%   { opacity: 1; }
  15%  { opacity: 0.25; }
  25%  { opacity: 0.85; }
  40%  { opacity: 0.1; }
  55%  { opacity: 0.6; }
  70%  { opacity: 0; }
  100% { opacity: 0; }
}
@keyframes scan-sweep {
  0%   { top: -4px; opacity: 1; }
  99%  { top: 100%; opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

/* ---------- Phones ---------- */
@media (max-width: 640px) {
  .viewer-back { position: static; }
  .file-box { gap: 1rem; padding: 1.2rem; }
}
