:root {
  --bg: #12161c;
  --bg-2: #1a212b;
  --panel: rgba(28, 35, 46, 0.92);
  --line: rgba(232, 168, 74, 0.18);
  --text: #e8eef5;
  --muted: #93a0b0;
  --copper: #e8a84a;
  --copper-deep: #c47a22;
  --mint: #6fbfa3;
  --danger: #ef7a6a;
  --radius: 14px;
  --font: "Outfit", sans-serif;
  --mono: "IBM Plex Mono", monospace;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  --page-pad: clamp(0.85rem, 2.5vw, 1.5rem);
  --content-max: 100%;
  --content-width: 100%;
  --touch: 44px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html, body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--copper);
  color: #1a1208;
  font-weight: 700;
  text-decoration: none;
  border-radius: 0 0 8px 0;
}

.skip-link:focus {
  left: 0;
}

.breadcrumbs {
  margin: 0 0 1rem;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 0.35rem;
  color: rgba(147, 160, 176, 0.45);
}

.breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--copper);
}

.breadcrumbs [aria-current="page"] {
  color: var(--text);
}

body {
  position: relative;
  overflow-x: hidden;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(232, 168, 74, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 168, 74, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 30% 0%, black 20%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.bg-glow {
  position: fixed;
  width: 55vw;
  height: 55vw;
  top: -20vw;
  right: -15vw;
  background: radial-gradient(circle, rgba(232, 168, 74, 0.16), transparent 65%);
  pointer-events: none;
  z-index: 0;
  animation: drift 12s ease-in-out infinite alternate;
}

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-4%, 6%) scale(1.08); }
}

.topbar, main, .footer {
  position: relative;
  z-index: 1;
}

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem 1.25rem;
  padding:
    calc(0.9rem + var(--safe-top))
    calc(var(--page-pad) + var(--safe-right))
    0.9rem
    calc(var(--page-pad) + var(--safe-left));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.92rem;
}

.topbar-nav a {
  color: var(--muted);
  text-decoration: none;
}

.topbar-nav a:hover,
.topbar-nav a.is-active {
  color: var(--copper);
}

.nav-sep { color: rgba(147, 160, 176, 0.45); }
.nav-current { color: var(--text); font-weight: 500; }

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 8px;
  background:
    linear-gradient(135deg, var(--copper), var(--copper-deep));
  box-shadow: 0 0 0 3px rgba(232, 168, 74, 0.15);
  position: relative;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 30% 18%;
  border-top: 2px solid rgba(18, 22, 28, 0.7);
  border-bottom: 2px solid rgba(18, 22, 28, 0.7);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-text strong {
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.brand-text small,
.topbar-note,
.footer {
  color: var(--muted);
  font-size: 0.85rem;
}

.topbar-note {
  margin: 0;
  text-align: right;
  justify-self: end;
}

main {
  width: var(--content-width);
  max-width: var(--content-max);
  margin: 0 auto;
  padding:
    1.5rem
    calc(var(--page-pad) + var(--safe-right))
    3rem
    calc(var(--page-pad) + var(--safe-left));
}

.hero {
  margin-bottom: 1.5rem;
  animation: rise 0.7s ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.eyebrow {
  margin: 0 0 0.4rem;
  color: var(--copper);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  font-weight: 600;
}

.hero h1 {
  margin: 0;
  max-width: 18ch;
  font-size: clamp(2.4rem, 6vw, 4rem);
  letter-spacing: -0.04em;
  line-height: 0.95;
}

.lead {
  max-width: 40rem;
  margin: 0.8rem 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.5;
}

.hero-home { margin-bottom: 1.75rem; }

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
  animation: rise 0.8s ease 0.1s both;
}

.tool-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 12.5rem;
  padding: 1.2rem 1.25rem 1.3rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, border-color 0.2s ease;
}

a.tool-card-ready:hover {
  transform: translateY(-3px);
  border-color: rgba(232, 168, 74, 0.45);
}

