/* ============================================================
   Dracula Color Variables
   ============================================================ */
:root {
  --bg:           #282a36;
  --current-line: #44475a;
  --foreground:   #f8f8f2;
  --comment:      #6272a4;
  --cyan:         #8be9fd;
  --green:        #50fa7b;
  --orange:       #ffb86c;
  --pink:         #ff79c6;
  --purple:       #bd93f9;
  --red:          #ff5555;
  --yellow:       #f1fa8c;

  --chrome-dark:  #1e1f29;
  --panel:        #21222c;
  --border-dark:  #191a21;

  --profile-width: 280px;
}

/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  font-family: 'Fira Code', monospace;
  background: var(--bg);
  color: var(--foreground);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
}

:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ============================================================
   App Shell
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: var(--profile-width) 1fr;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
}

/* ============================================================
   Profile Sidebar
   ============================================================ */
.profile {
  background: var(--panel);
  border-right: 1px solid var(--border-dark);
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--current-line) transparent;
}

.profile::-webkit-scrollbar { width: 4px; }
.profile::-webkit-scrollbar-track { background: transparent; }
.profile::-webkit-scrollbar-thumb { background: var(--current-line); border-radius: 2px; }

.avatar {
  font-size: 10px;
  line-height: 1.15;
  margin-bottom: 14px;
  user-select: none;
}

.profile-name {
  font-size: 18px;
  font-weight: 600;
}

.profile-title {
  font-size: 12px;
  color: var(--purple);
}

.profile-location {
  font-size: 12px;
  color: var(--comment);
}

.profile-divider {
  color: var(--current-line);
  margin: 12px 0;
  user-select: none;
}

.profile-links-direct,
.profile-links-social {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  font-size: 13px;
  width: 100%;
  text-align: left;
}

.profile-links-social {
  margin-top: auto; /* pins Social to the bottom of the sidebar */
  padding-top: 16px;
}

.profile-links-direct .link-card,
.profile-links-social .link-card {
  background: var(--chrome-dark);
  border: 1px solid var(--border-dark);
  border-radius: 6px;
  padding: 9px 12px;
  transition: border-color 0.15s, transform 0.15s;
}

.profile-links-direct .link-card:hover,
.profile-links-social .link-card:hover {
  border-color: var(--purple);
  transform: translateX(2px);
}

.profile-links-direct .copy-email,
.profile-links-social .copy-email {
  font-size: 11px;
  padding: 3px 8px;
}

.column-label {
  color: var(--comment);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 2px;
}

/* ============================================================
   Main Column
   ============================================================ */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 16px;
  gap: 12px;
}

/* ============================================================
   Nav Bar
   ============================================================ */
.nav-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}

.nav-btn {
  background: transparent;
  border: 1px solid var(--current-line);
  border-radius: 4px;
  color: var(--comment);
  font-size: 13px;
  padding: 6px 14px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.nav-btn::before {
  content: './';
  opacity: 0.6;
}

.nav-btn:hover {
  color: var(--foreground);
  border-color: var(--purple);
}

.nav-btn[aria-current="page"] {
  background: var(--current-line);
  color: var(--foreground);
  border-color: var(--purple);
}

.nav-btn-clear {
  margin-left: auto;
  color: var(--red);
  border-color: rgba(255, 85, 85, 0.4);
}

.nav-btn-clear::before {
  content: none;
}

.nav-btn-clear:hover {
  color: var(--red);
  border-color: var(--red);
  background: rgba(255, 85, 85, 0.08);
}

/* ============================================================
   Terminal
   ============================================================ */
.terminal {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--chrome-dark);
  border: 1px solid var(--current-line);
  border-radius: 8px;
  overflow: hidden;
}

.term-titlebar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--panel);
  border-bottom: 1px solid var(--border-dark);
  user-select: none;
  flex-shrink: 0;
}

.window-btns {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.window-btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.window-btn.close    { background: var(--red); }
.window-btn.minimize { background: var(--yellow); }
.window-btn.maximize { background: var(--green); }

.term-title {
  flex: 1;
  text-align: center;
  color: var(--comment);
  font-size: 12px;
  /* offset the traffic lights so the title is visually centered */
  margin-right: 48px;
}

/* ---------------- Output ---------------- */
.term-output {
  position: relative;
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--current-line) transparent;
  overscroll-behavior: contain;
}

