:root {
  --bg: #1E1026;
  --panel: #2A1836;
  --text: #F6EEE3;
  --saffron: #F2B531;
  --clay: #E8806A;
  --line: rgba(246, 238, 227, 0.15);
  --radius: 14px;
  --gutter: 16px;
  --font-head: 'Syne', system-ui, sans-serif;
  --font-body: 'Karla', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; margin: 0; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); color-scheme: dark; }
html.locked, html.locked body { overflow: hidden; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
.mono { font-family: var(--font-mono); letter-spacing: 0.02em; }

/* ---------- Masthead ---------- */
.hero {
  position: relative;
  height: 290px;
  overflow: hidden;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top) var(--gutter) 70px;
}
.contours {
  position: absolute;
  left: 0; top: -15%;
  width: 100%; height: 130%;
  will-change: transform;
  pointer-events: none;
}
.contours path {
  fill: none;
  stroke: var(--text);
  stroke-opacity: 0.28;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-dasharray: 0.1 7;
}
.hero-text { position: relative; text-align: center; }
.kicker { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.18em; color: var(--clay); margin-bottom: 10px; }
.title {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(2.7rem, 15vw, 4.6rem);
  line-height: 0.92;
  letter-spacing: -0.02em;
}
.title span { color: var(--saffron); display: block; }

.badge {
  position: relative;
  z-index: 2;
  width: 140px; height: 140px;
  margin: -70px auto 0;
  border-radius: 50%;
  background: #FBFAF3;
  border: 6px solid var(--bg);
  box-shadow: 0 0 0 1px var(--line), 0 10px 30px rgba(0, 0, 0, 0.45);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.badge img { width: 88%; height: auto; }

/* ---------- Feed ---------- */
.feed { padding: 28px var(--gutter) 8px; max-width: 640px; margin: 0 auto; }
.loading { text-align: center; opacity: 0.6; padding: 40px 0; }
.section { margin-bottom: 44px; }
.section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.section-head svg { width: 22px; height: 22px; flex: none; fill: var(--clay); }
.section-head h2 { font-family: var(--font-head); font-weight: 800; font-size: 1.5rem; letter-spacing: -0.01em; }
.section-head .dots { flex: 1; height: 0; border-top: 2px dotted rgba(246, 238, 227, 0.35); margin-top: 4px; }

/* shared card behaviour */
.card { position: relative; cursor: pointer; outline: none; transition: transform 0.2s var(--ease); }
.card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 0 1px var(--saffron), 0 0 26px rgba(242, 181, 49, 0.5);
  opacity: 0; transition: opacity 0.25s var(--ease);
}
.card:active { transform: scale(0.985); }
.card:active::after, .card:focus-visible::after { opacity: 1; }
.headline { font-family: var(--font-head); font-weight: 600; line-height: 1.2; letter-spacing: -0.005em; }
.preview { color: rgba(246, 238, 227, 0.78); font-size: 0.95rem; }
.meta { font-size: 0.72rem; color: rgba(246, 238, 227, 0.6); }
.pill {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--clay); background: rgba(232, 128, 106, 0.12); border: 1px solid rgba(232, 128, 106, 0.45);
}

