/* Mode Atlas homepage composition.
   Shared navigation, controls, typography primitives and theme tokens remain
   owned by the shared UI layers. This file owns only the Atlas homepage. */

body.ma-atlas-page{
  margin:0;
  min-height:100vh;
  overflow-x:hidden;
  color:var(--ma-text);
  background:var(--ma-page-bg-atlas);
}
body.ma-atlas-page::before{
  content:"";
  position:fixed;
  inset:0;
  z-index:0;
  pointer-events:none;
  background:
    radial-gradient(circle at 74% 16%,color-mix(in srgb,var(--ma-atlas) 10%,transparent),transparent 30%),
    radial-gradient(circle at 18% 38%,color-mix(in srgb,var(--ma-kana) 5%,transparent),transparent 26%);
}
body.ma-atlas-page::after{
  content:"学";
  position:fixed;
  right:-.08em;
  bottom:-.28em;
  z-index:0;
  pointer-events:none;
  color:color-mix(in srgb,var(--ma-watermark) 62%,transparent);
  font-family:var(--ma-font-jp);
  font-size:clamp(18rem,34vw,34rem);
  font-weight:900;
  line-height:1;
  transform:rotate(-8deg);
}
.ma-atlas-page a{color:inherit;}
.ma-atlas-page .shell{--ma-page-max:var(--ma-content-max);padding-bottom:var(--ma-space-8);}
[data-ma-home-visitor][hidden],[data-ma-home-user][hidden]{display:none!important;}

/* Hero */
.atlas-hero{padding-block:clamp(48px,7vw,96px) clamp(54px,8vw,108px);}
.atlas-hero__stage{
  position:relative;
  display:grid;
  grid-template-columns:minmax(0,.94fr) minmax(420px,1.06fr);
  align-items:center;
  gap:clamp(48px,7vw,104px);
}
.atlas-hero__copy{position:relative;z-index:2;min-width:0;}
.atlas-eyebrow{
  --ma-kicker-color:var(--ma-atlas);
  display:inline-flex;
  align-items:center;
  gap:10px;
  margin-bottom:20px;
}
.atlas-eyebrow::before{
  content:"";
  width:7px;
  height:7px;
  border-radius:50%;
  background:var(--ma-reading);
  box-shadow:0 0 18px color-mix(in srgb,var(--ma-reading) 48%,transparent);
}
.atlas-hero h1{
  max-width:9.4ch;
  margin:0;
  color:var(--ma-text-strong);
  font-family:var(--ma-font-display);
  font-size:clamp(3.5rem,7vw,6.5rem);
  font-weight:860;
  letter-spacing:-.072em;
  line-height:.9;
  text-wrap:balance;
}
.atlas-hero__lead{
  max-width:620px;
  margin:clamp(24px,3vw,34px) 0 0;
  color:var(--ma-text-soft);
  font-size:clamp(1.02rem,1.6vw,1.2rem);
  line-height:1.65;
}
.atlas-hero__actions{
  --ma-action-gap:18px;
  align-items:center;
  margin-top:clamp(28px,4vw,42px);
}
.atlas-primary-action,
.atlas-product--kana .atlas-product__action{
  --ma-button-bg:linear-gradient(180deg,color-mix(in srgb,var(--ma-atlas) 34%,var(--ma-card-2)),color-mix(in srgb,var(--ma-atlas) 20%,var(--ma-card-3)));
  --ma-button-bg-hover:linear-gradient(180deg,color-mix(in srgb,var(--ma-atlas) 42%,var(--ma-card-2)),color-mix(in srgb,var(--ma-atlas) 26%,var(--ma-card-3)));
  --ma-button-border:color-mix(in srgb,var(--ma-atlas) 56%,var(--ma-border));
}
.atlas-text-link{
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-height:40px;
  color:var(--ma-text-soft);
  font-size:.9rem;
  font-weight:800;
  text-decoration:none;
}
.atlas-text-link:hover{color:var(--ma-text-strong);}
.atlas-text-link:focus-visible{outline:3px solid var(--ma-focus-ring);outline-offset:4px;border-radius:8px;}
.atlas-text-link--returning{margin-top:18px;}

