/* ── Variables ───────────────────────────────────────────────────────────────── */
:root {
  --accent:       #d97706;
  --accent-dark:  #1e293b;
  --accent-light: #fef3c7;
  --accent-mid:   #f59e0b;
  --text:       #1c1917;
  --text-light: #57534e;
  --white:      #ffffff;
  --bg:         #e8e1d4;
  --border:     #e7e5e4;
  --sidebar-top:    #1e293b;
  --sidebar-bottom: #0f172a;
  --sidebar-text:   #ffffff;
  --sidebar-width: 280px;
}

/* ── Dark mode ───────────────────────────────────────────────────────────────── */
[data-theme="dark"] {
  --accent:       #fbbf24;
  --accent-dark:  #1e293b;
  --accent-light: #292524;
  --accent-mid:   #f59e0b;
  --text:       #f5f0e8;
  --text-light: #a8a29e;
  --white:      #1c1917;
  --bg:         #0c0a09;
  --border:     #3c3736;
}

[data-theme="dark"] body {
  background:
    radial-gradient(ellipse at 30% 20%, rgba(251,191,36,0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(251,191,36,0.04) 0%, transparent 55%),
    var(--bg);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --accent:       #fbbf24;
    --accent-dark:  #1e293b;
    --accent-light: #292524;
    --accent-mid:   #f59e0b;
    --text:       #f5f0e8;
    --text-light: #a8a29e;
    --white:      #1c1917;
    --bg:         #0c0a09;
    --border:     #3c3736;
  }

  html:not([data-theme="light"]) body {
    background:
      radial-gradient(ellipse at 30% 20%, rgba(251,191,36,0.06) 0%, transparent 60%),
      radial-gradient(ellipse at 80% 80%, rgba(251,191,36,0.04) 0%, transparent 55%),
      var(--bg);
  }
}

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

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(ellipse at 30% 20%, rgba(217,119,6,0.09) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(30,41,59,0.10) 0%, transparent 55%),
    var(--bg);
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 16px;
}

/* ── Wrapper ─────────────────────────────────────────────────────────────────── */
.cv-wrapper {
  display: flex;
  width: 100%;
  max-width: 960px;
  min-height: 1100px;
  background: var(--white);
  box-shadow: 0 4px 32px rgba(0,0,0,0.22);
  border-radius: 10px;
  overflow: hidden;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--sidebar-top) 0%, var(--sidebar-bottom) 100%);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
}

.photo-wrap {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--accent-dark);
  position: relative;
}

.photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  padding: 4px;
  background: var(--accent-dark);
}

.photo-wrap::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.35);
}

.sidebar-content {
  padding: 24px 20px;
  flex: 1;
}

.sidebar-section {
  margin-bottom: 28px;
}

.sidebar-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sidebar-text);
  padding-bottom: 6px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-title::before {
  content: '';
  width: 3px;
  height: 12px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 2px;
  flex-shrink: 0;
}

/* Contact items */
.contact-section {
  border-bottom: 1px solid rgba(255,255,255,0.2);
  padding-bottom: 20px;
  margin-bottom: 20px;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}

.contact-item:last-child { margin-bottom: 0; }

.contact-item .icon {
  font-size: 16px;
  opacity: 0.85;
  flex-shrink: 0;
  margin-top: 1px;
}

