:root {
  --page: #070b1a;
  --bg: #0d1224;
  --border: #1c1a4f;
  --divider: #1c1a4f;
  --fg: #c0caf5;
  --muted: #a9b1d6;
  --purple: #bb9af7;
  --cyan: #7dcfff;
  --orange: #ff9e64;
  --green: #9ece6a;
  --red: #f7768e;
  --yellow: #fff3a3;
  --portrait: #c8b9ff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--muted);
  font-family: "Fira Code", ui-monospace, Menlo, monospace;
  font-size: 16px;
  line-height: 1.7;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vh 16px;
  background:
    radial-gradient(ellipse at top, rgba(187, 154, 247, 0.08), transparent 60%),
    var(--page);
}

/* ---------- starfield ---------- */
.stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.star {
  position: absolute;
  border-radius: 50%;
  background: #fff;
  animation: twinkle var(--dur) ease-in-out infinite;
  animation-delay: var(--delay);
}
.star.yellow { background: var(--yellow); }
.star.purple { background: var(--purple); }
.star.sparkle {
  width: auto !important;
  height: auto !important;
  background: none;
  color: var(--yellow);
  font-size: var(--size);
  line-height: 1;
}
@keyframes twinkle {
  0%, 100% { opacity: var(--min); transform: scale(0.8); }
  50%      { opacity: 1; transform: scale(1.15); }
}

.shooting-star {
  position: absolute;
  width: 120px;
  height: 1.5px;
  background: linear-gradient(90deg, rgba(255, 243, 163, 0.9), transparent);
  border-radius: 2px;
  transform: rotate(-35deg);
  transform-origin: left center;
  animation: shoot 1.1s ease-out forwards;
}
@keyframes shoot {
  0%   { opacity: 0; translate: 0 0; }
  10%  { opacity: 1; }
  100% { opacity: 0; translate: -420px 300px; }
}

@media (prefers-reduced-motion: reduce) {
  .star { animation: none; opacity: 0.7; }
  .shooting-star { display: none; }
}

