/* EndlessJapan teaser — brand tokens mirror app/globals.css (register v60.8) */
:root {
  --red: #BC002D;
  --cream: #FBF9F5;
  --cream-2: #F4EFE6;
  --ink: #1A1714;
  --mute: #7A7268;
  --line: #E8E2D8;

  --font-display: "DM Serif Display", Georgia, "Times New Roman", serif;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-seal: "Noto Serif JP", "Noto Serif CJK JP", "Hiragino Mincho ProN", "Yu Mincho", serif;

  --pad: clamp(1.5rem, 5vw, 4rem);
  box-sizing: border-box;
}
*, *::before, *::after { box-sizing: inherit; }

html, body { margin: 0; height: 100%; }
body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-synthesis: none; /* DM Serif Display ships one weight: never fake-bold it */
}

/* ---------- Layout: photo first on mobile, side by side on desktop ---------- */
.page {
  min-height: 100svh;
  display: grid;
  grid-template-rows: 52svh auto;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 1024px) {
  .page {
    grid-template-rows: none;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    height: 100svh;
    min-height: 40rem;
  }
  .photo { order: 2; }
  .panel { order: 1; }
}

/* ---------- Photo ---------- */
.photo {
  position: relative;
  margin: 0;
  background: var(--cream-2); /* shows until the real photo lands */
}
.photo__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo__img.is-missing { visibility: hidden; }

