/* ==========================================================
   やまさんの日々の糧 — 登録LP
   色・書体・余白は :root の変数にまとめています。
   将来 yamalog 本体へ展開するときは、この変数をそのまま流用できます。
   ========================================================== */

:root {
  /* 色 */
  --color-bg: #faf8f4;          /* オフホワイト */
  --color-surface: #ffffff;
  --color-tint: #f2ede5;        /* 淡いベージュ */
  --color-line: #e2dcd2;        /* 淡いグレーベージュの罫線 */
  --color-text: #232220;        /* チャコール */
  --color-text-sub: #5f5b55;
  --color-accent: #8a2b2b;      /* 落ち着いた深い赤 */
  --color-accent-dark: #6f2020;
  --color-ink: #1d1c1a;         /* 締めのセクションとフッターの地色 */
  --color-on-ink: #f4f0e9;
  --color-on-ink-sub: #b3ada3;
  --color-accent-on-ink: #d9968c;

  /* 書体（外部フォントを読み込まず、端末の日本語フォントを使用） */
  --font-serif: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP",
    "Noto Serif CJK JP", "Source Han Serif JP", serif;
  --font-sans: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic Medium",
    "Yu Gothic", "Noto Sans JP", "Noto Sans CJK JP", Meiryo, sans-serif;
  --font-num: "Didot", "Bodoni 72", "Playfair Display", Georgia, "Times New Roman", serif;

  /* 余白・幅 */
  --gutter: 24px;
  --width: 1000px;
  --width-narrow: 680px;
  --section-space: clamp(72px, 12vw, 136px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.9;
  letter-spacing: 0.04em;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere;
  line-break: strict;
}

h1, h2, h3, p, ul, dl, dd {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--color-accent);
  text-underline-offset: 0.25em;
  text-decoration-thickness: 1px;
}

a:hover {
  color: var(--color-accent-dark);
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* 見出しなどは <wbr> の位置でだけ折り返す */
.hero__title,
.hero__lead,
.section__title,
.closing__text {
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.container {
  width: 100%;
  max-width: calc(var(--width) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
}

.container--narrow {
  max-width: calc(var(--width-narrow) + var(--gutter) * 2);
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 10;
  padding: 8px 16px;
  background: var(--color-text);
  color: #fff;
  font-size: 14px;
  text-decoration: none;
  border-radius: 4px;
}

.skip-link:focus {
  top: 12px;
  color: #fff;
}

/* ---------- ① ファーストビュー ---------- */

.hero {
  position: relative;
  padding-block: clamp(28px, 7vw, 88px) clamp(40px, 8vw, 96px);
  text-align: center;
  border-top: 3px solid var(--color-accent);
  border-bottom: 1px solid var(--color-line);
}

/* 背景にうっすら置く「糧」の一文字 */
/* （.hero 自体を overflow:hidden にすると #subscribe へのスクロールが効かなくなるため、背景用の枠を分けています） */
.hero__bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero__bg::before {
  content: "糧";
  position: absolute;
  top: -0.2em;
  right: -0.18em;
  z-index: 0;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: min(78vw, 620px);
  line-height: 1;
  letter-spacing: 0;
  color: rgba(138, 43, 43, 0.04);
  pointer-events: none;
  user-select: none;
}

.hero__inner {
  position: relative;
  z-index: 1;
}

.hero__visual {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.hero__photo {
  position: relative;
  width: 72px;
  height: 72px;
}

.hero__photo::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 1px solid var(--color-accent);
  border-radius: 50%;
  opacity: 0.55;
}

.hero__img,
.author__img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: var(--color-tint);
}

.hero__motto {
  display: none;
}

.label {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--color-accent);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.7;
  letter-spacing: 0.24em;
}

.label::before,
.label::after {
  content: "";
  width: 24px;
  height: 1px;
  background: currentColor;
}

.hero__title {
  margin-top: 12px;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(32px, 8.4vw, 60px);
  line-height: 1.3;
  letter-spacing: 0.08em;
}

.hero__catch {
  margin-top: 10px;
  font-family: var(--font-serif);
  font-size: clamp(16px, 4.2vw, 21px);
  letter-spacing: 0.14em;
  color: var(--color-accent);
}

.hero__lead {
  margin-top: 16px;
  font-size: 15px;
  line-height: 1.95;
  color: var(--color-text-sub);
}

.subscribe {
  max-width: 480px;
  margin: 22px auto 0;
  /* 「無料で購読する」から戻ったとき、メルマガ名とフォームが一緒に見える位置で止める */
  scroll-margin-top: 45vh;
}

.subscribe:focus {
  outline: none;
}

.subscribe__frame {
  padding: 4px 8px;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(35, 34, 32, 0.04), 0 14px 36px rgba(35, 34, 32, 0.08);
}

/* iframe の中身（Substack側）は変更せず、外枠の幅だけレスポンシブにします */
.subscribe__iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  border: 0;
  background: transparent;
}

