/* ============================================
   MARCELO NASSER OLEA — marcelonasser.cl
   Paleta: azul teal/petróleo PDND
   Tipografía: Raleway (uniforme, sin creatividad)
   ============================================ */

:root {
  --bg:          #f0f6f8;
  --bg-alt:      #ffffff;
  --bg-dark:     #0d2a33;
  --bg-mid:      #1a3d4a;
  --bg-teal:     #1e5060;
  --border:      #c8e4ea;
  --border-dark: rgba(255,255,255,.1);
  --white:       #ffffff;
  --text:        #1a3d4a;
  --text-light:  #4a7a8a;
  --accent:      #1e6678;
  --accent-light:#3a9ab0;
  --pale:        #ddeaee;
  --fn: 'Raleway', system-ui, sans-serif;
  --nav-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 15px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--fn);
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--fn); font-weight: 600; line-height: 1.2; color: var(--bg-dark); }
p { font-family: var(--fn); font-weight: 300; color: var(--text-light); margin-bottom: .9rem; font-size: .9rem; }
a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent-light); }
em { font-style: italic; }
strong { font-weight: 600; }

/* ---- LAYOUT ---- */
.container { max-width: 1100px; margin: 0 auto; padding: 0 2rem; }
.section { padding: 4rem 0; border-bottom: 1px solid var(--border); }
.section-alt { background: var(--bg-alt); }
.section-dark { background: var(--bg-mid); }

.section-label {
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: .8rem;
}
.section-label.light { color: rgba(255,255,255,.5); }

.section-title {
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--bg-dark);
  margin-bottom: 1rem;
}
.section-title.light { color: var(--white); }

.section-intro {
  font-size: .85rem;
  font-weight: 300;
  color: var(--text-light);
  max-width: 600px;
  margin-bottom: 2rem;
}
.section-intro.light { color: rgba(255,255,255,.65); }

/* ---- BOTONES ---- */
.btn-primary {
  display: inline-block;
  background: var(--white);
  color: var(--bg-dark);
  font-family: var(--fn);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .75rem 1.8rem;
  border: none;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.btn-primary:hover { background: var(--pale); color: var(--bg-dark); }
.btn-primary.full { width: 100%; text-align: center; }
.btn-primary.dark { background: var(--bg-dark); color: var(--white); }
.btn-primary.dark:hover { background: var(--bg-teal); color: var(--white); }

.btn-ghost {
  display: inline-block;
  border: 1px solid rgba(255,255,255,.35);
  color: var(--white);
  font-family: var(--fn);
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .75rem 1.8rem;
  transition: border-color .2s, background .2s;
}
.btn-ghost:hover { border-color: var(--white); background: rgba(255,255,255,.1); color: var(--white); }

.btn-outline {
  display: inline-block;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--fn);
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .5rem 1.2rem;
  margin-top: 1rem;
  transition: background .2s, color .2s;
}
.btn-outline:hover { background: var(--accent); color: var(--white); }

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 1000;
  transition: background .3s, box-shadow .3s;
}
.navbar.scrolled {
  background: rgba(13,42,51,.97);
  box-shadow: 0 1px 0 var(--border-dark);
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-family: var(--fn);
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: .15em;
  text-transform: uppercase;
}
.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
  align-items: center;
}
.nav-links a {
  font-family: var(--fn);
  font-size: .65rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.7);
  transition: color .2s;
}
.nav-links a:hover { color: var(--white); }
.nav-cta {
  color: rgba(255,255,255,.9) !important;
  border: 1px solid rgba(255,255,255,.3);
  padding: .4rem 1rem;
}
.nav-cta:hover { background: rgba(255,255,255,.1); color: var(--white) !important; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: .5rem;
}
.nav-toggle span { display: block; width: 22px; height: 1.5px; background: var(--white); }

