/* English-specific layout and typography tuning.
   Keeps the same atmosphere/tempo while improving English readability. */

html[lang="en-US"] body {
  font-family: var(--font-serif-en-body);
  letter-spacing: 0.02em;
}

html[lang="en-US"] .page-nav .nav-btn,
html[lang="en-US"] .lang-switch,
html[lang="en-US"] .btn,
html[lang="en-US"] .cta {
  font-family: var(--font-serif-en);
}

/* ==================== Index ==================== */
html[lang="en-US"] .hero {
  padding: 12vh 8vw 14vh;
}

html[lang="en-US"] .hero__title {
  font-family: var(--font-serif-en);
  font-size: clamp(56px, 8.2vw, 104px);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

html[lang="en-US"] .hero__lines--vertical {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.15rem;
  margin-left: 0;
  width: min(920px, 92vw);
}

html[lang="en-US"] .hero__line-group {
  flex-direction: column;
  align-items: center;
  gap: 0.16rem;
}

html[lang="en-US"] .hero__lines--vertical .hero__line {
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  font-family: var(--font-serif-en-body);
  font-size: clamp(26px, 2.8vw, 40px);
  line-height: 1.32;
  letter-spacing: 0.05em;
}

html[lang="en-US"] body.page--index .cta--vertical {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  padding: 14px 38px;
  font-size: clamp(20px, 2.1vw, 30px);
  letter-spacing: 0.14em;
}

/* ==================== Birth ==================== */
html[lang="en-US"] .page--birth .page-title {
  font-family: var(--font-serif-en);
  font-size: clamp(50px, 6.2vw, 84px);
  letter-spacing: 0.16em;
  text-indent: 0;
}

html[lang="en-US"] .page--birth .birth-composite-group {
  flex-direction: row;
  gap: clamp(24px, 3vw, 52px);
  align-items: flex-start;
}

html[lang="en-US"] .page--birth .vertical-text {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  height: auto;
  max-width: min(30vw, 360px);
}

html[lang="en-US"] .page--birth .v-line {
  margin: 0;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  font-family: var(--font-serif-en-body);
  font-size: clamp(21px, 2vw, 31px);
  line-height: 1.32;
  letter-spacing: 0.03em;
}

html[lang="en-US"] .page--birth .v-line:first-child {
  font-size: clamp(24px, 2.2vw, 34px);
}

html[lang="en-US"] .page--birth .v-line--focus {
  transform: none;
  margin: 0.45rem 0 0;
  color: var(--ink-text);
  font-family: var(--font-serif-en);
  font-size: clamp(25px, 2.6vw, 36px);
  letter-spacing: 0.14em;
}

html[lang="en-US"] .page--birth .date-grid {
  flex-direction: row;
  gap: clamp(18px, 2.5vw, 32px);
}

html[lang="en-US"] .page--birth .date-col {
  gap: 12px;
}

html[lang="en-US"] .page--birth .date-label {
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  font-family: var(--font-serif-en);
  font-size: clamp(14px, 1.1vw, 18px);
  letter-spacing: 0.12em;
  opacity: 0.75;
}

html[lang="en-US"] .page--birth .date-input {
  width: clamp(96px, 8.8vw, 132px);
  height: auto;
  min-height: 0;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  padding: 8px 6px;
  border-bottom: 1px solid rgba(220, 205, 175, 0.38);
  border-left: none;
  font-family: var(--font-serif-en-body);
  font-size: clamp(24px, 2.5vw, 34px);
  line-height: 1;
  letter-spacing: 0.04em;
}

html[lang="en-US"] .page--birth .date-input::placeholder {
  font-family: var(--font-serif-en-body);
  font-size: 0.68em;
  opacity: 0.28;
}

html[lang="en-US"] .page--birth .error-hint {
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  min-height: 1.5em;
  text-align: center;
  font-family: var(--font-serif-en-body);
  font-size: clamp(16px, 1.4vw, 22px);
  letter-spacing: 0.03em;
}

html[lang="en-US"] .birth-container .birth-cta.cta--vertical {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  margin-right: 0;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  padding: 14px 28px;
  min-height: auto;
  font-size: clamp(18px, 1.8vw, 26px);
  letter-spacing: 0.12em;
}

/* ==================== Select ==================== */
html[lang="en-US"] .page--select {
  --stone-text-size: clamp(10px, calc(var(--stone-size) * 0.18), 15px);
}

html[lang="en-US"] .page--select .page-title {
  font-family: var(--font-serif-en);
  font-size: clamp(42px, 4.4vw, 66px);
  letter-spacing: 0.14em;
  text-indent: 0;
}

html[lang="en-US"] .page--select .instruction-group-in-board {
  left: 50%;
  right: auto;
  top: calc(100% + 28px);
  transform: translateX(-50%);
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

html[lang="en-US"] .page--select .stage-desc,
html[lang="en-US"] .page--select .stage-hint {
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  white-space: nowrap;
  text-align: center;
  transform: none;
}

html[lang="en-US"] .page--select .stage-desc {
  font-family: var(--font-serif-en);
  font-size: clamp(21px, 2vw, 30px);
  letter-spacing: 0.08em;
}

html[lang="en-US"] .page--select .stage-hint {
  font-family: var(--font-serif-en-body);
  font-size: clamp(18px, 1.6vw, 24px);
  letter-spacing: 0.06em;
  gap: 0.35em;
}

html[lang="en-US"] .page--select .stage-hint.reveal.is-visible {
  transform: none;
}

html[lang="en-US"] .page--select .confirm-btn {
  left: 50%;
  top: calc(100% + 96px);
  transform: translateX(-50%);
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  font-size: clamp(17px, 1.5vw, 22px);
  min-height: auto;
  min-width: 220px;
  padding: 12px 24px;
  letter-spacing: 0.1em;
}

html[lang="en-US"] .page--select .confirm-btn:hover,
html[lang="en-US"] .page--select .confirm-btn.visible {
  transform: translateX(-50%);
}

html[lang="en-US"] .page--select .stone-point .stone-text {
  width: calc(var(--stone-size) * 0.9);
  white-space: normal;
  text-align: center;
  line-height: 1.05;
  letter-spacing: 0.01em;
  font-family: var(--font-serif-en-body);
}

/* ==================== Wait ==================== */
html[lang="en-US"] .page--wait .wait-cols {
  flex-direction: column;
  gap: 22px;
  align-items: center;
}

html[lang="en-US"] .page--wait .wait-col--status,
html[lang="en-US"] .page--wait .wait-col--main,
html[lang="en-US"] .page--wait .wait-col--sub {
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  min-height: auto;
  max-height: none;
  min-width: auto;
  width: 100%;
}

html[lang="en-US"] .page--wait .wait-col--status {
  font-family: var(--font-serif-en);
  font-size: clamp(18px, 1.7vw, 24px);
  text-align: center;
  letter-spacing: 0.07em;
}

html[lang="en-US"] .page--wait .wait-col--main {
  position: relative;
  min-height: 190px;
}

html[lang="en-US"] .page--wait .wait-main-group {
  flex-direction: column;
  align-items: center;
}

html[lang="en-US"] .page--wait .wait-line {
  font-family: var(--font-serif-en-body);
  font-size: clamp(26px, 2.9vw, 40px);
  line-height: 1.2;
  text-align: center;
}

html[lang="en-US"] .page--wait .wait-col--sub {
  font-family: var(--font-serif-en-body);
  font-size: clamp(17px, 1.5vw, 22px);
  text-align: center;
  letter-spacing: 0.03em;
}

html[lang="en-US"] .page--wait .wait-sub-line {
  margin: 0.45rem 0 0;
}

html[lang="en-US"] .page--wait .cta--reveal {
  top: auto;
  bottom: 10vh;
  transform: translateX(-50%);
  letter-spacing: 0.12em;
  font-family: var(--font-serif-en);
  font-size: clamp(18px, 1.8vw, 24px);
  padding: 14px 34px;
}

html[lang="en-US"] .page--wait .cta--reveal.is-visible {
  animation: floatRevealEn 2s ease-out forwards;
}

@keyframes floatRevealEn {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(20px) scale(0.95);
  }

  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

/* ==================== Result ==================== */
html[lang="en-US"] .page--result-mirror::before {
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  font-family: var(--font-serif-en);
  font-size: clamp(120px, 16vw, 280px);
  letter-spacing: 0.08em;
  opacity: 0.06;
}

html[lang="en-US"] .page--result-mirror .section-eye .ink-content,
html[lang="en-US"] .page--result-mirror .section-signs .ink-content,
html[lang="en-US"] .page--result-mirror .section-judgment .ink-content,
html[lang="en-US"] .page--result-mirror .section-path .ink-content {
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  font-family: var(--font-serif-en-body);
  text-align: center;
  letter-spacing: 0.03em;
}

html[lang="en-US"] .page--result-mirror .section-eye .ink-content {
  font-size: clamp(34px, 3.6vw, 52px);
  line-height: 1.34;
}

html[lang="en-US"] .page--result-mirror .section-signs .ink-content,
html[lang="en-US"] .page--result-mirror .section-judgment .ink-content {
  font-size: clamp(24px, 2.5vw, 34px);
  line-height: 1.55;
  max-width: 980px;
}

html[lang="en-US"] .page--result-mirror .section-path .ink-content {
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.65;
  max-width: 980px;
}

html[lang="en-US"] .page--result-mirror .result-actions {
  top: auto;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  flex-direction: row;
  gap: 12px;
}

html[lang="en-US"] .page--result-mirror .result-actions .btn {
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  min-width: 0;
  padding: 10px 18px;
  font-family: var(--font-serif-en);
  font-size: 14px;
  letter-spacing: 0.1em;
}

html[lang="en-US"] .page--result-mirror .scroll-cue {
  bottom: 90px;
}

html[lang="en-US"] .page--result-mirror .scroll-cue__text {
  font-family: var(--font-serif-en-body);
  font-size: 20px;
  letter-spacing: 0.07em;
}

html[lang="en-US"] .page--result-mirror .share-card__domain,
html[lang="en-US"] .page--result-mirror .share-card__poem,
html[lang="en-US"] .page--result-mirror .share-card__brand,
html[lang="en-US"] .page--result-mirror .share-panel__title,
html[lang="en-US"] .page--result-mirror .share-platform,
html[lang="en-US"] .page--result-mirror .share-panel__actions .btn,
html[lang="en-US"] .page--result-mirror .report-section__title,
html[lang="en-US"] .page--result-mirror .report-section__content,
html[lang="en-US"] .page--result-mirror .report-domain,
html[lang="en-US"] .page--result-mirror .report-age,
html[lang="en-US"] .page--result-mirror .report-date,
html[lang="en-US"] .page--result-mirror .report-poem,
html[lang="en-US"] .page--result-mirror .report-brand {
  font-family: var(--font-serif-en-body);
}

html[lang="en-US"] .page--result-mirror .share-card__poem {
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  line-height: 1.28;
  letter-spacing: 0.03em;
  width: 78%;
  height: auto;
}

html[lang="en-US"] .page--result-mirror .share-report__header {
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  justify-content: space-between;
  align-items: flex-start;
}

html[lang="en-US"] .page--result-mirror .report-domain {
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

html[lang="en-US"] .page--result-mirror .report-meta {
  align-items: flex-end;
}

html[lang="en-US"] .page--result-mirror .share-report__body {
  gap: 28px;
}

html[lang="en-US"] .page--result-mirror .report-section__title {
  letter-spacing: 0.12em;
}

html[lang="en-US"] .page--result-mirror .report-section__content {
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.85;
  letter-spacing: 0.01em;
  text-indent: 0;
  text-align: left;
}

html[lang="en-US"] .page--result-mirror .share-report__footer {
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  align-items: flex-end;
}

html[lang="en-US"] .page--result-mirror .report-poem {
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  font-size: clamp(28px, 3.1vw, 42px);
  line-height: 1.36;
  letter-spacing: 0.04em;
  padding: 12px 16px;
}

html[lang="en-US"] .page--result-mirror .result-disclaimer {
  font-family: var(--font-serif-en-body);
  line-height: 1.6;
  letter-spacing: 0.02em;
}

html[lang="en-US"] .page--result-mirror .share-card--report.is-capturing .report-section__content {
  font-size: 24px;
  line-height: 1.95;
}

html[lang="en-US"] .page--result-mirror .share-card--report.is-capturing .report-domain {
  font-size: 64px;
}

@media (max-width: 768px) {
  html[lang="en-US"] .lang-switch {
    top: calc(12px + env(safe-area-inset-top));
    right: calc(12px + env(safe-area-inset-right));
  }

  html[lang="en-US"] .hero {
    padding: 9vh 6vw 10vh;
  }

  html[lang="en-US"] body.page--index .cta--vertical {
    width: min(84vw, 320px);
    justify-content: center;
  }

  html[lang="en-US"] .page--birth .birth-stage {
    width: 100%;
  }

  html[lang="en-US"] .page--birth .date-grid {
    width: 100%;
    justify-content: center;
  }

  html[lang="en-US"] .page--birth .date-input {
    width: clamp(84px, 24vw, 116px);
  }

  html[lang="en-US"] .birth-container .birth-cta.cta--vertical {
    width: min(86vw, 340px);
    justify-content: center;
  }

  html[lang="en-US"] .page--select .instruction-group-in-board {
    position: fixed;
    left: 50%;
    right: auto;
    top: auto;
    bottom: calc(84px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    width: 92vw;
  }

  html[lang="en-US"] .page--select .confirm-btn {
    position: fixed;
    left: 50%;
    top: auto;
    bottom: calc(22px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    width: min(88vw, 320px);
  }

  html[lang="en-US"] .page--select .confirm-btn:hover,
  html[lang="en-US"] .page--select .confirm-btn.visible {
    transform: translateX(-50%);
  }

  html[lang="en-US"] .page--wait .wait-content {
    width: min(94vw, 460px);
  }

  html[lang="en-US"] .page--wait .cta--reveal {
    width: min(86vw, 300px);
    padding: 13px 20px;
  }

  html[lang="en-US"] .page--result-mirror .ink-content {
    width: 92vw;
    max-width: none;
    height: auto;
    min-height: 56vh;
    padding: 20px 8px;
  }

  html[lang="en-US"] .page--result-mirror .result-actions {
    width: 94vw;
    justify-content: center;
    gap: 8px;
  }

  html[lang="en-US"] .page--result-mirror .result-actions .btn {
    flex: 1 1 0;
    max-width: 160px;
    padding: 9px 10px;
    font-size: 13px;
  }

  html[lang="en-US"] .page--result-mirror .share-platforms {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  html[lang="en-US"] .page--result-mirror .share-platform {
    font-size: 10px;
    letter-spacing: 0.04em;
  }

  html[lang="en-US"] .page--result-mirror .scroll-cue {
    bottom: calc(78px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 960px) {
  html[lang="en-US"] .page--birth .birth-composite-group {
    flex-direction: column;
    align-items: center;
    gap: 26px;
  }

  html[lang="en-US"] .page--birth .vertical-text {
    max-width: min(90vw, 560px);
    align-items: center;
    text-align: center;
  }

  html[lang="en-US"] .page--select .instruction-group-in-board {
    top: calc(100% + 16px);
  }

  html[lang="en-US"] .page--select .confirm-btn {
    top: calc(100% + 74px);
  }
}

@media (max-width: 600px) {
  html[lang="en-US"] .hero__title {
    letter-spacing: 0.09em;
  }

  html[lang="en-US"] .hero__lines--vertical .hero__line {
    font-size: clamp(21px, 5.2vw, 30px);
  }

  html[lang="en-US"] .page--wait .wait-cols {
    gap: 18px;
  }

  html[lang="en-US"] .page--result-mirror .result-actions {
    bottom: 18px;
    gap: 8px;
  }

  html[lang="en-US"] .page--result-mirror .scroll-cue {
    bottom: 72px;
  }
}

@media (max-width: 480px) {
  html[lang="en-US"] .hero__title {
    font-size: clamp(42px, 11.4vw, 62px);
  }

  html[lang="en-US"] .hero__lines--vertical .hero__line {
    font-size: clamp(19px, 5.4vw, 27px);
  }

  html[lang="en-US"] .page--birth .v-line {
    font-size: clamp(18px, 5vw, 24px);
  }

  html[lang="en-US"] .page--birth .v-line--focus {
    font-size: clamp(21px, 5.6vw, 28px);
  }

  html[lang="en-US"] .page--birth .date-grid {
    gap: 12px;
  }

  html[lang="en-US"] .page--birth .date-input {
    width: clamp(72px, 26vw, 94px);
    font-size: clamp(20px, 6vw, 28px);
  }

  html[lang="en-US"] .page--select .stage-desc {
    font-size: clamp(18px, 5vw, 24px);
  }

  html[lang="en-US"] .page--select .stage-hint {
    font-size: clamp(15px, 4.5vw, 20px);
  }

  html[lang="en-US"] .page--wait .wait-line {
    font-size: clamp(22px, 6.4vw, 30px);
  }

  html[lang="en-US"] .page--result-mirror .result-actions .btn {
    font-size: 12px;
    letter-spacing: 0.06em;
  }
}

/* Variant-scoped mobile EN overrides (isolated from other versions). */
html[data-ui-variant="mobile-en"] .page--select {
  --stone-text-size: clamp(13px, calc(var(--stone-size) * 0.38), 17px);
}

html[data-ui-variant="mobile-en"] .page--select .stone-point .stone-text {
  width: calc(var(--stone-size) * 0.82);
  line-height: 0.92;
  letter-spacing: 0.005em;
  font-weight: 500;
  text-rendering: geometricPrecision;
}

/* ===== EN stability patch (mobile + desktop consistency) ===== */
html[lang="en-US"] .page-nav .nav-label {
  white-space: nowrap;
}

html[lang="en-US"] .page--birth .date-input {
  text-align: center;
  direction: ltr;
  font-variant-numeric: tabular-nums;
}

html[lang="en-US"] .page--select .stone-point .stone-text {
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

html[lang="en-US"] .page--wait .wait-line--offset {
  margin-top: 24px;
}

@media (max-width: 720px) {
  html[lang="en-US"] .page-nav {
    top: calc(10px + env(safe-area-inset-top));
  }

  html[lang="en-US"] .page-nav .nav-btn {
    padding: 8px 12px;
    font-size: 12px;
    letter-spacing: 0.1em;
  }

  html[lang="en-US"] .page--index .hero {
    padding-top: calc(92px + env(safe-area-inset-top));
    padding-bottom: calc(22vh + env(safe-area-inset-bottom));
  }

  html[lang="en-US"] body.page--index .cta--vertical {
    bottom: calc(18px + env(safe-area-inset-bottom));
    width: min(90vw, 332px);
  }

  html[lang="en-US"] .page--birth .birth-container {
    padding-top: calc(88px + env(safe-area-inset-top));
    padding-bottom: calc(20vh + env(safe-area-inset-bottom));
  }

  html[lang="en-US"] .birth-container .birth-cta.cta--vertical {
    bottom: calc(18px + env(safe-area-inset-bottom));
    width: min(90vw, 332px);
  }

  html[lang="en-US"] .page--birth .date-input {
    width: clamp(78px, 23vw, 104px);
    font-size: clamp(22px, 6.2vw, 30px);
  }

  html[lang="en-US"] .page--select .instruction-group-in-board {
    bottom: calc(82px + env(safe-area-inset-bottom));
  }

  html[lang="en-US"] .page--select .confirm-btn {
    bottom: calc(18px + env(safe-area-inset-bottom));
  }

  html[lang="en-US"] .page--select .stone-point .stone-text {
    width: calc(var(--stone-size) * 0.82);
    font-size: clamp(10px, calc(var(--stone-size) * 0.24), 13px);
    line-height: 0.95;
    letter-spacing: 0.005em;
  }

  html[lang="en-US"] .page--wait .wait-wrapper {
    padding-top: calc(92px + env(safe-area-inset-top));
    padding-bottom: calc(22vh + env(safe-area-inset-bottom));
  }

  html[lang="en-US"] .page--wait .wait-cols {
    top: 54%;
  }

  html[lang="en-US"] .page--wait .wait-col--status {
    font-size: clamp(15px, 4vw, 19px);
  }

  html[lang="en-US"] .page--wait .wait-line {
    font-size: clamp(24px, 6vw, 32px);
    line-height: 1.28;
  }

  html[lang="en-US"] .page--wait .wait-line--offset {
    margin-top: 10px;
  }

  html[lang="en-US"] .page--wait .wait-col--sub {
    font-size: clamp(15px, 4.2vw, 19px);
    line-height: 1.45;
  }

  html[lang="en-US"] .page--wait .cta--reveal {
    bottom: calc(18px + env(safe-area-inset-bottom));
    width: min(90vw, 320px);
  }

  html[lang="en-US"] .page--result-mirror .ink-content {
    width: 92vw;
    min-height: 52svh;
    height: auto;
    padding: 18px 10px 10px;
  }

  html[lang="en-US"] .page--result-mirror .section-eye .ink-content {
    font-size: clamp(24px, 6vw, 32px);
    line-height: 1.36;
  }

  html[lang="en-US"] .page--result-mirror .section-signs .ink-content,
  html[lang="en-US"] .page--result-mirror .section-judgment .ink-content {
    font-size: clamp(17px, 4.5vw, 23px);
    line-height: 1.6;
    text-align: left;
  }

  html[lang="en-US"] .page--result-mirror .section-path .ink-content {
    font-size: clamp(16px, 4.2vw, 22px);
    line-height: 1.66;
    text-align: left;
  }

  html[lang="en-US"] .page--result-mirror .result-actions {
    bottom: calc(18px + env(safe-area-inset-bottom));
    width: 95vw;
    gap: 8px;
  }

  html[lang="en-US"] .page--result-mirror .result-actions .btn {
    min-width: 0;
    font-size: 12px;
    padding: 10px 8px;
  }

  html[lang="en-US"] .page--result-mirror .scroll-cue {
    bottom: calc(74px + env(safe-area-inset-bottom));
    width: min(72vw, 240px);
  }

  html[lang="en-US"] .page--result-mirror .scroll-cue__text {
    font-size: 15px;
    letter-spacing: 0.08em;
  }
}

@media (max-width: 420px) {
  html[lang="en-US"] .page--result-mirror .result-actions .btn {
    font-size: 11px;
    letter-spacing: 0.04em;
    padding: 9px 6px;
  }
}