.home-continue{
  max-width:620px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  margin-top:clamp(28px,4vw,42px);
  padding:18px 0;
  border-block:1px solid var(--ma-border);
}
.home-continue__copy{min-width:0;display:grid;gap:5px;}
.home-continue__copy .ma-kicker{--ma-kicker-color:var(--ma-atlas);}
.home-continue__copy strong{
  overflow:hidden;
  color:var(--ma-text-strong);
  font-family:var(--ma-font-display);
  font-size:clamp(1.25rem,2vw,1.55rem);
  text-overflow:ellipsis;
  white-space:nowrap;
}
.home-continue__copy>span:last-child{color:var(--ma-muted);font-size:var(--ma-text-sm);font-weight:700;}
.home-continue__action{flex:0 0 auto;}

/* Editorial product preview rather than a decorative constellation. */
.atlas-showcase{
  position:relative;
  min-height:520px;
  isolation:isolate;
}
.atlas-showcase__glow{
  position:absolute;
  inset:10% 4% 3% 10%;
  z-index:-1;
  border-radius:42%;
  background:radial-gradient(circle,color-mix(in srgb,var(--ma-atlas) 20%,transparent),transparent 66%);
  filter:blur(22px);
}
.atlas-preview{
  position:absolute;
  box-sizing:border-box;
  border:1px solid var(--ma-border-strong);
  border-radius:22px;
  background:linear-gradient(180deg,color-mix(in srgb,var(--ma-card-2) 94%,transparent),color-mix(in srgb,var(--ma-card-3) 97%,transparent));
  box-shadow:0 24px 68px color-mix(in srgb,#000 28%,transparent);
  backdrop-filter:blur(16px);
}
.atlas-preview__top{
  min-height:42px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:0 16px;
  border-bottom:1px solid var(--ma-border);
  color:var(--ma-muted);
  font-size:.73rem;
  font-weight:850;
  letter-spacing:.03em;
}
.atlas-preview__dot{width:7px;height:7px;border-radius:50%;background:var(--ma-reading);}
.atlas-preview--reading{
  z-index:3;
  left:0;
  top:58px;
  width:min(70%,390px);
  min-height:344px;
  padding-bottom:22px;
  transform:rotate(-2.5deg);
}
.atlas-preview__prompt{
  display:grid;
  place-items:center;
  min-height:156px;
  color:var(--ma-text-strong);
  font-family:var(--ma-font-jp);
  font-size:6rem;
  font-weight:800;
}
.atlas-preview__answer{
  width:46%;
  margin:0 auto;
  padding:10px 14px;
  border:1px solid var(--ma-border);
  border-radius:12px;
  background:var(--ma-surface-inset);
  color:var(--ma-text-soft);
  font-size:1rem;
  font-weight:800;
  text-align:center;
}
.atlas-preview__caption{margin-top:18px;color:var(--ma-muted);font-size:.74rem;font-weight:750;text-align:center;}
.atlas-preview--words{
  z-index:4;
  right:0;
  top:12px;
  width:min(59%,330px);
  min-height:254px;
  overflow:hidden;
  transform:rotate(2.2deg);
}
.atlas-word-preview{display:grid;grid-template-columns:minmax(0,.4fr) minmax(0,1fr);gap:12px;padding:14px 16px;border-bottom:1px solid var(--ma-border);}
.atlas-word-preview:last-child{border-bottom:0;}
.atlas-word-preview strong{color:var(--ma-text-strong);font-family:var(--ma-font-jp);font-size:1.05rem;}
.atlas-word-preview span{color:var(--ma-muted);font-size:.75rem;align-self:center;}
.atlas-preview--writing{
  z-index:5;
  right:4%;
  bottom:16px;
  width:min(61%,350px);
  min-height:214px;
  transform:rotate(-1deg);
}
.atlas-writing-preview{display:grid;gap:20px;padding:24px 22px;}
.atlas-writing-preview>span{color:var(--ma-text-strong);font-family:var(--ma-font-display);font-size:2.1rem;font-weight:850;text-align:center;}
.atlas-writing-preview>div{display:grid;grid-template-columns:repeat(4,1fr);gap:7px;}
.atlas-writing-preview b{display:grid;place-items:center;min-height:48px;border:1px solid var(--ma-border);border-radius:10px;background:var(--ma-surface-inset);color:var(--ma-text-soft);font-family:var(--ma-font-jp);font-size:1.2rem;}
.atlas-writing-preview b:first-child{border-color:color-mix(in srgb,var(--ma-writing) 52%,var(--ma-border));background:color-mix(in srgb,var(--ma-writing) 15%,var(--ma-card-3));color:var(--ma-text-strong);}

/* Product sections */
.atlas-tools{padding-block:clamp(44px,7vw,92px);}
.atlas-section-intro{max-width:760px;margin-bottom:clamp(42px,6vw,72px);}
.section-kicker{color:var(--ma-atlas);font-size:var(--ma-text-xs);font-weight:900;letter-spacing:.13em;text-transform:uppercase;}
.atlas-section-intro h2,.atlas-future h2{
  margin:8px 0 0;
  color:var(--ma-text-strong);
  font-family:var(--ma-font-display);
  font-size:clamp(2.25rem,4.5vw,4.1rem);
  font-weight:850;
  letter-spacing:-.055em;
  line-height:.98;
}
.atlas-section-intro p,.atlas-future__copy p{max-width:620px;margin:18px 0 0;color:var(--ma-muted);font-size:1rem;line-height:1.65;}
.atlas-product{
  position:relative;
  display:grid;
  grid-template-columns:minmax(0,.92fr) minmax(380px,1.08fr);
  align-items:center;
  gap:clamp(42px,7vw,100px);
  min-height:430px;
  padding-block:clamp(46px,7vw,84px);
  border-top:1px solid var(--ma-border);
}
.atlas-product:last-child{border-bottom:1px solid var(--ma-border);}
.atlas-product--words .atlas-product__copy{order:2;}
.atlas-product--words .atlas-product__visual{order:1;}
.atlas-product__meta{display:flex;align-items:center;gap:12px;color:var(--ma-muted);font-size:.75rem;font-weight:900;letter-spacing:.1em;text-transform:uppercase;}
.atlas-availability{padding:4px 8px;border:1px solid color-mix(in srgb,var(--ma-success) 32%,var(--ma-border));border-radius:var(--ma-radius-pill);background:var(--ma-status-success-bg);color:var(--ma-success);font-size:.65rem;letter-spacing:.06em;}
.atlas-product h3{max-width:12ch;margin:18px 0 0;color:var(--ma-text-strong);font-family:var(--ma-font-display);font-size:clamp(2.15rem,4vw,3.8rem);font-weight:850;letter-spacing:-.055em;line-height:.98;}
.atlas-product__copy>p{max-width:560px;margin:20px 0 0;color:var(--ma-text-soft);font-size:1rem;line-height:1.68;}
.atlas-product__action{margin-top:28px;}
.atlas-product--words .atlas-product__action{--ma-button-bg:linear-gradient(180deg,color-mix(in srgb,var(--ma-words) 28%,var(--ma-card-2)),color-mix(in srgb,var(--ma-words) 16%,var(--ma-card-3)));--ma-button-bg-hover:linear-gradient(180deg,color-mix(in srgb,var(--ma-words) 36%,var(--ma-card-2)),color-mix(in srgb,var(--ma-words) 22%,var(--ma-card-3)));--ma-button-border:color-mix(in srgb,var(--ma-words) 50%,var(--ma-border));}
.atlas-product__visual{min-width:0;}
.atlas-kana-visual{display:grid;gap:12px;padding:clamp(22px,3vw,34px);border-radius:26px;background:linear-gradient(145deg,color-mix(in srgb,var(--ma-kana) 10%,transparent),transparent 58%),color-mix(in srgb,var(--ma-card-2) 72%,transparent);}
.atlas-mode-card{display:grid;grid-template-columns:58px minmax(0,1fr);align-items:center;gap:18px;min-height:78px;padding:13px 18px;border:1px solid var(--ma-border);border-radius:16px;background:color-mix(in srgb,var(--ma-card-2) 92%,transparent);}
.atlas-mode-card>span{display:grid;place-items:center;width:50px;height:50px;border-radius:14px;background:var(--ma-surface-inset);color:var(--ma-text-strong);font-family:var(--ma-font-jp);font-size:1.4rem;font-weight:900;}
.atlas-mode-card strong{display:block;color:var(--ma-text-strong);font-size:.93rem;}
.atlas-mode-card small{display:block;margin-top:4px;color:var(--ma-muted);font-size:.75rem;line-height:1.35;}
.atlas-mode-card--reading>span{border:1px solid color-mix(in srgb,var(--ma-reading) 42%,var(--ma-border));}
.atlas-mode-card--writing>span{border:1px solid color-mix(in srgb,var(--ma-writing) 42%,var(--ma-border));}
.atlas-mode-card--results>span{border:1px solid color-mix(in srgb,var(--ma-results) 42%,var(--ma-border));}
.atlas-bank-visual{padding:clamp(18px,3vw,30px);border-radius:26px;background:linear-gradient(145deg,color-mix(in srgb,var(--ma-words) 11%,transparent),transparent 60%),color-mix(in srgb,var(--ma-card-2) 72%,transparent);}
.atlas-bank-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:20px;padding:18px 8px;border-bottom:1px solid var(--ma-border);}
.atlas-bank-row>div{display:flex;align-items:baseline;gap:14px;min-width:0;}
.atlas-bank-row strong{color:var(--ma-text-strong);font-family:var(--ma-font-jp);font-size:1.25rem;}
.atlas-bank-row span{color:var(--ma-muted);font-size:.78rem;}
.atlas-bank-row>span{color:var(--ma-text-soft);font-size:.84rem;font-weight:750;}
.atlas-bank-note{padding:18px 8px 4px;color:var(--ma-muted);font-size:.75rem;font-weight:800;letter-spacing:.04em;}

