:root {
  --bg: var(--tdb-page-bg, #191b18);
  --bronze: #b39062;
  --tbd-bronze: #b39062;
  --tbd-bg: transparent;
  --tbd-page-bg: var(--tdb-page-bg, #191b18);
  --page-text: var(--tdb-text, #292b24);
  --title-text: var(--tdb-text, #292b24);
  --muted-text: var(--tdb-muted, #5f6058);
  --circle: 110px;
  --icon: 92px;
  --title: 16px;
  --desc: 13px;
}

:root[data-theme="light"],
:root[data-tdb-theme="light"] {
  color-scheme: light;
  --page-text: var(--tdb-text, #292b24);
  --title-text: var(--tdb-text, #292b24);
  --muted-text: var(--tdb-muted, #5f6058);
  --tbd-page-bg: var(--tdb-page-bg, #f7f5ef);
}

:root[data-theme="dark"],
:root[data-tdb-theme="dark"] {
  color-scheme: dark;
  --page-text: var(--tdb-text, #ece9df);
  --title-text: var(--tdb-text, #ece9df);
  --muted-text: var(--tdb-muted, #c2bfb4);
  --tbd-page-bg: var(--tdb-page-bg, #191b18);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-width: 320px;
  min-height: 100vh;
  padding: 2rem;
  color: var(--page-text);
  background: var(--tdb-page-bg, var(--tbd-page-bg));
  font-family: system-ui, sans-serif;
  transition: background-color 180ms ease, color 180ms ease;
}

.tbd-page {
  min-height: calc(100vh - 4rem);
  background: transparent;
}

.tbd-primeros-pasos,
.tbd-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  justify-items: center;
  gap: 24px;
  width: min(100%, 900px);
  margin: 0 auto;
}

.tbd-primeros-pasos {
  padding: 60px 20px;
  background: transparent;
}

.tbd-item {
  display: flex;
  width: 100%;
  max-width: 280px;
  align-self: start;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  margin-block: 0 !important;
  background: var(--tbd-bg) !important;
  text-align: center;
  user-select: none;
  -webkit-user-select: none;
  -webkit-focus-ring-color: transparent;
}

.tbd-icon-wrap {
  position: relative;
  width: var(--circle);
  height: var(--circle);
  flex: 0 0 var(--circle);
}

.tbd-inner-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  width: var(--circle);
  height: var(--circle);
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #b39062;
  background: #121212;
  transform: translate(-50%, -50%);
  transition: all 0.4s ease;
}

.tbd-image {
  display: block;
  width: var(--icon);
  height: var(--icon);
  flex: 0 0 var(--icon);
  border-radius: 50%;
  object-fit: cover;
  transition: all 0.4s ease;
}

.tbd-icon-link {
  display: grid;
  width: var(--icon);
  height: var(--icon);
  flex: 0 0 var(--icon);
  place-items: center;
  border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
}

.tbd-icon-link:focus,
.tbd-icon-link:active {
  outline: none !important;
}

.tbd-item:focus,
.tbd-item:active,
.tbd-icon-wrap:focus,
.tbd-icon-wrap:active,
.tbd-inner-circle:focus,
.tbd-inner-circle:active {
  outline: none !important;
}

.tbd-item:focus,
.tbd-item:active {
  background: transparent !important;
}

.tbd-icon-wrap:focus,
.tbd-icon-wrap:active {
  background: transparent !important;
}

.tbd-item:hover .tbd-inner-circle {
  box-shadow: 0 0 20px rgb(179 144 98 / 50%), 0 0 40px rgb(179 144 98 / 20%);
  border-color: #c9a87a;
  transform: translate(-50%, -50%) scale(1.05);
}

.tbd-item:hover .tbd-image {
  filter: brightness(1.1) contrast(1.1);
  transform: scale(1.02);
}

.tbd-item:hover .tbd-title {
  color: var(--tdb-accent-text, #70512d);
}

.tbd-title {
  margin-top: 14px;
  color: var(--title-text);
  font-size: calc(var(--title) * var(--font-scale, 1));
  font-weight: 600;
  line-height: 1.2;
}

.tbd-desc {
  margin-top: 6px;
  color: var(--muted-text);
  font-size: calc(var(--desc) * var(--font-scale, 1));
  line-height: 1.4;
}

.theme-toggle {
  position: fixed;
  z-index: 2147483647;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  padding: 0;
  border: 2px solid var(--bronze);
  border-radius: 50%;
  color: var(--bronze);
  background: #121212;
  box-shadow: 0 4px 16px rgb(25 27 24 / 35%);
  cursor: pointer;
  transition:
    background-color 160ms ease,
    color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

:root[data-theme="light"] .theme-toggle,
:root[data-tdb-theme="light"] .theme-toggle {
  color: var(--bronze);
  background: #121212;
}

:root[data-theme="dark"] .theme-toggle,
:root[data-tdb-theme="dark"] .theme-toggle {
  color: #121212;
  background: var(--tbd-bronze);
}

.tbd-home-link {
  position: fixed;
  z-index: 2147483647;
  right: max(88px, calc(env(safe-area-inset-right) + 72px));
  bottom: max(20px, env(safe-area-inset-bottom));
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border: 2px solid var(--bronze);
  border-radius: 50%;
  color: var(--bronze);
  background: #121212;
  box-shadow: 0 4px 16px rgb(25 27 24 / 35%);
  text-decoration: none;
  transition:
    background-color 160ms ease,
    color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

:root[data-theme="dark"] .tbd-home-link,
:root[data-tdb-theme="dark"] .tbd-home-link {
  color: #121212;
  background: var(--tbd-bronze);
}

.tbd-home-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 7px 20px rgb(25 27 24 / 42%);
}

.tbd-home-link svg {
  display: block;
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.tbd-home-link:focus-visible {
  outline: 3px solid var(--bronze);
  outline-offset: 3px;
}

.theme-toggle:hover {
  transform: translateY(-3px);
  box-shadow: 0 7px 20px rgb(25 27 24 / 42%);
}

.theme-icon {
  display: block;
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.theme-icon[hidden] {
  display: none !important;
}

.theme-toggle:focus-visible {
  outline: 3px solid var(--bronze);
  outline-offset: 3px;
}

@media (max-width: 900px) {
  .tbd-primeros-pasos,
  .tbd-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 901px) {
  .tbd-primeros-pasos,
  .tbd-grid {
    width: min(100%, 1180px);
    gap: 40px;
  }

  .tbd-item {
    max-width: 320px;
    padding: 20px;
  }

  .tbd-icon-wrap {
    transform: scale(1.08);
  }
}

@media (max-width: 600px) {
  body {
    padding: 1.25rem 1rem;
  }

  .tbd-page {
    min-height: calc(100vh - 2.5rem);
  }

  .tbd-primeros-pasos,
  .tbd-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .tbd-primeros-pasos > .tbd-item:last-child {
    grid-column: 1 / -1;
    justify-self: center;
  }

  .tbd-item {
    padding: 8px 4px;
  }

  .theme-toggle {
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
  }

  .tbd-home-link {
    right: max(80px, calc(env(safe-area-inset-right) + 68px));
    bottom: max(16px, env(safe-area-inset-bottom));
    width: 56px;
    height: 56px;
  }
}

:root[data-theme="light"] .tbd-inner-circle,
:root[data-tdb-theme="light"] .tbd-inner-circle {
  border-color: #8a6d4a;
  background: #f8f6f0;
}

.tbd-floating-controls {
  position: fixed;
  z-index: 2147483647;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  max-width: calc(100vw - 24px);
  overflow: hidden;
  padding: 5px;
  border: 1px solid rgb(179 144 98 / 55%);
  border-radius: 999px;
  background: rgb(18 18 18 / 94%);
  box-shadow: 0 4px 16px rgb(25 27 24 / 35%);
  transition: width 200ms ease, background-color 180ms ease;
}

.tbd-floating-controls[data-collapsed="true"] {
  width: 52px;
  min-width: 52px;
  gap: 0;
  padding: 4px;
}

:root[data-theme="light"] .tbd-floating-controls,
:root[data-tdb-theme="light"] .tbd-floating-controls {
  border-color: rgb(93 72 48 / 45%);
  background: rgb(247 245 239 / 96%);
}

.tbd-floating-controls .theme-toggle,
.tbd-floating-controls .tdb-reading-mode-toggle,
.tbd-floating-controls .tbd-home-link,
.tbd-floating-controls .tdb-controls-toggle {
  position: static;
  inset: auto;
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 1px solid var(--bronze);
  border-radius: 50%;
  color: var(--bronze);
  background: #121212;
  box-shadow: none;
  text-decoration: none;
  cursor: pointer;
}

.tbd-floating-controls .tdb-controls-toggle {
  flex-basis: 42px;
  width: 42px;
  min-width: 42px;
  border-color: transparent;
  background: transparent;
}

.tbd-floating-controls[data-collapsed="true"] .tdb-controls-toggle {
  position: relative;
  z-index: 1;
  display: grid !important;
  flex: 0 0 42px !important;
  width: 42px !important;
  height: 42px !important;
  min-width: 42px;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.tbd-floating-controls[data-collapsed="true"] {
  overflow: visible;
}

.tbd-floating-controls .theme-icon,
.tbd-floating-controls .tdb-reading-mode-toggle svg,
.tbd-floating-controls .tbd-home-link svg {
  display: block;
  width: 19px;
  height: 19px;
}

.tbd-floating-controls .tdb-controls-toggle svg {
  display: block;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  transition: transform 200ms ease;
}

.tbd-floating-controls[data-collapsed="true"] .tdb-controls-toggle svg {
  transform: rotate(180deg);
}

.tbd-floating-controls[data-collapsed="true"] > :not(.tdb-controls-toggle) {
  width: 0;
  height: 0;
  flex-basis: 0;
  margin: 0;
  padding: 0;
  border-width: 0;
  opacity: 0;
  visibility: hidden;
}

:root[data-theme="light"] .tbd-floating-controls .theme-toggle,
:root[data-tdb-theme="light"] .tbd-floating-controls .theme-toggle,
:root[data-theme="light"] .tbd-floating-controls .tdb-reading-mode-toggle,
:root[data-tdb-theme="light"] .tbd-floating-controls .tdb-reading-mode-toggle,
:root[data-theme="light"] .tbd-floating-controls .tbd-home-link,
:root[data-tdb-theme="light"] .tbd-floating-controls .tbd-home-link {
  color: #5d4830;
  background: #f7f5ef;
}

:root[data-theme="dark"] .tbd-floating-controls .theme-toggle,
:root[data-tdb-theme="dark"] .tbd-floating-controls .tdb-reading-mode-toggle,
:root[data-theme="dark"] .tbd-floating-controls .tbd-home-link,
:root[data-tdb-theme="dark"] .tbd-floating-controls .tbd-home-link {
  color: #121212;
  background: var(--bronze);
}

.tbd-floating-controls .theme-toggle:hover,
.tbd-floating-controls .tdb-reading-mode-toggle:hover,
.tbd-floating-controls .tbd-home-link:hover {
  filter: brightness(1.12);
}

.tbd-floating-controls :focus-visible {
  outline: 2px solid var(--bronze);
  outline-offset: 2px;
}

@media (max-width: 600px) {
  .tbd-floating-controls {
    right: max(8px, env(safe-area-inset-right));
    bottom: max(8px, env(safe-area-inset-bottom));
  }
}
