/* =========================================================
   Victor Mamani Condori — Portafolio
   Diseño sobrio, un solo acento de color (guinda).
   ========================================================= */

:root {
  --guinda-800: #4a0e17;
  --guinda-700: #5c121c;
  --guinda-600: #6d1220;
  --guinda-500: #8a1b2b;

  --bg: #fbf9f7;
  --bg-alt: #f3eee9;
  --surface: #ffffff;
  --border: #e2d9d0;
  --text: #201417;
  --text-muted: #5c4d51;

  --radius-sm: 6px;
  --radius-md: 10px;
  --transition: 150ms ease;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Georgia, "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

:root[data-theme="dark"] {
  --bg: #1a1113;
  --bg-alt: #211517;
  --surface: #251618;
  --border: #3a2226;
  --text: #f1e6e3;
  --text-muted: #c2acb0;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1a1113;
    --bg-alt: #211517;
    --surface: #251618;
    --border: #3a2226;
    --text: #f1e6e3;
    --text-muted: #c2acb0;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: var(--bg-alt);
  padding: 1px 5px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-narrow { max-width: 760px; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--guinda-700);
  color: #fff;
  padding: 12px 18px;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 999;
}
.skip-link:focus { left: 0; }

/* ---------------- Header ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--guinda-600);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 0.9rem;
}

.main-nav ul {
  display: flex;
  align-items: center;
  gap: 26px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition);
}
.nav-link:hover, .nav-link:focus-visible, .nav-link.active { color: var(--guinda-600); }
:root[data-theme="dark"] .nav-link:hover,
:root[data-theme="dark"] .nav-link:focus-visible,
:root[data-theme="dark"] .nav-link.active { color: #e2a1ac; }

.nav-cta {
  padding: 7px 15px;
  border-radius: var(--radius-sm);
  background: var(--guinda-600);
  color: #fff !important;
}
.nav-cta:hover { background: var(--guinda-700); }

.header-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--text);
}
.icon-btn:hover { border-color: var(--guinda-500); }

.icon { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: none; }
:root[data-theme="dark"] .icon-moon { display: block; }

.nav-toggle { display: none; flex-direction: column; justify-content: center; gap: 4px; }
.nav-toggle span { width: 18px; height: 2px; background: var(--text); border-radius: 2px; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.btn-primary { background: var(--guinda-600); color: #fff; }
.btn-primary:hover { background: var(--guinda-700); }

.btn-outline { background: transparent; border-color: var(--guinda-500); color: var(--guinda-600); }
:root[data-theme="dark"] .btn-outline { color: #e2a1ac; border-color: #a5495a; }
.btn-outline:hover { background: color-mix(in srgb, var(--guinda-500) 8%, transparent); }

.btn-ghost { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--text-muted); }

.btn-block { width: 100%; }

/* ---------------- Hero ---------------- */
.hero { padding: 72px 0 56px; border-bottom: 1px solid var(--border); }

.eyebrow, .section-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--guinda-600);
  margin: 0 0 10px;
}
:root[data-theme="dark"] .eyebrow,
:root[data-theme="dark"] .section-eyebrow { color: #e2a1ac; }

.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 3.6vw, 2.6rem);
  line-height: 1.15;
  margin: 0 0 16px;
}

.hero-lead {
  font-size: 1.02rem;
  color: var(--text-muted);
  max-width: 62ch;
  margin: 0 0 20px;
}

.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }

.pill {
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }

.hero-stats { margin: 0; font-size: 0.88rem; color: var(--text-muted); }

/* ---------------- Sections ---------------- */
.section { padding: 56px 0; border-bottom: 1px solid var(--border); }
.section:last-of-type { border-bottom: none; }
.section-alt { background: var(--bg-alt); }

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 2.4vw, 1.9rem);
  margin: 0 0 18px;
}

.section-lead {
  color: var(--text-muted);
  max-width: 68ch;
  font-size: 1rem;
  margin: -4px 0 28px;
}

.subsection-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  margin: 40px 0 16px;
}

/* ---------------- About ---------------- */
.about-text { color: var(--text-muted); max-width: 68ch; margin: 0 0 32px; }

.quick-facts {
  margin: 0 0 40px;
  display: grid;
  gap: 0;
  border-top: 1px solid var(--border);
}

.quick-fact {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.quick-fact dt {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--guinda-600);
}
:root[data-theme="dark"] .quick-fact dt { color: #e2a1ac; }

.quick-fact dd { margin: 0; color: var(--text); }

.method { border-top: 1px solid var(--border); padding-top: 28px; }

.method h3 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  margin: 0 0 8px;
}

