/* ── CV — A4 printable sheet ─────────────────────────────────────── */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --paper: #fdfcf9;
  --panel-1: #17294e;
  --panel-2: #0c1a36;
  --navy: #1d3563;
  --navy-deep: #12234a;
  --gold: #c49a2a;
  --gold-soft: #e6c877;
  --gold-ink: #9a7414;
  --gold-tint: rgba(196, 154, 42, 0.13);
  --ink: #222a3c;
  --muted: #66708a;
  --cream: #e9edf6;
  --cream-dim: #a9b3ca;
  --hairline: rgba(29, 53, 99, 0.14);
}

html {
  background: #e4e8f1;
}

body {
  background: linear-gradient(180deg, #edf0f7 0%, #dde3ee 100%) fixed;
  color: var(--ink);
  font-family: "Inter", "Helvetica Neue", Helvetica, Arial, "Segoe UI", sans-serif;
  font-size: 9.2pt;
  line-height: 1.42;
  -webkit-font-smoothing: antialiased;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

::selection {
  background: var(--gold-soft);
  color: var(--navy-deep);
}

/* ── Password gate ───────────────────────────────────────────────── */

body.locked .toolbar,
body.locked .sheet {
  display: none !important;
}

.gate {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy-deep);
  padding: 20px;
}

.gate.hidden {
  display: none;
}

.gate-box {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 360px;
  border: 1px solid var(--gold);
  border-radius: 3mm;
  background: rgba(255, 255, 255, 0.04);
  padding: 32px 30px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 0 30px rgba(216, 167, 35, 0.12);
}

.gate-title {
  color: var(--gold-soft);
  font-family: "Courier New", Courier, monospace;
  font-size: 15px;
  letter-spacing: 3px;
}

.gate-sub {
  color: #9aa6bd;
  font-family: "Courier New", Courier, monospace;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.gate-box input {
  font: inherit;
  font-family: "Courier New", Courier, monospace;
  letter-spacing: 3px;
  color: var(--paper);
  caret-color: var(--gold-soft);
  background: transparent;
  border: 1px solid rgba(232, 236, 244, 0.35);
  border-radius: 1.5mm;
  padding: 11px 12px;
  width: 100%;
}

.gate-box input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(216, 167, 35, 0.35);
}

.gate-error {
  min-height: 14px;
  color: #ff6b6b;
  font-family: "Courier New", Courier, monospace;
  font-size: 11px;
  letter-spacing: 2px;
}

.gate-btn {
  font: inherit;
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--navy-deep);
  background: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 1.5mm;
  padding: 11px 18px;
  cursor: pointer;
  transition: all 0.15s;
}

.gate-btn:hover,
.gate-btn:focus-visible {
  background: var(--gold-soft);
  border-color: var(--gold-soft);
}

.gate-back {
  color: #9aa6bd;
  font-family: "Courier New", Courier, monospace;
  font-size: 11px;
  letter-spacing: 2px;
  text-decoration: none;
  border-bottom: 1px dashed #55617a;
  align-self: flex-start;
}

.gate-back:hover {
  color: var(--gold-soft);
  border-color: var(--gold-soft);
}

/* ── Toolbar (screen only) ───────────────────────────────────────── */

.toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 16px;
  background: var(--navy-deep);
  border-bottom: 0.6mm solid var(--gold);
  box-shadow: 0 6px 18px rgba(18, 35, 74, 0.35);
}

.tool-btn {
  font: inherit;
  font-size: 10.5px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--cream);
  background: transparent;
  border: 1px solid rgba(232, 236, 244, 0.3);
  border-radius: 2mm;
  padding: 8px 16px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}

.tool-btn:hover,
.tool-btn:focus-visible {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--navy-deep);
}

.tool-btn.primary {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--navy-deep);
  font-weight: 700;
}

.tool-btn.primary:hover,
.tool-btn.primary:focus-visible {
  background: var(--gold-soft);
  border-color: var(--gold-soft);
}

.lang-switch {
  display: flex;
  gap: 6px;
}

.lang-switch .tool-btn {
  padding: 8px 12px;
  letter-spacing: 1px;
}

