/* ==========================================================
   Variables
   ========================================================== */
:root {
  --color-header: #3d3d3d;
  --color-blue: #1976d2;
  --color-blue-dark: #0d5bb5;
  --color-ink: #111111;
  --color-border: #aaaaaa;
  --color-close: #d4d4d4;
  --color-line-light: #e0e0e0;
  --color-photo-bg: #eeeeee;
  --color-white: #ffffff;

  --font-main: "Inter", "Helvetica Neue", Arial, sans-serif;

  --window-width: 600px;
  --space-x: 36px;
  --transition: 0.2s ease;

  /* Page backdrop, matching style.css */
  --bg: #ffffff;
  --sky-soft: #9fc0fa;
  --sky: #6d9bf5;
  --sky-deep: #3b6fe0;
  --overlay: rgba(17, 17, 17, 0.3);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15161b;
    --sky-soft: #1c2848;
    --sky: #1f3a78;
    --sky-deep: #2350b8;
    --overlay: rgba(0, 0, 0, 0.45);
  }
}

:root[data-theme="dark"] {
  --bg: #15161b;
  --sky-soft: #1c2848;
  --sky: #1f3a78;
  --sky-deep: #2350b8;
  --overlay: rgba(0, 0, 0, 0.45);
}

/* ==========================================================
   Base
   ========================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-main);
  color: var(--color-ink);
  /* Same backdrop as index.html (style.css), light and dark */
  background-color: var(--bg);
  background-image: linear-gradient(
    to bottom,
    var(--bg) 0%,
    var(--bg) 48%,
    var(--sky-soft) 58%,
    var(--sky) 78%,
    var(--sky-deep) 100%
  );
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

h1,
h2,
p,
ul {
  margin: 0;
}

ul {
  padding: 0;
}

/* ==========================================================
   Layout
   ========================================================== */
/* Full-screen overlay that dims everything behind the popup */
.page {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  /* Light dim so the home-page gradient still shows through */
  background: var(--overlay);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  animation: overlay-in 0.25s ease;
}

@keyframes overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ==========================================================
   Window (popup)
   ========================================================== */
.window {
  width: 100%;
  max-width: var(--window-width);
  /* Header and profile stay put; only .content scrolls */
  max-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.18),
    0 20px 50px rgba(0, 0, 0, 0.35);
  animation: popup-in 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

@keyframes popup-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.titlebar {
  flex-shrink: 0;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 0 16px;
  background: var(--color-header);
  border-bottom: 1px solid var(--color-line-light);
}

.titlebar__title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  color: var(--color-white);
}

/* Close "X" drawn with two rotated bars */
.titlebar__close {
  position: relative;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 2px;
  transition: background-color var(--transition);
}

.titlebar__close::before,
.titlebar__close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 2px;
  background: var(--color-close);
  transition: background-color var(--transition);
}

.titlebar__close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.titlebar__close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.titlebar__close:hover,
.titlebar__close:focus-visible {
  background: rgba(255, 255, 255, 0.15);
}

.titlebar__close:hover::before,
.titlebar__close:hover::after,
.titlebar__close:focus-visible::before,
.titlebar__close:focus-visible::after {
  background: var(--color-white);
}

.titlebar__close:focus-visible {
  outline: 1px dotted var(--color-white);
  outline-offset: 1px;
}

/* ==========================================================
   Profile
   ========================================================== */
.profile {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding: 28px var(--space-x) 24px;
}

.profile__photo {
  width: 130px;
  height: 130px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 50%;
  background: var(--color-photo-bg);
}

.profile__info {
  min-width: 0;
  padding-top: 16px;
}

.profile__name {
  font-size: 34px;
  font-weight: 500;
  line-height: 1.15;
  color: var(--color-blue);
}

.profile__tagline {
  max-width: 320px;
  margin-top: 4px;
  font-size: 15px;
  line-height: 1.6;
}

.divider {
  flex-shrink: 0;
  height: 0;
  margin: 0 14px;
  border: 0;
  border-top: 2px solid var(--color-ink);
}

/* ==========================================================
   Content
   ========================================================== */
.content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px var(--space-x) 32px;
  font-size: 15px;
  line-height: 1.6;
  scrollbar-width: thin;
  scrollbar-color: #bbbbbb transparent;
}

.content::-webkit-scrollbar {
  width: 6px;
}

.content::-webkit-scrollbar-thumb {
  background: #bbbbbb;
  border-radius: 3px;
}

.content p + p {
  margin-top: 12px;
}

.block + .block {
  margin-top: 28px;
}

.block__title {
  margin-bottom: 10px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.accent {
  color: var(--color-blue);
}

.link {
  color: var(--color-blue);
  text-decoration: none;
  transition: color var(--transition);
}

.link:hover,
.link:focus-visible {
  color: var(--color-blue-dark);
  text-decoration: underline;
}

/* Education */
.education {
  list-style: none;
  padding-left: 10px;
}

.education__item + .education__item {
  margin-top: 15px;
}

.education__degree {
  display: block;
  font-size: 16px;
  font-weight: 700;
}

.education__school {
  display: block;
  margin-top: 1px;
  font-size: 14.5px;
}

/* Skills */
.skills {
  padding-left: 16px;
  font-size: 14.5px;
  line-height: 1.6;
}

.skills li::marker {
  font-size: 12px;
}

/* ==========================================================
   Responsive
   ========================================================== */
@media (max-width: 480px) {
  :root {
    --space-x: 18px;
  }

  .page {
    padding: 12px;
  }

  .profile {
    gap: 14px;
    padding-top: 16px;
  }

  .profile__photo {
    width: 84px;
    height: 84px;
  }

  .profile__info {
    padding-top: 10px;
  }

  .profile__name {
    font-size: 28px;
  }

  .divider {
    margin: 0 10px;
  }
}

@media (max-width: 340px) {
  .profile__photo {
    width: 68px;
    height: 68px;
  }

  .profile__info {
    padding-top: 6px;
  }

  .profile__name {
    font-size: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
