/* Sky Atlas — shared ink, paper and engraved illustrations. */
html:root:root {
  color-scheme: light;
  --background: #eff7fb;
  --foreground: #123e54;
  --ink: #123e54;
  --ink-soft: #426170;
  --surface: #fcfdfe;
  --surface-2: #e4f0f6;
  --gold: #175a77;
  --gold-soft: #2269851b;
  --primary-foreground: #fff;
  --border: #94b0bd;
  --input: #9fbac6;
  --shadow-gold: 0 3px 12px #23566e23;
  --atlas-coral: #ae462b;
  --atlas-rule: #a8c1cf;
  --atlas-title: "Cormorant Garamond", "Hiragino Mincho ProN", "Songti SC", Georgia, serif;
  --atlas-ui: "DM Sans", "Hiragino Sans", "PingFang SC", system-ui, sans-serif;
  --text: #284b59;
  --red: var(--atlas-coral);
  --accent: #175a77;
  --paper: #fbfcfc;
  --bg: var(--background);
  --line: #b9cdd6;
  --muted: var(--ink-soft);
}
html body {
  color: var(--ink);
  background: radial-gradient(ellipse at 78% 18%, #d9edf6a3, transparent 62%) top / 100% 54rem no-repeat, var(--background);
}
body .paper-noise { opacity: .15; }
:focus-visible { outline: 2px solid #24658a; outline-offset: 3px; }
::selection { background: #c0e2f2; color: #113649; }
header a:has(> img[src*="icon"]), .mast .brand {
  display: inline-flex; align-items: center; gap: .55rem; width: fit-content;
  color: var(--ink); font: 600 18px/1 var(--atlas-ui); letter-spacing: -.035em;
}
header a:has(> img[src*="icon"])::after { content: "bornhere.site"; text-transform: none; }
header nav a[href*="gift"], header > a[href*="gift"] {
  color: var(--atlas-coral); border-color: #cd876b; background: #fff8;
}
header nav label:has(select), header label:has(select) { background-color: #ffffff85; }
header :is(nav a, label):focus-within { outline-offset: 3px; }
:where(h1,h2,h3) { color: var(--ink); }
button.bg-gold, a.bg-gold { background: #185c79; color: #fff; }
button.bg-gold:hover:not(:disabled), a.bg-gold:hover { background: #104b66; }
.studio-help > button { background: #195a74; box-shadow: 0 4px 16px #214e6629; }
.studio-help .help-panel { border-color: var(--atlas-rule); background: #fbfdff; }
.classic-ad .ad-notice, .cookie-settings { color: #426170; }
footer { background-color: #e8f2f7a6; }

/* Opening spread. Keep the existing responsive form and live certificate. */
main:has(> .atlas-home-grid) {
  position: relative; isolation: isolate; max-width: 78rem;
  padding-block-start: clamp(3.1rem,7vh,5rem);
  padding-block-end: clamp(8.25rem,16vh,11rem);
}
header:has(+main > .atlas-home-grid) { max-width: 78rem; }
main:has(> .atlas-home-grid)::after, .atlas-journey::after {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  left: 50%; bottom: 0; width: 100vw; height: clamp(62px,8.8vw,122px);
  transform: translateX(-50%); background: url('/classic/atlas/horizon.webp') center bottom / 100% 100% no-repeat;
  mix-blend-mode: multiply; opacity: .67;
  mask-image: linear-gradient(transparent,black 24%,black 94%,transparent);
}
.atlas-home-grid { position: relative; }
.atlas-home-grid::before {
  content: ""; position: absolute; pointer-events: none; z-index:-1;
  inset-inline-start: 46%; top: -1.8rem; width: clamp(74px,8vw,114px); aspect-ratio: 1;
  background: url('/classic/atlas/moon.webp') center / contain no-repeat;
  mix-blend-mode: multiply; opacity: .42;
}
.atlas-home-grid h1 {
  font: italic 600 clamp(3rem,5.25vw,4.65rem)/1.07 var(--atlas-title);
  letter-spacing: -.038em; margin-block-start: 1.3rem; text-wrap: balance;
}
:is(html:lang(zh),html:lang(ja)) .atlas-home-grid h1 {
  max-width: 11em; font: italic 650 clamp(2.5rem,4.6vw,4.25rem)/1.21 var(--atlas-ui);
  letter-spacing: -.066em;
}
.atlas-home-grid h1 + p { max-width: 33rem; line-height: 1.8; }
.atlas-home-grid > div > div > .font-mono:first-child,
.atlas-home-grid form .animate-pulse + span::first-letter { color: var(--atlas-coral); }
.atlas-home-grid form .bg-gold.animate-pulse { background: #db7558; }
.atlas-home-grid form { margin-block-start: clamp(1.4rem,3.6vh,2.45rem); }
.atlas-home-grid input, .atlas-home-grid select, .atlas-home-grid button.border,
main form input:not([type=range]):not([type=checkbox]):not([type=radio]):not([type=hidden]):not(.bg-transparent),
main form textarea {
  background-color: #ffffffc7; color: var(--ink); border-color: #a7c1cd;
}
main form :is(input,textarea)::placeholder { color: #607783; opacity: 1; }
.atlas-home-grid form [type=submit] { box-shadow: 0 4px 11px #12435e20; }
.atlas-home-grid + *, .rule-gold { border-color: var(--atlas-rule); }
@media(min-width: 1000px) {
  .atlas-home-grid { grid-template-columns: minmax(0,1.22fr) minmax(0,.95fr); gap: clamp(4rem,7vw,7.4rem); }
  .atlas-home-grid > aside { margin-block-start: .5rem; }
}
@media(min-width: 768px) and (max-width: 999px) {
  .atlas-home-grid { grid-template-columns: minmax(0,1fr) minmax(0,.85fr); gap: 2rem; }
  .atlas-home-grid::before { width: 54px; inset-inline-start: 45%; }
}

/* Printable stationery in the live preview. The real phase renderer stays dynamic. */
.atlas-home-grid aside > div { transform: none !important; }
.preview-cert {
  --gold-ink: #447995; --ink: #17455b; --paper: #faf9f6;
  border: 1px solid #bbcbcf; border-radius: 9px;
  background: #faf9f6; padding: 23px 26px 22px;
  box-shadow: 0 18px 30px -14px #24566e65, 0 3px 9px #29495b1a;
  isolation: isolate;
}
.preview-cert::before { inset: 9px; border-color: #82a2b3; border-radius: 5px; }
.preview-cert::after { inset: 13px; border-color: #b4c6cd; border-radius: 3px; }
.preview-cert-inner {
  background: url('/classic/atlas/moon-cloud.webp') right -24px top -8px / 110px auto no-repeat;
  background-blend-mode: multiply; background-color: transparent;
}
.preview-cert-eyebrow, .preview-cert-label { color: #396377; font-weight: 600; }
.preview-cert-name-wrap { min-height: 80px; }
.preview-cert-name { font: italic 600 clamp(1.65rem,2.6vw,2.6rem)/1.2 var(--atlas-title); }
.preview-cert .preview-cert-placeholder { color: #55717e !important; }
.preview-cert-row { padding-block: 13px; }
.preview-cert-value { font-size: 1.23rem; }
.preview-cert-moon-wrap { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 0 .6rem; }
.preview-cert-moon-wrap > .preview-cert-label { grid-column: 1/-1; margin-block-end: 8px; }
.preview-cert-moon { grid-column: 1; min-height: 94px; margin: 0; }
.preview-cert-moon svg, .preview-cert-moon-placeholder { max-width: 98px; max-height: 98px; }
.preview-cert-moon .preview-cert-moon-placeholder {
  border: 0; border-radius: 50%; width: 94px; height: 94px; opacity: .72;
  background: var(--paper) url('/classic/atlas/moon.webp') center / cover; background-blend-mode: multiply;
}
.preview-cert-moon-wrap::after {
  content: ""; grid-column: 2; grid-row: 2/4; align-self: stretch;
  min-height: 98px; border-inline-start: 1px dashed #b2c3cc;
  background: var(--paper) url('/classic/atlas/night-sky.webp') 64% center / 89% auto no-repeat;
  background-blend-mode: multiply;
}
.preview-cert-moon-label { grid-column: 1; padding-top: 5px; }
.preview-cert-seal { color: #d76b50; }
.preview-cert-footer { border-color: #9db6c5; }

/* The mobile journey swaps to the live, navigable globe as the user advances. */
.atlas-journey { background: radial-gradient(ellipse at 50% 42%,#d9eef9,transparent 70%),var(--background); isolation:isolate; }
.atlas-journey::after { height: 4rem; opacity: .34; }
.atlas-journey main h1 { color: var(--ink); text-shadow: none; margin-block-start: clamp(1.2rem,4vh,2.7rem); }
.atlas-journey main h1 .italic { color: inherit; }
:is(html:lang(zh),html:lang(ja)) .atlas-journey main h1 {
  font-family: var(--atlas-ui); font-style: italic; font-weight: 650; letter-spacing: -.065em; line-height: 1.17;
}
.atlas-journey:has(#journey-name) main h1 {
  align-self: center; text-align: start; width: 100%; max-width: 24rem; font-size: clamp(2.15rem,9.2vw,3rem);
}
.atlas-journey-globe.atlas-illustrated {
  top: 47%; width: min(115vw,56svh,550px); opacity: 1;
  mask-image: linear-gradient(black 56%,transparent 98%); mix-blend-mode: multiply;
}
.atlas-illustrated > div { opacity: 0; }
.atlas-illustrated::after {
  content: ""; position: absolute; inset: 0; pointer-events:none;
  background: transparent url('/classic/atlas/earth.webp') center / contain no-repeat;
  background-blend-mode: multiply;
}
.atlas-journey form [data-line] { border-color: #a2bdcb !important; background: #fbfdff !important; }
.atlas-journey form label { color: var(--ink); font-weight: 600; }
.atlas-journey form button.min-h-11 { color: var(--atlas-coral); }
@media(max-width: 420px) {
  header a:has(> img[src*="icon"]) { font-size: 15px; gap: .3rem; }
  .atlas-journey header nav { gap: .4rem; }
}
@media(max-width: 355px) {
  .atlas-journey header a:has(> img[src*="icon"])::after { font-size: 12px; }
  .atlas-journey header { gap: 4px; padding-inline: 12px; }
}

/* Story, comparisons, gifts, and the chapter index. */
header:has(+ .classic-actions) {
  isolation: isolate; background: linear-gradient(145deg,#f5fbfe,#d7eaf4);
}
header:has(+ .classic-actions)::after {
  content: ""; position: absolute; inset: auto 0 0; height: 34%;
  background: url('/classic/atlas/horizon.webp') center bottom / 100% 100% no-repeat;
  opacity: .57; mix-blend-mode: multiply; pointer-events:none;
}
header:has(+ .classic-actions) h1 { text-wrap: balance; color: var(--ink); }
.classic-actions { padding: clamp(1.2rem,3vw,2rem) 1rem; border-bottom: 1px solid #abc4d080; }
.classic-actions a,.classic-actions button { background:#fcfdff; border-color:#a6c1cf; border-radius: 9px; }
.classic-actions a:first-child,.classic-actions button:first-child { background:#195a77; }
.section-reveal { border-block-start: 1px solid #acc6d370; }
.section-reveal > h2, #sec-share h2 { color: var(--ink); letter-spacing: -.025em; }
#sec-03 article { background:#fbfcfd; border:1px solid var(--atlas-rule); box-shadow:0 8px 26px #345b7210; }
main:has(#gift-birth-time) > .text-center, main:has(form .grid) > .text-center { color: var(--ink); }
main:has(#gift-birth-time) .space-y-5 > .overflow-hidden:first-of-type,
main:has(#gift-birth-time) [class*="bg-[#f6ecd6]"] {
  background: #faf9f6 url('/classic/atlas/moon-cloud.webp') right -40px top -48px / 160px auto no-repeat;
  background-blend-mode:multiply; border:1px solid #8eaebf; color:#16445b;
  outline:1px solid #b6cad2; outline-offset:-8px; box-shadow:0 10px 30px #29526816;
}
main:has(#gift-birth-time) [class*="text-[#"] { color:#476779; }
main:has(#gift-birth-time) .space-y-5 > .bg-gradient-to-br { background:linear-gradient(155deg,#fcfeff,#e3f1f7); }
main:has(#gift-birth-time) fieldset legend, .section-reveal > .font-mono { color: var(--atlas-coral); }
main form > .rounded-2xl:has(.grid) { background:#f9fcfe; border-color:#a9c4d2; box-shadow:0 3px 16px #3c60710c; }
main:has(form > .rounded-2xl) { position:relative; }
main:has(form > .rounded-2xl)::before {
  content:""; position:absolute; z-index:-1; pointer-events:none; top:2.5rem; inset-inline-end:-3.2rem;
  width:6rem; height:5.5rem; opacity:.4; mix-blend-mode:multiply;
  background:url('/classic/atlas/moon-cloud.webp') center/contain no-repeat;
}
@media(max-width: 800px) { main:has(form > .rounded-2xl)::before { inset-inline-end:1rem; width:3.25rem; top:0; } }

/* Server-rendered almanacs, data sources, personal gifts, and film controls. */
body.inside .mast,body.cover .mast { border-bottom:1px solid #abc4d075; }
body.inside .sheet { max-width: 64rem; margin: clamp(1rem,4vw,3rem) auto; padding:clamp(1.2rem,4vw,3rem); background:#fcfdfe; border:1px solid #b1c7d3; border-radius:12px; }
body.inside .sheet.short { max-width: 48rem; }
.sheet-head { border-color:var(--line); padding-bottom:1.5rem; }
.sheet-head :is(.kicker,h1), .sheet h2, .sheet h4 { color:var(--ink); }
.sheet .primary { background:#185a76; color:white; border-color:#185a76; }
.sheet .secondary { color:var(--ink); background:#edf6fa; border-color:#9dbbca; }
.sheet .fact { border-color:#b8ceda; }
.sheet .controls { display:flex; align-items:center; flex-wrap:wrap; gap:.75rem; margin-top:1rem; }
.sheet .controls input { flex:1; min-width:70px; accent-color:var(--accent); }
.sheet.film-page canvas { display:block; width:100%; height:auto; border-radius:8px; }
body:has(#response) { background:#edf6fb; color:var(--ink); }
body:has(#response) article { background:#faf9f6; border-color:#8faebb; color:var(--ink); }
body:has(#response) :is(.action,button) { background:#175975; color:white; }
body:has(#response) :is(.small,.signature,.sender,.when,header a) { color: #31586b; }
@media(max-width: 650px) { body.inside .sheet { margin:1rem .75rem; } }
@media(prefers-reduced-motion: reduce) {
  .animate-twinkle,.animate-pulse { animation:none; }
}
/* Keep controls comfortable to scan on large screens and with longer locales. */
.atlas-home-grid form label > span.font-mono, .atlas-home-grid form span.font-mono,
main form legend.font-mono { font-size: .72rem; letter-spacing: .13em; }
.atlas-home-grid h1 + p { font-size: 1rem; }
@media(min-width:1000px) {
  .atlas-home-grid > div:first-child { padding-inline-start: .6rem; }
  .preview-cert-moon-wrap::after { min-height: 118px; }
}
@media(min-width:768px) and (max-width:999px) {
  .preview-cert { padding-inline: 19px; }
  .preview-cert-inner { background-size: 70px auto; }
}
@media(max-width:600px) {
  .atlas-journey header .text-ink-soft, .atlas-journey label.relative { color: var(--ink); }
  .atlas-journey h1:not(:lang(zh)):not(:lang(ja)) { letter-spacing: -.035em; }
}
