:root {
  --bg: #12151c;
  --panel: #1a1e28;
  --panel-border: #2a2f3d;
  --text: #e8e9ed;
  --text-dim: #9aa0ae;
  --accent: #ffb454;
  --accent-dim: #7a5c2e;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.5;
  padding: 32px 16px 64px;
}

.hidden { display: none !important; }

.resume-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  grid-template-areas:
    "identity description description"
    "skills experience experience"
    "projects education education";
}

.identity   { grid-area: identity; }
.description { grid-area: description; }
.skills     { grid-area: skills; }
.experience { grid-area: experience; }
.projects   { grid-area: projects; }
.education  { grid-area: education; }

.cell {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-left: 3px solid var(--accent-dim);
  border-radius: 8px;
  padding: 22px 24px;
}

.cell h2 {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 16px;
}

/* ---------- Identity ---------- */
.identity h1 {
  font-size: 1.6rem;
  margin: 0 0 4px;
  line-height: 1.2;
}

.identity .contact-line {
  color: var(--text-dim);
  font-size: 0.88rem;
  margin: 2px 0;
  word-break: break-word;
}

.identity .contact-line a {
  color: var(--text-dim);
  text-decoration: none;
}
.identity .contact-line a:hover {
  color: var(--accent);
}

.identity .contact-line a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.identity .profile-title {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent);
  margin: 0 0 10px;
}

.contact-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ---------- Description ---------- */
.description p {
  margin: 0;
  color: var(--text);
  font-size: 0.98rem;
  white-space: pre-line;
}

/* ---------- Skills ---------- */
.skills-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.skill-category {
  padding-top: 16px;
  border-top: 1px solid var(--panel-border);
}

.skill-category:first-child {
  padding-top: 0;
  border-top: none;
}

.skill-category-title {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-family: var(--mono);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  padding: 5px 12px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: border-color 0.15s ease, transform 0.1s ease;
}

.skill-item:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.skill-item .skill-level {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

.skill-tag {
  display: inline-flex;
  align-items: center;
  background: transparent;
  border: 1px dashed var(--panel-border);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* ---------- Experience ---------- */
.exp-entry {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--panel-border);
}
.exp-entry:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.exp-entry .exp-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
}

.exp-entry h3 {
  margin: 0;
  font-size: 1.02rem;
}

.exp-entry .exp-period {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  white-space: nowrap;
}

.exp-entry .exp-company {
  color: var(--text-dim);
  font-size: 0.88rem;
  margin: 2px 0 8px;
}

.exp-entry .exp-desc {
  margin: 0 0 8px;
  font-size: 0.92rem;
}

.exp-entry ul {
  margin: 0;
  padding-left: 18px;
  font-size: 0.9rem;
  color: var(--text-dim);
}
.exp-entry ul li { margin-bottom: 3px; }

/* ---------- Projects ---------- */
#projects-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.project-item {
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  padding: 10px 12px;
}

.project-item.linked {
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.project-item.linked:hover {
  border-color: var(--accent);
}

.project-item a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}
.project-item.linked a::after {
  content: " ↗";
  color: var(--accent);
}

.project-item .project-name {
  font-weight: 600;
  font-size: 0.94rem;
}

.project-item p {
  margin: 4px 0 0;
  font-size: 0.86rem;
  color: var(--text-dim);
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tech-tag {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  border-radius: 4px;
  padding: 2px 7px;
}

/* ---------- Education ---------- */
.edu-entry {
  margin-bottom: 14px;
}
.edu-entry:last-child { margin-bottom: 0; }

.edu-entry h3 {
  margin: 0;
  font-size: 0.98rem;
}

.edu-entry .edu-school {
  color: var(--text-dim);
  font-size: 0.88rem;
  margin: 2px 0;
}

.edu-entry .edu-period {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
}

.edu-entry .edu-details {
  font-size: 0.86rem;
  color: var(--text-dim);
  margin: 6px 0 0;
}

/* ---------- Modal (skill details) ---------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(8, 9, 13, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.modal-content {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 28px 26px;
  max-width: 440px;
  width: 100%;
  position: relative;
}

.modal-content h3 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}

#modal-level {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  margin: 0 0 14px;
}

#modal-details {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.3rem;
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover { color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 800px) {
  .resume-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "identity"
      "description"
      "skills"
      "experience"
      "projects"
      "education";
  }
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .skill-item { transition: none; }
}

@media print {
  body {
    background: #fff;
    color: #111;
    padding: 0;
  }

  /* Single column for print: DOM order becomes the only reading order,
     eliminating any risk of adjacent columns bleeding into each other */
  .resume-grid {
    display: block;
  }

  .cell {
    background: #fff;
    border: 1px solid #ccc;
    break-inside: avoid;
    margin-bottom: 14px;
  }

  .cell h2, .skill-category-title, .profile-title,
  .exp-period, .tech-tag {
    color: #111 !important;
    letter-spacing: normal; /* letter-spacing fragments PDF text extraction */
  }

  /* One skill per line instead of wrapping pills: avoids mid-word
     wraps and keeps every skill/tag clearly separated in extracted text */
  .skill-list {
    display: block;
  }

  .skill-item, .skill-tag {
    display: block;
    border: none;
    padding: 0;
    margin-bottom: 6px;
    color: #111;
  }

  .skill-item::after {
    content: " — " attr(data-details);
    display: block;
    font-size: 0.78em;
    color: #444;
    margin-top: 2px;
  }

  .modal {
    display: none !important;
  }

  a {
    color: #111 !important;
    text-decoration: underline;
  }
}

.print-button {
  display: block;
  margin: 0 auto 20px;
  background: var(--panel);
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  border-radius: 6px;
  padding: 8px 16px;
  font-family: var(--mono);
  font-size: 0.8rem;
  cursor: pointer;
}

.print-button:hover {
  border-color: var(--accent);
}

@media print {
  .no-print {
    display: none !important;
  }
}

.print-spacer {
  display: none;
}

@media print {
  .print-spacer {
    display: block;
    height: 0;
    overflow: hidden;
    font-size: 1px;
    line-height: 0;
  }
}

