/* =========================================================
   Mario Vega — Ensayos
   Style: Stripe-like (premium, modern, dynamic, clean)
   ========================================================= */

:root{
  /* Base */
  --bg: #f6f9fc;
  --paper: rgba(255,255,255,.86);
  --paper2: rgba(255,255,255,.72);
  --text: #0a2540;
  --muted: rgba(10, 37, 64, .70);
  --border: rgba(10, 37, 64, .10);

  /* Accents (Stripe-ish) */
  --a1: #635bff;   /* Stripe purple/indigo vibe */
  --a2: #00d4ff;   /* cyan */
  --a3: #ff4d8d;   /* pink */
  --a4: #00c48c;   /* green */

  /* Layout */
  --max: 1040px;
  --radius: 18px;
  --radius-sm: 14px;

  /* Type */
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;

  /* Shadow */
  --shadow: 0 24px 60px rgba(10,37,64,.12);
  --shadow2: 0 12px 30px rgba(10,37,64,.10);
  --shadowHover: 0 28px 70px rgba(10,37,64,.16);

  /* Focus */
  --focus: rgba(99, 91, 255, .30);

  /* Elegant red palette */
    --red-1: #8b1e1e;   /* vino profundo */
    --red-2: #c03636;   /* carmín sobrio */
    --red-soft: rgba(139,30,30,.12);
    --red-line: linear-gradient(180deg, #8b1e1e, #c03636);

}

*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(900px 520px at 10% -10%, rgba(99,91,255,.25), transparent 55%),
    radial-gradient(900px 520px at 90% 0%, rgba(0,212,255,.22), transparent 55%),
    radial-gradient(900px 520px at 60% 120%, rgba(255,77,141,.16), transparent 60%),
    var(--bg);
  line-height: 1.75;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Grain for premium feel */
body::before{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)' opacity='.10'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
  opacity: .08;
}

.container{
  max-width: var(--max);
  margin: 0 auto;
  padding: 48px 18px;
}

/* =========================
   Header (Stripe-ish)
   ========================= */
.site-header{
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(246,249,252,.78);
  backdrop-filter: saturate(170%) blur(14px);
  -webkit-backdrop-filter: saturate(170%) blur(14px);
  border-bottom: 1px solid rgba(10,37,64,.08);
}

.site-header .container{
  padding: 14px 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 14px;
}

.brand{
  text-decoration:none;
  color: var(--text);
  font-weight: 820;
  letter-spacing: -0.02em;
  display:inline-flex;
  align-items:center;
  gap: 10px;
  font-size: 0.98rem;
}

.brand::before{
  content:"";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--a1), var(--a2));
  box-shadow: 0 12px 28px rgba(99,91,255,.25);
}

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

.nav a{
  position: relative;
  text-decoration:none;
  color: var(--muted);
  font-size: .94rem;
  padding: 10px 12px;
  border-radius: 12px;
  transition: transform .18s ease, background .18s ease, color .18s ease;
}

.nav a:hover{
  color: var(--text);
  background: rgba(10,37,64,.05);
  transform: translateY(-1px);
}

.nav a.active{
  color: var(--text);
  background: rgba(99,91,255,.10);
}

.nav a::after{
  content:"";
  position:absolute;
  left: 12px;
  right: 12px;
  bottom: 7px;
  height: 2px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--a1), var(--a2), var(--a3));
  opacity: 0;
  transform: scaleX(.25);
  transform-origin: left;
  transition: opacity .18s ease, transform .18s ease;
}

.nav a.active::after{
  opacity: 1;
  transform: scaleX(1);
}

/* =========================
   Hero
   ========================= */
.hero{
  margin-top: 26px;
  padding: 40px 0 24px;
  background: none;
  border: none;
  box-shadow: none;
  position: relative;
}

.hero::before,
.hero::after{
  content: none;
}

.hero > *{
  position: relative;
  z-index: 1;
}

.hero h1{
  margin: 0 0 12px;
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(2.8rem, 5vw, 4.2rem);
  letter-spacing: -0.045em;
  line-height: 1.02;
}


.quote{
  margin: 0 0 22px;
  color: rgba(10,37,64,.72);
  font-family: var(--sans);
  font-size: 1.15rem;
  max-width: 62ch;
}


.hero p{
  margin: 0;
  color: var(--muted);
  max-width: 76ch;
  font-size: 1.03rem;
}

/* Optional: small pill row (if you add it) */
.pills{
  display:flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.pill{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(10,37,64,.10);
  background: rgba(255,255,255,.65);
  color: rgba(10,37,64,.78);
  font-size: .90rem;
}

/* =========================
   Posts grid (Stripe-ish cards)
   ========================= */
.posts{
  margin-top: 26px;
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* card */
.post-card{
  position: relative;
  padding: 18px 18px 16px;
  border-radius: var(--radius-sm);
  background: var(--paper2);
  border: 1px solid rgba(10,37,64,.10);
  box-shadow: var(--shadow2);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  overflow: hidden;
}

/* subtle top glow */
.post-card::before{
  content:"";
  position:absolute;
  inset: 0;
background: radial-gradient(
  380px 220px at 20% 0%,
  rgba(139,30,30,.14),
  transparent 55%
);
  opacity: .9;
  pointer-events: none;
}

/* gradient edge line */
.post-card::after{
  content:"";
  position:absolute;
  left: 14px;
  right: 14px;
  top: 0;
  height: 2px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--red-1), var(--red-2));
  opacity: .55;
}