.term-output::-webkit-scrollbar { width: 8px; }
.term-output::-webkit-scrollbar-track { background: transparent; }
.term-output::-webkit-scrollbar-thumb {
  background: var(--current-line);
  border-radius: 4px;
}

.term-block {
  margin-bottom: 20px;
}

.prompt-echo {
  color: var(--foreground);
  margin-bottom: 10px;
}

.prompt-echo .prompt-user {
  color: var(--green);
}

/* Output typography */
.term-output h2 {
  font-size: 15px;
  color: var(--purple);
  margin: 6px 0 10px;
}

.term-output h2::before {
  content: '# ';
  color: var(--comment);
}

.term-output h3 {
  font-size: 14px;
  color: var(--pink);
  margin: 4px 0 2px;
}

.term-output p {
  line-height: 1.6;
  margin: 6px 0;
  max-width: 72ch;
}

.term-output ul {
  list-style: none;
  margin: 6px 0;
}

.term-output ul li {
  line-height: 1.6;
  padding-left: 18px;
  position: relative;
  max-width: 72ch;
}

.term-output ul li::before {
  content: '-';
  position: absolute;
  left: 2px;
  color: var(--cyan);
}

.term-output pre {
  line-height: 1.5;
  margin: 8px 0;
  overflow-x: auto;
}

.term-output a {
  color: var(--cyan);
}

.term-output a:hover {
  color: var(--pink);
  text-decoration: underline;
}

.term-output .kv {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 18px;
  margin: 10px 0;
}

.term-output .kv dt {
  color: var(--purple);
}

.term-output .kv dt::after {
  content: ':';
  color: var(--comment);
}

.job-meta {
  margin: 0 0 4px !important;
}

.job-role {
  color: var(--orange);
}

.job-dates {
  color: var(--comment);
  font-size: 12px;
}

.hint {
  color: var(--comment);
  font-size: 13px;
}

.hint .c-green {
  font-style: normal;
}

.term-error {
  color: var(--red);
  white-space: pre-wrap;
}

.term-text {
  white-space: pre-wrap;
  line-height: 1.6;
}

.banner {
  font-size: 13px;
}

/* ---------------- Page card ----------------
   Outer container for each rendered page. Deliberately subtler than the
   inner .card fill below, so nested cards (job cards, link cards) still
   read as a distinct, "closer" layer rather than a duplicate box. */
.page-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--current-line);
  border-radius: 10px;
  padding: 20px 24px;
}

/* ---------------- Cards ---------------- */
.card {
  background: var(--panel);
  border: 1px solid var(--current-line);
  border-radius: 8px;
  padding: 14px 16px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  margin: 12px 0;
  max-width: 760px;
}

/* ---------------- Contact columns ---------------- */
.contact-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
  margin: 14px 0;
  max-width: 620px;
}

.contact-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.contact-column .card {
  width: 100%;
}

.term-output a.card {
  color: inherit;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.term-output a.card:hover {
  color: inherit;
  text-decoration: none;
  border-color: var(--purple);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.link-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
  flex-shrink: 0;
}

.link-card .icon {
  color: var(--purple);
}

.link-card-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.link-card-label {
  color: var(--foreground);
  font-weight: 500;
}

.link-card-sub {
  color: var(--comment);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.email-card {
  grid-column: 1 / -1; /* full row so the address never truncates */
}

.email-card .icon {
  color: var(--green);
}

.copy-email {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--current-line);
  border-radius: 4px;
  color: var(--green);
  font-family: inherit;
  font-size: 12px;
  padding: 4px 10px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}

.copy-email:hover {
  border-color: var(--green);
  background: rgba(80, 250, 123, 0.08);
}

.copy-email.copied {
  color: var(--bg);
  background: var(--green);
  border-color: var(--green);
}

.job-card {
  margin: 12px 0;
  max-width: 760px;
}

.job-card h3 {
  margin-top: 0;
}

.job-card .job-meta {
  display: flex;
  justify-content: space-between;
  gap: 4px 12px;
  flex-wrap: wrap;
}

.interest-card {
  padding: 12px 14px;
}

.interest-emoji {
  font-size: 22px;
  flex-shrink: 0;
}

.interest-card .c-cyan {
  font-size: 11px;
}

/* ---------------- Skills accordion ---------------- */
.tree-root {
  color: var(--foreground);
  margin-bottom: 2px !important;
}

.skill-cats {
  margin: 4px 0 10px;
  max-width: 760px;
}

.skill-cat-toggle {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--cyan);
  font-family: inherit;
  font-size: 14px;
  padding: 6px 4px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.skill-cat-toggle::before {
  content: '\25B8  ';
  color: var(--comment);
}

.skill-cat-toggle[aria-expanded="true"]::before {
  content: '\25BE  ';
}

.skill-cat-toggle:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--pink);
}