/* ============================================
   HERO
   ============================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #0d2a33 0%, #1a3d4a 55%, #1e5060 100%);
}
.hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 79px, rgba(255,255,255,.025) 80px),
    repeating-linear-gradient(90deg, transparent, transparent 79px, rgba(255,255,255,.025) 80px);
}
.hero-bg::after {
  content: '';
  position: absolute;
  bottom: -100px; right: -100px;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(58,154,176,.2) 0%, transparent 70%);
}
.hero-layout {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  padding-top: calc(var(--nav-h) + 3rem);
  padding-bottom: 5rem;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 4rem;
  align-items: center;
}
.hero-eyebrow {
  font-size: .62rem;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(255,255,255,.5);
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeUp .8s .2s forwards;
}
.hero-name {
  font-size: clamp(2.8rem, 6vw, 5rem);
  font-weight: 700;
  color: var(--white);
  line-height: 1.0;
  margin-bottom: 1rem;
  letter-spacing: -.01em;
  opacity: 0;
  animation: fadeUp .8s .4s forwards;
}
.hero-tagline {
  font-size: .85rem;
  font-weight: 300;
  color: rgba(255,255,255,.55);
  line-height: 1.9;
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeUp .8s .6s forwards;
}
.hero-actions {
  display: flex;
  gap: .8rem;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp .8s .8s forwards;
}
.hero-photo {
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  animation: fadeUp .9s .5s forwards;
}
.hero-photo-frame {
  position: relative;
  width: 300px;
  height: 380px;
}
.hero-photo-frame::before {
  content: '';
  position: absolute;
  top: -10px; right: -10px;
  width: 100%; height: 100%;
  border: 1px solid rgba(255,255,255,.2);
  z-index: 0;
}
.hero-photo-frame img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  filter: grayscale(10%);
}
.hero-scroll {
  position: absolute;
  bottom: 2.5rem; left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
  z-index: 1;
  opacity: 0;
  animation: fadeIn 1s 1.2s forwards;
}
.hero-scroll span {
  font-size: .6rem;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: rgba(255,255,255,.3);
}
.scroll-line {
  width: 1px; height: 40px;
  background: linear-gradient(to bottom, rgba(255,255,255,.3), transparent);
  animation: scrollPulse 2s infinite;
}

/* ============================================
   SOBRE MÍ
   ============================================ */
.about-simple { max-width: 680px; }
.about-simple p { font-size: .92rem; line-height: 1.85; }
.about-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: 1.5rem;
}
.about-tags span {
  font-size: .6rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  color: var(--accent);
  padding: .25rem .75rem;
}

/* ============================================
   LIBROS
   ============================================ */
.books-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  margin-bottom: 3rem;
}
.book-card {
  background: var(--bg-alt);
  padding: 1.8rem;
  border-bottom: 3px solid transparent;
  transition: border-color .2s;
}
.book-card:hover { border-color: var(--accent); }
.book-year { font-size: .62rem; font-weight: 500; letter-spacing: .1em; color: var(--text-light); margin-bottom: .3rem; }
.book-card h3 { font-size: .92rem; font-weight: 600; color: var(--bg-dark); margin-bottom: .25rem; line-height: 1.35; }
.book-publisher { font-size: .72rem; font-weight: 400; color: var(--accent-light); margin-bottom: .5rem; }
.book-card p { font-size: .82rem; }

/* ============================================
   CAPÍTULOS Y ARTÍCULOS — lista unificada
   ============================================ */
.filter-bar {
  display: flex;
  gap: .3rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.filter-btn {
  font-size: .6rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .35rem .9rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-light);
  cursor: pointer;
  transition: all .2s;
}
.filter-btn:hover, .filter-btn.active {
  background: var(--bg-dark);
  border-color: var(--bg-dark);
  color: var(--white);
}

.items-list { display: flex; flex-direction: column; }
.list-item {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 1.2rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border);
  transition: padding-left .2s;
}
.list-item:first-child { border-top: 1px solid var(--border); }
.list-item:hover { padding-left: .5rem; }
.list-item.hidden { display: none; }

.list-year {
  font-size: .65rem;
  font-weight: 600;
  color: var(--accent-light);
  padding-top: .15rem;
  letter-spacing: .05em;
}
.list-cat {
  font-size: .58rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: .3rem;
}
.list-body p {
  font-size: .85rem;
  font-weight: 400;
  color: var(--text);
  margin: 0;
  line-height: 1.6;
}
.list-body .ref {
  font-size: .78rem;
  font-weight: 300;
  color: var(--text-light);
  margin-top: .25rem;
}

