/* Fuse Studio — landing page local styles
   Extends design-system/colors_and_type.css and design-system/marketing.css */

/* ===========================================================
   Palette tweak: optional ochre-as-primary mode.
   When html[data-accent="ochre"] is set, swap accent tokens.
   =========================================================== */
html[data-accent="ochre"] {
  --accent: var(--ochre);
  --accent-hover: var(--ochre-2);
  --accent-soft: var(--ochre-soft);
}

/* Smooth scrolling for anchor nav */
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--fg); }

/* Section anchor offset for fixed nav */
section[id] { scroll-margin-top: 80px; }

/* ===========================================================
   Reveal — extends marketing.css, adds a few more delay steps
   =========================================================== */
.reveal[data-delay="6"] { transition-delay: 480ms; }
.reveal[data-delay="7"] { transition-delay: 560ms; }
.reveal[data-delay="8"] { transition-delay: 640ms; }

/* Reveal but from the left (text columns) */
.reveal-left {
  opacity: 0; transform: translateX(-24px);
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
}
.reveal-left.in { opacity: 1; transform: translateX(0); }

/* ===========================================================
   Inline mark — wobble underline behind emphasised words.
   Use <span class="mk-emph">word</span>.
   =========================================================== */
.mk-emph {
  position: relative;
  display: inline-block;
  font-style: italic;
  color: var(--accent);
}
.mk-emph::after {
  content: "";
  position: absolute;
  left: -2%; right: -2%;
  bottom: -0.12em;
  height: 0.45em;
  background-image: url("design-system/marks/underline-wobble.svg");
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: 100% 100%;
  filter: invert(13%) sepia(76%) saturate(2400%) hue-rotate(343deg) brightness(85%) contrast(94%);
  opacity: 0.85;
  pointer-events: none;
  z-index: -1;
}
html[data-accent="ochre"] .mk-emph::after {
  filter: invert(53%) sepia(58%) saturate(630%) hue-rotate(347deg) brightness(91%) contrast(90%);
}

/* ===========================================================
   Big editorial headlines — fine-tune per section
   =========================================================== */
.h-display {
  font-family: var(--font-display);
  font-size: var(--text-display-xl);
  line-height: 0.98;
  letter-spacing: -0.025em;
  font-weight: 400;
  text-wrap: balance;
  margin: 0;
}
.h-section {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.4vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 400;
  text-wrap: balance;
  margin: 0;
}

/* ===========================================================
   Cursor — subtle editorial blot that follows the mouse on
   pointer-fine devices. Inverts when hovering linkable items.
   =========================================================== */
@media (pointer: fine) {
  body { cursor: none; }
  a, button, input, textarea, label[for], [role="button"], .cursor-pointer { cursor: none; }
}
#fuse-cursor {
  position: fixed;
  top: 0; left: 0;
  width: 14px; height: 14px;
  border-radius: 999px;
  background: var(--ink);
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 220ms var(--ease-out), height 220ms var(--ease-out),
              background 220ms var(--ease-in-out), opacity 220ms;
  will-change: transform, width, height;
  opacity: 0;
}
#fuse-cursor.ready { opacity: 1; }

/* Hover state — turns into a "theme inverter" lens.  Two SVG color
   matrices (defined in index.html) map the palette one-to-one:
   - On light sections:  bone bg → ink, ink text → ochre orange.
   - On dark sections:   ink bg  → bone, bone text → ochre orange.
   Net effect: a circular window onto the opposite theme, with the
   highlighted text in accent orange.  No blue cyan artefacts. */