.lang-switch .tool-btn.active {
  background: var(--cream);
  border-color: var(--cream);
  color: var(--navy-deep);
  font-weight: 700;
}

/* ── A4 sheet (always 210×297mm, scaled to fit the viewport) ─────── */

.sheet-wrap {
  position: relative;
  width: calc(210mm * var(--sheet-scale, 1));
  height: calc(297mm * var(--sheet-scale, 1));
  margin: 22px auto;
}

.sheet {
  position: absolute;
  top: 0;
  left: 0;
  width: 210mm;
  height: 297mm;
  background: var(--paper);
  display: flex;
  overflow: hidden;
  box-shadow: 0 22px 60px rgba(18, 35, 74, 0.3), 0 3px 10px rgba(18, 35, 74, 0.16);
  transform: scale(var(--sheet-scale, 1));
  transform-origin: top left;
}

/* ── Sidebar ─────────────────────────────────────────────────────── */

.sidebar {
  width: 72mm;
  flex: 0 0 72mm;
  background: linear-gradient(197deg, var(--panel-1) 0%, var(--panel-2) 72%);
  border-right: 0.9mm solid;
  border-image: linear-gradient(180deg, var(--gold-soft), var(--gold) 55%, var(--gold-ink)) 1;
  padding: 8mm 6mm 6mm;
  display: flex;
  flex-direction: column;
  gap: 3.6mm;
}

.photo-frame {
  align-self: center;
  width: 40mm;
  height: 48mm;
  border: 0.5mm solid rgba(230, 200, 119, 0.55);
  border-radius: 3mm;
  overflow: hidden;
  background: var(--panel-2);
  box-shadow: 0 2.5mm 6mm rgba(0, 0, 0, 0.4), 0 0 0 0.4mm rgba(230, 200, 119, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-fallback {
  color: var(--gold-soft);
  font-family: "Playfair Display", Georgia, serif;
  font-size: 22pt;
  font-weight: 600;
  letter-spacing: 2px;
}

.cv-block h2 {
  width: 100%;
  color: var(--gold-soft);
  font-size: 7pt;
  font-weight: 700;
  letter-spacing: 2.6px;
  text-transform: uppercase;
  padding-bottom: 0;
  margin-bottom: 1.8mm;
}

.cv-block h2::after {
  content: "";
  display: block;
  margin-top: 1mm;
  width: 100%;
  height: 0.35mm;
  background: linear-gradient(90deg, var(--gold), rgba(230, 200, 119, 0.05));
}

.cv-block ul {
  list-style: none;
}

.cv-block li {
  padding: 0.55mm 0;
  overflow-wrap: break-word;
}

.contact-list li {
  display: flex;
  align-items: flex-start;
  gap: 1.8mm;
  font-size: 7.3pt;
  color: var(--cream);
}

.contact-list li::before {
  content: "";
  width: 1.3mm;
  height: 1.3mm;
  margin-top: 1mm;
  flex: 0 0 1.3mm;
  background: var(--gold);
  transform: rotate(45deg);
  opacity: 0.9;
}

.contact-list a {
  color: var(--cream);
  text-decoration: none;
  border-bottom: 0.2mm solid rgba(230, 200, 119, 0.35);
  transition: all 0.12s;
}

.contact-list a:hover {
  color: var(--gold-soft);
  border-color: var(--gold-soft);
}

.tech-group {
  margin-bottom: 1.8mm;
}

.tech-group:last-child {
  margin-bottom: 0;
}

.tech-group .tech-name {
  display: block;
  font-size: 6pt;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: rgba(233, 237, 246, 0.55);
  margin-bottom: 0.6mm;
}

.tech-group .tech-items {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1mm;
}

.tech-chip {
  font-size: 6.6pt;
  letter-spacing: 0.2px;
  color: var(--cream);
  background: rgba(255, 255, 255, 0.07);
  border: 0.2mm solid rgba(230, 200, 119, 0.3);
  border-radius: 6mm;
  padding: 0.5mm 1.9mm;
}

.lang-row,
.skill-row {
  display: flex;
  justify-content: space-between;
  gap: 3mm;
  font-size: 7.3pt;
  color: var(--cream);
}

.lang-row .level {
  color: var(--gold-soft);
  font-style: italic;
  white-space: nowrap;
}

.skill-row {
  justify-content: flex-start;
  gap: 2.2mm;
}

.skill-row::before {
  content: "";
  width: 1.5mm;
  height: 1.5mm;
  margin-top: 1.1mm;
  flex: 0 0 1.5mm;
  background: var(--gold);
  transform: rotate(45deg);
}

.interest-item .interest-name {
  font-weight: 600;
  color: var(--gold-soft);
}

.interest-item .interest-details {
  display: block;
  font-size: 6.3pt;
  color: var(--cream-dim);
}

/* ── Main content ────────────────────────────────────────────────── */

.main {
  flex: 1;
  padding: 9mm 9mm 7mm 8mm;
  display: flex;
  flex-direction: column;
  gap: 5.8mm;
}

.cv-header {
  position: relative;
  padding-bottom: 3.2mm;
}

.cv-header::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 0.55mm;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-soft) 30%, rgba(196, 154, 42, 0.06) 100%);
}

