/* ============================================
   Matías Ortega — Portfolio
   style.css
   ============================================ */

/* ---------- DESIGN TOKENS ---------- */
:root {
  --bg: #0D1420;
  --surface: #141C2B;
  --surface-alt: #19233570;
  --border: #232E44;
  --border-soft: #1B2537;
  --text: #EDF0F6;
  --text-muted: #98A3BB;
  --text-dim: #6B7690;
  --accent: #4C7CF0;
  --accent-strong: #6D93F5;
  --accent-ink: #0B1730;
  --radius: 10px;
  --maxw: 1120px;
  --s-section: 132px;
  --s-lg: 48px;
  --s-md: 32px;
  --s-sm: 20px;
}

/* ---------- RESET & BASE ---------- */
* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}

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

a { color: inherit; }

h1, h2, h3 {
  font-family: 'Sora', sans-serif;
  margin: 0;
  letter-spacing: -0.01em;
  font-weight: 600;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
}

section.wrap:not(.hero) {
  padding-top: 56px;
  padding-bottom: var(--s-section);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- NAV ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(13, 20, 32, 0.86);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
}

.logo {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.logo .name {
  font-family: 'Sora', sans-serif;
  font-weight: 600;
  font-size: 15.5px;
  color: var(--text);
}

.logo .role {
  font-size: 10.5px;
  color: var(--accent-strong);
  letter-spacing: .12em;
  font-weight: 600;
}

nav.links {
  display: flex;
  gap: 4px;
}

.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.menu-toggle span,
.menu-toggle span::before,
.menu-toggle span::after {
  content: "";
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  position: relative;
  transition: transform .2s ease, opacity .2s ease;
}

.menu-toggle span::before { position: absolute; top: -6px; }
.menu-toggle span::after  { position: absolute; top: 6px; }
.menu-toggle.open span    { background: transparent; }
.menu-toggle.open span::before { transform: translateY(6px) rotate(45deg); }
.menu-toggle.open span::after  { transform: translateY(-6px) rotate(-45deg); }

.mobile-panel {
  display: none;
  flex-direction: column;
  padding: 8px 28px 18px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.mobile-panel.open { display: flex; }

.mobile-panel a {
  padding: 12px 4px;
  font-size: 15px;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px solid var(--border-soft);
}

.mobile-panel a:last-child { border-bottom: none; }
.mobile-panel a:hover { color: var(--text); }

nav.links a {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 9px 14px;
  border-radius: 7px;
  transition: background .15s ease, color .15s ease;
  white-space: nowrap;
}

nav.links a:hover {
  color: var(--text);
  background: var(--surface);
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 13.5px;
  padding: 10px 18px;
  border-radius: 8px;
  text-decoration: none;
  border: 1px solid var(--border);
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--accent);
  color: #FFFFFF;
  border-color: var(--accent);
}

.btn-primary:hover { background: var(--accent-strong); }

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

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

@media (max-width: 820px) {
  nav.links { display: none; }
  .menu-toggle { display: flex; }
  .nav-cta .btn-ghost { display: none; }
}

@media (min-width: 821px) {
  .mobile-panel { display: none !important; }
}

/* ---------- HERO ---------- */
.hero {
  padding: var(--s-section) 0 var(--s-lg);
}

.hero-top {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--s-lg);
  align-items: start;
  margin-bottom: var(--s-lg);
}

.id-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 28px;
  text-align: center;
}

.id-photo {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 5px rgba(76, 124, 240, 0.14);
  display: block;
  margin: 0 auto 16px;
}

.id-name {
  font-family: 'Sora', sans-serif;
  font-weight: 600;
  font-size: 17px;
}

.id-role {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  margin-bottom: 20px;
}

.id-rows {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  text-align: left;
}

.id-row {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  padding: 6px 0;
}

.id-row span:first-child { color: var(--text-dim); }
.id-row span:last-child  { color: var(--text); font-weight: 500; }

@media (max-width: 820px) {
  .hero-top { grid-template-columns: 1fr; }

  /* Compact ID card on mobile: inline photo + key data only */
  .id-card {
    display: flex;
    align-items: center;
    gap: 16px;
    text-align: left;
    padding: 20px;
    max-width: 100%;
    margin: 0;
  }

  .id-photo {
    width: 64px;
    height: 64px;
    margin: 0;
    flex-shrink: 0;
  }

  .id-card-info { flex: 1; }
  .id-name   { font-size: 15px; }
  .id-role   { margin-bottom: 0; }
  .id-rows   { display: none; }
}

.eyebrow {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-strong);
  letter-spacing: .04em;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(76, 124, 240, 0.18);
  flex: none;
}

.hero h1 {
  font-size: clamp(32px, 4.6vw, 52px);
  line-height: 1.12;
  max-width: 820px;
}

.hero h1 .accent { color: var(--accent-strong); }

