:root {
  --bg: #f7f6f2;
  --paper: #ffffff;
  --text: #141414;
  --muted: #555;
  --line: #dedbd2;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.08);
  --radius: 16px;
  --btn: #141414;
  --btnText: #ffffff;
  --badge: #f0eee7;

  /* Lo setea JS con el alto real del header */
  --header-offset: 220px;
}

* {
  box-sizing: border-box;
}

/* Evitar scroll horizontal */
html,
body {
  width: 100%;
  overflow-x: hidden;
}
@supports (overflow: clip) {
  html,
  body {
    overflow-x: clip;
  }
}

html {
  scroll-behavior: smooth;
  /* offset dinámico (lo setea JS) */
  scroll-padding-top: var(--header-offset);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco,
    Consolas, "Liberation Mono", "Courier New", monospace;
  line-height: 1.7;
}

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 44px 18px calc(64px + var(--header-offset));
}

/* Card */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 100%;
}

/* Header */
.header {
  padding: 22px 22px 18px;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 10px;
  background: var(--paper);
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
}

/* Estado fijo (JS lo aplica) */
.header.is-fixed {
  position: fixed;
  z-index: 999;
  padding-top: calc(22px + env(safe-area-inset-top, 0px));

  /* SUPERIOR RECTA (sin redondeo) */
  border-top-left-radius: 0;
  border-top-right-radius: 0;

  /* si querés conservar redondeo abajo, dejalo en 0 también para que sea barra limpia */
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;

  overflow: hidden;
  border: 1px solid var(--line);

  /* sin halo (porque ya no hace falta) */
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.08);
  border-top: 0;
}

/* El spacer existe solo para mantener el layout cuando header pasa a fixed */
.header-spacer {
  height: 0px;
}

/* Contenido */
.content {
  padding: 18px 22px 22px;
}

/* Footer */
.footer {
  padding: 16px 22px 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-bottom-left-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
}

.topline {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.mark {
  width: 14px;
  height: 14px;
  border: 2px solid var(--text);
  border-radius: 4px;
  transform: rotate(6deg);
  flex: 0 0 auto;
}

.masthead {
  display: grid;
  gap: 8px;
}

/* Desktop: 1 sola línea */
.site-title {
  margin: 0;
  font-size: clamp(22px, 5.2vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.6px;
  font-weight: 600;
  white-space: nowrap;
}

/* Móviles angostos */
@media (max-width: 520px) {
  .site-title {
    white-space: normal;
    overflow-wrap: anywhere;
    letter-spacing: -0.4px;
  }
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  max-width: 78ch;
}

.nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
  margin-top: 6px;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}

.nav a:hover {
  color: var(--text);
  border-bottom-color: var(--text);
}

@media (max-width: 520px) {
  .nav a {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.55);
  }
  .nav a:hover {
    border-bottom-color: var(--line);
    background: rgba(255, 255, 255, 0.8);
  }
}

/* Vertical flow */
.section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);

  /* offset dinámico (lo setea JS) */
  scroll-margin-top: var(--header-offset);
}

.section h3 {
  margin: 0 0 8px;
  font-size: 14px;
  letter-spacing: 0.2px;
  font-weight: 600;
}

.section p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  max-width: 78ch;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  background: var(--badge);
  border: 1px solid var(--line);
  padding: 8px 10px;
  border-radius: 999px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: var(--text);
  opacity: 0.75;
}

.hero-title {
  margin: 14px 0 10px;
  font-size: clamp(22px, 3.6vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.2px;
  font-weight: 600;
}

.lead {
  margin: 0 0 18px;
  color: var(--muted);
  max-width: 70ch;
  font-size: 14px;
}

.cta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
}

.btn.primary {
  background: var(--btn);
  color: var(--btnText);
  border-color: var(--btn);
}

.btn:hover {
  filter: brightness(0.98);
}
.btn:active {
  transform: translateY(1px);
}

@media (max-width: 520px) {
  .wrap {
    padding: 26px 14px calc(44px + var(--header-offset));
  }
  .subtitle {
    font-size: 13px;
  }

  /* ya NO hay scroll-padding-top / scroll-margin-top fijo acá */
  .cta {
    gap: 8px;
  }
  .btn {
    width: 100%;
  }
}

.notice {
  margin-top: 16px;
  padding: 14px 14px;
  border: 1px dashed rgba(20, 20, 20, 0.35);
  border-radius: 14px;
  background: rgba(240, 238, 231, 0.55);
  color: var(--muted);
  font-size: 12.5px;
}

.link-underline {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

@media print {
  body {
    background: #fff;
  }
  .card {
    box-shadow: none;
  }
  .nav,
  .cta {
    display: none;
  }
}