/* Artículos: título separado de referencia */
.list-body h4 {
  font-size: .88rem;
  font-weight: 500;
  color: var(--bg-dark);
  margin-bottom: .2rem;
  line-height: 1.4;
}

/* ============================================
   CONFERENCIAS — TABS
   ============================================ */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}
.tab-btn {
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: .7rem 2rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: var(--text-light);
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.tab-btn.active { color: var(--bg-dark); border-bottom-color: var(--bg-dark); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ============================================
   JURISPRUDENCIA
   ============================================ */
.coming-soon {
  max-width: 520px;
  padding: 2.5rem;
  border: 1px solid var(--border);
}
.coming-soon p { font-size: .88rem; }

/* ============================================
   REVISTA
   ============================================ */
.revista-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}
.revista-cover {
  width: 200px;
  height: 270px;
  background: linear-gradient(135deg, #0d2a33, #1a3d4a);
  border: 1px solid rgba(255,255,255,.15);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 16px 16px 48px rgba(0,0,0,.3);
  transform: rotate(-2deg);
  transition: transform .3s;
}
.revista-cover:hover { transform: rotate(0deg); }
.revista-cover-inner { padding: 1.8rem; text-align: center; }
.revista-cover-title { font-size: .82rem; font-weight: 400; color: rgba(255,255,255,.85); line-height: 1.6; margin-bottom: .9rem; }
.revista-cover-line { width: 32px; height: 1px; background: var(--accent-light); margin: 0 auto .9rem; }
.revista-cover-org { font-size: .6rem; letter-spacing: .18em; color: rgba(255,255,255,.4); text-transform: uppercase; }

/* ============================================
   CONTACTO
   ============================================ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 4rem;
  align-items: start;
}
.contact-items { display: flex; flex-direction: column; gap: 1.3rem; margin-top: 1rem; }
.contact-item { display: flex; gap: .9rem; align-items: flex-start; }
.contact-icon { font-size: 1rem; color: var(--accent-light); line-height: 1.6; flex-shrink: 0; }
.contact-item strong {
  display: block;
  font-size: .6rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: .15rem;
}
.contact-item a, .contact-item span { font-size: .88rem; font-weight: 300; color: var(--text); }
.contact-item a:hover { color: var(--accent); }

.contact-form { display: flex; flex-direction: column; gap: .8rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.contact-form input, .contact-form textarea {
  font-family: var(--fn);
  font-size: .85rem;
  font-weight: 300;
  color: var(--bg-dark);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: .75rem 1rem;
  width: 100%;
  outline: none;
  transition: border-color .2s;
}
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--accent); }
.contact-form textarea { resize: vertical; }

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: #0d2a33;
  padding: 2.5rem 0;
  border-top: 1px solid rgba(255,255,255,.06);
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
}
.footer-name { font-size: .95rem; font-weight: 600; color: var(--white); margin-bottom: .25rem; }
.footer-left p, .footer-right p {
  font-size: .7rem;
  font-weight: 300;
  color: rgba(255,255,255,.35);
  margin: 0;
  line-height: 1.8;
}
.footer-right { max-width: 400px; text-align: right; }

/* ============================================
   ANIMACIONES
   ============================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes scrollPulse {
  0%, 100% { opacity: .3; }
  50%       { opacity: .8; }
}
.fade-in { opacity: 0; transform: translateY(16px); transition: opacity .6s, transform .6s; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ============================================
   SUBSECCIÓN
   ============================================ */
.subsection { margin-top: 3.5rem; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .hero-layout { grid-template-columns: 1fr; text-align: center; gap: 2.5rem; }
  .hero-actions { justify-content: center; }
  .hero-photo { order: -1; }
  .hero-photo-frame { width: 200px; height: 260px; }
  .revista-inner, .contact-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .books-grid { grid-template-columns: 1fr; }
  .footer-right { text-align: left; }
}
@media (max-width: 768px) {
  .section { padding: 3rem 0; }
  .nav-links { display: none; flex-direction: column; position: absolute; top: var(--nav-h); left: 0; right: 0; background: rgba(13,42,51,.98); padding: 2rem; gap: 1.2rem; text-align: center; }
  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; }
  .form-row { grid-template-columns: 1fr; }
}