/* Benefits stay intentionally border-light. */
.atlas-benefits{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:clamp(28px,5vw,64px);padding-block:clamp(58px,8vw,104px);}
.atlas-benefit{min-width:0;}
.atlas-benefit::before{content:"";display:block;width:42px;height:2px;margin-bottom:22px;background:color-mix(in srgb,var(--ma-atlas) 62%,transparent);}
.atlas-benefit strong{display:block;margin-top:10px;color:var(--ma-text-strong);font-family:var(--ma-font-display);font-size:clamp(1.35rem,2.2vw,1.85rem);letter-spacing:-.035em;line-height:1.08;}
.atlas-benefit p{margin:14px 0 0;color:var(--ma-muted);font-size:.92rem;line-height:1.65;}

.atlas-future{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:clamp(36px,7vw,92px);padding-block:clamp(52px,7vw,88px);border-block:1px solid var(--ma-border);}
.atlas-future h2{max-width:10ch;font-size:clamp(2.1rem,4vw,3.6rem);}
.atlas-future__list{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:10px;max-width:520px;}
.atlas-future__list span{padding:10px 13px;border:1px solid var(--ma-border);border-radius:var(--ma-radius-pill);background:color-mix(in srgb,var(--ma-card-3) 54%,transparent);color:var(--ma-text-soft);font-size:.8rem;font-weight:800;}