#fuse-cursor.hover {
  width: 64px; height: 64px;
  background: transparent;
  mix-blend-mode: normal;
  backdrop-filter: url(#cursor-lens-light);
  -webkit-backdrop-filter: url(#cursor-lens-light);
}
#fuse-cursor.on-dark.hover {
  width: 64px; height: 64px;
  background: transparent;
  mix-blend-mode: normal;
  backdrop-filter: url(#cursor-lens-dark);
  -webkit-backdrop-filter: url(#cursor-lens-dark);
}
#fuse-cursor.text {
  width: 2px; height: 22px; border-radius: 0;
  background: var(--ink);
  mix-blend-mode: normal;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
/* On dark sections the resting dot would vanish — swap to ochre. */
#fuse-cursor.on-dark { background: var(--ochre); mix-blend-mode: normal; }
#fuse-cursor.on-dark.text { background: var(--ochre); }
@media (pointer: coarse), (hover: none) {
  #fuse-cursor { display: none; }
}

/* ===========================================================
   Marginalia — hand-drawn marks placed at intentional offsets
   =========================================================== */
.marginalia {
  position: absolute;
  pointer-events: none;
  opacity: 0;
  transition: opacity 800ms var(--ease-out), transform 800ms var(--ease-out);
}
.marginalia.in { opacity: 0.85; transform: translate(0,0) rotate(var(--rot, 0deg)); }

/* ===========================================================
   Pill toggle (used for ES/EN + Latam/US)
   =========================================================== */
.pill-toggle {
  display: inline-flex;
  align-items: center;
  background: rgb(20 17 14 / 0.06);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.pill-toggle button {
  background: transparent;
  border: none;
  padding: 7px 14px;
  border-radius: 999px;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: var(--fg-mute);
  transition: background 220ms var(--ease-in-out), color 220ms;
}
.pill-toggle button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--bone);
}
.pill-toggle.on-dark {
  background: rgb(244 239 229 / 0.06);
  border-color: var(--border-on-dark);
}
.pill-toggle.on-dark button { color: rgba(244,239,229,0.55); }
.pill-toggle.on-dark button[aria-pressed="true"] {
  background: var(--bone);
  color: var(--ink);
}

/* ===========================================================
   Leak grid (in Propuesta) — index-card feel, slight rotations
   =========================================================== */
.leak-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 56px;
}
@media (max-width: 900px) {
  .leak-grid { grid-template-columns: repeat(2, 1fr); }
}
.leak-card {
  position: relative;
  background: var(--bone);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 22px 22px 24px;
  transition: border-color 220ms var(--ease-in-out), transform 320ms var(--ease-out), box-shadow 320ms;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
}
.leak-card:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px -16px rgb(20 17 14 / 0.18);
  z-index: 2;
}
.leak-card .leak-num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.leak-card .leak-title {
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.leak-card .leak-body {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-2);
  margin: 0;
}

/* ===========================================================
   Para Quién — definition list
   =========================================================== */
.dl-spec {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px 56px;
  border-top: 1px solid var(--ink);
  padding-top: 28px;
}
.dl-spec > dt {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-mute);
  padding-top: 6px;
}
.dl-spec > dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--ink);
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.dl-spec > dt:not(:first-of-type) { border-top: 1px solid var(--border); padding-top: 30px; }
.dl-spec > dd:last-of-type { border-bottom: none; }
@media (max-width: 720px) {
  .dl-spec { grid-template-columns: 1fr; gap: 8px 0; }
  .dl-spec > dd { padding-bottom: 18px; }
  .dl-spec > dt:not(:first-of-type) { padding-top: 18px; }
}

/* ===========================================================
   Ofertas — three layout variants
   =========================================================== */
.offers-list { display: flex; flex-direction: column; }
.offer-row {
  display: grid;
  grid-template-columns: 64px 1.2fr 1fr auto 32px;
  gap: 28px;
  align-items: flex-start;
  padding: 28px 24px;
  border-bottom: 1px solid var(--border);
  position: relative;
  cursor: pointer;
  transition: background 220ms var(--ease-in-out);
}
.offer-row[data-open="true"] { background: var(--bone-2); }
.offer-row:hover { background: var(--bone-2); }
.offer-row .o-num {
  font-family: var(--font-display);
  font-size: 44px;
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.02em;
  padding-top: 4px;
}
.offer-row .o-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--ink);
}
.offer-row .o-type {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-mute);
  margin-top: 6px;
}
.offer-row .o-summary {
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 48ch;
  margin: 0;
}
.offer-row .o-price {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink);
  line-height: 1.5;
  white-space: nowrap;
}
.offer-row .o-price b {
  display: block;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.01em;
  color: var(--accent);
  margin-bottom: 4px;
}
.offer-row .o-toggle {
  font-family: var(--font-display);
  font-size: 32px;
  color: var(--ink);
  padding-top: 2px;
  line-height: 0.8;
  transition: transform 240ms var(--ease-in-out);
}
.offer-row[data-open="true"] .o-toggle { transform: rotate(45deg); }