.contact-item div {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.contact-item strong {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.75;
}

.contact-item span {
  font-size: 13px;
  word-break: break-word;
  white-space: pre-line;
}

/* Sidebar list */
.sidebar-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sidebar-list li {
  display: inline-block;
  font-size: 11.5px;
  line-height: 1.3;
  padding: 3px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.sidebar-list li::before {
  content: none;
}

/* ── Main content ────────────────────────────────────────────────────────────── */
.content {
  flex: 1;
  padding: 36px 40px;
  min-width: 0;
}

/* Header */
.cv-header {
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 3px solid var(--accent);
}

.cv-header h1 {
  font-size: 2rem;
  font-weight: 300;
  letter-spacing: 0.01em;
  color: var(--text);
  line-height: 1.2;
}

.cv-header h1 span {
  font-weight: 800;
}

.cv-title {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 6px;
}

/* Sections */
.cv-section {
  margin-bottom: 28px;
}

.section-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.section-title::before {
  content: '';
  width: 4px;
  height: 14px;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
}

.section-title::after {
  content: none;
}

/* Profile bio */
#cv-bio {
  color: var(--text-light);
  font-size: 13.5px;
  position: relative;
  z-index: 1;
}

#cv-bio::before {
  content: '\201C';
  position: absolute;
  top: -0.25em;
  left: -0.2em;
  font-size: 7rem;
  line-height: 1;
  font-weight: 800;
  color: var(--accent);
  opacity: 0.06;
  pointer-events: none;
  z-index: 0;
  font-family: Georgia, 'Times New Roman', serif;
  user-select: none;
}

/* Experience entry */
.exp-entry {
  display: flex;
  gap: 14px;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
  border-radius: 6px;
  transition: background 0.18s ease;
  padding-left: 4px;
  margin-left: -4px;
}

.exp-entry:hover {
  background: var(--accent-light);
}

.exp-entry:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.exp-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 5px;
  position: relative;
}

.exp-entry:not(:last-child) .exp-dot::after {
  content: '';
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: calc(18px + 18px);
  background: var(--accent);
  opacity: 0.2;
}

.exp-body { flex: 1; min-width: 0; }

.exp-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.exp-role {
  font-weight: 700;
  font-size: 13.5px;
}

.exp-employer {
  font-size: 12.5px;
  color: var(--text-light);
}

.exp-date {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-light);
  padding: 1px 8px;
  border-radius: 10px;
  white-space: nowrap;
  margin-left: auto;
}

.exp-desc {
  color: var(--text-light);
  font-size: 13px;
  margin-top: 4px;
}
.exp-desc p { margin: 0; }
.exp-desc p + p { margin-top: 2px; }
.exp-desc ul, .exp-desc ol { padding-left: 1.4em; margin: 2px 0; }
.exp-desc li { margin: 1px 0; }

/* Education entry */
.edu-entry {
  display: flex;
  gap: 14px;
  margin-bottom: 14px;
}

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

.edu-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 4px;
  position: relative;
}

.edu-entry:not(:last-child) .edu-dot::after {
  content: '';
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: calc(14px + 14px);
  background: var(--accent);
  opacity: 0.2;
}

.edu-body { flex: 1; }

.edu-degree {
  font-weight: 700;
  font-size: 13.5px;
}

.edu-institution {
  font-size: 12.5px;
  color: var(--text-light);
  margin-top: 2px;
}

.edu-year {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-light);
  padding: 1px 8px;
  border-radius: 10px;
  display: inline-block;
  margin-top: 2px;
}

/* Education description */
.edu-desc {
  color: var(--text-light);
  font-size: 13px;
  white-space: pre-line;
  margin-top: 4px;
}

/* ── Private field placeholder ───────────────────────────────────────────────── */
.private-field { font-style: italic; color: rgba(255,255,255,0.5); font-size: 0.88em; }

/* ── PDF button ──────────────────────────────────────────────────────────────── */
.pdf-btn-wrap {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 200;
}

.pdf-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: var(--white);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
  transition: background 0.15s, transform 0.1s;
}

.pdf-btn:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

/* ── Theme toggle button ─────────────────────────────────────────────────────── */
.theme-btn {
  background: var(--accent);
  color: var(--white);
  border: none;
  border-radius: 20px;
  padding: 8px 12px;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
  transition: background 0.15s, transform 0.1s;
  margin-right: 8px;
  line-height: 1;
}

.theme-btn:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

/* ── Contact links ───────────────────────────────────────────────────────────── */
.contact-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  transition: border-color 0.15s;
}
.contact-link:hover {
  border-color: var(--white);
}

