/* Homepage-only enhancements. Atlas and its shared stylesheet are untouched. */
body.home-atlas .result-comparisons {
  margin: 24px 0;
  padding: 16px 0;
  border-top: 1px solid var(--site-hairline-soft, #292b34);
  border-bottom: 1px solid var(--site-hairline-soft, #292b34);
}
body.home-atlas .result-comparisons > summary {
  min-height: 44px;
  padding: 10px 0;
  color: var(--site-paper, #eee9df);
  cursor: pointer;
}
body.home-atlas .result-comparisons > p { color: var(--site-muted, #d7d2c8); line-height: 1.6; }
body.home-atlas .result-comparisons[hidden],
body.home-atlas .result-report-action[hidden] { display: none; }
body.home-atlas #landing .hero {
  margin-top: 0;
  padding-top: clamp(44px, 7vh, 84px);
  padding-bottom: clamp(40px, 6vh, 72px);
  border-top: 0;
}

body.home-atlas #landing .hero-h1 {
  font-size: clamp(50px, 5.2vw, 72px);
  line-height: 1.07;
  letter-spacing: -0.045em;
}

body.home-atlas #landing .home-atlas-sky { max-height: none; }

body.home-atlas #landing > .encyclopedia-home-intro {
  padding-top: clamp(32px, 5vw, 64px);
  border-top: 1px solid var(--site-hairline-soft, #292b34);
}

body.home-atlas .encyclopedia-home-intro > h2 {
  max-width: 850px;
  margin: 16px 0;
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.035em;
}

body.home-atlas .home-atlas-nav .home-atlas-nav-links > a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--site-muted, #d7d2c8);
  line-height: 1.5;
}

body.home-atlas .app-nav-toggle {
  display: inline-flex;
  min-width: 66px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 10px 14px;
  border: 1px solid var(--site-hairline, #45444a);
  border-radius: 10px;
  color: var(--site-paper, #eee9df);
  background: var(--site-surface, #0c0e16);
  font: 500 12px/1.4 var(--mono, ui-monospace, monospace);
  cursor: pointer;
}

body.home-atlas .app-nav-toggle[aria-expanded='true'] {
  border-color: var(--site-gold, #e1b969);
  color: var(--site-gold, #e1b969);
}

body.home-atlas .app-nav-toggle[hidden],
body.home-atlas .home-atlas-nav-links[hidden] {
  display: none !important;
}

body.home-atlas :is(.app-nav-toggle, .home-atlas-nav-links > a, .public-example-link, .result-report-action > a):focus-visible {
  outline: 2px solid var(--site-gold, #e1b969);
  outline-offset: 4px;
}

body.home-atlas .home-public-example {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin: 12px 0 0;
  color: var(--site-muted, #d7d2c8);
  font-size: 13px;
  line-height: 1.5;
}

body.home-atlas .public-example-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 6px 0;
  border: 0;
  color: var(--site-gold, #e1b969);
  background: transparent;
  font: inherit;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

body.home-atlas .hop-explanation {
  max-width: 66ch;
  margin: 14px 0 0;
  color: var(--site-muted, #d7d2c8);
  font-size: 13px;
  line-height: 1.7;
}

body.home-atlas .hop-explanation strong {
  color: var(--site-paper, #eee9df);
  font-weight: 600;
}

body.home-atlas .result-address-identity {
  display: grid;
  min-width: 0;
  gap: 6px;
  margin: 14px 0;
  color: var(--site-paper, #eee9df);
  line-height: 1.5;
}

body.home-atlas .result-address-identity strong {
  font-size: 15px;
  font-weight: 500;
}

body.home-atlas .result-address-identity code {
  color: var(--site-muted, #d7d2c8);
  font: 12px/1.7 var(--mono, ui-monospace, monospace);
  overflow-wrap: anywhere;
  user-select: all;
}

body.home-atlas .result-report-action {
  display: grid;
  justify-items: start;
  gap: 2px;
  margin-top: 16px;
}

body.home-atlas .result-report-action > a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--site-gold, #e1b969);
  font-size: 14px;
  text-underline-offset: 4px;
}

body.home-atlas .result-report-action > small {
  max-width: 60ch;
  color: var(--site-muted, #d7d2c8);
  font-size: 12px;
  line-height: 1.6;
}

@media (max-width: 1100px) {
  body.home-atlas .home-atlas-nav {
    flex-wrap: wrap;
    gap: 0 12px;
    padding: 12px 0;
  }

  body.home-atlas .home-atlas-brand {
    min-width: 0;
    min-height: 44px;
    line-height: 1.5;
    letter-spacing: 0.1em;
  }

  body.home-atlas .home-atlas-nav-links {
    display: flex;
    width: 100%;
    flex-wrap: wrap;
    gap: 2px 14px;
    padding: 8px 0 0;
  }

  body.home-atlas .home-atlas-nav-links > a {
    display: inline-flex;
    font-size: 10px;
    letter-spacing: 0.06em;
  }

  body.home-atlas .home-atlas-nav[data-nav-enhanced] .home-atlas-nav-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--site-hairline-soft, #292b34);
  }

  body.home-atlas .home-atlas-nav[data-nav-enhanced] .home-atlas-nav-links > a {
    padding: 10px;
  }

  body.home-atlas .home-atlas-nav-links .home-atlas-open {
    min-height: 44px;
    border-radius: 8px;
  }
}

@media (max-width: 360px) {
  body.home-atlas .home-atlas-brand { font-size: 8px; }
  body.home-atlas .home-atlas-nav[data-nav-enhanced] .home-atlas-nav-links {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* The portrait columns need 800px plus their gap. Stack before that minimum
   reaches the viewport edge, and let the result navigation use a second row. */
@media (max-width: 900px) {
  body.home-atlas #result { display: block; }
  body.home-atlas .result-profile::before { right: 0; max-width: 100%; }
  body.home-atlas #result #r-map { margin-top: 18px; }
  body.home-atlas .result-global-nav {
    flex-wrap: wrap;
    gap: 8px 20px;
    padding: 8px 0;
  }
  body.home-atlas .result-global-nav > div { flex-wrap: wrap; }
  body.home-atlas .result-global-nav a {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
  }
}

@media (max-width: 700px) {
  body.home-atlas #landing .hero-h1 { font-size: clamp(38px, 10vw, 50px); }
  body.home-atlas #landing .hero {
    padding-top: 38px;
    padding-bottom: 36px;
  }
}

/* Result and dialog refinements retained after restoring the previous landing page. */
@media screen {
  body.home-atlas { --app-panel:#0e141e; --app-panel-raised:#141c27; --app-ink:#f0ede5; --app-muted:#b8bec7; --app-border:#ccd7e224; --app-gold:#e0bb78; --app-blue:#97becd; }
  /* 25 — The returned address is its own readable identity block. */
  body.home-atlas .result-profile-head { grid-template-columns:minmax(0,1fr); gap:0; }
  body.home-atlas .result-global-nav a { color:var(--app-muted); font-size:10px; letter-spacing:.05em; }
  body.home-atlas .result-address-identity { background:#97becd08; border:1px solid var(--app-border); border-radius:7px; padding:14px 16px; margin:16px 0; gap:8px; }
  body.home-atlas .result-address-identity strong { color:var(--app-ink); font-size:14px; }
  body.home-atlas .result-address-identity code { color:var(--app-blue); font-size:12px; line-height:1.75; }
  body.home-atlas .result-profile::before { opacity:.25; }
  body.home-atlas #r-profile-title { font-size:30px; line-height:1.15; letter-spacing:-.035em; }

  /* 26 — The degree is the large primary datum; its explanation stays nearby. */
  body.home-atlas .result-coordinate { margin:24px 0 0; align-items:flex-start; text-align:left; }
  body.home-atlas .result-coordinate .degree { color:var(--app-gold); font-size:clamp(72px,8vw,104px); line-height:1; letter-spacing:-.06em; font-variant-numeric:tabular-nums; text-shadow:none; }
  body.home-atlas .result-coordinate > span { color:var(--app-muted); font-size:12px; line-height:1.6; margin-top:10px; }
  body.home-atlas .result-hop-explanation { font-size:12px; color:var(--app-muted); line-height:1.75; }

  /* 27 — The actual route and its vitals share a consistent surface treatment. */
  body.home-atlas .result-profile { grid-row:2; }
  body.home-atlas .result-map-panel { min-width:0; grid-column:2; grid-row:2; }
  body.home-atlas #result #r-map { border:1px solid var(--app-border); border-radius:10px; background:#0e141e99; overflow:hidden; }
  body.home-atlas #result .result-map-panel > .caption { width:100%; margin:12px 0 24px; color:var(--app-muted); font-size:11px; line-height:1.75; text-align:left; }
  body.home-atlas .result-vitals { border:1px solid var(--app-border); border-radius:8px; background:var(--app-panel); margin:28px 0; overflow:hidden; }
  body.home-atlas .result-vitals > div { padding:20px; border-color:var(--app-border); }
  body.home-atlas .result-vitals dt { color:var(--app-muted); font-size:10px; letter-spacing:.07em; }
  body.home-atlas .result-vitals dd { color:var(--app-ink); margin-top:10px; font-size:17px; line-height:1.5; font-variant-numeric:tabular-nums; }

  /* 28 — Findings and expandable comparisons have different visual priorities. */
  body.home-atlas #result .result-finding { padding:24px; margin:20px 0; border:1px solid #e0bb7855; border-left:3px solid var(--app-gold); border-radius:0 8px 8px 0; background:linear-gradient(100deg,#e0bb780b,transparent),var(--app-panel); }
  body.home-atlas #result .result-finding h3 { font-size:24px; line-height:1.25; }
  body.home-atlas #result .result-finding > p:last-child { color:var(--app-muted); font-size:13px; line-height:1.8; }
  body.home-atlas .result-comparisons { margin:20px 0; padding:0 18px; border:1px solid var(--app-border); border-radius:8px; background:#0e141e80; }
  body.home-atlas .result-comparisons > summary { padding:18px 0; color:var(--app-ink); font-size:13px; }
  body.home-atlas .result-comparisons > p { font-size:12px; line-height:1.75; color:var(--app-muted); }
  body.home-atlas .result-reward { border-color:var(--app-border); border-radius:7px; background:#0e141e; }
  body.home-atlas .result-pattern > p:last-child { color:var(--app-muted); }

  /* 29 — Saving, reporting and secondary actions use a coherent form layout. */
  body.home-atlas #result .result-save-panel { padding:24px; border-radius:10px; border:1px solid var(--app-border); background:var(--app-panel); box-shadow:none; }
  body.home-atlas .result-save-heading h3 { font-size:23px; letter-spacing:-.025em; }
  body.home-atlas :is(.result-save-copy,.save-privacy,.result-watch-caption) { color:var(--app-muted); line-height:1.75; }
  body.home-atlas .save-email-row input { min-height:50px; background:#080d15; border:1px solid var(--app-border); border-radius:6px; font-size:16px; }
  body.home-atlas .save-email-row button { min-height:50px; border-radius:6px; }
  body.home-atlas .result-report-action { padding:18px; border:1px solid var(--app-border); border-radius:8px; background:#97becd08; }
  body.home-atlas .result-report-action > a { color:var(--app-blue); font-size:14px; }
  body.home-atlas .result-report-action > small { color:var(--app-muted); font-size:12px; }
  body.home-atlas .result-next-links { gap:10px; }
  body.home-atlas .result-next-links a { min-height:48px; border-radius:6px; border-color:var(--app-border); padding:12px; font-size:12px; }

  /* 30 — Dialogs have a clear header, framed preview and aligned actions. */
  body.home-atlas :is(.share-dialog,.publication-dialog) { border:1px solid #d4c19d55; border-radius:12px; background:var(--app-panel); box-shadow:0 32px 100px #0009; padding:24px; max-height:calc(100dvh - 32px); }
  body.home-atlas :is(.share-dialog-head,.publication-dialog-head) { padding-bottom:18px; border-bottom:1px solid var(--app-border); gap:16px; }
  body.home-atlas :is(.share-dialog,.publication-dialog) h2 { font-size:clamp(22px,3vw,30px); line-height:1.2; letter-spacing:-.035em; }
  body.home-atlas :is(#share-close,.publication-close) { min-width:44px; min-height:44px; flex-shrink:0; border-radius:6px; background:#ffffff05; border-color:var(--app-border); }
  body.home-atlas .share-dialog-copy { color:var(--app-muted); font-size:13px; line-height:1.75; }
  body.home-atlas #share-preview { border-radius:8px; border-color:var(--app-border); margin:20px 0; }
  body.home-atlas .share-dialog-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  body.home-atlas .share-dialog-actions button { min-height:46px; border-radius:6px; font-size:12px; letter-spacing:0; }
  body.home-atlas .publication-score-preview,body.home-atlas .publication-public-note { border-radius:7px; border-color:var(--app-border); background:#080d1544; }
  body.home-atlas :is(#result,.share-dialog,.publication-dialog) :is(button,a,input,select,summary):focus-visible { outline:2px solid var(--app-gold); outline-offset:4px; }
}

@media screen and (max-width:760px) {
  body.home-atlas .result-vitals > div { padding:16px; }
}
@media screen and (max-width:480px) {
  body.home-atlas .result-next-links,body.home-atlas .share-dialog-actions { grid-template-columns:minmax(0,1fr); }
  body.home-atlas :is(.share-dialog,.publication-dialog) { padding:18px; width:calc(100vw - 24px); }
  body.home-atlas .result-address-identity { padding:12px; }
  body.home-atlas #result .result-save-panel { padding:18px; }
}
