:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1c1b19;
  --muted: #5f5b53;
  --border: #e6e2da;
  --accent: #e08a00;
  --accent-strong: #b86f00;
  --accent-soft: #fdf0dc;
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141311;
    --surface: #1d1c19;
    --text: #f1eee8;
    --muted: #aaa498;
    --border: #2f2d29;
    --accent: #f5a524;
    --accent-strong: #ffbd4a;
    --accent-soft: #2e2415;
  }
}

:root[data-theme="dark"] {
  --bg: #141311;
  --surface: #1d1c19;
  --text: #f1eee8;
  --muted: #aaa498;
  --border: #2f2d29;
  --accent: #f5a524;
  --accent-strong: #ffbd4a;
  --accent-soft: #2e2415;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.6;
}

a { color: inherit; }
img { max-width: 100%; }

.container { width: min(1040px, 100% - 32px); margin-inline: auto; }

/* Navegación */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { font-weight: 700; text-decoration: none; }

.nav-right { display: flex; align-items: center; gap: 8px; }

.nav-links { display: flex; gap: 24px; list-style: none; margin: 0; padding: 0; }
.nav-links a { text-decoration: none; color: var(--muted); font-weight: 500; }
.nav-links a:hover { color: var(--text); }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}
.theme-toggle:hover { color: var(--text); border-color: var(--accent); }
.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun { display: none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
}
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }

.nav-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 2px; margin: 5px 0; background: var(--text); }

@media (max-width: 640px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: 14px 16px; }
}

/* Encabezado principal */
.hero { padding: 96px 0 72px; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); line-height: 1.1; margin: 8px 0 20px; letter-spacing: -0.02em; }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 640px; }
.lead strong { color: var(--text); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.eyebrow {
  margin: 0;
  color: var(--accent-strong);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #1c1b19; }
.btn-primary:hover { background: var(--accent-strong); }
.btn-ghost { border-color: var(--border); background: var(--surface); }

/* Secciones */
.section { padding: 64px 0; border-top: 1px solid var(--border); }
.section h2 { font-size: 1.8rem; margin: 0 0 28px; letter-spacing: -0.01em; }
.section h3 { margin: 0 0 8px; font-size: 1.15rem; }
.subhead { margin-top: 56px !important; }

.about { display: grid; grid-template-columns: 3fr 2fr; gap: 48px; }
.about p { margin-top: 0; color: var(--muted); }
.about strong { color: var(--text); }
.skills h3 { font-size: 0.95rem; margin-top: 0; }
.skills .tags { margin-bottom: 24px; }

@media (max-width: 800px) { .about { grid-template-columns: 1fr; gap: 24px; } }

.tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 12px 0; }
.tags li {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
}
.tags-soft li { background: var(--surface); border: 1px solid var(--border); }

/* Proyectos */
.featured {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 32px;
  padding: 32px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  margin-bottom: 24px;
}
.featured > img:not(.featured-shot), .featured-icon svg { border-radius: 50%; display: block; }
.featured h3 { font-size: 1.5rem; margin: 6px 0 12px; }
.featured p { color: var(--muted); }
.featured-links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 4px; }
.featured-shot {
  grid-column: 1 / -1;
  width: 100%;
  margin-top: 8px;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid var(--border);
}

@media (max-width: 640px) {
  .featured { grid-template-columns: 1fr; padding: 24px; }
  .featured > img:not(.featured-shot), .featured-icon svg { width: 112px; height: 112px; }
}

.checks { padding-left: 0; list-style: none; }
.checks li { padding-left: 26px; position: relative; margin: 6px 0; }
.checks li::before { content: "✓"; position: absolute; left: 0; color: var(--accent-strong); font-weight: 700; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.card {
  padding: 24px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.card p { color: var(--muted); margin: 0; flex: 1; }

.link { color: var(--accent-strong); font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; }

/* Experiencia */
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--border); }
.timeline > li { position: relative; padding: 0 0 32px 28px; }
.timeline > li::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
}
.timeline .when { margin: 0; color: var(--muted); font-size: 0.9rem; font-weight: 500; }
.timeline ul { color: var(--muted); padding-left: 20px; margin: 8px 0 0; }

.edu { list-style: none; padding: 0; margin: 0; }
.edu li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.edu span { color: var(--muted); }

/* Contacto */
.contact p { color: var(--muted); margin-top: -12px; }

.contact-form {
  max-width: 480px;
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.botcheck { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row label { font-size: 0.9rem; font-weight: 500; color: var(--muted); }
.form-row input,
.form-row textarea {
  font: inherit;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}
.form-row input:focus,
.form-row textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.form-row textarea { resize: vertical; }
.contact-form .btn { align-self: flex-start; border: none; }
.form-status { margin: 0; min-height: 1.4em; font-size: 0.9rem; color: var(--muted); }
.form-status.is-success { color: var(--accent-strong); }
.form-status.is-error { color: #d64545; }

.contact-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.contact-links .btn { overflow-wrap: anywhere; }

.site-footer { padding: 32px 0 48px; color: var(--muted); font-size: 0.9rem; border-top: 1px solid var(--border); }

code { font-size: 0.9em; padding: 1px 6px; border-radius: 6px; background: var(--accent-soft); }