.footer{display:flex;justify-content:space-between;gap:var(--ma-space-4);padding:var(--ma-space-6) 0 var(--ma-space-4);color:var(--ma-muted);font-size:.78rem;line-height:1.5;}
.footer strong{color:var(--ma-text-soft);}.footer a{text-decoration:none;}.footer a:hover{text-decoration:underline;}

@media(max-width:980px){
  .atlas-hero__stage{grid-template-columns:1fr;gap:44px;}
  .atlas-hero h1{max-width:11ch;}
  .atlas-showcase{min-height:450px;max-width:690px;width:100%;margin-inline:auto;}
  .atlas-product{grid-template-columns:1fr;gap:38px;min-height:0;}
  .atlas-product--words .atlas-product__copy,.atlas-product--words .atlas-product__visual{order:initial;}
  .atlas-product__visual{max-width:720px;width:100%;}
  .atlas-future{grid-template-columns:1fr;align-items:start;}
  .atlas-future__list{justify-content:flex-start;}
}
@media(max-width:720px){
  body.ma-atlas-page::after{display:none;}
  .atlas-hero{padding-top:38px;}
  .atlas-hero h1{font-size:clamp(3rem,14vw,5rem);}
  .atlas-hero__actions{align-items:stretch;flex-direction:column;}
  .atlas-hero__actions .ma-button{width:100%;}
  .home-continue{align-items:stretch;flex-direction:column;}
  .home-continue__action{width:100%;}
  .atlas-showcase{min-height:390px;}
  .atlas-preview--reading{left:0;top:48px;width:68%;min-height:284px;}
  .atlas-preview__prompt{min-height:126px;font-size:4.8rem;}
  .atlas-preview--words{right:0;width:56%;min-height:214px;}
  .atlas-word-preview{grid-template-columns:1fr;gap:3px;padding:11px 13px;}
  .atlas-preview--writing{right:2%;bottom:2px;width:62%;min-height:178px;}
  .atlas-writing-preview{gap:15px;padding:18px 16px;}.atlas-writing-preview>span{font-size:1.7rem;}.atlas-writing-preview b{min-height:40px;}
  .atlas-product{padding-block:48px;}.atlas-product h3{max-width:14ch;}.atlas-product__action{width:100%;}
  .atlas-benefits{grid-template-columns:1fr;gap:42px;}
  .footer{flex-direction:column;}
}
@media(max-width:480px){
  .atlas-showcase{min-height:350px;}
  .atlas-preview{border-radius:17px;}
  .atlas-preview--reading{width:72%;}.atlas-preview--words{width:58%;}.atlas-preview--writing{width:67%;}
  .atlas-preview__top{min-height:36px;padding-inline:12px;font-size:.65rem;}
  .atlas-preview__prompt{min-height:110px;font-size:4.2rem;}
  .atlas-preview__answer{padding:8px 10px;}
  .atlas-preview__caption{margin-top:12px;font-size:.65rem;}
  .atlas-product__meta{align-items:flex-start;flex-direction:column;gap:8px;}
  .atlas-mode-card{grid-template-columns:50px minmax(0,1fr);padding-inline:13px;}.atlas-mode-card>span{width:44px;height:44px;}
  .atlas-bank-row>div{align-items:flex-start;flex-direction:column;gap:3px;}
}
/* Saved display modes own the page composition as well as the global shell.
   This keeps Tablet and Phone visually distinct even on a wider device. */
