/* ═══════════════════════════════════════════════════════
   FLOATING OS WINDOWS — glassmorphism chrome + content
   ═══════════════════════════════════════════════════════ */

.windows-layer {
  position: fixed;
  inset: 0;
  z-index: 55;
  pointer-events: none;
}

.os-window {
  position: absolute;
  width: min(760px, calc(100vw - 48px));
  max-height: calc(100vh - 96px);
  display: flex;
  flex-direction: column;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 0 60px rgba(0, 245, 255, 0.05);
  pointer-events: auto;
  overflow: hidden;
  transform-origin: center;
}

.os-window.is-focused {
  border-color: rgba(0, 245, 255, 0.32);
  box-shadow:
    0 40px 100px rgba(0, 0, 0, 0.65),
    0 0 80px rgba(0, 245, 255, 0.08);
}

/* Title bar */
.os-window__bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent);
  user-select: none;
  touch-action: none;
  flex-shrink: 0;
}

.os-window__lights {
  display: flex;
  gap: 7px;
}

.os-window__light {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  padding: 0;
  transition: transform 0.2s, box-shadow 0.2s;
}

.os-window__light:hover { transform: scale(1.25); }
.os-window__light--close { background: #ff5f57; }
.os-window__light--close:hover { box-shadow: 0 0 10px #ff5f57; }
.os-window__light--min { background: #febc2e; }
.os-window__light--max { background: #28c840; }

.os-window__title {
  flex: 1;
  /* Flex items default to min-width:auto, which refuses to shrink below
     the title text's natural width — on a narrow bar that forces the
     whole row to overflow instead, pushing __closebtn past the window's
     clipped edge rather than truncating the title. */
  min-width: 0;
  overflow: hidden;
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.os-window__title .path {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.os-window__signal {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
}

.os-window__closebtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.25s, border-color 0.25s, background 0.25s;
}

.os-window__closebtn:hover {
  color: #ff5f57;
  border-color: rgba(255, 95, 87, 0.5);
  background: rgba(255, 95, 87, 0.08);
}

/* Content */
.os-window__content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 28px;
  overscroll-behavior: contain;
}

/* ══════════ SHARED CONTENT PATTERNS ══════════ */
.sec-kicker {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.4em;
  color: var(--emerald);
  margin-bottom: 10px;
}

.sec-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}

.sec-title em {
  font-style: normal;
  background: linear-gradient(120deg, var(--cyan), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sec-lead {
  font-size: 0.92rem;
  line-height: 1.75;
  color: var(--muted);
  max-width: 56ch;
  margin-bottom: 26px;
}

.reveal { opacity: 0; transform: translateY(24px); }

/* ══════════ PROJECTS ══════════ */
.project-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 24px;
  background: rgba(255, 255, 255, 0.015);
  transition: border-color 0.35s, transform 0.35s var(--ease-out), box-shadow 0.35s;
}

.project-card:hover {
  border-color: rgba(0, 245, 255, 0.3);
  transform: translateY(-3px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.project-card__hero {
  position: relative;
  height: 170px;
  display: flex;
  align-items: flex-end;
  padding: 20px;
  overflow: hidden;
}

.project-card__hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(5, 8, 22, 0.85));
}

.project-card__hero-art {
  position: absolute;
  inset: 0;
  background-size: cover;
  transition: transform 0.8s var(--ease-out);
}

.project-card:hover .project-card__hero-art { transform: scale(1.06); }

.project-card__hero h3 {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
}

.project-card__body { padding: 20px; }

.project-card__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 18px 0;
}

.project-card__cell h4 {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.3em;
  color: var(--cyan);
  margin-bottom: 7px;
  text-transform: uppercase;
}

.project-card__cell p {
  font-size: 0.8rem;
  line-height: 1.65;
  color: var(--muted);
}

.project-card__tech {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 14px 0;
}

.project-card__metrics {
  display: flex;
  gap: 26px;
  margin: 18px 0 14px;
  padding: 14px 18px;
  border: 1px dashed rgba(0, 245, 255, 0.18);
  border-radius: 12px;
}

.metric__value {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--cyan);
}

.metric__label {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
}

.project-card__links {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

/* ══════════ SKILLS NETWORK ══════════ */
/* Masonry via CSS multi-column, not grid: a shared-row grid still leaves
   dead space below a short card until every other card in that row
   clears, even with align-items:start. Columns instead let each card
   flow straight into the next available slot in its own column. */
.skills-grid {
  column-width: 220px;
  column-gap: 16px;
}

.skill-card {
  break-inside: avoid;
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(5, 8, 22, 0.4);
}

.skill-card h4 {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.skill-card__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

/* ══════════ ANALYTICS ══════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-tile {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.015);
}

.stat-tile__value {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  background: linear-gradient(120deg, var(--cyan), var(--emerald));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-tile__label {
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.2em;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 6px;
}

.chart-block {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 16px;
}

.chart-block h4 {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.28em;
  color: var(--cyan);
  margin-bottom: 14px;
  text-transform: uppercase;
}

/* ══════════ GLOBAL REACH MAP ══════════ */
.geo-map-wrap { position: relative; }

.geo-map {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: radial-gradient(circle at 50% 40%, rgba(0, 245, 255, 0.05), transparent 70%), rgba(5, 8, 22, 0.4);
  padding: 14px;
}

.geo-map__svg { display: block; width: 100%; height: auto; }

.geo-map__loading,
.geo-map__error {
  padding: 60px 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
}

/* Every country renders from real path data (see credit below), not
   hand-drawn shapes — base countries sit dim and inert; the ones we
   actually have Fiverr order data for light up cyan, brighter for more
   orders (via --geo-intensity, set per-path in JS). */
.geo-country {
  fill: rgba(255, 255, 255, 0.05);
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 0.5;
}

.geo-country--active {
  fill: rgba(0, 245, 255, var(--geo-intensity, 0.5));
  stroke: var(--cyan);
  stroke-width: 0.75;
  cursor: pointer;
  transition: fill 0.2s, filter 0.2s;
}

.geo-country--active:hover,
.geo-country--active:focus {
  filter: drop-shadow(0 0 6px var(--cyan));
  outline: none;
}

.geo-tooltip {
  position: absolute;
  z-index: 5;
  transform: translate(-50%, -130%);
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(10, 15, 36, 0.94);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}

.geo-tooltip.is-visible { opacity: 1; }
.geo-tooltip b { display: block; font-size: 0.72rem; margin-bottom: 2px; }
.geo-tooltip span { color: var(--muted); letter-spacing: 0.05em; }

.geo-note {
  font-size: 0.68rem;
  color: var(--muted);
  margin: 10px 0 14px;
}

.geo-legend { display: flex; flex-direction: column; gap: 8px; }

.geo-legend__row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.74rem;
}

.geo-legend__name { flex: 0 0 150px; }

.geo-legend__bar {
  flex: 1;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.geo-legend__bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
}

.geo-legend__value {
  flex: 0 0 32px;
  text-align: right;
  font-family: var(--font-mono);
  color: var(--muted);
}

/* ══════════ TIMELINE ══════════ */
.timeline {
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: linear-gradient(180deg, var(--cyan), var(--violet), transparent);
}

.timeline__item {
  position: relative;
  padding-bottom: 30px;
}

.timeline__item::before {
  content: "";
  position: absolute;
  left: -25px;
  top: 5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--cyan);
  box-shadow: 0 0 10px rgba(0, 245, 255, 0.6);
}

.timeline__date {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--emerald);
}

.timeline__role {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  margin: 6px 0 2px;
}

.timeline__org {
  font-size: 0.78rem;
  color: var(--cyan);
  margin-bottom: 8px;
}

.timeline__desc {
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--muted);
  max-width: 52ch;
}