.tool-card-soon {
  opacity: 0.72;
}

.tool-card-top {
  display: flex;
  justify-content: flex-start;
}

.tool-badge {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
}

.tool-badge.ready {
  color: #10241c;
  background: var(--mint);
}

.tool-badge.soon {
  color: var(--muted);
  background: rgba(147, 160, 176, 0.15);
  border: 1px solid rgba(147, 160, 176, 0.25);
}

.tool-card h2 {
  margin: 0.2rem 0 0;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.tool-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
  flex: 1;
}

.tool-cta {
  margin-top: 0.4rem;
  color: var(--copper);
  font-weight: 600;
  font-size: 0.9rem;
}

.tool-cta.muted {
  color: var(--muted);
  font-weight: 500;
}

.workspace {
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: 1.25rem;
  align-items: start;
  animation: rise 0.8s ease 0.1s both;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.35rem 1.5rem;
}

.panel-head h2 {
  margin: 0;
  font-size: 1.2rem;
}

.panel-head p {
  margin: 0.25rem 0 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

fieldset {
  border: 1px solid rgba(147, 160, 176, 0.18);
  border-radius: 12px;
  margin: 0 0 1rem;
  padding: 0.9rem 1rem 1rem;
}

legend {
  padding: 0 0.4rem;
  color: var(--copper);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

input, select, button {
  font: inherit;
}

input, select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-height: var(--touch);
  background: #10151c;
  color: var(--text);
  border: 1px solid rgba(147, 160, 176, 0.25);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

select {
  padding-right: 2.4rem;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 1.15rem) 50%,
    calc(100% - 0.75rem) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

input:focus, select:focus {
  border-color: var(--copper);
  box-shadow: 0 0 0 3px rgba(232, 168, 74, 0.15);
}

.grid-2, .grid-3 {
  display: grid;
  gap: 0.75rem;
}

.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.hint {
  margin: -0.35rem 0 0.85rem;
  color: var(--mint);
  font-size: 0.82rem;
  min-height: 1.2em;
}

.buried-only { display: none; }
.show-buried .buried-only { display: flex; }
.show-buried .grid-2.buried-only { display: grid; }

.actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-primary, .btn-ghost {
  border-radius: 999px;
  min-height: var(--touch);
  padding: 0.8rem 1.3rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s, border-color 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--copper), var(--copper-deep));
  color: #1a1208;
  font-weight: 700;
}

.btn-primary:hover { transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: rgba(147, 160, 176, 0.3);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--copper);
}

.result-panel {
  position: sticky;
  top: 1rem;
  min-height: 28rem;
}

.result-empty {
  display: grid;
  place-items: center;
  gap: 1rem;
  min-height: 18rem;
  text-align: center;
  color: var(--muted);
}

.result-wire {
  width: 120px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--copper), transparent);
  background-size: 200% 100%;
  animation: pulse-wire 2.2s linear infinite;
}

@keyframes pulse-wire {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

.hidden { display: none !important; }

.result-hero {
  text-align: center;
  padding: 1.2rem 0.5rem 1.4rem;
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 0%, rgba(232, 168, 74, 0.18), transparent 60%),
    #141a22;
  border: 1px solid var(--line);
  margin-bottom: 1rem;
  animation: pop 0.45s ease both;
}

@keyframes pop {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: none; }
}