.post-card > *{ position: relative; z-index: 1; }

.post-card:hover{
  transform: translateY(-4px);
  box-shadow: var(--shadowHover);
  border-color: rgba(10,37,64,.14);
}

.post-card h2{
  margin: 0 0 8px;
  font-size: 1.16rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.post-card a{
  color: var(--text);
  text-decoration: none;
}

.post-card a:hover{
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--red-2);
}

.post-card time{
  display:inline-flex;
  align-items:center;
  gap: 10px;
  color: var(--muted);
  font-size: .92rem;
  margin-bottom: 10px;
}

.post-card time::before{
  content:"";
  width: 9px;
  height: 9px;
  border-radius: 999px;
background: linear-gradient(135deg, var(--red-1), var(--red-2));
  box-shadow: 0 12px 24px rgba(99,91,255,.18);
  opacity: .85;
}

.post-card p{
  margin: 0;
  color: var(--muted);
  max-width: 74ch;
}

/* =========================
   Post page (reading)
   ========================= */
.post{
  margin-top: 26px;
  padding: 28px 24px;
  border-radius: var(--radius);
  background: var(--paper);
  border: 1px solid rgba(10,37,64,.10);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.post::before{
  content:"";
  position:absolute;
  inset: -2px;
  background:
    radial-gradient(560px 320px at 15% 0%, rgba(99,91,255,.16), transparent 58%),
    radial-gradient(560px 340px at 90% 20%, rgba(0,212,255,.12), transparent 62%);
  opacity: .9;
}

.post > *{ position: relative; z-index: 1; }

.post h1{
  margin: 0 0 10px;
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(2.2rem, 3.8vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.post time{
  display:inline-flex;
  align-items:center;
  gap: 10px;
  color: var(--muted);
  font-size: .95rem;
  margin-bottom: 18px;
}

.post time::before{
  content:"";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--a1), var(--a3));
  opacity: .8;
}

.post p{
  margin: 0 0 16px;
  font-size: 1.06rem;
  color: rgba(10,37,64,.96);
}

.post h2{
  margin: 30px 0 10px;
  font-size: 1.24rem;
  letter-spacing: -0.01em;
}

.post h3{
  margin: 22px 0 10px;
  font-size: 1.10rem;
}

/* Links */
.post a{
  color: rgba(10,37,64,.98);
  text-decoration: underline;
  text-decoration-color: rgba(99,91,255,.25);
  text-underline-offset: 4px;
}

.post a:hover{
  text-decoration-color: rgba(0,212,255,.35);
}

/* Quote */
blockquote{
  margin: 22px 0;
  padding: 14px 16px;
  border-left: 3px solid var(--red-2);
  background: var(--red-soft);
  border-radius: 14px;
  color: rgba(10,37,64,.88);
  font-family: var(--serif);
}


/* HR */
hr{
  border: 0;
  height: 1px;
  background: rgba(10,37,64,.12);
  margin: 28px 0;
}

/* Footer */
.site-footer{
  margin-top: 46px;
  border-top: 1px solid rgba(10,37,64,.08);
  background: rgba(255,255,255,.45);
}

.site-footer p{
  margin: 0;
  text-align:center;
  color: var(--muted);
  font-size: .92rem;
  padding: 26px 12px;
}

/* Reading progress bar (optional) */
.progress{
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  z-index: 999;
  background: linear-gradient(90deg, var(--a1), var(--a2), var(--a3));
  box-shadow: 0 10px 20px rgba(99,91,255,.18);
}

/* Focus */
a:focus-visible{
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 10px;
}

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

@media (max-width: 640px){
  .container{ padding: 36px 16px; }

  .site-header .container{
    padding: 12px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .nav{ gap: 12px; }
  .hero{ padding: 24px 18px; }
  .post{ padding: 24px 18px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  *{ transition: none !important; }
  body::before{ display:none; }
}

.hero-separator{
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(10,37,64,.18),
    transparent
  );
  margin: 36px 0 8px;
}

/* =========================
   Essay highlight (final statement)
   ========================= */
.essay-highlight{
  margin-top: 36px;
  padding: 22px 24px;
  border-left: 4px solid var(--red-2);
  background: rgba(139,30,30,.06);
  border-radius: 16px;
}

.essay-highlight p{
  margin: 0 0 14px;
  font-size: 1.08rem;
  color: rgba(10,37,64,.95);
}

.essay-highlight p:last-child{
  margin-bottom: 0;
  font-weight: 600;
}