.subscribe__note {
  margin-top: 14px;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--color-text-sub);
}

.subscribe__after {
  font-size: 12px;
  line-height: 1.7;
  color: var(--color-text-sub);
}

.subscribe__fallback {
  margin-top: 2px;
  font-size: 13px;
}

/* フォームが出ない環境のための保険。困った人だけが気づく程度に控えめに */
.subscribe__fallback a {
  display: inline-block;
  padding: 10px 6px;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: #78736b;
  text-decoration-color: rgba(120, 115, 107, 0.4);
  text-underline-offset: 0.35em;
}

.subscribe__fallback a:hover {
  color: var(--color-accent);
}

/* 画面の低い端末では、フォームを優先して写真を省く */
@media (max-height: 620px) and (max-width: 899px) {
  .hero__visual {
    display: none;
  }
}

/* ---------- 共通セクション ---------- */

.section {
  padding-block: var(--section-space);
}

.section--tint {
  background: var(--color-tint);
}

.section__eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--color-accent);
}

.section__eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
}

.section__title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(24px, 6.2vw, 36px);
  line-height: 1.55;
  letter-spacing: 0.08em;
}

.prose {
  margin-top: 32px;
}

.prose p + p {
  margin-top: 1.5em;
}

.prose--small {
  margin-top: 14px;
  font-size: 15px;
}

.prose--small p + p {
  margin-top: 1em;
}

/* ---------- ③ テーマ ---------- */

.themes {
  display: grid;
  grid-template-columns: 1fr;
  margin-top: 36px;
  border-top: 1px solid var(--color-text);
}

.theme {
  display: grid;
  grid-template-columns: 56px 1fr;
  column-gap: 12px;
  padding: 26px 4px 28px;
  border-bottom: 1px solid var(--color-line);
}

.theme__num {
  grid-row: span 2;
  font-family: var(--font-num);
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: 0.02em;
  color: var(--color-accent);
}

.theme__title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 20px;
  line-height: 1.5;
  letter-spacing: 0.1em;
}

.theme__text {
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.85;
  color: var(--color-text-sub);
}

.facts {
  margin-top: 44px;
  padding: 8px 22px;
  background: var(--color-bg);
  border-radius: 8px;
}

.facts__row {
  display: grid;
  grid-template-columns: 4.5em 1fr;
  gap: 12px;
  padding: 16px 0;
  font-size: 15px;
  line-height: 1.8;
}

.facts__row + .facts__row {
  border-top: 1px solid var(--color-line);
}

.facts dt {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--color-accent);
}

.facts dd {
  color: var(--color-text-sub);
}

/* ---------- ④ 書いている人 ---------- */

.author {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: 36px;
}

.author__photo {
  position: relative;
  width: 112px;
  height: 112px;
}

.author__photo::after {
  content: "";
  position: absolute;
  inset: -7px;
  border: 1px solid var(--color-accent);
  border-radius: 50%;
  opacity: 0.5;
}

.author__name {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: 0.12em;
}

.motto {
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--color-accent);
  white-space: nowrap;
}

/* 「なぜ、書くのか。」— 本人の言葉として、罫線で区切って読ませる */
.why {
  margin-top: 56px;
  padding-top: 40px;
  border-top: 1px solid var(--color-line);
}

.why__title {
  position: relative;
  padding-left: 18px;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(20px, 5.2vw, 24px);
  line-height: 1.6;
  letter-spacing: 0.1em;
}

.why__title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.3em;
  bottom: 0.3em;
  width: 2px;
  background: var(--color-accent);
}

.why__body {
  margin-top: 24px;
  font-family: var(--font-serif);
  line-height: 2.1;
}