.result-label {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.result-value {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 0.3rem;
  font-family: var(--mono);
  font-weight: 600;
  color: var(--copper);
  font-size: clamp(2.8rem, 8vw, 3.6rem);
  line-height: 1;
}

.result-value small {
  font-size: 1rem;
  color: var(--muted);
}

.result-cable {
  margin: 0.55rem 0 0;
  color: var(--text);
  font-weight: 500;
}

.result-metrics {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.result-metrics li {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem 1rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: rgba(16, 21, 28, 0.7);
  border: 1px solid rgba(147, 160, 176, 0.12);
}

.result-metrics span {
  color: var(--muted);
  font-size: 0.88rem;
  flex: 0 1 auto;
}

.result-metrics strong {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.92rem;
  text-align: right;
  overflow-wrap: anywhere;
  max-width: 65%;
}

.result-breakdown h3 {
  margin: 0.4rem 0 0.55rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mint);
}

.result-breakdown dl {
  margin: 0 0 1rem;
  display: grid;
  gap: 0.4rem;
}

.result-breakdown dl > div,
#r-factors > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem 1rem;
  font-size: 0.9rem;
  border-bottom: 1px dashed rgba(147, 160, 176, 0.18);
  padding-bottom: 0.3rem;
}

.result-breakdown dt { color: var(--muted); }
.result-breakdown dd {
  margin: 0;
  font-family: var(--mono);
  text-align: right;
  overflow-wrap: anywhere;
}

.result-error {
  margin: 0.75rem 0 0;
  padding: 0.75rem;
  border-radius: 10px;
  background: rgba(239, 122, 106, 0.12);
  border: 1px solid rgba(239, 122, 106, 0.35);
  color: #ffc4bb;
  font-size: 0.9rem;
  line-height: 1.45;
}

.result-warnings {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: rgba(232, 168, 74, 0.1);
  border: 1px solid rgba(232, 168, 74, 0.35);
  color: #f0d2a0;
  font-size: 0.86rem;
  line-height: 1.4;
}

.result-warnings li + li {
  margin-top: 0.35rem;
}

.disclaimer-banner {
  margin: 0 0 1.25rem;
  padding: 0.85rem 1.1rem;
  border-radius: 12px;
  border: 1px solid rgba(232, 168, 74, 0.35);
  background: rgba(232, 168, 74, 0.08);
  animation: rise 0.75s ease 0.05s both;
}

.disclaimer-banner p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.disclaimer-banner strong {
  color: var(--copper);
  font-weight: 600;
}

.footer {
  width: var(--content-width);
  max-width: var(--content-max);
  margin: 0 auto;
  padding:
    0.5rem
    calc(var(--page-pad) + var(--safe-right))
    calc(2rem + var(--safe-bottom))
    calc(var(--page-pad) + var(--safe-left));
}

.disclaimer {
  padding: 1.15rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid rgba(147, 160, 176, 0.22);
  background: rgba(28, 35, 46, 0.75);
}

.disclaimer h2 {
  margin: 0 0 0.65rem;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--copper);
}

.disclaimer p {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.disclaimer p:last-child {
  margin-bottom: 0;
}

.disclaimer strong {
  color: var(--text);
  font-weight: 600;
}

.disclaimer-hub {
  border-color: rgba(147, 160, 176, 0.18);
}

.section-head {
  margin: 0 0 1rem;
}

.section-head h2 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.25rem, 3vw, 1.6rem);
  letter-spacing: -0.02em;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  max-width: 40rem;
}

.tools-section {
  margin-bottom: 1.75rem;
}

.seo-home-copy {
  margin-bottom: 1.25rem;
}

.seo-home-copy h2 {
  margin: 0 0 0.6rem;
  font-size: 1.25rem;
}

.seo-home-copy p {
  margin: 0 0 0.75rem;
  color: var(--muted);
  line-height: 1.55;
}

.seo-home-copy a {
  color: var(--copper);
}

.seo-article {
  margin: 2rem 0 1.5rem;
  display: grid;
  gap: 1.25rem;
}

.seo-block {
  padding: 1.2rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid rgba(147, 160, 176, 0.18);
  background: rgba(28, 35, 46, 0.55);
}