body[data-effective-display-mode="tablet"].ma-atlas-page .shell{--ma-page-max:1100px;}
body[data-effective-display-mode="tablet"] .atlas-hero{padding-block:56px 72px;}
body[data-effective-display-mode="tablet"] .atlas-hero__stage{grid-template-columns:minmax(0,1fr) minmax(340px,.82fr);gap:42px;}
body[data-effective-display-mode="tablet"] .atlas-hero h1{max-width:9.6ch;font-size:clamp(4rem,7vw,5.4rem);}
body[data-effective-display-mode="tablet"] .atlas-hero__lead{max-width:560px;margin-top:22px;font-size:1.04rem;}
body[data-effective-display-mode="tablet"] .home-continue{margin-top:28px;}
body[data-effective-display-mode="tablet"] .atlas-showcase{min-height:430px;}
body[data-effective-display-mode="tablet"] .atlas-tools{padding-block:58px;}
body[data-effective-display-mode="tablet"] .atlas-section-intro{margin-bottom:44px;}
body[data-effective-display-mode="tablet"] .atlas-section-intro h2,
body[data-effective-display-mode="tablet"] .atlas-future h2{font-size:clamp(2.7rem,5vw,3.7rem);}
body[data-effective-display-mode="tablet"] .atlas-product{grid-template-columns:minmax(0,.92fr) minmax(340px,1.08fr);gap:44px;min-height:370px;padding-block:56px;}
body[data-effective-display-mode="tablet"] .atlas-product h3{font-size:clamp(2.45rem,4.5vw,3.35rem);}
body[data-effective-display-mode="tablet"] .atlas-future{padding-block:58px;}

