/* Portafolio · Darwin Montiel Mora — CSS propio, sin frameworks. */

:root {
  --bg: #f5f8f9;
  --surface: #ffffff;
  --surface-2: #eef4f5;
  --border: #dde6ea;
  --text: #0f1f2e;
  --muted: #546474;
  --accent: #0d9488;
  --accent-strong: #0f766e;
  --accent-soft: #ccfbf1;
  --hero-from: #0f1f2e;
  --hero-to: #12384a;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(15 31 46 / 6%), 0 10px 30px rgb(15 31 46 / 7%);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0a131b;
  --surface: #101c26;
  --surface-2: #0d1821;
  --border: #1f303d;
  --text: #e6edf2;
  --muted: #94a7b6;
  --accent: #2dd4bf;
  --accent-strong: #5eead4;
  --accent-soft: #134e4a;
  --hero-from: #07101a;
  --hero-to: #0d2a37;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a131b;
    --surface: #101c26;
    --surface-2: #0d1821;
    --border: #1f303d;
    --text: #e6edf2;
    --muted: #94a7b6;
    --accent: #2dd4bf;
    --accent-strong: #5eead4;
    --accent-soft: #134e4a;
    --hero-from: #07101a;
    --hero-to: #0d2a37;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.65 var(--font); color: var(--text); background: var(--bg); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-strong); text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: 16px; top: -48px; background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 20; }
.skip:focus { top: 12px; }
.muted { color: var(--muted); }

/* ---------- Barra superior ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar__inner { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; margin-right: auto; }
.brand__logo { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: #0d9488; color: #fff; font-size: 14px; letter-spacing: .5px; }
.nav__list { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav__list a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--text); text-decoration: none; font-weight: 500; font-size: 15px; }
.nav__list a:hover { background: var(--surface-2); }
.nav__toggle { display: none; }
.theme, .nav__toggle {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 10px; height: 38px; min-width: 38px; padding: 0 10px; cursor: pointer; font: inherit;
}

/* ---------- Hero ---------- */
.hero { background: linear-gradient(135deg, var(--hero-from), var(--hero-to)); color: #e8f1f5; padding: 72px 0 40px; }
.hero__inner { display: grid; grid-template-columns: 1fr auto; gap: 48px; align-items: center; }
.eyebrow { margin: 0 0 10px; color: #7fe3d6; font-weight: 600; font-size: 14px; letter-spacing: .3px; }
.hero h1 { font-size: clamp(34px, 5vw, 56px); color: #fff; }
.hero__role { margin: 10px 0 0; font-size: clamp(17px, 2.2vw, 21px); color: #b9d4df; font-weight: 500; }
.hero__pitch { max-width: 640px; margin: 18px 0 0; color: #d3e3ea; font-size: 17px; }
.hero__pitch strong { color: #fff; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.hero__photo { width: 260px; height: 260px; border-radius: 50%; object-fit: cover; border: 4px solid #2dd4bf; box-shadow: 0 20px 50px rgb(0 0 0 / 35%); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 10px; font-weight: 600; text-decoration: none;
  border: 1px solid rgb(255 255 255 / 30%); color: inherit; background: rgb(255 255 255 / 6%);
  transition: transform .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); background: rgb(255 255 255 / 12%); }
.btn--primary { background: #0d9488; border-color: #0d9488; color: #fff; }
.btn--primary:hover { background: #0f766e; }

.stats { list-style: none; margin: 48px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stats li { background: rgb(255 255 255 / 6%); border: 1px solid rgb(255 255 255 / 12%); border-radius: var(--radius); padding: 16px 18px; }
.stats strong { display: block; font-size: 26px; color: #fff; }
.stats span { color: #b9d4df; font-size: 14px; }

/* ---------- Secciones ---------- */
.section { padding: 80px 0; }
.section--alt { background: var(--surface-2); border-block: 1px solid var(--border); }
.section__head { max-width: 720px; margin-bottom: 36px; }
.section__head h2 { font-size: clamp(28px, 3.5vw, 36px); }
.section__head p { margin: 10px 0 0; color: var(--muted); font-size: 17px; }

.project {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 36px; align-items: center;
  margin-bottom: 56px;
}
.project--reverse .project__media { order: 2; }
.project__media { display: block; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); background: var(--surface); }
.project__media img { transition: transform .35s ease; }
.project__media:hover img { transform: scale(1.02); }
.project__kicker { margin: 0 0 6px; color: var(--accent-strong); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .7px; }
.project h3 { font-size: 26px; }
/* Cada proyecto tiene su propia identidad visual; su color marca la tarjeta (solo como adorno,
   el texto sigue en los colores del sitio para no perder contraste). */
.project { --proyecto: var(--accent); }
.project--colmena { --proyecto: #f2a516; }
.project--torre { --proyecto: #39d98a; }
.project--vigia { --proyecto: #b8392e; }
.project--radar { --proyecto: #d4a72c; }
.project--faro { --proyecto: #5b53e6; }
.project--viajero { --proyecto: #b8400b; }
.project__media { border-top: 4px solid var(--proyecto); }
.project .project__kicker::before {
  content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 2px;
  background: var(--proyecto); vertical-align: 0;
}
.project__body p { margin: 12px 0 0; }
.project__links { display: flex; gap: 18px; font-weight: 600; }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 16px 0 0; }
.chips li { font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.card h3 { font-size: 19px; }
.card p { margin: 10px 0 0; color: var(--muted); }
.card__link { margin-top: auto; padding-top: 16px; font-weight: 600; }

.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.timeline > li {
  display: grid; grid-template-columns: 190px 1fr; gap: 24px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px;
}
.timeline__when { color: var(--accent-strong); font-weight: 700; font-size: 15px; }
.timeline h3 { font-size: 19px; }
.timeline h3 span { color: var(--accent-strong); }
.timeline p { margin: 4px 0 0; font-size: 15px; }
.timeline ul { margin: 10px 0 0; padding-left: 18px; }
.timeline li li { margin: 4px 0; }

.skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.skills > div { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.skills h3 { font-size: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 40px; }
.subhead { font-size: 20px; margin-bottom: 12px; }
.list { margin: 0; padding-left: 18px; }
.list li { margin: 8px 0; }

.section--contact { background: linear-gradient(135deg, var(--hero-from), var(--hero-to)); color: #e8f1f5; }
.contact { text-align: center; max-width: 720px; }
.contact h2 { color: #fff; font-size: clamp(28px, 3.5vw, 38px); }
.contact p { color: #c9dbe3; font-size: 17px; }
.contact .hero__actions { justify-content: center; }
.section--contact .btn:not(.btn--primary) { color: #fff; background: rgb(255 255 255 / 8%); border-color: rgb(255 255 255 / 30%); }

.footer { padding: 26px 0; color: var(--muted); font-size: 14px; border-top: 1px solid var(--border); }
.footer p { margin: 0; text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__photo { width: 150px; height: 150px; order: -1; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .project, .project--reverse { grid-template-columns: 1fr; gap: 20px; }
  .project--reverse .project__media { order: 0; }
  .cards, .skills { grid-template-columns: 1fr 1fr; }
  .timeline > li { grid-template-columns: 1fr; gap: 6px; }
}

@media (max-width: 640px) {
  .nav__toggle { display: inline-block; }
  .nav__list {
    display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column;
    background: var(--surface); border-bottom: 1px solid var(--border); padding: 8px 16px 14px;
  }
  .nav__list.open { display: flex; }
  .brand__name { display: none; }
  .hero { padding-top: 40px; }
  .cards, .skills, .grid2 { grid-template-columns: 1fr; }
  .stats strong { font-size: 22px; }
  .section { padding: 56px 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