.seo-block h2 {
  margin: 0 0 0.65rem;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.seo-block p,
.seo-block li {
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.95rem;
}

.seo-block p { margin: 0 0 0.7rem; }
.seo-block p:last-child { margin-bottom: 0; }

.seo-steps {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.45rem;
}

.faq-list {
  display: grid;
  gap: 0.55rem;
}

.faq-item {
  border: 1px solid rgba(147, 160, 176, 0.18);
  border-radius: 10px;
  padding: 0.55rem 0.8rem;
  background: rgba(16, 21, 28, 0.55);
}

.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  list-style: none;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::before {
  content: "+";
  display: inline-block;
  width: 1.1rem;
  color: var(--copper);
  font-weight: 700;
}

.faq-item[open] summary::before { content: "–"; }

.faq-item p {
  margin: 0.55rem 0 0.15rem;
}

.related-tools ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.related-tools a {
  color: var(--copper);
}

.pcp-cta {
  margin: 1.25rem 0 0;
  padding: 1.15rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid rgba(232, 168, 74, 0.22);
  background: linear-gradient(135deg, rgba(232, 168, 74, 0.08), rgba(28, 35, 46, 0.7));
}

.pcp-cta h2 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--copper);
}

.pcp-cta p {
  margin: 0 0 0.55rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.pcp-cta a {
  color: var(--copper);
  font-weight: 600;
}

.pcp-cta-link { margin-bottom: 0 !important; }

.hero-home h1 {
  max-width: 22ch;
  font-size: clamp(1.85rem, 5.5vw, 3.2rem);
  line-height: 1.08;
}

@media (min-width: 901px) {
  :root {
    --content-width: 85%;
  }

  main,
  .footer {
    padding-left: 0;
    padding-right: 0;
  }
}

@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .result-panel {
    position: static;
    min-height: 0;
  }
}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .topbar-note {
    text-align: left;
    justify-self: start;
    max-width: 100%;
  }

  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero h1 {
    font-size: clamp(2rem, 9vw, 3.2rem);
  }

  .lead {
    font-size: 1rem;
  }

  .panel {
    padding: 1.1rem 1rem 1.25rem;
  }

  .tool-card {
    min-height: 0;
  }
}

@media (max-width: 640px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .show-buried .grid-2.buried-only {
    grid-template-columns: 1fr;
  }

  main {
    padding-top: 1.1rem;
    padding-bottom: 2rem;
  }

  .hero {
    margin-bottom: 1.1rem;
  }

  .eyebrow {
    letter-spacing: 0.08em;
    font-size: 0.7rem;
  }

  .disclaimer-banner {
    padding: 0.75rem 0.9rem;
  }

  .disclaimer {
    padding: 1rem;
  }

  .disclaimer p,
  .disclaimer-banner p {
    font-size: 0.86rem;
  }

  .actions {
    flex-direction: column;
  }

  .btn-primary,
  .btn-ghost {
    width: 100%;
    text-align: center;
  }

  .result-metrics li {
    flex-direction: column;
    gap: 0.25rem;
  }

  .result-metrics strong {
    max-width: 100%;
    text-align: left;
  }

  .result-breakdown dl > div,
  #r-factors > div {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
  }

  .result-breakdown dd {
    text-align: left;
  }

  .result-empty {
    min-height: 10rem;
  }

  .bg-glow {
    width: 80vw;
    height: 80vw;
    top: -25vw;
    right: -30vw;
  }
}

@media (max-width: 380px) {
  .brand-text small {
    display: none;
  }

  .brand-text strong {
    font-size: 1.1rem;
  }

  .result-value {
    font-size: clamp(2.2rem, 14vw, 2.8rem);
  }

  fieldset {
    padding: 0.75rem 0.8rem 0.85rem;
  }
}

@media (hover: none) and (pointer: coarse) {
  a.tool-card-ready:hover {
    transform: none;
  }

  .btn-primary:hover,
  .btn-ghost:hover {
    transform: none;
  }

  input,
  select,
  .btn-primary,
  .btn-ghost {
    font-size: 16px; /* evita zoom automático en iOS */
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .bg-glow,
  .result-wire,
  .hero,
  .tools-grid,
  .workspace,
  .disclaimer-banner,
  .result-hero {
    animation: none !important;
  }
}
