/* ============================
   VARIABLES
   ============================ */
:root {
  --bg: #f8f7f4;
  --sheet: #ffffff;
  --text: #1c1c1a;
  --text-muted: #6b6760;
  --text-light: #9b9890;
  --accent: #0f3460;
  --accent-2: #c0392b;
  --border: #e2ddd8;
  --tag-bg: #efecea;
  --tag-text: #3a3835;
  --bar-bg: #efecea;
  --bar-fill: #0f3460;
  --toolbar-bg: #1c1c1a;
  --toolbar-text: #c8c5bf;
  --mono: 'IBM Plex Mono', monospace;
  --sans: 'IBM Plex Sans', system-ui, sans-serif;
  --sheet-width: 860px;
  --sheet-pad: 3rem 3.5rem;
}

body.dark {
  --bg: #111110;
  --sheet: #181816;
  --text: #e8e5df;
  --text-muted: #8a8780;
  --text-light: #5a5855;
  --accent: #4d8fc4;
  --accent-2: #e05a1a;
  --border: #2a2a28;
  --tag-bg: #222220;
  --tag-text: #b0ada8;
  --bar-bg: #222220;
  --bar-fill: #4d8fc4;
  --toolbar-bg: #0a0a09;
  --toolbar-text: #8a8780;
}

/* ============================
   BASE
   ============================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  transition: background 0.2s, color 0.2s;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover { text-decoration: underline; }

/* ============================
   TOOLBAR (web only)
   ============================ */
.toolbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--toolbar-bg);
  color: var(--toolbar-text);
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.toolbar-brand {
  color: #fff;
  font-weight: 500;
}

.toolbar-brand span {
  color: #4d8fc4;
}

.toolbar-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  opacity: 0.6;
}

.dot-green {
  width: 7px; height: 7px;
  background: #2a9d5c;
  border-radius: 50%;
  animation: blink 2s ease infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.toolbar-actions {
  display: flex;
  gap: 0.75rem;
}

.toolbar-actions button {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--toolbar-text);
  padding: 0.3rem 0.9rem;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.toolbar-actions button:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

/* ============================
   SHEET (the resume itself)
   ============================ */
.sheet {
  max-width: var(--sheet-width);
  margin: 0 auto;
  padding: calc(44px + 2.5rem) 0 3rem;
  background: transparent;
}

/* ============================
   RESUME HEADER
   ============================ */
.resume-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: end;
  padding: var(--sheet-pad);
  padding-bottom: 0;
  background: var(--sheet);
}

h1 {
  font-family: var(--mono);
  font-size: 2.2rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1;
}

h1 span {
  color: var(--accent);
}

.head-title {
  margin-top: 0.45rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-family: var(--mono);
  letter-spacing: 0.02em;
}

.head-contact {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: right;
}

.head-contact a:hover { color: var(--accent); }

/* ============================
   DIVIDER
   ============================ */
.divider {
  height: 1px;
  background: var(--border);
  margin: 0 3.5rem;
}

/* ============================
   SECTION COMMON
   ============================ */
.section {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 2rem;
  padding: 1.6rem 3.5rem;
  background: var(--sheet);
}

.side-section {
  grid-template-columns: 1fr;
  padding: 1.4rem 0;
  gap: 0.8rem;
}

.section-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-light);
  padding-top: 0.15rem;
  white-space: nowrap;
}

.summary-text {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.75;
}

/* ============================
   RESUME BODY (two columns)
   ============================ */
.resume-body {
  display: grid;
  grid-template-columns: 1fr 220px;
  background: var(--sheet);
}

.col-main {
  border-right: 1px solid var(--border);
}

.col-side {
  padding: 0 2rem;
}

/* ============================
   ENTRIES (experience, edu, projects)
   ============================ */
.entry {
  margin-bottom: 1.6rem;
}

.entry:last-child { margin-bottom: 0; }

.entry-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.3rem;
  flex-wrap: nowrap;
}

.entry-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  font-family: var(--sans);
}

.entry-org {
  font-size: 0.78rem;
  color: var(--accent);
  font-family: var(--mono);
  margin-top: 0.1rem;
}

.entry-date {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-light);
  white-space: nowrap;
  letter-spacing: 0.03em;
}

.entry-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-top: 0.3rem;
}

.entry-link {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--accent-2);
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.entry-bullets {
  list-style: none;
  margin-top: 0.5rem;
}

.entry-bullets li {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.65;
  padding-left: 1rem;
  position: relative;
  margin-bottom: 0.2rem;
}

.entry-bullets li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--text-light);
  font-size: 0.7rem;
}

/* ============================
   TECH TAGS
   ============================ */
