:root {
  --frame: 20px;
  --terminal-font: 'Courier New', Courier, monospace;
  --green: #39ff14;
  --green-dim: #00ff00;
}

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

.hidden { display: none !important; }

body {
  position: absolute;
  width: 100%;
  height: 100%;
  background: #0a0a0a;
  /* border: var(--frame) solid #222; */
  /* border-radius: 15px; */
  overflow-y: auto;
  font-family: var(--terminal-font);
}

/* ---------- Shared full-screen views (title + login) ---------- */
.view {
  position: fixed;
  inset: var(--frame);         /* keeps the gray frame visible */
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #000;
  color: var(--green-dim);
  font-family: var(--terminal-font);
}

/* ---------- Title screen ---------- */
#title-screen { justify-content: flex-start; padding-top: 12vh; }

.welcome {
  margin: 0 0 48px;
  font-size: clamp(1rem, 12vw, 8rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: 0 0 10px var(--green-dim), 0 0 30px #00aa00;
}

.welcome-subtitle {
  margin-top: -36px;
  margin-bottom: 48px;
  font-size: clamp(1rem, 3vw, 1.5rem);
  letter-spacing: 0.12em;
  text-shadow: 0 0 8px var(--green-dim);
}

.btn-row { display: flex; gap: 24px; justify-content: center; }

#title-screen .btn-row { flex-direction: column; align-items: center; gap: 20px; }
#title-screen .menu-btn { width: 240px; }

.menu-btn {
  padding: 14px 40px;
  font-family: var(--terminal-font);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--green-dim);
  background: transparent;
  border: 2px solid var(--green-dim);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.menu-btn:hover,
.menu-btn:focus-visible {
  background: var(--green-dim);
  color: #000;
  box-shadow: 0 0 18px var(--green-dim);
  outline: none;
}
.menu-btn.small { padding: 10px 24px; font-size: 1rem; }

/* Twitch effect on heading + title buttons */
@keyframes twitch {
  0%   { opacity: 0.55; }
  10%  { opacity: 0.7;  }
  15%  { opacity: 1;    }
  20%  { opacity: 0.6;  }
  30%  { opacity: 0.8;  }
  40%  { opacity: 0.6;  }
  45%  { opacity: 1;    }
  55%  { opacity: 0.5;  }
  65%  { opacity: 0.9;  }
  75%  { opacity: 0.7;  }
  85%  { opacity: 0.88; }
  100% { opacity: 0.6;  }
}
.welcome,
#title-screen .menu-btn { animation: twitch 0.15s infinite; }

#title-screen .menu-btn:hover,
#title-screen .menu-btn:focus-visible { animation: none; opacity: 1; }

/* ---------- Login screen ---------- */
#login-screen { justify-content: center; }

.login-box {
  width: min(420px, 90vw);
  padding: 32px;
  border: 2px solid var(--green-dim);
  box-shadow: 0 0 25px rgba(0, 255, 0, 0.35);
}

.field { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.field label { width: 120px; font-size: 0.95rem; }
.field input {
  flex: 1;
  min-width: 0;
  padding: 8px;
  font: 1rem var(--terminal-font);
  color: var(--green-dim);
  background: #000;
  border: 1px solid var(--green-dim);
}
.field input:focus { outline: none; box-shadow: 0 0 8px var(--green-dim); }

#login-msg {
  min-height: 1.4em;
  margin: 0 0 16px;
  color: #ff4d4d;
  font-size: 0.85rem;
  text-align: center;
}

/* ---------- Loading bar ---------- */
.loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.progress-bar { width: 406px; max-width: 80vw; height: 21px; background: #111; }
.progress { width: 16px; max-width: 100%; height: 15px; background: var(--green-dim); }
.percent { margin-top: 20px; text-align: center; }

/* ---------- Terminal screen ---------- */
.screen {
  position: relative;
  min-height: calc(100vh - 2 * var(--frame));
  padding: 30px;
  overflow: hidden;
  background: #000;
  color: var(--green);
  font-family: var(--terminal-font);
  font-size: 18px;
  line-height: 1.6;
}

/* CRT scanlines + vignette (kept light so text stays bright) */
.screen::before,
.screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.screen::before {
  z-index: 2;
  background: repeating-linear-gradient(0deg,
    rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.06) 1px,
    transparent 1px, transparent 2px);
}
.screen::after {
  z-index: 1;
  background: radial-gradient(ellipse at center, transparent 0%, rgba(0, 0, 0, 0.12) 100%);
}

#terminal { position: relative; z-index: 3; }

#terminal,
.prompt,
.user-input {
  color: var(--green);
  text-shadow: 0 0 4px var(--green), 0 0 12px var(--green-dim), 0 0 28px #00aa00;
}

.line { margin-bottom: 8px; }

.prompt { display: none; }
.prompt.active {
  display: flex;
  align-items: center;
  gap: 0.6em;
  white-space: nowrap;
}

.user-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--terminal-font);
  font-size: 18px;
}
.user-input:disabled {
  opacity: 1;
  -webkit-text-fill-color: var(--green);
}