.method-lead { color: var(--text-muted); margin: 0 0 16px; font-size: 0.94rem; }

.process-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 0;
}

.process-steps li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  padding-right: 18px;
  margin-right: 18px;
  border-right: 1px solid var(--border);
}
.process-steps li:last-child { border-right: none; margin-right: 0; padding-right: 0; }

.step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--guinda-600);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ---------------- Skills / definition-list rows ---------------- */
.skills-list { margin: 0; border-top: 1px solid var(--border); }

.skills-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.skills-row dt { font-weight: 700; font-size: 0.92rem; color: var(--text); }
.skills-row dd { margin: 0; color: var(--text-muted); font-size: 0.92rem; }

/* ---------------- Timeline ---------------- */
.timeline { list-style: none; margin: 0 0 8px; padding: 0; }

.timeline-item {
  padding: 20px 0;
  border-top: 1px solid var(--border);
}
.timeline-item:first-child { border-top: none; padding-top: 0; }

.timeline-date {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--guinda-600);
  margin-bottom: 6px;
}
:root[data-theme="dark"] .timeline-date { color: #e2a1ac; }

.timeline-item h3 { margin: 0 0 6px; font-size: 1.08rem; }

.role-modality { font-size: 0.78rem; font-weight: 400; color: var(--text-muted); }

.timeline-summary { color: var(--text-muted); margin: 0 0 10px; }

.cvitems {
  margin: 0;
  padding-left: 20px;
  color: var(--text-muted);
  display: grid;
  gap: 5px;
  font-size: 0.94rem;
}

.education-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border);
}

.education-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}

.edu-date { font-size: 0.82rem; color: var(--text-muted); min-width: 170px; }
.edu-body { color: var(--text); }

/* ---------------- Projects ---------------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.project-status { color: var(--text-muted); grid-column: 1 / -1; }

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.project-period {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.project-card h3 { margin: 0; font-size: 1.05rem; }
.project-client { margin: 0; font-size: 0.86rem; color: var(--text-muted); font-style: italic; }
.project-card > p:not(.project-client) { margin: 0; color: var(--text-muted); font-size: 0.92rem; }

.project-tags {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.project-tags li {
  font-size: 0.74rem;
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.project-repos {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 2px;
}

.project-repos a {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--guinda-600);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.project-repos a:hover { color: var(--guinda-500); }

/* ---------------- Section CTA ---------------- */
.section-cta { margin-top: 8px; }

/* ---------------- Contact ---------------- */
.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 48px;
  align-items: start;
}

.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--border); }

.contact-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.contact-label {
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--guinda-600);
}
:root[data-theme="dark"] .contact-label { color: #e2a1ac; }

.contact-list a { text-decoration: none; color: var(--text); font-weight: 500; }
.contact-list a:hover { color: var(--guinda-600); }

.contact-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 26px;
  display: grid;
  gap: 16px;
}

.form-row { display: grid; gap: 6px; }
.form-row label { font-size: 0.84rem; font-weight: 600; color: var(--text); }
.optional { color: var(--text-muted); font-weight: 400; }

.form-row input,
.form-row select,
.form-row textarea {
  font: inherit;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--guinda-500);
}

.form-status { margin: 0; min-height: 1.2em; font-size: 0.88rem; }
.form-status[data-state="ok"] { color: #2e7d32; }
:root[data-theme="dark"] .form-status[data-state="ok"] { color: #7fd88a; }
.form-status[data-state="error"] { color: #b03a2e; }
:root[data-theme="dark"] .form-status[data-state="error"] { color: #ff8f7d; }

/* ---------------- Footer ---------------- */
.site-footer { padding: 24px 0; }

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-links { display: flex; gap: 18px; }
.footer-links a { text-decoration: none; color: var(--text-muted); }
.footer-links a:hover { color: var(--guinda-600); }

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
  .contact-grid { grid-template-columns: 1fr; }

  .quick-fact, .skills-row { grid-template-columns: 1fr; gap: 4px; }

  .main-nav {
    position: fixed;
    inset: 64px 16px auto 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    padding: 10px;
    transform: translateY(-10px);
    opacity: 0;
    pointer-events: none;
    transition: transform var(--transition), opacity var(--transition);
  }
  .main-nav.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .main-nav ul { flex-direction: column; align-items: stretch; gap: 2px; }
  .main-nav a { display: block; padding: 10px 12px; border-radius: var(--radius-sm); }
  .nav-cta { text-align: center; }

  .nav-toggle { display: flex; }
}

@media (max-width: 560px) {
  .hero { padding: 48px 0 40px; }
  .section { padding: 44px 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