/* The one bold element: a red hanko seal, 近日 ("soon"), stamped where photo meets page */
.seal {
  position: absolute;
  right: var(--pad);
  bottom: 0;
  transform: translateY(50%) rotate(-3deg);
  width: 4rem;
  height: 6.25rem;
  background: var(--red);
  color: var(--cream);
  border-radius: 4px;
  box-shadow: inset 0 0 0 3px var(--red), inset 0 0 0 4.5px rgba(251, 249, 245, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.seal__text {
  writing-mode: vertical-rl;
  font-family: var(--font-seal);
  font-weight: 700;
  font-size: 1.6rem;
  line-height: 1.05;
  letter-spacing: 0.05em;
}
@media (min-width: 1024px) {
  .seal {
    right: auto;
    left: 0;
    bottom: 18%;
    transform: translateX(-50%) rotate(-3deg);
    width: 5rem;
    height: 7.75rem;
  }
  .seal__text { font-size: 2rem; }
}

/* Single page-load moment: the seal stamps in */
@media (prefers-reduced-motion: no-preference) {
  .seal { animation: stamp 520ms cubic-bezier(.2,.9,.3,1.2) 350ms both; }
  @keyframes stamp {
    from { opacity: 0; scale: 1.25; }
    to   { opacity: 1; scale: 1; }
  }
}

/* ---------- Text panel ---------- */
.panel {
  display: flex;
  align-items: center;
  padding: calc(var(--pad) + 1.5rem) var(--pad) calc(var(--pad) + env(safe-area-inset-bottom, 0px));
}
.panel__inner { width: 100%; max-width: 30rem; }
@media (min-width: 1024px) {
  .panel { padding: var(--pad) calc(var(--pad) + 1.5rem) var(--pad) var(--pad); justify-content: center; }
}

.wordmark {
  display: block;
  height: 2.5rem;
  width: auto;
  margin-bottom: clamp(2rem, 6vh, 3.5rem);
}

.headline {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  /* Sized so each sentence holds one line on phones (DM Serif Display ≈ 9.2× font-size wide) */
  font-size: clamp(1.75rem, calc((100vw - 3.5rem) / 11), 2.5rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.headline__upright, .headline__italic { display: block; }
.headline__italic { font-style: italic; }

.subcopy {
  margin: 1.25rem 0 0;
  font-size: 1.125rem;
  line-height: 1.5;
  color: var(--mute);
  max-width: 26rem;
}

/* ---------- Signup ---------- */
.signup { margin-top: 2rem; }
.signup__row {
  display: flex;
  gap: 0.5rem;
}
.signup__input {
  flex: 1;
  min-width: 0;
  height: 3.25rem;
  padding: 0 1rem;
  font: inherit;
  font-size: 1rem; /* 16px stops iOS zoom-on-focus */
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.signup__input::placeholder { color: var(--mute); }
.signup__input:focus-visible,
.signup__button:focus-visible,
.social__link:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}
.signup__input[aria-invalid="true"] { border-color: var(--red); }

.signup__button {
  flex: none;
  height: 3.25rem;
  padding: 0 1.4rem;
  font: inherit;
  font-weight: 500;
  color: var(--cream);
  background: var(--ink);
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 150ms ease;
}
.signup__button:hover { background: #33302c; }
.signup__button:disabled { opacity: 0.6; cursor: progress; }

.signup__note {
  margin: 0.75rem 0 0;
  font-size: 0.8125rem;
  color: var(--mute);
}
.signup__status {
  margin: 0.5rem 0 0;
  min-height: 1.25rem;
  font-size: 0.9375rem;
  color: var(--red);
}
.signup__status:empty { min-height: 0; margin: 0; }

/* Success replaces the form row in place */
.signup.is-done .signup__row,
.signup.is-done .signup__note { display: none; }
.signup.is-done .signup__status {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.6rem;
  line-height: 1.2;
  color: var(--ink);
}

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Social ---------- */
.social {
  margin-top: 2.25rem;
  display: flex;
  gap: 0.75rem;
}
.social__link {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.375rem;
  height: 3.375rem;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--ink);
  border-radius: 999px;
  transition: background-color 150ms ease, color 150ms ease;
}
.social__icon { display: block; width: 26px; height: 26px; }
.social__link:hover { background: var(--ink); color: var(--cream); }

.footer {
  margin: 2.5rem 0 0;
  font-size: 0.8125rem;
  color: var(--mute);
}

/* ---------- Desktop overrides (kept last so they win the cascade) ---------- */
@media (min-width: 1024px) {
  .panel__inner { max-width: 38rem; }
  .wordmark { height: 3.75rem; }
  .headline { font-size: clamp(2.25rem, 3.2vw, 3.25rem); }
  .headline__upright, .headline__italic { white-space: nowrap; }
  .subcopy, .signup, .social { max-width: 30rem; }
}
@media (min-width: 1600px) {
  .headline { font-size: clamp(4.5rem, 3.4vw, 6rem); }
  .panel__inner { max-width: 44rem; }
}

/* ---------- Phones: keep the form and both follow links on one screen ---------- */
@media (max-width: 1023px) {
  .page { grid-template-rows: 42svh auto; }
  .panel { padding-top: 1.75rem; }
  .wordmark { margin-bottom: 1.25rem; }
  .subcopy { margin-top: 0.875rem; }
  .signup { margin-top: 1.5rem; }
  .social { margin-top: 1.5rem; }
  .footer { margin-top: 1.5rem; }

  /* Centered mobile option — uncomment to try
  .panel__inner { text-align: center; }
  .wordmark { margin-left: auto; margin-right: auto; }
  .subcopy { margin-left: auto; margin-right: auto; }
  .social { justify-content: center; }
  */
}

/* Short phones (iPhone SE and similar): give the photo a little less */
@media (max-width: 1023px) and (max-height: 720px) {
  .page { grid-template-rows: 33svh auto; }
  .panel { padding-top: 1.25rem; }
  .wordmark { margin-bottom: 1.125rem; }
  .signup { margin-top: 1.25rem; }
  .social { margin-top: 1.25rem; }
  .footer { margin-top: 1.125rem; }
}

/* The seal stamps again when someone signs up */
@media (prefers-reduced-motion: no-preference) {
  .seal.is-restamping { animation: restamp 620ms cubic-bezier(.2,.9,.3,1.2); }
  @keyframes restamp {
    0%   { scale: 1; rotate: 0deg; }
    35%  { scale: 1.22; rotate: -2deg; }
    100% { scale: 1; rotate: 0deg; }
  }
}