/* Blinking cursor */
.cursor {
  display: inline-block;
  width: 10px;
  height: 20px;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: var(--green-dim);
  animation: blink 1s step-end infinite;
}
@keyframes blink {
  0%, 50%    { opacity: 1; }
  51%, 100%  { opacity: 0; }
}

/* Fast flicker can bother some people */


/* ---------- CRT pop-up window ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.65);   /* dims the page and blocks clicks behind it */
}

.crt-window {
  position: absolute;                 /* left/top are set by script.js */
  width: min(460px, 92vw);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #000;
  color: var(--green);
  border: 2px solid var(--green-dim);
  border-radius: 6px;
  box-shadow: 0 0 25px rgba(0, 255, 0, 0.45), inset 0 0 40px rgba(0, 255, 0, 0.08);
  font-family: var(--terminal-font);
  text-shadow: 0 0 4px var(--green), 0 0 12px var(--green-dim);
}

/* scanlines over the window */
.crt-window::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg,
    rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.12) 1px, transparent 1px, transparent 3px);
}

/* CRT "turn on": a bright line stretches into the full window */
.crt-window.pop { animation: crt-on 0.35s ease-out; }
@keyframes crt-on {
  0%   { transform: scale(1, 0.005); filter: brightness(4); opacity: 0.4; }
  45%  { transform: scale(1, 0.005); filter: brightness(4); opacity: 1; }
  100% { transform: scale(1, 1);     filter: brightness(1); opacity: 1; }
}

.win-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 2px solid var(--green-dim);
  background: rgba(0, 255, 0, 0.08);
  cursor: grab;
  user-select: none;
  touch-action: none;                 /* lets touch dragging work */
}
.win-bar.dragging { cursor: grabbing; }

.win-close {
  width: 30px;
  height: 30px;
  font: 700 1.4rem/1 var(--terminal-font);
  color: var(--green-dim);
  background: transparent;
  border: 2px solid var(--green-dim);
  cursor: pointer;
}
.win-close:hover,
.win-close:focus-visible {
  background: var(--green-dim);
  color: #000;
  outline: none;
}

.win-body { padding: 20px 24px; overflow-y: auto; }
.win-body ul { padding-left: 22px; }
.win-body li { margin-bottom: 8px; }
.win-body a {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
  word-break: break-all;
}
.win-body a:hover,
.win-body a:focus-visible {
  background: var(--green-dim);
  color: #000;
  text-shadow: none;
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  .welcome, #title-screen .menu-btn, .cursor, .crt-window.pop { animation: none; }
}

/* ---------- Mode toggle (title screen) ---------- */
.mode-toggle {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  border: 2px solid var(--green-dim);
}
.mode-opt {
  padding: 8px 18px;
  font: 700 0.95rem var(--terminal-font);
  color: var(--green-dim);
  background: transparent;
  border: 0;
  cursor: pointer;
}
.mode-opt[aria-pressed="true"] {
  background: var(--green-dim);
  color: #000;
  text-shadow: none;
}
.mode-opt:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

.mode-hint {
  max-width: 90vw;
  margin-top: 28px;
  text-align: center;
  font-size: 0.95rem;
  opacity: 0.85;
}

