/* Shared readability and mobile-layout adjustments. */

body [style*="--sv-fg-muted"] {
  --sv-fg-muted: rgba(234, 226, 214, 0.92) !important;
  --sv-fg-subtle: rgba(239, 228, 210, 0.62) !important;
}

body p[style*="font-weight: 300"][style*="var(--sv-fg-muted)"],
body li[style*="font-weight: 300"][style*="var(--sv-fg-muted)"],
body p[style*="font-weight: 300"][style*="0.88)"],
body p[style*="font-weight: 300"][style*="0.85)"] {
  font-weight: 400 !important;
}

body p[style*="max-width: 820px"],
body p[style*="max-width: 800px"],
body p[style*="max-width: 760px"],
body p[style*="max-width: 720px"],
body [style*="max-width: 820px"] > p[style*="var(--sv-fg-muted)"],
body [style*="max-width: 800px"] > p[style*="var(--sv-fg-muted)"] {
  max-width: 68ch !important;
}

/* Visual feature cards on the method page. */
[data-practice-features] {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: clamp(18px, 2.4vw, 28px);
  margin-top: clamp(28px, 4vw, 40px);
}

[data-practice-feature] {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: clamp(22px, 3vw, 30px);
  border: 1px solid rgba(182, 90, 46, 0.32);
  background: linear-gradient(145deg, rgba(182, 90, 46, 0.08), rgba(16, 24, 43, 0.88) 44%);
}