.why__sign {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 28px;
  font-family: var(--font-serif);
  font-size: 15px;
  letter-spacing: 0.16em;
  color: var(--color-text-sub);
}

.why__sign::before {
  content: "";
  width: 32px;
  height: 1px;
  background: var(--color-accent);
}

@media (min-width: 640px) {
  .why {
    margin-top: 72px;
    padding-top: 56px;
  }

}

/* ---------- ⑤ 最後の登録案内 ---------- */

.section--closing {
  position: relative;
  overflow: hidden;
  text-align: center;
  background: var(--color-ink);
  color: var(--color-on-ink);
}

.section--closing::before {
  content: "糧";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -52%);
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: min(90vw, 560px);
  line-height: 1;
  letter-spacing: 0;
  color: rgba(244, 240, 233, 0.035);
  pointer-events: none;
  user-select: none;
}

/* --- 背景写真つきの版（.section--closing-photo） --- */
.section--closing-photo::before {
  content: none;
}

/* スマホでは上部の帯にだけ写真を置き、見出しは顔の下から始める */
.closing__bg {
  position: absolute;
  inset: 0 0 auto 0;
  height: 330px;
  display: block;
  overflow: hidden;
  /* 写真そのものを下に向かって透明にする（下端に線が残らないように） */
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 94%);
  mask-image: linear-gradient(to bottom, #000 55%, transparent 94%);
}

.closing__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 10%;
  opacity: 0.5;
}

/* 文字が読めるよう、下に向かって地色に溶かす */
.closing__bg::after {
  content: "";
  position: absolute;
  inset: 0 0 -2px 0; /* 下端に写真の線が残らないよう少しはみ出させる */
  background: linear-gradient(
    to bottom,
    rgba(29, 28, 26, 0.15) 0%,
    rgba(29, 28, 26, 0.25) 45%,
    rgba(29, 28, 26, 0.8) 74%,
    var(--color-ink) 92%
  );
}

.section--closing-photo {
  padding-top: 286px;
}

@media (min-width: 900px) {
  .section--closing-photo {
    padding-top: var(--section-space);
  }

  /* PCでは右側に寄せ、左に向かって溶かす */
  .closing__bg {
    inset: 0 0 0 auto;
    height: auto;
    width: min(46%, 620px);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 40%);
    mask-image: linear-gradient(to right, transparent 0%, #000 40%);
  }

  .closing__bg img {
    object-position: 50% 22%;
    opacity: 0.5;
  }

  .closing__bg::after {
    background:
      linear-gradient(to right, var(--color-ink) 0%, rgba(29, 28, 26, 0.55) 45%, rgba(29, 28, 26, 0.2) 100%),
      linear-gradient(to bottom, rgba(29, 28, 26, 0) 60%, var(--color-ink) 100%);
  }
}

.section--closing .container {
  position: relative;
}