.timeline__bullets {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-left: 16px;
  max-width: 56ch;
}

.timeline__bullets li {
  position: relative;
  list-style: none;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--muted);
}

.timeline__bullets li::before {
  content: "▸";
  position: absolute;
  left: -16px;
  color: var(--cyan);
}

/* ══════════ ABOUT ══════════ */
.about-head {
  display: flex;
  gap: 22px;
  align-items: center;
  margin-bottom: 24px;
}

.about-avatar {
  width: 92px;
  height: 92px;
  flex-shrink: 0;
  border-radius: 22px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--bg);
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  box-shadow: 0 0 40px rgba(0, 245, 255, 0.25);
}

.about-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.fact {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.fact b {
  display: block;
  font-family: var(--font-display);
  font-size: 0.9rem;
  margin-bottom: 3px;
}

.fact span {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
}

/* ══════════ CONTACT ══════════ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.contact-grid .full { grid-column: 1 / -1; }

.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.24em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 7px;
}

.field input,
.field textarea {
  width: 100%;
  padding: 13px 15px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--white);
  background: rgba(5, 8, 22, 0.55);
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  resize: vertical;
  transition: border-color 0.3s, box-shadow 0.3s;
  cursor: none;
}

.field input:focus,
.field textarea:focus {
  border-color: rgba(0, 245, 255, 0.5);
  box-shadow: 0 0 18px rgba(0, 245, 255, 0.12);
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.contact-status {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.contact-status.is-success { color: var(--emerald); }
.contact-status.is-error { color: #ff5f57; }

/* ══════════ AI ASSISTANT CHAT ══════════ */
.chat {
  display: flex;
  flex-direction: column;
  height: 380px;
}

.chat__log {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 14px;
}

.chat__msg {
  max-width: 82%;
  padding: 11px 15px;
  font-size: 0.82rem;
  line-height: 1.6;
  border-radius: 14px;
}

.chat__msg--bot {
  align-self: flex-start;
  background: rgba(123, 97, 255, 0.12);
  border: 1px solid rgba(123, 97, 255, 0.25);
  border-bottom-left-radius: 4px;
}

.chat__msg--user {
  align-self: flex-end;
  background: rgba(0, 245, 255, 0.1);
  border: 1px solid rgba(0, 245, 255, 0.25);
  border-bottom-right-radius: 4px;
}

.chat__form {
  display: flex;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.chat__input {
  flex: 1;
  padding: 12px 15px;
  font-family: var(--font-body);
  font-size: 0.84rem;
  color: var(--white);
  background: rgba(5, 8, 22, 0.55);
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  cursor: none;
}

.chat__input:focus { border-color: rgba(0, 245, 255, 0.5); }

.chat__meta {
  display: flex;
  justify-content: center;
  padding-top: 9px;
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.18em;
  color: var(--muted);
}

/* Quick-question chips */
.chat__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 2px 0 6px;
}

.chat__chip {
  padding: 8px 13px;
  font-family: var(--font-body);
  font-size: 0.7rem;
  color: var(--cyan);
  border: 1px solid rgba(0, 245, 255, 0.28);
  border-radius: 99px;
  background: rgba(0, 245, 255, 0.05);
  transition: background 0.25s, border-color 0.25s, transform 0.25s var(--ease-out);
}

.chat__chip:hover {
  background: rgba(0, 245, 255, 0.12);
  border-color: var(--cyan);
  transform: translateY(-1px);
}

/* Typing indicator */
.chat__typing { display: inline-flex; gap: 4px; padding: 3px 0; }
.chat__typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: chat-bounce 1.2s ease-in-out infinite;
}
.chat__typing i:nth-child(2) { animation-delay: 0.15s; }
.chat__typing i:nth-child(3) { animation-delay: 0.3s; }

@keyframes chat-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* ══════════ CERTIFICATES ══════════ */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.cert {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.015);
  transition: border-color 0.3s, transform 0.3s var(--ease-out);
}

.cert:hover {
  border-color: rgba(0, 255, 157, 0.35);
  transform: translateY(-3px);
}

.cert__icon { font-size: 1.3rem; margin-bottom: 10px; }
.cert__name {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.cert__issuer {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}

/* ══════════ RESUME ══════════ */
.resume-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.resume-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.resume-row > div {
  /* The filename is one unbroken word (no spaces) — without this it can't
     wrap and forces the row to overflow, pushing the Download button past
     the window's clipped edge on narrow mobile widths. */
  min-width: 0;
  overflow-wrap: break-word;
}

.resume-row .btn {
  flex-shrink: 0;
}

.resume-row b { font-family: var(--font-display); font-size: 0.9rem; }
.resume-row span {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--muted);
  letter-spacing: 0.1em;
}