.offer-expanded {
  grid-column: 2 / -1;
  padding: 8px 0 16px;
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 56px;
  animation: fadeUp 360ms var(--ease-out);
}
.offer-expanded h5 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-mute);
  margin: 0 0 16px;
  font-weight: 500;
}
.offer-expanded .o-duration {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 20px;
  color: var(--ink);
  margin-bottom: 24px;
}
.offer-expanded ul {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; flex-direction: column;
  gap: 10px;
}
.offer-expanded li {
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  padding-left: 24px;
  position: relative;
}
.offer-expanded li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--font-display);
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .offer-row { grid-template-columns: 48px 1fr auto 24px; gap: 16px; padding: 24px 16px; }
  .offer-row .o-summary { display: none; }
  .offer-expanded { grid-template-columns: 1fr; gap: 16px; grid-column: 2 / -1; }
  .offer-row .o-num { font-size: 32px; }
}

/* --- Grid variant --- */
.offers-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (max-width: 800px) { .offers-grid { grid-template-columns: 1fr; } }
.offer-card {
  background: var(--bone);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: border-color 220ms;
  min-height: 380px;
}
.offer-card:hover { border-color: var(--border-strong); }
.offer-card .oc-head {
  display: flex; justify-content: space-between; align-items: baseline;
}
.offer-card .oc-num {
  font-family: var(--font-display);
  font-size: 44px;
  color: var(--accent);
  letter-spacing: -0.02em;
  line-height: 1;
}
.offer-card .oc-type {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-mute);
}
.offer-card h3 {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0;
}
.offer-card .oc-dur {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
}
.offer-card .oc-summary {
  font-size: 15px; line-height: 1.55;
  color: var(--ink-2);
  margin: 0;
  flex: 1;
}
.offer-card .oc-price {
  font-family: var(--font-display);
  font-size: 22px;
  font-style: italic;
  color: var(--accent);
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
.offer-card .oc-price small {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-style: normal;
  color: var(--fg-mute);
  display: block;
  margin-bottom: 4px;
}

/* --- Table variant --- */
.offers-table {
  width: 100%;
  border-collapse: collapse;
  border-top: 1px solid var(--ink);
}
.offers-table th, .offers-table td {
  text-align: left;
  padding: 22px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.offers-table th {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-mute);
  font-weight: 500;
}
.offers-table td.t-num {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--accent);
  width: 60px;
  letter-spacing: -0.02em;
}
.offers-table td.t-title {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: -0.02em;
  line-height: 1.15;
  min-width: 220px;
}
.offers-table td.t-price {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink);
  white-space: nowrap;
  text-align: right;
}

/* ===========================================================
   Diagnóstico interactivo
   =========================================================== */
.diag-wrap {
  background: var(--bone-2);
  border-radius: 12px;
  padding: clamp(32px, 5vw, 64px);
  border: 1px solid var(--border);
  position: relative;
}
.diag-progress {
  display: flex; gap: 6px; margin-bottom: 36px;
}
.diag-progress span {
  flex: 1;
  height: 2px;
  background: var(--border);
  transition: background 320ms var(--ease-in-out);
}
.diag-progress span.done { background: var(--accent); }
.diag-progress span.now { background: var(--ink); }

.diag-q {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 28px;
  text-wrap: balance;
  color: var(--ink);
}
.diag-counter {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-mute);
  margin-bottom: 8px;
}

.diag-options {
  display: flex; flex-direction: column; gap: 10px;
  list-style: none; padding: 0; margin: 0;
}
.diag-option {
  text-align: left;
  background: var(--bone);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 22px;
  font: inherit;
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  cursor: pointer;
  transition: all 180ms var(--ease-in-out);
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px;
}
.diag-option:hover {
  border-color: var(--ink);
  background: #fff;
}
.diag-option .arrow {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--accent);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 220ms, transform 220ms var(--ease-out);
}
.diag-option:hover .arrow { opacity: 1; transform: translateX(0); }