/* Finanza: stacked wide cards */
.fin-list { display: grid; gap: 18px; }
.fin-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.fin-card .media { aspect-ratio: 21 / 9; background: #150a1b; }
.fin-card img { width: 100%; height: 100%; object-fit: cover; }
.fin-card .body { display: flex; gap: 14px; padding: 16px 16px 16px 0; margin: 4px 0 0; }
.fin-card .bar { width: 3px; flex: none; background: var(--saffron); border-radius: 0 3px 3px 0; margin: 2px 0; }
.fin-card .num { font-family: var(--font-head); font-weight: 800; font-size: 2.6rem; line-height: 0.9; color: var(--saffron); display: block; margin-bottom: 8px; }
.fin-card .headline { font-size: 1.2rem; margin-bottom: 8px; }
.fin-card .preview { margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Economia: zigzag split rows */
.eco-list { display: grid; gap: 22px; }
.eco-row {
  display: grid; grid-template-columns: 0.92fr 1.08fr; gap: 14px; align-items: center;
  padding: 10px; border-radius: var(--radius); border: 1px solid var(--line); background: rgba(42, 24, 54, 0.55);
}
.eco-row:nth-child(even) { grid-template-columns: 1.08fr 0.92fr; }
.eco-row:nth-child(even) .media { order: 2; }
.eco-row .media { aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: #150a1b; }
.eco-row img { width: 100%; height: 100%; object-fit: cover; }
.eco-row .headline { font-size: 1rem; margin: 8px 0 6px; }
.eco-row .preview { font-size: 0.85rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 8px; }

/* Tecnologia: square tiles, last one full width */
.tec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tec-tile { aspect-ratio: 1 / 1; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #150a1b; }
.tec-tile:last-child { grid-column: 1 / -1; }
.tec-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tec-tile .shade {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(18, 8, 24, 0.92) 0%, rgba(18, 8, 24, 0.55) 38%, rgba(18, 8, 24, 0) 70%);
}
.tec-tile .text { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px; }
.tec-tile .headline { font-size: 0.88rem; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 6px; }
.tec-tile:last-child .headline { font-size: 1.15rem; }
.tec-tile .meta { color: var(--saffron); }

/* ---------- Footer ---------- */
.footer { text-align: center; padding: 36px var(--gutter) calc(48px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); margin: 0 var(--gutter); }
.tagline { font-family: var(--font-head); font-weight: 600; font-size: 1.05rem; color: var(--saffron); margin-bottom: 8px; }
.footer a { color: var(--text); opacity: 0.75; font-size: 0.8rem; text-decoration: none; border-bottom: 1px dotted var(--line); }

/* ---------- Reader ---------- */
.reader {
  position: fixed; inset: 0; z-index: 50; background: var(--bg); overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  transform: translateY(100%); visibility: hidden;
  transition: transform 0.4s var(--ease), visibility 0s linear 0.4s;
}
.reader.open { transform: none; visibility: visible; transition-delay: 0s; }
.close {
  position: fixed; top: calc(12px + env(safe-area-inset-top)); right: 12px; z-index: 3;
  width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(30, 16, 38, 0.82); backdrop-filter: blur(6px); cursor: pointer; color: var(--text);
}
.close .ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 2.5; }
.ring-track { stroke: var(--line); }
.ring-bar { stroke: var(--saffron); stroke-linecap: round; stroke-dasharray: 131.95; stroke-dashoffset: 131.95; }
.close .x { position: absolute; inset: 14px; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.close:active { box-shadow: 0 0 20px rgba(242, 181, 49, 0.55); }
.reader-media { max-height: 48vh; overflow: hidden; background: #150a1b; border-bottom: 1px solid var(--line); }
.reader-media img { width: 100%; height: 100%; max-height: 48vh; object-fit: cover; }
.reader-body { max-width: 640px; margin: 0 auto; padding: 22px var(--gutter) calc(64px + env(safe-area-inset-bottom)); }
.reader-body h2 { font-family: var(--font-head); font-weight: 800; font-size: clamp(1.6rem, 7vw, 2.2rem); line-height: 1.1; letter-spacing: -0.015em; margin: 14px 0 10px; }
.reader-body .meta { margin-bottom: 22px; padding-bottom: 18px; border-bottom: 1px dotted rgba(246, 238, 227, 0.3); }
.prose p { font-size: 1.06rem; line-height: 1.72; margin-bottom: 1.15em; color: rgba(246, 238, 227, 0.92); }
.prose p:first-child::first-letter { font-family: var(--font-head); font-weight: 800; color: var(--saffron); }
.reader-end { margin-top: 36px; text-align: center; }

:focus-visible { outline: 2px solid var(--saffron); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  .reader, .card, .card::after { transition: none; }
  .contours { transform: none !important; }
}