body[data-effective-display-mode="phone"].ma-atlas-page .shell{--ma-page-max:none;}
body[data-effective-display-mode="phone"] .atlas-hero{padding-block:28px 42px;}
body[data-effective-display-mode="phone"] .atlas-hero__stage{grid-template-columns:1fr;gap:26px;}
body[data-effective-display-mode="phone"] .atlas-eyebrow{margin-bottom:14px;}
body[data-effective-display-mode="phone"] .atlas-hero h1{max-width:10ch;font-size:clamp(2.85rem,12.5vw,3.35rem);line-height:.92;}
body[data-effective-display-mode="phone"] .atlas-hero__lead{margin-top:18px;font-size:.96rem;line-height:1.55;}
body[data-effective-display-mode="phone"] .home-continue{gap:12px;margin-top:22px;padding:14px 0;}
body[data-effective-display-mode="phone"] .atlas-text-link--returning{margin-top:12px;}
body[data-effective-display-mode="phone"] .atlas-showcase{min-height:320px;}
body[data-effective-display-mode="phone"] .atlas-preview--reading{top:36px;min-height:250px;}
body[data-effective-display-mode="phone"] .atlas-preview__prompt{min-height:94px;font-size:3.8rem;}
body[data-effective-display-mode="phone"] .atlas-preview--words{min-height:188px;}
body[data-effective-display-mode="phone"] .atlas-preview--writing{min-height:154px;}
body[data-effective-display-mode="phone"] .atlas-writing-preview{gap:11px;padding:14px 12px;}
body[data-effective-display-mode="phone"] .atlas-writing-preview>span{font-size:1.5rem;}
body[data-effective-display-mode="phone"] .atlas-writing-preview b{min-height:36px;}
body[data-effective-display-mode="phone"] .atlas-tools{padding-block:38px;}
body[data-effective-display-mode="phone"] .atlas-section-intro{margin-bottom:30px;}
body[data-effective-display-mode="phone"] .atlas-section-intro h2,
body[data-effective-display-mode="phone"] .atlas-future h2{font-size:2.35rem;}
body[data-effective-display-mode="phone"] .atlas-section-intro p,
body[data-effective-display-mode="phone"] .atlas-future__copy p{margin-top:13px;font-size:.94rem;line-height:1.55;}
body[data-effective-display-mode="phone"] .atlas-product{grid-template-columns:1fr;gap:26px;min-height:0;padding-block:38px;}
body[data-effective-display-mode="phone"] .atlas-product--words .atlas-product__copy,
body[data-effective-display-mode="phone"] .atlas-product--words .atlas-product__visual{order:initial;}
body[data-effective-display-mode="phone"] .atlas-product h3{margin-top:13px;font-size:2.35rem;}
body[data-effective-display-mode="phone"] .atlas-product__copy>p{margin-top:14px;font-size:.94rem;line-height:1.55;}
body[data-effective-display-mode="phone"] .atlas-product__action{margin-top:20px;}
body[data-effective-display-mode="phone"] .atlas-kana-visual{padding:16px;}
body[data-effective-display-mode="phone"] .atlas-mode-card{min-height:68px;gap:12px;padding:10px 12px;}
body[data-effective-display-mode="phone"] .atlas-benefits{gap:30px;padding-block:40px;}
body[data-effective-display-mode="phone"] .atlas-future{gap:26px;padding-block:42px;}

@media(max-width:900px){
  body[data-effective-display-mode="tablet"] .atlas-hero__stage{grid-template-columns:1fr;gap:32px;}
  body[data-effective-display-mode="tablet"] .atlas-showcase{min-height:390px;max-width:720px;width:100%;margin-inline:auto;}
  body[data-effective-display-mode="tablet"] .atlas-product{grid-template-columns:1fr;gap:32px;min-height:0;}
  body[data-effective-display-mode="tablet"] .atlas-product--words .atlas-product__copy,
  body[data-effective-display-mode="tablet"] .atlas-product--words .atlas-product__visual{order:initial;}
  body[data-effective-display-mode="tablet"] .atlas-product__visual{max-width:760px;width:100%;}
}

@media(prefers-reduced-motion:reduce){.atlas-preview{transform:none;}}