.tech-tags, .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.tech-tags span, .tags span {
  background: var(--tag-bg);
  color: var(--tag-text);
  font-family: var(--mono);
  font-size: 0.65rem;
  padding: 0.2rem 0.55rem;
  border-radius: 2px;
  letter-spacing: 0.02em;
}

.tags em {
  font-style: normal;
  color: var(--accent-2);
  font-size: 0.62rem;
}

/* ============================
   SIDEBAR SPECIFIC
   ============================ */
.avail-block {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.avail-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.72rem;
}

.avail-day { color: var(--text-muted); }

.avail-time {
  color: var(--accent);
  font-weight: 500;
}

.avail-note {
  font-size: 0.75rem;
  color: var(--text-light);
  line-height: 1.6;
  margin-top: 0.4rem;
}

.skill-block {
  margin-bottom: 0.9rem;
}

.skill-block h4 {
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  margin-bottom: 0.4rem;
}

/* CERT PROGRESS BARS */
.cert-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cert-name {
  display: block;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.cert-bar {
  height: 3px;
  background: var(--bar-bg);
  border-radius: 2px;
  overflow: hidden;
}

.cert-fill {
  height: 100%;
  background: var(--bar-fill);
  border-radius: 2px;
  transition: width 1s ease;
}

/* ============================
   PRINT STYLES
   ============================ */
@media print {
  @page {
    size: A4;
    margin: 10mm 12mm;
  }

  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }

  html { font-size: 12.2px; }

  body {
    background: #fff !important;
    color: #1c1c1a !important;
  }

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

  .sheet {
    padding: 0 !important;
    max-width: 100%;
  }

  * { color: #1c1c1a !important; background: #fff !important; }
  .head-contact a, .entry-org, .entry-link { color: #0f3460 !important; }
  .tags span, .tech-tags span { background: #efecea !important; color: #3a3835 !important; }
  .cert-fill { background: #0f3460 !important; }
  .cert-bar { background: #efecea !important; }
  .divider { background: #e2ddd8 !important; }

  h1 { font-size: 2rem; }
  .head-title { font-size: 0.78rem; }

  .resume-head {
    padding: 1rem 2rem 0.65rem !important;
    gap: 1.4rem;
  }

  .head-contact { font-size: 0.7rem; gap: 0.25rem; }

  .divider { margin: 0 2rem; }

  .section {
    padding: 0.8rem 2rem !important;
    gap: 1.2rem;
  }

  .section-label { font-size: 0.6rem; }
  .summary-text { font-size: 0.82rem; line-height: 1.65; }

  .entry { margin-bottom: 0.8rem; }
  .entry-title { font-size: 0.88rem; }
  .entry-org { font-size: 0.73rem; white-space: nowrap; }
  .entry-date { font-size: 0.66rem; }
  .entry-note { font-size: 0.75rem; line-height: 1.55; margin-top: 0.22rem; }
  .entry-bullets li { font-size: 0.75rem; line-height: 1.55; margin-bottom: 0.12rem; }

  /* Wider sidebar prevents text wrap */
  .resume-body {
    grid-template-columns: 1fr 230px !important;
  }

  .col-side { padding: 0 1.2rem !important; }
  .side-section { padding: 0.82rem 0 !important; gap: 0.6rem !important; }

  .skill-block { margin-bottom: 0.55rem; }
  .skill-block h4 { font-size: 0.6rem; margin-bottom: 0.25rem; }

  .tags span, .tech-tags span {
    font-size: 0.64rem;
    padding: 0.13rem 0.45rem;
    white-space: nowrap;
  }

  .cert-list { gap: 0.5rem; }
  .cert-name { font-size: 0.66rem; margin-bottom: 0.18rem; white-space: nowrap; }
  .cert-bar { height: 3px; }

  .avail-note { font-size: 0.72rem; line-height: 1.58; }

  a { color: #0f3460 !important; text-decoration: none !important; }

  .entry { page-break-inside: avoid; }
}

/* ============================
   RESPONSIVE (web, small screens)
   ============================ */
@media (max-width: 700px) {
  :root { --sheet-pad: 1.5rem; }

  .divider { margin: 0 1.5rem; }

  .resume-head {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .head-contact {
    align-items: flex-start;
    text-align: left;
  }

  .section {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding: 1.2rem 1.5rem;
  }

  .section-label {
    font-size: 0.6rem;
  }

  .resume-body {
    grid-template-columns: 1fr;
  }

  .col-main { border-right: none; border-bottom: 1px solid var(--border); }
  .col-side { padding: 0 1.5rem; }
  .side-section { padding: 1rem 0; }

  .toolbar { padding: 0 1rem; }
  .toolbar-brand { display: none; }
}