.closing__text {
  margin-top: 24px;
  color: var(--color-on-ink-sub);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  max-width: 320px;
  min-height: 58px;
  margin-top: 36px;
  padding: 14px 32px;
  background: var(--color-on-ink);
  color: var(--color-ink);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-decoration: none;
  border-radius: 999px;
  transition: background-color 0.2s ease, transform 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.button::after {
  content: "";
  width: 7px;
  height: 7px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: rotate(-45deg) translate(-1px, 1px);
  transition: transform 0.2s ease;
}

.button:hover {
  background: #fff;
  color: var(--color-ink);
}

.button:hover::after {
  transform: rotate(-45deg) translate(1px, -1px);
}

.button:active {
  transform: translateY(1px);
}

.button:focus-visible {
  outline-color: var(--color-on-ink);
  outline-offset: 4px;
}

.closing__note {
  margin-top: 16px;
  font-size: 13px;
  color: var(--color-on-ink-sub);
}

.closing__motto {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 64px;
  font-family: var(--font-serif);
  font-size: clamp(14px, 4.2vw, 17px);
  letter-spacing: 0.14em;
  white-space: nowrap;
  color: var(--color-accent-on-ink);
}

.closing__motto::before,
.closing__motto::after {
  content: "";
  flex: 0 1 32px;
  min-width: 12px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

/* ---------- ⑥ フッター ---------- */

.footer {
  padding-block: 40px calc(40px + env(safe-area-inset-bottom));
  background: var(--color-ink);
  border-top: 1px solid rgba(244, 240, 233, 0.12);
  font-size: 13px;
  line-height: 1.85;
  color: var(--color-on-ink-sub);
}

.footer a {
  color: var(--color-on-ink);
}

.footer a:hover {
  color: #fff;
}

.footer :focus-visible {
  outline-color: var(--color-on-ink);
}

.footer__notes li {
  position: relative;
  padding-left: 1.1em;
}

.footer__notes li + li {
  margin-top: 8px;
}

.footer__notes li::before {
  content: "";
  position: absolute;
  left: 0.15em;
  top: 0.85em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(244, 240, 233, 0.3);
}

.footer__links {
  margin-top: 20px;
}

.footer__copy {
  margin-top: 32px;
  font-family: var(--font-serif);
  letter-spacing: 0.16em;
  text-align: center;
  color: var(--color-on-ink);
}

/* ---------- プライバシーポリシー（privacy.html） ---------- */

.policy {
  padding-block: clamp(40px, 8vw, 80px) clamp(64px, 10vw, 104px);
  border-top: 3px solid var(--color-accent);
  font-size: 15px;
}

.policy__back {
  margin-bottom: 40px;
  font-size: 13px;
}

.policy__back a::before {
  content: "←";
  margin-right: 0.5em;
}

.policy__lead {
  margin-top: 28px;
  color: var(--color-text-sub);
}

.policy__heading {
  margin-top: 44px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-line);
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 18px;
  line-height: 1.6;
  letter-spacing: 0.08em;
}

.policy p + p {
  margin-top: 1em;
}

.policy .policy__date {
  margin-top: 48px;
  font-size: 13px;
  text-align: right;
  color: var(--color-text-sub);
}

/* ---------- 控えめなアニメーション ---------- */

@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.9s ease, transform 0.9s ease;
  }

  .js .reveal.is-visible {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .button,
  .button::after {
    transition: none;
  }
}

/* ---------- タブレット ---------- */

@media (min-width: 640px) {
  body {
    font-size: 17px;
  }

  .hero__lead {
    font-size: 16px;
  }

  .hero__photo {
    width: 96px;
    height: 96px;
  }

  .hero__visual {
    margin-bottom: 22px;
  }

  .subscribe {
    margin-top: 32px;
  }

  .themes {
    grid-template-columns: 1fr 1fr;
    column-gap: 48px;
  }

  .theme {
    padding: 32px 4px 34px;
  }

  .facts {
    padding: 10px 32px;
  }

  .facts__row {
    grid-template-columns: 6em 1fr;
    padding: 18px 0;
  }

  .author {
    grid-template-columns: 168px 1fr;
    gap: 44px;
    align-items: start;
    margin-top: 48px;
  }

  .author__photo {
    width: 168px;
    height: 168px;
  }

  .button {
    width: auto;
    min-width: 300px;
  }
}

/* ---------- PC ---------- */

@media (min-width: 900px) {
  .hero {
    text-align: left;
  }

  .hero__bg::before {
    top: -0.12em;
    right: -0.08em;
  }

  .hero__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 64px;
  }

  .hero__text {
    grid-column: 1;
    grid-row: 1;
  }

  .hero__visual {
    grid-column: 2;
    grid-row: 1;
    align-items: center;
    gap: 28px;
    margin: 0;
    padding-right: 8px;
  }

  .hero__photo {
    width: clamp(260px, 28vw, 340px);
    height: clamp(260px, 28vw, 340px);
  }

  .hero__photo::after {
    inset: -14px;
  }

  .hero__motto {
    display: block;
    writing-mode: vertical-rl;
    font-family: var(--font-serif);
    font-size: 15px;
    letter-spacing: 0.4em;
    color: var(--color-text-sub);
  }

  .hero__motto::before {
    content: "";
    display: block;
    width: 1px;
    height: 48px;
    margin: 0 auto 16px;
    background: var(--color-accent);
  }

  .label::before {
    display: none;
  }

  .subscribe {
    margin-inline: 0;
  }

  .subscribe__note,
  .subscribe__after,
  .subscribe__fallback {
    padding-left: 4px;
  }

  /* ② 見出しと本文を左右に分ける */
  .split {
    display: grid;
    grid-template-columns: 5fr 6fr;
    column-gap: 72px;
    align-items: start;
  }

  .split .prose {
    margin-top: 34px;
  }
}