.cv-role {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 1.8mm;
  font-size: 8pt;
  font-weight: 700;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: var(--navy);
}

.cv-role .cv-avail {
  display: flex;
  align-items: baseline;
  gap: 1.8mm;
  font-size: 7.5pt;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: none;
  color: var(--muted);
  white-space: nowrap;
}

.cv-role .cv-avail::before {
  content: "|";
  color: var(--gold);
}

.cv-name {
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-size: 27pt;
  font-weight: 600;
  letter-spacing: 0.2px;
  line-height: 1.05;
  color: var(--navy-deep);
  margin-top: 1.4mm;
}

.cv-section h2 {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 2.4mm;
  font-size: 8.2pt;
  font-weight: 700;
  letter-spacing: 2.8px;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: 3mm;
}

.cv-section h2::before {
  content: "";
  flex: 0 0 4mm;
  width: 4mm;
  height: 1mm;
  background: var(--gold);
}

.cv-section h2::after {
  content: "";
  flex: 1;
  height: 0.3mm;
  background: var(--hairline);
}

.cv-summary {
  font-size: 9.4pt;
  line-height: 1.6;
  color: var(--ink);
  text-align: justify;
}

.entry {
  display: flex;
  gap: 4mm;
  padding: 2.6mm 0;
  break-inside: avoid;
  page-break-inside: avoid;
}

.entry + .entry {
  border-top: 0.2mm solid var(--hairline);
}

.entry .entry-year {
  flex: 0 0 22mm;
  height: fit-content;
  font-size: 7.6pt;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--gold-ink);
  background: var(--gold-tint);
  border-left: 0.7mm solid var(--gold);
  border-radius: 0 1mm 1mm 0;
  padding: 1mm 2mm;
  white-space: nowrap;
}

.entry .entry-title {
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-size: 10.6pt;
  font-weight: 700;
  color: var(--navy-deep);
}

.entry .entry-desc {
  font-size: 8.5pt;
  line-height: 1.5;
  color: var(--muted);
  margin-top: 0.6mm;
}

/* ── Print → PDF ─────────────────────────────────────────────────── */

@page {
  size: A4;
  margin: 0;
}

@media print {
  html,
  body {
    background: #ffffff;
  }

  .toolbar,
  .gate {
    display: none !important;
  }

  .sheet-wrap {
    width: 210mm;
    height: 297mm;
    margin: 0;
  }

  .sheet {
    transform: none;
    margin: 0;
    box-shadow: none;
  }

  .sidebar {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}

/* Invisible ATS layer: transparent 1 pt text kept in the PDF text stream so
   automated screeners can read the configured keywords. */
.ats-text {
  position: absolute;
  left: 0;
  bottom: 1.5mm;
  width: 100%;
  z-index: 6;
  font-size: 1pt;
  line-height: 1;
  letter-spacing: 0;
  /* transparent text is still written to the PDF text stream (opacity:0 is not) */
  color: transparent;
  white-space: normal;
  overflow: visible;
  pointer-events: none;
}