.window {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 920px;
  height: 88vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.titlebar {
  position: relative;
  display: flex;
  align-items: center;
  padding: 22px 24px;
  border-bottom: 2px solid var(--divider);
  flex-shrink: 0;
}
.dots { display: flex; gap: 10px; }
.dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.25);
}
.dot svg { width: 100%; height: 100%; }
.dot path { fill: none; stroke-width: 1.6; stroke-linecap: round; }
.dot path.fill { stroke: none; }
.dot.red    { background: #ff5f57; }
.dot.red path    { stroke: #8c1a10; }
.dot.yellow { background: #febc2e; }
.dot.yellow path { stroke: #8f5a00; }
.dot.green  { background: #28c840; }
.dot.green path  { fill: #0b5a17; }
.title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.85rem;
  color: #6b7299;
  white-space: nowrap;
}

.terminal {
  flex: 1;
  overflow-y: auto;
  padding: 6vh 40px 30vh;
  cursor: text;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.banner {
  font-size: clamp(2.2rem, 7vw, 4.4rem);
  line-height: 1.25;
  margin: 0 0 0.6rem;
  font-weight: 700;
  color: var(--muted);
  word-break: break-word;
}
.banner-user { color: var(--yellow); }
.banner-star {
  color: var(--muted);
  font-family: system-ui, sans-serif;
  font-size: 0.75em;
  vertical-align: 0.12em;
  margin-left: 0.3em;
  opacity: 0;
  transition: opacity 0.4s;
}
.banner.done .banner-star { opacity: 1; }
/* "welcome to my portfolio": elegant serif italic next to the code-font prompt */
.banner-text {
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic;
  font-weight: 600;
}
.banner-text::after {
  content: "▌";
  animation: blink 1s steps(1) infinite;
  color: var(--muted);
  margin-left: 4px;
}
.banner.done .banner-text::after { display: none; }

.subtitle {
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  font-weight: 500;
  color: #9d7cd8;
  margin: 0 0 1.2rem;
  min-height: 1.7em;
}
.subtitle.typing::after {
  content: "▌";
  animation: blink 1s steps(1) infinite;
  margin-left: 2px;
}

@keyframes blink { 50% { opacity: 0; } }

.line { margin: 0; white-space: pre-wrap; word-break: break-word; }

a { color: var(--cyan); }
a:hover { color: var(--purple); }

.prompt { white-space: nowrap; color: var(--muted); }
.lambda { color: var(--orange); }
.path   { color: #9d7cd8; }
.arrows { color: var(--yellow); }

.prompt-line {
  display: flex;
  align-items: center;
  gap: 0.6ch;
}
.prompt-line input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--fg);
  font: inherit;
  caret-color: var(--fg);
  padding: 0;
}

.cmd-echo { color: var(--fg); }

.block { margin: 0.2rem 0 1.2rem; }

.help-row {
  display: flex;
  justify-content: space-between;
  gap: 2ch;
}
.help-row .cmd { color: var(--muted); cursor: pointer; }
.help-row .cmd:hover { color: var(--cyan); }
.help-row .desc { text-align: right; }

.accent  { color: var(--cyan); }
.purple  { color: var(--purple); }
.orange  { color: var(--orange); }
.green   { color: var(--green); }
.error   { color: var(--red); }
.heading { color: var(--purple); font-weight: 700; }

.clickable { cursor: pointer; text-decoration: none; }
.clickable:hover { text-decoration: underline; }

.item { margin-bottom: 0.8rem; }
.item-title { color: var(--fg); font-weight: 500; }
.item-meta  { color: var(--orange); font-size: 0.9em; }
.bullet {
  position: relative;
  padding-left: 2ch;
}
.bullet::before {
  content: "›";
  position: absolute;
  left: 0;
  color: var(--purple);
}
.line:empty { min-height: 1.7em; }

.about-wrap {
  display: flex;
  gap: 32px;
  align-items: center;
}
.portrait {
  width: 300px;
  flex-shrink: 0;
  display: block;
  filter: drop-shadow(0 0 6px rgba(200, 185, 255, 0.35));
}
.about-text { flex: 1; min-width: 0; }

.worldmap {
  display: block;
  width: 100%;
  max-width: 780px;
  margin: 0.4rem 0 1.4rem;
}

@media (max-width: 700px) {
  .about-wrap { flex-direction: column; align-items: flex-start; gap: 16px; }
  .portrait { width: min(240px, 70vw); }
}

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.tag {
  color: var(--green);
  background: rgba(158, 206, 106, 0.08);
  border: 1px solid rgba(158, 206, 106, 0.35);
  border-radius: 999px;
  padding: 1px 11px;
  line-height: 1.6;
  font-size: 0.92em;
  white-space: nowrap;
}
.tag-key {
  color: var(--yellow);
  background: rgba(255, 243, 163, 0.12);
  border-color: rgba(255, 243, 163, 0.55);
  font-weight: 500;
}

@media (max-width: 560px) {
  html, body { font-size: 14px; }
  body { padding: 12px; }
  .window { height: calc(100vh - 24px); }
  .titlebar { padding: 16px; }
  .dot { width: 14px; height: 14px; }
  .title { display: none; }
  .terminal { padding: 5vh 16px 30vh; }
}

.clock { color: var(--yellow); font-variant-numeric: tabular-nums; }
.clock-rel { color: var(--muted); opacity: 0.7; font-size: 0.85em; }

/* keyword styling in `about` (see fmt() in script.js) */
.kw-bold { color: var(--fg); font-weight: 700; }
.kw-mark {
  background: rgba(187, 154, 247, 0.18);
  color: var(--fg);
  padding: 0 0.3ch;
  border-radius: 4px;
  box-shadow: inset 0 -2px 0 rgba(187, 154, 247, 0.55);
}
.kw-serif {
  font-family: "Instrument Serif", Georgia, serif;
  font-style: italic;
  font-size: 1.22em;
  line-height: 1;
  color: var(--purple);
  letter-spacing: 0.01em;
}
.kw-y { color: var(--yellow); }
.kw-p { color: var(--purple); }
.kw-c { color: var(--cyan); }

/* instructions (help, passion list, page footers): quieter than the content */
.hint { color: #626a92; font-size: 0.88em; }
.hint .accent { color: #7f9cc4; }
.hint .accent:hover { color: var(--cyan); }
.nav-hint { margin-top: 1rem; }

.seal {
  width: 230px;
  flex-shrink: 0;
  display: block;
  filter: drop-shadow(0 0 6px rgba(255, 243, 163, 0.18));
}
@media (max-width: 700px) {
  .seal { width: min(200px, 60vw); }
}


.item-note { font-size: 0.92em; }

/* dotted logos beside experience items */
.item.has-logo { display: flex; gap: 20px; align-items: center; }
.logo-slot { width: 120px; flex-shrink: 0; display: flex; justify-content: center; }
.item-logo { display: block; width: 60px; }
.item-body { flex: 1; min-width: 0; }
@media (max-width: 560px) {
  .logo-slot { width: 72px; }
  .item.has-logo { gap: 12px; }
}

/* inline autocomplete suggestion */
.input-wrap { position: relative; flex: 1; min-width: 0; display: flex; }
.input-wrap input { position: relative; z-index: 1; width: 100%; }
.ghost {
  position: absolute;
  inset: 0;
  white-space: pre;
  overflow: hidden;
  pointer-events: none;
  display: flex;
  align-items: center;
}
.ghost-typed { visibility: hidden; }
.ghost-rest { color: var(--muted); opacity: 0.4; }

/* ---------- photography gallery ---------- */
.gallery {
  columns: 3 200px;
  column-gap: 12px;
  margin: 0.4rem 0 1rem;
}
.photo {
  display: block;
  width: 100%;
  margin: 0 0 12px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #0a0e1d;
  cursor: zoom-in;
  position: relative;
  break-inside: avoid;
  font: inherit;
}
.photo img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.4s ease, filter 0.4s ease;
  filter: saturate(0.9) brightness(0.9);
}
.photo:hover img, .photo:focus-visible img { transform: scale(1.04); filter: none; }
.photo:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
.photo-cap {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 18px 10px 6px;
  font-size: 0.8em;
  text-align: left;
  color: var(--fg);
  background: linear-gradient(transparent, rgba(7, 11, 26, 0.85));
  opacity: 0;
  transition: opacity 0.3s ease;
}
.photo:hover .photo-cap, .photo:focus-visible .photo-cap { opacity: 1; }
@media (hover: none) { .photo-cap { opacity: 1; } }

/* ---------- photo viewer ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px 16px;
  background: rgba(5, 8, 20, 0.94);
  backdrop-filter: blur(4px);
}
.lightbox[hidden] { display: none; }
.lb-figure { margin: 0; max-width: min(1200px, 100%); display: flex; flex-direction: column; align-items: center; }
.lb-figure img {
  max-width: 100%;
  max-height: calc(100vh - 110px);
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.lb-figure figcaption { margin-top: 12px; color: var(--fg); text-align: center; }
.lb-count { color: var(--muted); opacity: 0.7; margin-left: 1ch; font-size: 0.85em; }
.lb-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--fg);
  font: inherit;
  font-size: 1.6rem;
  width: 44px; height: 44px;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
}
.lb-btn:hover { border-color: var(--yellow); color: var(--yellow); }
.lb-close { position: absolute; top: 16px; right: 16px; font-size: 1rem; }
body.lb-open { overflow: hidden; }
@media (max-width: 560px) {
  .lb-prev, .lb-next { position: absolute; bottom: 20px; }
  .lb-prev { left: calc(50% - 56px); }
  .lb-next { right: calc(50% - 56px); }
  .lb-figure img { max-height: calc(100vh - 170px); }
}

/* bigger headings for each sport */
.passion-sports .item, .passion-music .item { margin-bottom: 1.2rem; }
.passion-sports .item-title, .passion-music .item-title {
  font-size: 1.35em;
  font-weight: 700;
  color: var(--yellow);
  margin-bottom: 0.15rem;
}

.item-date { color: var(--yellow); white-space: nowrap; }

/* footer under the terminal window */
body { flex-direction: column; }
.site-footer {
  margin-top: 14px;
  font-size: 0.8rem;
  color: #626a92;
  letter-spacing: 0.02em;
  position: relative;
  z-index: 1;
}
.site-footer .heart { color: var(--red); }
.site-footer .footer-name { color: var(--yellow); }
.window { height: calc(88vh - 34px); }
@media (max-width: 560px) {
  .window { height: calc(100vh - 58px); }
  .site-footer { margin-top: 10px; }
}

/* music: a featured item with a large figure, and artist tags */
.item.feature { gap: 28px; margin-bottom: 1.6rem; }
.item.feature .logo-slot { width: auto; }
.item.feature .item-title { font-size: 1.6em; }
.passion-music .tag {
  color: var(--purple);
  background: rgba(187, 154, 247, 0.1);
  border-color: rgba(187, 154, 247, 0.4);
}
.item-footnote { margin-top: 8px; color: var(--muted); opacity: 0.8; }
@media (max-width: 560px) {
  .item.feature { flex-direction: column; align-items: flex-start; gap: 12px; }
}

.map-legend { margin: -0.9rem 0 1.2rem; white-space: pre; }
.legend-been { color: var(--yellow); }
.legend-wish { color: var(--cyan); }