/* ---------- Simple mode menu ---------- */
#menu-screen { justify-content: flex-start; padding-top: 7rem; overflow-y: auto; }
#menu-screen .menu-title { margin-top: auto; }   /* auto margins center the menu, and let it scroll on short screens */

.menu-title {
  font-size: clamp(2rem, 8vw, 4rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: 0 0 10px var(--green-dim), 0 0 30px #00aa00;
}
.menu-user { margin: 8px 0 32px; opacity: 0.85; }

.menu-buttons { flex-direction: column; align-items: center; gap: 16px; }
.menu-buttons .menu-btn { width: min(280px, 80vw); min-height: 52px; }

/* ---------- Phones ---------- */
@media (max-width: 600px) {
  :root { --frame: 8px; }
  body { border-radius: 8px; }
  .screen { padding: 16px; font-size: 16px; }
  .user-input { font-size: 16px; }          /* 16px stops iOS zooming on focus */
  .field { flex-direction: column; align-items: stretch; gap: 6px; }
  .field label { width: auto; }
  .login-box { padding: 20px; }
  .win-body { padding: 16px; }
}


/* ---------- Big window (Introduction) ---------- */
.crt-window.large {
  width: min(92vw, max(50vw, 520px));
  min-height: min(50vh, 85vh);
}
.crt-window.large .win-body { flex: 1; font-size: 1.1rem; line-height: 1.7; }
.win-body p { margin-bottom: 14px; }

/* ---------- Simple menu banner: intro ticker, then ambition ---------- */
.menu-banner {
  position: absolute;
  top: 24px;
  left: 0;
  right: 0;
  min-height: 4.5rem;
  padding: 0 16px;
  overflow: hidden;
  text-align: center;
}
.intro-track {
  position: absolute;
  left: 0;
  top: 0;
  white-space: nowrap;
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  text-shadow: 0 0 6px var(--green-dim);
  transform: translateX(100vw);              /* parked off-screen to the right */
  will-change: transform;
}
.intro-track.run { animation: intro-slide linear forwards; }   /* duration set by index.js */
@keyframes intro-slide {
  from { transform: translateX(100vw); }
  to   { transform: translateX(-100%); }
}
.intro-track.still { position: static; display: block; transform: none; white-space: normal; margin-bottom: 8px; }

.ambition-line {
  font-size: 1.1rem;
  letter-spacing: 0.06em;
  opacity: 0.9;
  text-shadow: 0 0 6px var(--green-dim);
}

/* ---------- Education + Certifications windows ---------- */
.crt-window.wide { width: min(92vw, 640px); }

.win-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 12px 16px;
  border-top: 2px solid var(--green-dim);
  background: rgba(0, 255, 0, 0.05);
}

.entry { margin-bottom: 24px; }
.entry:last-child { margin-bottom: 0; }

.entry-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
}
.entry-title { font-size: 1.1rem; font-weight: 700; }
.entry-date,
.entry-status { margin-left: auto; white-space: nowrap; }
.entry-line {                       /* the line between school name and dates */
  flex: 1 1 24px;
  min-width: 24px;
  height: 1px;
  align-self: center;
  background: var(--green-dim);
  opacity: 0.7;
}
.entry-sub,
.entry-detail { margin-top: 4px; opacity: 0.9; }


/* ---------- Custom mouse cursor ---------- */
:root {
  /* green arrow (hotspot = the tip, at 3,2) */
  --cursor-default: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M3 2l16 9-7 2-3 7z' fill='%2339ff14' stroke='%23000' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E") 3 2, auto;

  /* terminal block cursor for anything clickable (hotspot = the middle) */
  --cursor-click: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Crect x='6' y='2' width='12' height='20' fill='%2339ff14' fill-opacity='0.85' stroke='%23000' stroke-width='1.5'/%3E%3C/svg%3E") 12 12, pointer;
}

html { cursor: var(--cursor-default); }

button,
a,
.menu-btn,
.mode-opt,
.win-close { cursor: var(--cursor-click); }