/* ── Chip hover ──────────────────────────────────────────────────────────────── */
.sidebar-list li {
  cursor: default;
  transition: background 0.15s, transform 0.1s;
}
.sidebar-list li:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: scale(1.04);
}

/* ── Content top accent bar ──────────────────────────────────────────────────── */
.content {
  position: relative;
}
.content::before {
  content: '';
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-mid) 60%, transparent 100%);
  margin-top: -36px;
  margin-left: -40px;
  margin-right: -40px;
  margin-bottom: 36px;
}

/* ── Skeleton loading ────────────────────────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.is-loading .cv-header h1,
.is-loading #cv-title,
.is-loading #cv-bio {
  background: linear-gradient(90deg, var(--border) 25%, #e8e8e8 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  color: transparent !important;
  min-height: 1em;
  min-width: 100px;
  display: block;
}

.is-loading #cv-experiences,
.is-loading #cv-education {
  background: linear-gradient(90deg, var(--border) 25%, #e8e8e8 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
  min-height: 80px;
}

[data-theme="dark"] .is-loading .cv-header h1,
[data-theme="dark"] .is-loading #cv-title,
[data-theme="dark"] .is-loading #cv-bio,
[data-theme="dark"] .is-loading #cv-experiences,
[data-theme="dark"] .is-loading #cv-education {
  background: linear-gradient(90deg, var(--border) 25%, #2e3a50 50%, var(--border) 75%);
  background-size: 200% 100%;
}

/* ── Entry fade-in animations ────────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.exp-entry, .edu-entry {
  animation: fadeUp 0.4s ease both;
}
@media (prefers-reduced-motion: reduce) {
  .exp-entry, .edu-entry { animation: none; }
}

/* ── Error state ─────────────────────────────────────────────────────────────── */
.cv-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 40px;
  gap: 12px;
  min-height: 300px;
}
.cv-error-icon { font-size: 2.5rem; color: var(--accent-mid); opacity: 0.6; }
.cv-error-title { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.cv-error-msg { font-size: 13.5px; color: var(--text-light); max-width: 320px; line-height: 1.6; }
.cv-error-msg a { color: var(--accent); text-decoration: underline; }

/* ── Modals ──────────────────────────────────────────────────────────────────── */
.honeypot { display: none !important; }

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.is-open { display: flex; }

.modal-box {
  background: var(--white);
  border-radius: 12px;
  padding: 32px;
  width: 100%;
  max-width: 520px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-box--narrow { max-width: 380px; }

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-light);
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s;
}
.modal-close:hover { background: var(--border); color: var(--text); }

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.modal-description {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 16px;
}
.form-group label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}
.form-group input,
.form-group textarea {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 7px;
  padding: 9px 12px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text);
  transition: border-color 0.15s;
  resize: vertical;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-feedback {
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 7px;
  margin-bottom: 14px;
  display: none;
}
.form-feedback.is-success {
  display: block;
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}
.form-feedback.is-error {
  display: block;
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}
[data-theme="dark"] .form-feedback.is-success {
  background: #064e3b;
  color: #6ee7b7;
  border-color: #065f46;
}
[data-theme="dark"] .form-feedback.is-error {
  background: #7f1d1d;
  color: #fca5a5;
  border-color: #991b1b;
}

.form-submit {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s;
}
.form-submit:hover { opacity: 0.88; }
.form-submit:disabled { opacity: 0.55; cursor: default; }

/* ── Print ───────────────────────────────────────────────────────────────────── */
@media print {
  body { background: none; padding: 0; }
  .cv-wrapper { box-shadow: none; max-width: none; border-radius: 0; }
  .no-print { display: none !important; }
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 680px) {
  .cv-wrapper { flex-direction: column; }
  .sidebar { width: 100%; }
  .photo-wrap { width: 120px; height: 120px; border-radius: 50%; margin: 20px auto 0; aspect-ratio: auto; }
  .content { padding: 24px 20px; }
}