.skill-cat-toggle .cat-count {
  color: var(--comment);
  font-size: 12px;
}

.skill-cat-body {
  margin: 0 0 6px 9px;
  padding: 2px 4px 6px 20px;
  border-left: 1px solid var(--current-line);
}

.skill-cat-body h3 {
  display: none; /* category name is already on the toggle row */
}

/* ---------------- Typewriter cursor ---------------- */
.type-cursor {
  display: inline-block;
  animation: blink 1s step-end infinite;
  user-select: none;
}

/* ---------------- Input line ---------------- */
.term-input-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-top: 1px solid var(--border-dark);
  background: var(--panel);
  flex-shrink: 0;
}

.term-input-line .prompt {
  color: var(--green);
  user-select: none;
  white-space: nowrap;
}

#term-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--foreground);
  font-family: inherit;
  font-size: 14px;
  caret-color: var(--green);
  min-width: 0;
}

/* ============================================================
   Syntax Colors
   ============================================================ */
.c-comment { color: var(--comment); font-style: italic; }
.c-cyan     { color: var(--cyan); }
.c-green    { color: var(--green); }
.c-orange   { color: var(--orange); }
.c-pink     { color: var(--pink); }
.c-purple   { color: var(--purple); }
.c-red      { color: var(--red); }
.c-yellow   { color: var(--yellow); }
.c-fg       { color: var(--foreground); }
.c-bold     { font-weight: 600; }

/* ============================================================
   Animation
   ============================================================ */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

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

/* ============================================================
   Mobile Responsive
   ============================================================ */
@media (max-width: 768px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  /* Profile collapses to a compact horizontal strip */
  .profile {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: flex-start;
    text-align: left;
    gap: 4px 12px;
    padding: 12px 16px;
    border-right: none;
    border-bottom: 1px solid var(--border-dark);
    overflow-y: visible;
  }

  .avatar,
  .profile-divider {
    display: none;
  }

  .profile-name {
    font-size: 16px;
    width: 100%;
  }

  /* both groups flatten into one wrapping chip row; the desktop
     Direct Contact / Social split and bottom-justify are not meaningful
     once the sidebar becomes a horizontal strip */
  .profile-links-direct,
  .profile-links-social {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    font-size: 12px;
    margin-top: 0;
    padding-top: 0;
  }

  .column-label {
    display: none;
  }

  /* compact icon+label chips */
  .profile-links-direct .link-card,
  .profile-links-social .link-card {
    padding: 6px 10px;
    gap: 8px;
  }

  .profile-links-direct .link-card-sub,
  .profile-links-social .link-card-sub {
    display: none;
  }

  .profile-links-direct .icon,
  .profile-links-social .icon {
    width: 16px;
    height: 16px;
  }

  .contact-columns {
    grid-template-columns: 1fr;
  }

  .page-card {
    padding: 14px 16px;
  }

  .main {
    padding: 10px;
    gap: 8px;
    min-height: 0;
  }

  .nav-btn {
    padding: 5px 10px;
    font-size: 12px;
  }

  body {
    font-size: 13px;
  }

  .term-output {
    padding: 12px 14px;
  }

  .term-input-line {
    padding: 8px 14px;
  }

  .banner {
    font-size: 10px;
  }
}