/* ---------- Experiences window: tabs + bullets ---------- */
.crt-window.big {                    /* fixed height so switching tabs never resizes the window */
  width: min(92vw, 820px);
  height: min(85vh, 720px);
}
.crt-window.big .win-body { flex: 1; }

.win-tabs {                         /* lives inside the title bar */
  display: flex;
  align-self: stretch;
  margin: -8px 0 -8px -12px;         /* bleed to the bar's top, bottom and left edges */
}
.win-tab {
  padding: 0 18px;
  font: 700 1rem var(--terminal-font);
  color: var(--green-dim);
  background: transparent;
  border: 0;
  border-right: 2px solid var(--green-dim);
  cursor: pointer;
}
.win-tab[aria-selected="true"] { background: var(--green-dim); color: #000; text-shadow: none; }
.win-tab:hover:not([aria-selected="true"]),
.win-tab:focus-visible { background: rgba(0, 255, 0, 0.15); outline: none; }

/* ---------- Skills by category ---------- */
.skill-group {
  display: grid;
  grid-template-columns: 12.5rem 1fr;
  gap: 4px 16px;
  margin-bottom: 14px;
}
.skill-group:last-child { margin-bottom: 0; }
.skill-label { font-weight: 700; }
.skill-label::after { content: ":"; }
.skill-items { opacity: 0.95; }

@media (max-width: 600px) {
  .skill-group { grid-template-columns: 1fr; }
}


/* ---------- Projects window ---------- */
.win-subtabs {                      /* tab strip under the title bar */
  display: flex;
  overflow-x: auto;
  border-bottom: 2px solid var(--green-dim);
}
.win-subtabs .win-tab {
  flex: none;
  padding: 8px 16px;
  font-size: 0.9rem;
  white-space: nowrap;
}

.project-art {
  float: right;
  max-width: 45%;
  margin: 0 0 12px 16px;
  overflow: hidden;
  font: 0.8rem/1.15 var(--terminal-font);
  white-space: pre;
  opacity: 0.9;
}
.project-desc { margin-bottom: 14px; }
.project-skills,
.project-link { clear: both; margin-bottom: 8px; }

@media (max-width: 600px) {
  .project-art { float: none; max-width: 100%; margin: 0 0 12px; overflow-x: auto; }
}

/* ---------- Connect with me ---------- */
.social {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--green-dim);
  text-decoration: none;
  cursor: pointer;
}
.social-icon {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  text-shadow: 0 0 6px var(--green-dim), 0 0 16px #00aa00;
}
.social-label { font-size: 0.85rem; letter-spacing: 0.06em; }

.social:hover,
.social:focus-visible {
  background: var(--green-dim);
  color: #000;
  outline: none;
}
.social:hover .social-icon,
.social:focus-visible .social-icon { text-shadow: none; }

/* terminal pop-up: three icons on top, two staggered in between */
.connect-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 28px 0;
  padding: 8px 0;
}
.connect-grid .social { grid-column: span 2; padding: 8px 0; }
.connect-grid .social:nth-child(4) { grid-column: 2 / 4; }
.connect-grid .social:nth-child(5) { grid-column: 4 / 6; }
.win-body .social { text-decoration: none; word-break: normal; }

/* Simple-mode footer */
.connect-footer {
  margin-top: auto;
  padding: 24px 0 8px;
  text-align: center;
}
.connect-title { margin-bottom: 10px; font-size: 1rem; letter-spacing: 0.12em; text-shadow: 0 0 6px var(--green-dim); }
.connect-icons { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px; }
.connect-footer .social { padding: 4px 8px; }
.connect-footer .social-icon { font-size: 1.4rem; }


/* ---------- Help window ---------- */
.help-row {
  display: grid;
  grid-template-columns: 15rem 1fr;
  gap: 4px 16px;
  padding: 6px 0;
}
.help-cmd { font-weight: 700; }

@media (max-width: 600px) {
  .help-row { grid-template-columns: 1fr; }
}

/* ---------- Skip the boot ---------- */
.screen { touch-action: manipulation; }     /* stops double-tap from zooming the page */
.skip-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 20px;
  z-index: 3;
  padding: 0 16px;
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.6;
}