[data-practice-feature-top] {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

[data-practice-number] {
  color: #d78f67;
  font-family: var(--sv-font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
}

[data-practice-icon] {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(182, 90, 46, 0.4);
  border-radius: 999px;
  color: #d78f67;
}

[data-practice-icon] svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[data-practice-feature] h3 {
  margin: 0 0 8px;
  color: #efe4d2;
  font-family: var(--sv-font-display);
  font-size: clamp(20px, 2vw, 25px);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  text-wrap: balance;
}

[data-practice-subtitle] {
  min-height: 2.8em;
  margin: 0 0 20px;
  color: #d78f67;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.04em;
}

[data-practice-flow] {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

[data-practice-token] {
  flex: 1;
  min-width: 0;
  padding: 9px 5px;
  border-top: 1px solid rgba(182, 90, 46, 0.38);
  border-bottom: 1px solid rgba(182, 90, 46, 0.38);
  color: #efe4d2;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.025em;
  text-align: center;
  white-space: nowrap;
}

[data-practice-arrow] {
  flex: none;
  color: #d78f67;
  font-size: 13px;
}

[data-practice-rounds] {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

[data-practice-rounds] > span {
  padding: 11px 5px;
  border-top: 1px solid rgba(182, 90, 46, 0.38);
  background: rgba(6, 10, 22, 0.28);
  text-align: center;
}

[data-practice-rounds] strong,
[data-practice-rounds] small {
  display: block;
}

[data-practice-rounds] strong {
  margin-bottom: 4px;
  color: #d78f67;
  font-family: var(--sv-font-display);
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
}

[data-practice-rounds] small {
  color: var(--sv-fg-muted);
  font-size: 11px;
  line-height: 1.3;
  letter-spacing: 0.025em;
}

[data-practice-copy] {
  margin: 18px 0 0;
  color: var(--sv-fg-muted);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.65;
  text-wrap: pretty;
}

/* Audience cards on the personal-algorithm page. */
[data-audience-grid] {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(14px, 2vw, 22px);
}

[data-audience-card] {
  min-width: 0;
  padding: clamp(20px, 2.8vw, 30px);
  border: 1px solid rgba(182, 90, 46, 0.32);
  background: linear-gradient(145deg, rgba(182, 90, 46, 0.07), rgba(16, 24, 43, 0.9) 48%);
}

[data-audience-top] {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

[data-audience-number] {
  color: #d78f67;
  font-family: var(--sv-font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
}

[data-audience-icon] {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(182, 90, 46, 0.4);
  border-radius: 999px;
  color: #d78f67;
}

[data-audience-icon] svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[data-audience-card] h3 {
  margin: 0 0 10px;
  color: #efe4d2;
  font-family: var(--sv-font-display);
  font-size: clamp(18px, 1.8vw, 22px);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  text-wrap: balance;
}

[data-audience-card] > p {
  margin: 0;
  color: var(--sv-fg-muted);
  font-size: clamp(15px, 1.2vw, 17px);
  font-weight: 400;
  line-height: 1.65;
  text-wrap: pretty;
}

@media (max-width: 640px) {
  body p[style*="font-size: 15px"][style*="var(--sv-fg-muted)"],
  body li[style*="font-size: 15px"][style*="var(--sv-fg-muted)"],
  body p[style*="font-size: 14px"][style*="var(--sv-fg-muted)"],
  body p[style*="font-size: clamp(15px"][style*="var(--sv-fg-muted)"],
  body li[style*="font-size: clamp(15px"][style*="var(--sv-fg-muted)"],
  body p[style*="font-size: clamp(15px"][style*="0.88)"],
  body p[style*="font-size: clamp(15px"][style*="0.85)"] {
    font-size: 16px !important;
  }

  footer {
    padding-top: 42px !important;
    padding-bottom: 28px !important;
  }

  footer > div > div:first-child {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 30px 20px !important;
  }

  footer > div > div:first-child > div:first-child {
    grid-column: 1 / -1;
    gap: 12px !important;
  }

  footer > div > div:nth-child(2) {
    margin-top: 32px !important;
    padding-top: 20px !important;
    gap: 8px 16px !important;
  }

  footer > div > p:last-child {
    font-size: 13px !important;
    line-height: 1.55 !important;
  }

  [data-practice-features] {
    gap: 16px;
  }

  [data-practice-feature] {
    padding: 20px;
  }

  [data-practice-subtitle] {
    min-height: 0;
  }

  [data-practice-copy] {
    font-size: 16px;
  }

  [data-audience-grid] {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  [data-audience-card] {
    padding: 20px;
  }

  [data-audience-card] > p {
    font-size: 16px;
  }
}

/* Compact full-screen navigation for phones and small tablets. */
@media (max-width: 880px) {
  html:has([data-mobile-menu]),
  body:has([data-mobile-menu]) {
    overflow: hidden !important;
  }

  [data-mobile-menu] {
    min-height: 100vh;
    min-height: 100dvh;
    max-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    background:
      radial-gradient(circle at 16% 18%, rgba(182, 90, 46, 0.08), transparent 34%),
      #060a16 !important;
  }

  [data-mobile-menu] > div:first-child {
    flex: none;
    height: 64px !important;
    padding: 0 20px !important;
  }

  [data-mobile-menu] > div:first-child > div:first-child {
    gap: 10px !important;
    min-width: 0;
  }

  [data-mobile-menu] > div:first-child img {
    height: 27px !important;
  }

  [data-mobile-menu] > div:first-child span {
    overflow: hidden;
    font-size: 12px !important;
    letter-spacing: 0.24em !important;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  [data-mobile-menu] > div:first-child button {
    flex: none;
    width: 40px !important;
    height: 40px !important;
  }

  [data-mobile-menu] > nav {
    flex: 1;
    justify-content: flex-start !important;
    gap: 0 !important;
    padding: clamp(36px, 8vh, 64px) 24px 24px !important;
  }

  [data-mobile-menu] > nav > a {
    display: block;
    width: 100%;
    padding: 12px 0;
    border-bottom: 1px solid rgba(182, 90, 46, 0.16) !important;
    font-size: clamp(21px, 4.8vw, 28px) !important;
    line-height: 1.2 !important;
    letter-spacing: 0.055em !important;
    text-wrap: balance;
  }

  [data-mobile-menu] > nav > a:last-child {
    border-bottom-color: transparent !important;
  }

  [data-mobile-menu] > nav + div {
    display: flex;
    flex: none;
    justify-content: center;
    padding: 18px 20px calc(18px + env(safe-area-inset-bottom)) !important;
    border-top: 1px solid rgba(182, 90, 46, 0.16);
  }

  [data-mobile-menu] > nav + div > a {
    width: 100% !important;
    max-width: 420px;
    min-height: 46px;
    margin: 0 auto;
    padding: 13px 18px !important;
    font-size: 11px !important;
    line-height: 1.35;
    letter-spacing: 0.13em !important;
    text-align: center;
  }
}

@media (max-width: 380px) {
  [data-mobile-menu] > div:first-child {
    height: 60px !important;
    padding: 0 16px !important;
  }

  [data-mobile-menu] > div:first-child img {
    height: 25px !important;
  }

  [data-mobile-menu] > div:first-child span {
    font-size: 11px !important;
    letter-spacing: 0.2em !important;
  }

  [data-mobile-menu] > nav {
    padding-right: 20px !important;
    padding-left: 20px !important;
  }
}

@media (max-width: 880px) and (max-height: 680px) {
  [data-mobile-menu] > nav {
    padding-top: 22px !important;
    padding-bottom: 14px !important;
  }

  [data-mobile-menu] > nav > a {
    padding: 8px 0;
    font-size: 20px !important;
  }

  [data-mobile-menu] > nav + div {
    padding-top: 12px !important;
    padding-bottom: calc(12px + env(safe-area-inset-bottom)) !important;
  }
}

@media (max-width: 350px) {
  footer > div > div:first-child {
    grid-template-columns: 1fr !important;
  }

  footer > div > div:first-child > div:first-child {
    grid-column: auto;
  }
}