.diag-result {
  animation: fadeUp 480ms var(--ease-out);
}
.diag-result-card {
  background: var(--ink);
  color: var(--bone);
  border-radius: 12px;
  padding: clamp(28px, 4vw, 48px);
  margin-top: 24px;
}
.diag-result-card .dr-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ochre);
  margin-bottom: 18px;
}
.diag-result-card h3 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.6vw, 2.8rem);
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  color: var(--bone);
}
.diag-result-card h3 em { color: var(--ochre); }
.diag-result-card p {
  color: var(--bone);
  opacity: 0.78;
  max-width: 56ch;
  margin: 0 0 24px;
}
.diag-result-card .dr-actions {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  margin-top: 24px;
}
.diag-result-card .dr-actions a.btn-on-dark { padding: 14px 22px; }
.diag-result-card .dr-actions button {
  background: transparent;
  border: none;
  color: var(--bone);
  opacity: 0.6;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.diag-result-card .dr-actions button:hover { opacity: 1; }

/* ===========================================================
   Por qué Fuse — numbered editorial list
   =========================================================== */
.reasons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border-top: 1px solid var(--border-on-dark);
}
@media (max-width: 800px) { .reasons { grid-template-columns: 1fr; } }
.reason {
  padding: 36px 32px 40px 0;
  border-bottom: 1px solid var(--border-on-dark);
  display: flex; flex-direction: column; gap: 14px;
}
.reason:nth-child(even) { padding-left: 32px; border-left: 1px solid var(--border-on-dark); }
@media (max-width: 800px) {
  .reason:nth-child(even) { padding-left: 0; border-left: none; }
}
.reason .r-num {
  font-family: var(--font-display);
  font-size: 32px;
  color: var(--ochre);
  letter-spacing: -0.02em;
}
.reason h4 {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0;
  color: var(--bone);
}
.reason p {
  color: var(--bone);
  opacity: 0.72;
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
}

/* ===========================================================
   Sticky right-column section progress
   =========================================================== */
.side-progress {
  position: fixed;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 30;
  pointer-events: auto;
}
.side-progress a {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.4;
  transition: opacity 220ms;
}
.side-progress a .dot {
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--ink);
  transition: width 220ms var(--ease-out), background 220ms;
}
.side-progress a .lbl {
  opacity: 0;
  transform: translateX(6px);
  transition: opacity 220ms, transform 220ms var(--ease-out);
}
.side-progress a:hover { opacity: 1; }
.side-progress a:hover .lbl { opacity: 1; transform: translateX(0); }
.side-progress a.active { opacity: 1; }
.side-progress a.active .dot { width: 22px; border-radius: 999px; background: var(--accent); }
.side-progress.on-dark a { color: var(--bone); }
.side-progress.on-dark a .dot { background: var(--bone); }
.side-progress.on-dark a.active .dot { background: var(--ochre); }
@media (max-width: 1100px) { .side-progress { display: none; } }

/* ===========================================================
   CTA form input on-dark
   =========================================================== */
.fuse-input {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 16px;
  padding: 14px 16px;
  background: transparent;
  color: var(--bone);
  border: 1px solid var(--border-on-dark);
  border-radius: 4px;
  outline: none;
  transition: border-color 180ms;
}
.fuse-input:focus { border-color: var(--ochre); }
.fuse-input::placeholder { color: rgba(244, 239, 229, 0.45); }

/* ===========================================================
   Subtle paper noise overlay
   =========================================================== */
.paper-grain::before {
  content: "";
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='4'/><feColorMatrix values='0 0 0 0 0.08 0 0 0 0 0.07 0 0 0 0 0.06 0 0 0 0.45 0'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.5'/></svg>");
  mix-blend-mode: multiply;
  opacity: 0.05;
  pointer-events: none;
  z-index: 1;
}

/* ===========================================================
   Body scroll-progress bar at top
   =========================================================== */
.scroll-progress {
  position: fixed; top: 0; left: 0;
  height: 2px;
  background: var(--accent);
  width: 0;
  z-index: 60;
  transition: width 80ms linear;
}