.hero p.lede {
  color: var(--text-muted);
  font-size: 16.5px;
  max-width: 560px;
  margin: 24px 0 32px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: var(--s-lg);
}

/* ---------- KPI STRIP (semantic <dl>) ---------- */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  margin: 0;
  padding: 0;
}

.kpi {
  padding: 24px 22px;
  border-right: 1px solid var(--border);
  position: relative;
}

.kpi:last-child { border-right: none; }

.kpi dt {
  display: block;
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 400;
}

.kpi dd {
  margin: 0;
  font-weight: 700;
  font-size: 26px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  order: -1;
}

.kpi dd .unit {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 3px;
}

.kpi .spark {
  margin-top: 16px;
  width: 100%;
  height: 24px;
  display: block;
}

.kpi .spark path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
}

@media (max-width: 760px) {
  .kpi-strip { grid-template-columns: repeat(2, 1fr); }
  .kpi:nth-child(2) { border-right: none; }
}

/* ---------- SECTION shell ---------- */
section { padding: var(--s-section) 0; }

section#experiencia,
section#proyectos {
  background: var(--surface);
}

.section-head { margin-bottom: 44px; }

.section-head h2 {
  font-size: 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-head h2::before {
  content: "";
  width: 34px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
}

.section-sub {
  color: var(--text-muted);
  font-size: 15px;
  max-width: 560px;
  margin: -16px 0 32px;
}

/* ---------- ABOUT ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: var(--s-md);
  align-items: start;
}

.about-grid p {
  color: var(--text-muted);
  font-size: 15.5px;
  margin: 0 0 16px;
}

.about-grid p strong {
  color: var(--text);
  font-weight: 600;
}

.facts {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.facts-spaced { margin-top: 20px; }

.facts .row {
  display: flex;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}

.facts .row:last-child { border-bottom: none; }

.facts .row span:first-child {
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 500;
}

.facts .row span:last-child {
  color: var(--text);
  font-weight: 500;
  text-align: right;
}

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

/* ---------- STACK ---------- */
.stack-groups {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-sm);
}

.stack-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  background: var(--surface);
}

.stack-card h3 {
  font-size: 16px;
  margin-bottom: 16px;
  font-weight: 600;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 12px;
  transition: border-color .15s ease, color .15s ease;
}

.chip:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

@media (max-width: 820px) {
  .stack-groups { grid-template-columns: 1fr; }
}

/* ---------- PROJECTS / EXPERIENCE cards ---------- */
.project {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 24px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  transition: border-color .25s ease, box-shadow .25s ease;
}

.project:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 24px rgba(76, 124, 240, 0.08);
}

.project .shot {
  background: var(--border-soft);
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  position: relative;
  overflow: hidden;
}

.project .shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.96;
  transition: opacity .3s ease, transform .4s ease;
}

.project:hover .shot img {
  opacity: 1;
  transform: scale(1.02);
}

.project .body { padding: 32px; }

.project .kicker {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-strong);
  margin-bottom: 10px;
  display: block;
  letter-spacing: .03em;
}

.project h3 {
  font-size: 20px;
  margin-bottom: 12px;
}

.project p.desc {
  color: var(--text-muted);
  font-size: 14.5px;
  margin: 0 0 20px;
}

.project .metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.project .metric {
  border: 1px solid var(--border-soft);
  border-radius: 7px;
  padding: 12px 14px;
}

.project .metric .n {
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.project .metric .t {
  font-size: 11.5px;
  color: var(--text-dim);
  margin-top: 3px;
}

.project .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 20px;
}

.tag {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: 5px;
}

.project .links {
  display: flex;
  gap: 10px;
}

.project .links a {
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  transition: color .15s ease;
}

.project .links a:hover { color: var(--accent-strong); }

@media (max-width: 820px) {
  .project { grid-template-columns: 1fr; }
  .project .shot {
    border-right: none;
    border-bottom: 1px solid var(--border);
    min-height: 180px;
  }
}

/* ---------- CONTACT ---------- */
.contact-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  padding: 56px 44px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.contact-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(560px 220px at 50% -20%, rgba(76, 124, 240, 0.12), transparent 70%);
  pointer-events: none;
}

.contact-card h2 {
  font-size: 28px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.contact-card h2::before {
  content: "";
  width: 34px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
}

.contact-card p {
  color: var(--text-muted);
  font-size: 15.5px;
  max-width: 460px;
  margin: 0 auto 30px;
}

.contact-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 22px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.contact-links a {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: color .15s ease;
}

.contact-links a:hover { color: var(--accent-strong); }

/* ---------- FOOTER ---------- */
footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  margin-top: 16px;
}

footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

footer .fine {
  font-size: 12px;
  color: var(--text-dim);
}

/* ---------- SCROLL REVEAL ---------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .6s ease, transform .6s ease;
}

.reveal.in {
  opacity: 1;
  transform: translateY(0);
}
