/*
  1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
  2. Remove default margins and padding
  3. Reset all borders.
*/

*,
::after,
::before,
::backdrop,
::file-selector-button {
  box-sizing: border-box; /* 1 */
  margin: 0; /* 2 */
  padding: 0; /* 2 */
  border: 0 solid; /* 3 */
}

/*
  1. Use a consistent sensible line-height in all browsers.
  2. Prevent adjustments of font size after orientation changes in iOS.
  3. Use a more readable tab size.
  4. Use the user's configured `sans` font-family by default.
  5. Use the user's configured `sans` font-feature-settings by default.
  6. Use the user's configured `sans` font-variation-settings by default.
  7. Disable tap highlights on iOS.
*/

html,
:host {
  line-height: 1.5; /* 1 */
  -webkit-text-size-adjust: 100%; /* 2 */
  tab-size: 4; /* 3 */
  font-family: --theme(
    --default-font-family,
    ui-sans-serif,
    system-ui,
    sans-serif,
    'Apple Color Emoji',
    'Segoe UI Emoji',
    'Segoe UI Symbol',
    'Noto Color Emoji'
  ); /* 4 */
  font-feature-settings: --theme(--default-font-feature-settings, normal); /* 5 */
  font-variation-settings: --theme(--default-font-variation-settings, normal); /* 6 */
  -webkit-tap-highlight-color: transparent; /* 7 */
}

/*
  1. Add the correct height in Firefox.
  2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)
  3. Reset the default border style to a 1px solid border.
*/

hr {
  height: 0; /* 1 */
  color: inherit; /* 2 */
  border-top-width: 1px; /* 3 */
}

/*
  Add the correct text decoration in Chrome, Edge, and Safari.
*/

abbr:where([title]) {
  -webkit-text-decoration: underline dotted;
  text-decoration: underline dotted;
}

/*
  Remove the default font size and weight for headings.
*/

h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: inherit;
  font-weight: inherit;
}

/*
  Reset links to optimize for opt-in styling instead of opt-out.
*/

a {
  color: inherit;
  -webkit-text-decoration: inherit;
  text-decoration: inherit;
}

/*
  Add the correct font weight in Edge and Safari.
*/

b,
strong {
  font-weight: bolder;
}

/*
  1. Use the user's configured `mono` font-family by default.
  2. Use the user's configured `mono` font-feature-settings by default.
  3. Use the user's configured `mono` font-variation-settings by default.
  4. Correct the odd `em` font sizing in all browsers.
*/

code,
kbd,
samp,
pre {
  font-family: --theme(
    --default-mono-font-family,
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    'Liberation Mono',
    'Courier New',
    monospace
  ); /* 1 */
  font-feature-settings: --theme(--default-mono-font-feature-settings, normal); /* 2 */
  font-variation-settings: --theme(--default-mono-font-variation-settings, normal); /* 3 */
  font-size: 1em; /* 4 */
}

/*
  Add the correct font size in all browsers.
*/

small {
  font-size: 80%;
}

/*
  Prevent `sub` and `sup` elements from affecting the line height in all browsers.
*/

sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sub {
  bottom: -0.25em;
}

sup {
  top: -0.5em;
}

/*
  1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)
  2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)
  3. Remove gaps between table borders by default.
*/

table {
  text-indent: 0; /* 1 */
  border-color: inherit; /* 2 */
  border-collapse: collapse; /* 3 */
}

/*
  Use the modern Firefox focus style for all focusable elements.
*/

:-moz-focusring {
  outline: auto;
}

/*
  Add the correct vertical alignment in Chrome and Firefox.
*/

progress {
  vertical-align: baseline;
}

/*
  Add the correct display in Chrome and Safari.
*/

summary {
  display: list-item;
}

/*
  Make lists unstyled by default.
*/

ol,
ul,
menu {
  list-style: none;
}

/*
  1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)
  2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)
      This can trigger a poorly considered lint error in some tools but is included by design.
*/

img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
  display: block; /* 1 */
  vertical-align: middle; /* 2 */
}

/*
  Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)
*/

img,
video {
  max-width: 100%;
  height: auto;
}

/*
  1. Inherit font styles in all browsers.
  2. Remove border radius in all browsers.
  3. Remove background color in all browsers.
  4. Ensure consistent opacity for disabled states in all browsers.
*/

button,
input,
select,
optgroup,
textarea,
::file-selector-button {
  font: inherit; /* 1 */
  font-feature-settings: inherit; /* 1 */
  font-variation-settings: inherit; /* 1 */
  letter-spacing: inherit; /* 1 */
  color: inherit; /* 1 */
  border-radius: 0; /* 2 */
  background-color: transparent; /* 3 */
  opacity: 1; /* 4 */
}

/*
  Restore default font weight.
*/

:where(select:is([multiple], [size])) optgroup {
  font-weight: bolder;
}

/*
  Restore indentation.
*/

:where(select:is([multiple], [size])) optgroup option {
  padding-inline-start: 20px;
}

/*
  Restore space after button.
*/

::file-selector-button {
  margin-inline-end: 4px;
}

/*
  Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)
*/

::placeholder {
  opacity: 1;
}

/*
  Set the default placeholder color to a semi-transparent version of the current text color in browsers that do not
  crash when using `color-mix(…)` with `currentcolor`. (https://github.com/tailwindlabs/tailwindcss/issues/17194)
*/

@supports (not (-webkit-appearance: -apple-pay-button)) /* Not Safari */ or
  (contain-intrinsic-size: 1px) /* Safari 17+ */ {
  ::placeholder {
    color: color-mix(in oklab, currentcolor 50%, transparent);
  }
}

/*
  Prevent resizing textareas horizontally by default.
*/

textarea {
  resize: vertical;
}

/*
  Remove the inner padding in Chrome and Safari on macOS.
*/

::-webkit-search-decoration {
  -webkit-appearance: none;
}

/*
  1. Ensure date/time inputs have the same height when empty in iOS Safari.
  2. Ensure text alignment can be changed on date/time inputs in iOS Safari.
*/

::-webkit-date-and-time-value {
  min-height: 1lh; /* 1 */
  text-align: inherit; /* 2 */
}

/*
  Prevent height from changing on date/time inputs in macOS Safari when the input is set to `display: block`.
*/

::-webkit-datetime-edit {
  display: inline-flex;
}

/*
  Remove excess padding from pseudo-elements in date/time inputs to ensure consistent height across browsers.
*/

::-webkit-datetime-edit-fields-wrapper {
  padding: 0;
}

::-webkit-datetime-edit,
::-webkit-datetime-edit-year-field,
::-webkit-datetime-edit-month-field,
::-webkit-datetime-edit-day-field,
::-webkit-datetime-edit-hour-field,
::-webkit-datetime-edit-minute-field,
::-webkit-datetime-edit-second-field,
::-webkit-datetime-edit-millisecond-field,
::-webkit-datetime-edit-meridiem-field {
  padding-block: 0;
}

/*
  Center dropdown marker shown on inputs with paired `<datalist>`s in Chrome. (https://github.com/tailwindlabs/tailwindcss/issues/18499)
*/

::-webkit-calendar-picker-indicator {
  line-height: 1;
}

/*
  Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)
*/

:-moz-ui-invalid {
  box-shadow: none;
}

/*
  Correct the inability to style the border radius in iOS Safari.
*/

button,
input:where([type='button'], [type='reset'], [type='submit']),
::file-selector-button {
  appearance: button;
}

/*
  Correct the cursor style of increment and decrement buttons in Safari.
*/

::-webkit-inner-spin-button,
::-webkit-outer-spin-button {
  height: auto;
}

/*
  Make elements with the HTML hidden attribute stay hidden by default.
*/

[hidden]:where(:not([hidden='until-found'])) {
  display: none !important;
}

/* =================================================================
   アースグループ 30th Anniversary（www/themes/earth-30th_261020）
   デザインカンプ基準幅: 1440px / コンテンツ幅: 1200px

   **このファイルは記念サイト専用。** コーポレートサイトのデザインシステム
   （daisyUI トークン・.app-* の余白クラス）とは別系統で、素の CSS と
   BEM（.anv-*）で組んである。index.css が app.css と同じ components レイヤーへ
   @import するので、コーポレート側の見た目には触れない
   （セレクタは全部 .anv / .anv-* / .anv-root 始まりで閉じてある）。

   ★ 画像を参照する url() はここに書けない。dist/style.css の中の url() は
     サブディレクトリ公開（/30th/ やステージングの /earth-corporation/）で
     ベースパスが付かず 404 になるため、**画像の URL はテーマの header.php の
     <style> がカスタムプロパティ（--anv-foot-image / --anv-outro-image）で渡す**
     （HTML に埋めた url() はコアが出力時に書き換える）。
================================================================= */

/* -----------------------------------------------------------------
   変数
   :root ではなく .anv（＝ body）に置く。コーポレート側に変数を撒かないため。
   足跡レイヤー（JS が body 配下に作る）も継承で拾える。
----------------------------------------------------------------- */
.anv {
    --anv-bg: #f5f5f5;
    --anv-text: #3b3b3b;             /* 本文・見出し・ロゴの文字で共通 */
    --anv-text-year: var(--anv-text);
    --anv-line: #ccc;
    --anv-line-fade: clamp(140px, 18vw, 260px);   /* センターラインの下端が消えていく長さ */
    --anv-border: #b8b8b8;

    --anv-container: 1024px;   /* 左右カラム 452px + センター余白 120px。
                                  外側に --anv-gutter が左右つくので箱の実寸は 1104px */
    --anv-gutter: 40px;
    --anv-col-gap: 120px;      /* センターライン左右の合計余白 */
    --anv-line-w: 8px;
    --anv-year-pad-t: 33px;    /* 年号とラインのクリアランス（上） */
    --anv-year-pad-b: 29px;    /* 同（下） */
    --anv-group-gap: clamp(56px, 7vw, 100px);  /* 年号ブロックどうしの間隔（ラインはここを跨ぐ） */

    /* 足跡トレイル（画面左の余白を下っていく） */
    --anv-foot-size: 46px;     /* 足跡の長さ（回転前の横幅） */
    --anv-foot-step: 60px;     /* 1歩の間隔（歩幅） */
    --anv-foot-random: .3;     /* 間隔・左右の振り・向き・大きさのばらつき。0 で揃う */
    --anv-foot-offset: 13px;   /* 軸を挟んだ左右の振り幅（歩幅の横ブレ） */
    --anv-foot-edge: 26px;     /* 軸が画面左端に寄りすぎないための下限 */
    --anv-foot-arc: 110px;     /* 入りの弧の横幅の最小値（画面左の余白が狭いとき用） */
    --anv-foot-sweep: 1;       /* 入りの弧の横幅の倍率（基本は画面左端まで） */
    --anv-foot-reach-max: 420px;  /* 同上の上限 */
    --anv-foot-bend: 2.9;      /* 入りの弧の縦幅（横幅の倍率）。大きいほどゆっくり起き上がる */
    --anv-foot-exit-spill: 900px; /* 出が履歴セクションの下端からはみ出してよい上限 */
    --anv-foot-exit-fall: .2;     /* 曲がったあとの下りに回す縦の割合。小さいほど角がゆるい */
    --anv-foot-exit-arc: .75;     /* 角の半径の上限（画面右端までの横幅に対する割合）。
                                     **狭い画面の曲がり具合はここで決まる。** 小さいと急カーブ */
    --anv-foot-exit-stretch: 1;   /* 歩き去る区間の間隔の倍率（1 = 全区間同じ歩幅） */
    --anv-foot-run-speed: 3500;   /* この速さ(px/秒)でスクロールすると歩幅が最大になる */
    --anv-foot-run-gain: .6;      /* 速いときに歩幅を何倍まで広げるか（.6 = 最大1.6倍） */
    --anv-foot-tilt: 2deg;     /* つま先の開き（進行方向に対する左右の振り） */
    --anv-foot-opacity: .22;

    /* 足跡が必要とする帯の幅（左右の隙間込み）。**ここが「窮屈さ」の唯一のつまみ。**
       足跡の実寸は size + offset*2（PC で 46 + 26 = 72px）なので、
       lane との差がそのまま画面端・本文との隙間になる（140 なら左右 34px ずつ） */
    --anv-foot-lane: 140px;

    /* コンテンツ左の余白 */
    --anv-foot-free: calc(max(0px, 50vw - (var(--anv-container) / 2 + var(--anv-gutter))) + var(--anv-gutter));
    /* 余白が帯より狭いぶんだけ、左にだけ追加で空ける（右の余白は変えない） */
    --anv-foot-reserve: max(0px, calc(var(--anv-foot-lane) - var(--anv-foot-free)));
    /* 足跡が実際に使える帯 ＝ 画面端から本文までの幅（余白と帯の広いほう） */
    --anv-foot-band: max(var(--anv-foot-free), var(--anv-foot-lane));
    /* 足跡の中心軸＝その帯の中央。狭いときは画面端から --anv-foot-edge を確保。
       ⚠ free ではなく **band** の中央にする。free で割ると、帯を広げた（reserve が
          付いた）ぶん本文だけが右へ逃げて、足跡は左に寄ったままになる */
    --anv-foot-x: max(var(--anv-foot-edge), calc(var(--anv-foot-band) / 2));

    --anv-font-jp: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "ヒラギノ角ゴ ProN W3",
                   "Yu Gothic Medium", "游ゴシック Medium", YuGothic, "游ゴシック体", Meiryo, sans-serif;
    /* 年号用：DIN系（端末にDINが無い場合は Web フォントの Barlow へフォールバック） */
    --anv-font-din: "DIN Alternate", "DIN Next LT Pro", "DIN Next", "DIN Pro", "D-DIN",
                    Barlow, "Helvetica Neue", Arial, sans-serif;

    /* 画像（header.php の <style> が入れる。無ければ描かない） */
    --anv-foot-image: none;
    --anv-outro-image: none;
}

/* -----------------------------------------------------------------
   ベース
   .anv-root は記念サイトの <html>（header.php）。素の html に当てると
   コーポレートサイトまでスムーススクロールになるのでクラスで閉じる。
----------------------------------------------------------------- */
/* 滑らかスクロール … **programmatic なスクロール（アンカー・JS）だけに効く。**
   ホイールやトラックパッドの操作には影響しない。 */
@media (prefers-reduced-motion: no-preference) {
    .anv-root { scroll-behavior: smooth; }
}

/* -----------------------------------------------------------------
   ⚠ **scroll-snap は使えない。** 一度入れて外した。
   `.anv-root { scroll-snap-type: y proximity }` ＋ 1画面ぶんのセクションに
   `scroll-snap-align: start` を当てると、**ホイールを回しても進まなくなる**。
   実測（1440×900・Chrome）: 100px × 10 回入力しても 244px しか進まず、
   手を止めた瞬間に 0 へ戻る。スナップ先（HERO の先頭）がずっと最寄りのままで、
   スクロールのたびに引き戻されるため。トラックパッド相当の連続入力でも同じ。
   ブロック送りが要るなら、スクロールを奪わない形（キー操作・ボタン・年ナビ）で足す。
----------------------------------------------------------------- */

/* 年ブロックが画面の上端に貼り付かないようにする。
   **年ナビのアンカー（id="anv-year-…"）とブロック送り（PageUp / PageDown →
   anniversary.ts の setupBlockKeys）はどちらもこの箱**なので、停止位置は 1 か所で決まる。
   （id を年号の <h2> に付けると、コアの出力整形が本番で警告を吐く → front-page.php の注記） */
.anv-history__group {
    scroll-margin-top: clamp(40px, 8vh, 96px);
}


.anv {
    margin: 0;
    background: var(--anv-bg);
    color: var(--anv-text);
    font-family: var(--anv-font-jp);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.75;
    letter-spacing: .06em;
    font-feature-settings: "palt" 1;
    text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
}

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

.anv :where(h1, h2, h3, p, ul, figure, figcaption) {
    margin: 0;
    padding: 0;
}

.anv :where(ul) { list-style: none; }

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

.anv__main {
    position: relative;
    z-index: 0;                      /* 足跡レイヤー（z-index:-1）の重なり基準 */
    overflow-x: clip;                /* 右端へ歩き去る足跡で横スクロールを出さない */
}

.anv-container {
    width: 100%;
    max-width: calc(var(--anv-container) + var(--anv-gutter) * 2);
    margin-inline: auto;
    padding-inline: var(--anv-gutter);
}

/* 足跡の帯ぶんの左余白は**年表だけ**に足す。
   HERO・MESSAGE・OUTRO まで足すと、中央揃えの文字が帯のぶん右へずれて見える
   （これらのセクションには足跡が下りてこないので、そもそも空ける必要がない）。 */
.anv-history .anv-container {
    padding-left: calc(var(--anv-gutter) + var(--anv-foot-reserve));
}

/* -----------------------------------------------------------------
   HERO / MESSAGE … どちらも1画面使う
   **height ではなく min-height で組む。** 固定の height にすると、中身が
   画面より高いときに上下中央揃えのぶんが画面の上へはみ出して読めなくなる。
   min-height なら中身に合わせて箱が伸び、そのままページのスクロールになる。
   100svh … モバイルのアドレスバーが出ている状態の高さ（出し入れで揺れない）。
----------------------------------------------------------------- */
.anv-fullscreen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    padding-block: clamp(48px, 6.5vw, 94px);
}

/* 同じ宣言を2行並べると minify で後ろだけ残り、svh 非対応（Safari 14）で
   高さが効かなくなる。@supports なら両方残る */
@supports (height: 100svh) {
    .anv-fullscreen { min-height: 100svh; }
}

/* -----------------------------------------------------------------
   HERO
----------------------------------------------------------------- */
.anv-hero {
    /* 下だけ .anv-fullscreen より広く取る。**ガイドの居場所**で、
       中身（ロゴ〜エンブレム）はその上の範囲で上下中央になる。
       ★ ここを広げすぎると HERO が1画面を超えて伸び、下が画面の外に出る */
    padding-bottom: clamp(96px, 9vw, 130px);
    text-align: center;
}

/* --- スクロールのガイド（SCROLL ＋ 下へ流れる線） --- */
/* **画面の下端に固定**（HERO の下端ではない）。
   HERO は中身しだいで1画面より高くなることがあり、箱の下端に置くと
   ガイドが画面の外に出てしまうため（実測で 6px はみ出した）。
   スクロールし始めたら消えるので、出ているのは最初の1画面だけ。 */
.anv-scroll {
    position: fixed;
    left: 50%;
    bottom: clamp(14px, 2.4vw, 34px);
    z-index: 5;                      /* 本文より上・年ナビ(10)より下 */
    transform: translateX(-50%);
    transition: opacity .5s ease, visibility .5s;
}

/* 少しでもスクロールしたら引っ込める（→ setupScrollGuide） */
.anv-scroll.is-hidden {
    opacity: 0;
    visibility: hidden;
}

.anv-scroll__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.anv-scroll__label {
    color: var(--anv-text);
    font-family: var(--anv-font-din);
    font-size: clamp(10px, .83vw, 12px);
    font-weight: 500;
    line-height: 1;
    letter-spacing: .22em;
    text-indent: .22em;              /* letter-spacing 分の中央ズレ補正 */
    opacity: .75;
}

/* 縦線。**下地はうっすら引いたまま**で、その中を濃い帯が上から下へ流れる */
.anv-scroll__line {
    position: relative;
    width: 1px;
    height: clamp(36px, 3.8vw, 52px);
    overflow: hidden;
    background: var(--anv-line);
}

.anv-scroll__line::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 45%;
    background: var(--anv-text);
    animation: anv-scroll-line 2.1s cubic-bezier(.45, 0, .2, 1) infinite;
}

@keyframes anv-scroll-line {
    0%        { transform: translateY(-100%); }
    55%, 100% { transform: translateY(222%); }   /* 下へ抜けてから少し待つ */
}

/* 動きを減らす設定では流さず、線を引いておくだけ */
@media (prefers-reduced-motion: reduce) {
    .anv-scroll__line::before {
        animation: none;
        height: 100%;
        opacity: .5;
    }
}

.anv-hero__mark img {
    width: clamp(76px, 7.6vw, 109px);
    margin-inline: auto;
}

.anv-hero__catch {
    margin-top: clamp(16px, 1.7vw, 24px);
    font-size: clamp(26px, 3.9vw, 56px);
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: .177em;
    text-indent: .177em;             /* 中央揃え時の字送り分のズレを補正 */
}

.anv-hero__brand {
    margin-top: clamp(16px, 1.7vw, 24px);
}

.anv-hero__brand img {
    width: clamp(146px, 16vw, 231px);
    margin-inline: auto;
}

.anv-hero__emblem {
    margin-top: clamp(80px, 11.5vw, 166px);
}

.anv-hero__emblem img {
    /* 素材が 200.71×228.49。カンプの高さ227pxに合わせて幅200pxを上限にする */
    width: clamp(129px, 13.9vw, 200px);
    margin-inline: auto;
}

/* -----------------------------------------------------------------
   MESSAGE
----------------------------------------------------------------- */
.anv-message__body {
    text-align: center;
    font-size: clamp(15px, 1.39vw, 20px);
    font-weight: 600;
    line-height: 1.9;
    letter-spacing: .09em;
}

.anv-message__body p + p {
    margin-top: 1.9em;               /* 1行分の空き（line-height と同値） */
}

/* 1行 = 1要素。PC はカンプの改行位置で切る（block）。
   SP は inline のままにして自然な折り返しに任せる
   （block にすると短い画面で改行位置が中途半端になる）。 */
@media screen and (min-width: 768px) {
    .anv-message__line { display: block; }
}

/* GSAP が出すもの（1行ずつの MESSAGE ＝ js-anv-line、
   ローディング明けに下から出る HERO ＝ js-anv-rise）。
   JS が動く前は隠れたまま。**JS が無いときは noscript の style が出す**
   （→ front-page.php）。 */
.js-anv-line,
.js-anv-rise { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
    .js-anv-line,
    .js-anv-rise { opacity: 1; }
}

/* -----------------------------------------------------------------
   LOADING
   年をカウントアップしつつ、その下を足跡が左端から右端へ横切る
----------------------------------------------------------------- */
.anv-root.is-loading,
.anv-root.is-loading body { overflow: hidden; }

/* 先頭へ戻す動きを見せないよう、ローディング中はスムーススクロールを切る */
.anv-root.is-loading { scroll-behavior: auto; }

.anv-loader {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    background: var(--anv-bg);
    transition: opacity .7s ease, visibility .7s;
}

.anv-loader.is-done {
    opacity: 0;
    visibility: hidden;
}

.anv-loader__inner { width: 100%; }

.anv-loader__year {
    color: var(--anv-text-year);
    text-align: center;
    font-family: var(--anv-font-din);
    font-size: clamp(64px, 13.1vw, 189px);
    font-weight: 500;
    line-height: 1;
    letter-spacing: .06em;
    text-indent: .06em;              /* letter-spacing 分の中央ズレ補正 */
    font-variant-numeric: tabular-nums;
    font-feature-settings: normal;
}

/* 足跡が通る帯。画面の左端から右端まで使う */
.anv-loader__track {
    position: relative;
    height: clamp(44px, 5vw, 68px);
    margin-top: clamp(28px, 3.4vw, 52px);
}

.anv-loader__foot {
    position: absolute;
    top: 50%;
    left: 0;
    width: clamp(26px, 2.7vw, 38px);
    aspect-ratio: 188.63 / 68.99;    /* foot_right.svg の viewBox 比 */
    background: var(--anv-foot-image) no-repeat center / contain;
    opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
    .anv-loader { transition: none; }
}

/* -----------------------------------------------------------------
   YEAR NAV（画面右に固定。年表の範囲でだけ出す）
----------------------------------------------------------------- */
.anv-nav {
    position: fixed;
    top: 50%;
    right: clamp(16px, 2.2vw, 34px);
    z-index: 10;
    max-height: 86vh;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-50%);
    transition: opacity .4s ease, visibility .4s;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.anv-nav::-webkit-scrollbar { display: none; }

.anv-nav.is-shown {
    opacity: 1;
    visibility: visible;
}

.anv-nav__list {
    display: flex;
    flex-direction: column;
}

/* 全ての年を目盛りとして並べる。文字が無い年も同じ高さで押せるようにする */
.anv-nav__link {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    width: 58px;
    height: 17px;
    color: #c8c8c8;
    font-family: var(--anv-font-din);
    font-size: clamp(11px, .9vw, 13px);
    font-weight: 400;
    line-height: 1;
    letter-spacing: .1em;
    text-decoration: none;
    transition: color .25s ease;
}

/* 右端の目盛り線 */
.anv-nav__link::after {
    content: "";
    width: 7px;
    height: 1px;
    background: currentColor;
    transition: width .25s ease;
}

/* 年号を出す年（最初・最後・10年区切り）は少し濃く、目盛りも長く */
.anv-nav__link--labeled { color: #9a9a9a; }
.anv-nav__link--labeled::after { width: 13px; }

.anv-nav__link:hover,
.anv-nav__link:focus-visible {
    color: var(--anv-text);
}

.anv-nav__link.is-current {
    color: var(--anv-text);
    font-weight: 500;
}

.anv-nav__link.is-current::after { width: 24px; }

/* コンテンツに掛からない余白が取れる幅でだけ表示する */
@media screen and (max-width: 1339px) {
    .anv-nav { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .anv-nav,
    .anv-nav__link,
    .anv-nav__link::after { transition: none; }
}

/* -----------------------------------------------------------------
   HISTORY
----------------------------------------------------------------- */
.anv-history {
    position: relative;              /* 足跡レイヤーの基準 */
    margin-top: clamp(130px, 18.5vw, 267px);
}

/* センターライン（年号ブロックで分断される）

   **年号の上に地色の板を置いて隠す方式はやめた。** 背面に地球があるので、
   塗った矩形が地球より明るい箱として浮いて見える。
   代わりに**ラインそのものを年号のぶんだけ描かない** — 線を年号の下
   （= .anv-history__list）から引き、次の年号の手前までグループ間の余白を跨がせる。
   隙間がそのまま年号ブロックの高さになるので、塗りも打ち消しも要らず、
   地球はそのまま透ける。 */
.anv-history__body {
    position: relative;
    padding-bottom: clamp(90px, 12.8vw, 185px);
}

.anv-history__list {
    position: relative;
}

.anv-history__list::before {
    content: "";
    position: absolute;
    top: 0;
    /* 次のグループの年号の手前まで。グループ間の余白を跨ぐので、
       線が切れるのは**年号ブロックの高さぶんだけ**になる */
    bottom: calc(var(--anv-group-gap) * -1);
    left: 50%;
    width: var(--anv-line-w);
    margin-left: calc(var(--anv-line-w) / -2);
    background: var(--anv-line);
}

/* 最後のグループだけ、下端を切り落とさず薄く消す ＝「この先も続く」。
   長さは --anv-line-fade */
.anv-history__group:last-child .anv-history__list::before {
    bottom: calc(var(--anv-line-fade) * -1);
    background: linear-gradient(
        to bottom,
        var(--anv-line) 0,
        var(--anv-line) calc(100% - var(--anv-line-fade)),
        transparent 100%
    );
}

.anv-history__group + .anv-history__group {
    margin-top: var(--anv-group-gap);
}

/* 年号：**ラインを隠す塗りは持たない。** 線のほうが年号のぶん描かれない
   （→ .anv-history__list::before）ので、ここは文字だけを置く。
   上下の padding がそのまま線の途切れ幅になる。 */
.anv-history__year {
    position: relative;
    z-index: 1;
    padding-top: var(--anv-year-pad-t);
    padding-bottom: var(--anv-year-pad-b);
    color: var(--anv-text-year);
    text-align: center;
    font-family: var(--anv-font-din);
    font-size: clamp(64px, 13.1vw, 189px);
    font-weight: 500;
    line-height: 1;
    letter-spacing: .06em;
    text-indent: .06em;              /* letter-spacing 分の中央ズレ補正 */
    font-feature-settings: normal;
}

.anv-history__list {
    margin-top: clamp(40px, 5vw, 73px);
}

/* --- 各エントリー --- */
.anv-history__item {
    position: relative;
    width: calc(50% - var(--anv-col-gap) / 2);
}

.anv-history__item + .anv-history__item {
    margin-top: clamp(40px, 3.9vw, 56px);
}

.anv-history__item--left {
    margin-right: auto;
    text-align: right;
}

.anv-history__item--right {
    margin-left: auto;
    text-align: left;
}

.anv-history__title {
    font-size: clamp(18px, 1.67vw, 24px);
    font-weight: 500;
    line-height: 1.6;
    letter-spacing: .07em;
}

.anv-history__text {
    font-size: clamp(14px, 1.11vw, 16px);
    line-height: 1.75;
    letter-spacing: .1em;
}

.anv-history__title + .anv-history__text {
    margin-top: 20px;
}

.anv-history__cards {
    margin-top: clamp(24px, 2.5vw, 36px);
}

.anv-history__cards > * + * {
    margin-top: 24px;
}

/* 左カラムではカードを右端に寄せる */
.anv-history__item--left .anv-history__cards { display: flex; flex-direction: column; align-items: flex-end; }

/* --- 画像カード --- */
.anv-card {
    width: 100%;
    max-width: 456px;
    padding: 28px 32px 32px;
    border: 1px solid var(--anv-border);
    border-radius: 10px;
    text-align: left;                /* 左カラムでもカード内は左揃え */
}

/* ロゴのカードは写真のカードより小さく（histories.php の 'variant' => 'logo'）。
   地を白にするのは、ロゴ画像が透過なしの白背景だから。
   カードが地色（--anv-bg）のままだと、ロゴの白地だけ四角く浮いて見える */
.anv-card--logo {
    max-width: 260px;
    padding: 20px 24px 24px;
    background: #fff;
}

.anv-card__visual {
    margin-bottom: 24px;
}

/* ロゴは縦長（759×1161）から横長（1763×1237）まで比率がまちまちなので、
   幅ではなく**高さを揃えた箱**に収める。こうしないと縦長のロゴだけ巨大になる */
.anv-card--logo .anv-card__visual {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 132px;
    margin-bottom: 16px;
}

.anv-card__visual img {
    width: 100%;
}

.anv-card--logo .anv-card__visual img {
    width: auto;
    max-width: 100%;
    max-height: 100%;
}

/* 写真が未入稿のあいだ出る枠（壊れた画像アイコンを出さないため）。
   画像が揃ったらこのルールは出番が無くなるが、残しておいても害はない */
.anv-card__placeholder {
    width: 100%;
    aspect-ratio: 4 / 3;
    border: 1px dashed var(--anv-border);
    border-radius: 6px;
    background: rgba(0, 0, 0, .02);
}

/* カードは本文（.anv-history__text）の補足なので、文字は本文より一段小さく置く */
.anv-card__title {
    font-size: clamp(14px, 1.18vw, 17px);
    font-weight: 500;
    line-height: 1.5;
    letter-spacing: .02em;
}

/* ロゴのカードは見出しも「▲ ○○ロゴマーク」の注記あつかい ＝ 説明文と同じ大きさ */
.anv-card--logo .anv-card__title {
    font-size: clamp(12px, .97vw, 14px);
    line-height: 1.75;
}

.anv-card__list,
.anv-card__text {
    margin-top: 14px;
    font-size: clamp(12px, .97vw, 14px);
    line-height: 1.5;
    letter-spacing: .04em;
}

.anv-card__text { line-height: 1.75; }

.anv-card__list li {
    position: relative;
    padding-left: 1.6em;
}

.anv-card__list li::before {
    content: "・";
    position: absolute;
    top: 0;
    left: 0;
}

.anv-card__list li + li { margin-top: 0; }

/* -----------------------------------------------------------------
   OUTRO
----------------------------------------------------------------- */
.anv-outro {
    /* 年表との距離（足跡が歩き去る助走）。**padding ではなく margin** で取る。
       padding にすると .anv-fullscreen の min-height に足し込まれて
       1画面を超えてしまい、コピーとロゴが同時に収まらない。 */
    margin-top: clamp(280px, 42vw, 604px);
    text-align: center;
}

/* 地球 … 画面の下に貼り付く背面レイヤー（<main> の外に置いた .anv-earth）。
   **最初から最後までずっと出ている**地。スクロールに合わせてゆっくり
   せり上がるだけ（パララックス → anniversary.ts）。

   **OUTRO の背景にはしない。** 背景は要素の箱の中にしか描かれないので、
   background-attachment: fixed にすると箱の上辺で地球が水平に切れる。

   薄さの調整は下の opacity で行う（素材自体がほぼ白なので 1 でも地に沈む）。 */
.anv-earth {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    /* z-index は本文（.anv__main）と同じ 0。重なりは DOM 順で決まるので、
       **<main> より前に置く**ことで背面に回る。
       -1 にすると body の地の色（.anv の background）に塗りつぶされて見えない。 */
    z-index: 0;
    aspect-ratio: 2021.01 / 720.65;  /* earth.svg の viewBox 比 */
    background: var(--anv-outro-image) no-repeat center bottom / 100% auto;
    opacity: 1;
    pointer-events: none;
}

.anv-outro__catch {
    font-size: clamp(26px, 3.9vw, 56px);
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: .177em;
    text-indent: .177em;
}

.anv-outro__logo {
    margin-top: clamp(60px, 8.5vw, 123px);
}

.anv-outro__logo img {
    width: clamp(220px, 24.7vw, 356px);
    margin-inline: auto;
}

/* コーポレートサイトへ戻る導線（header.php・全ページ共通）。
   記念サイトはヘッダーもフッターも持たない1枚ものなので、**出口はこれだけ**。
   文字だけの控えめな形にする（ボタンにすると1枚ものの静けさを壊すうえ、
   記念サイトに CTA が無いので「塗り」の強さの基準が無い）。
   下線は最初から場所を取っていて色だけが動く ＝ hover で高さが揺れない。 */
.anv-back {
    display: inline-flex;
    align-items: center;
    gap: .6em;
    color: var(--anv-text);
    font-size: clamp(13px, 1.1vw, 15px);
    letter-spacing: .12em;
    text-decoration: none;
    transition: opacity .3s ease;
}

/* 戻る矢印。lucide の arrow-left（stroke="currentColor"）をインラインで出している */
.anv-back__icon {
    flex-shrink: 0;
    width: 1.2em;
    height: 1.2em;
    transition: transform .3s ease;
}

/* 下線は border ではなく text-decoration。
   **文字にだけ**掛けたいので、リンク全体ではなくラベルに当てる
   （リンクに当てると矢印の下にも線が伸びる）。 */
.anv-back__label {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-decoration-color: var(--anv-border);
    text-underline-offset: 6px;
    transition: text-decoration-color .3s ease;
}

.anv-back:hover {
    opacity: .7;
}

/* hover は「色が動く ＋ 矢印が行き先へ進む」だけ。戻る導線なので矢印は左へ */
.anv-back:hover .anv-back__label {
    text-decoration-color: currentColor;
}

.anv-back:hover .anv-back__icon {
    transform: translateX(-3px);
}

@media (prefers-reduced-motion: reduce) {
    .anv-back__icon { transition: none; }
}

/* -----------------------------------------------------------------
   BGM コントローラー（画面右下に固定）
   停止中は波形の形で止まり、再生中は**曲の音量に合わせて**上下する
   （解析は anniversary.ts の Web Audio。使えない環境では CSS のループ）。
   高さではなく scaleY を動かす（レイアウトを起こさない）。
----------------------------------------------------------------- */
.anv-sound {
    position: fixed;
    right: clamp(16px, 2.2vw, 34px);
    bottom: clamp(16px, 2.2vw, 34px);
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: .7em;
    padding: .62em 1.1em;
    border: 1px solid var(--anv-border);
    border-radius: 999px;
    background: var(--anv-bg);
    color: var(--anv-text);
    font-family: inherit;
    font-size: clamp(12px, 1vw, 14px);
    letter-spacing: .12em;
    line-height: 1;
    cursor: pointer;
    transition: border-color .3s ease, opacity .3s ease;
}

.anv-sound:hover,
.anv-sound:focus-visible {
    border-color: var(--anv-text);
}

.anv-sound__label {
    opacity: .6;
    transition: opacity .3s ease;
}

.anv-sound.is-playing .anv-sound__label { opacity: 1; }

.anv-sound__bars {
    display: flex;
    align-items: center;             /* 中心から上下に伸びる */
    gap: 3px;
    height: 16px;
    opacity: .5;                     /* 停止中は控えめに */
    transition: opacity .3s ease;
}

.anv-sound.is-playing .anv-sound__bars { opacity: 1; }

.anv-sound__bar {
    width: 2px;
    height: 100%;
    border-radius: 1px;
    background: currentColor;
    transform-origin: center;
    transition: transform .3s ease;
}

/* 停止中 … 高さをばらして「波形」の形で止めておく。
   **全部同じ高さにすると点が並んでいるだけに見えて、音のボタンだと分からない。**
   再生中は JS が transform を直接書くので、この指定は効かなくなる。 */
.anv-sound__bar:nth-child(1) { transform: scaleY(.34); }
.anv-sound__bar:nth-child(2) { transform: scaleY(.70); }
.anv-sound__bar:nth-child(3) { transform: scaleY(.46); }
.anv-sound__bar:nth-child(4) { transform: scaleY(.86); }
.anv-sound__bar:nth-child(5) { transform: scaleY(.40); }

/* 曲に合わせて動かしているあいだは、JS が 1フレームごとに値を書く。
   なまし済みなので CSS 側の transition は切る（二重に遅れて鈍くなる） */
.anv-sound.is-live .anv-sound__bar { transition: none; }

/* フォールバック … Web Audio が使えない環境では一定のループで上下させる */
.anv-sound.is-playing:not(.is-live) .anv-sound__bar {
    animation: anv-eq .8s ease-in-out infinite alternate;
}

.anv-sound.is-playing:not(.is-live) .anv-sound__bar:nth-child(1) { animation-duration: .72s; }
.anv-sound.is-playing:not(.is-live) .anv-sound__bar:nth-child(2) { animation-duration: .54s; animation-delay: -.2s; }
.anv-sound.is-playing:not(.is-live) .anv-sound__bar:nth-child(3) { animation-duration: .9s;  animation-delay: -.35s; }
.anv-sound.is-playing:not(.is-live) .anv-sound__bar:nth-child(4) { animation-duration: .64s; animation-delay: -.1s; }
.anv-sound.is-playing:not(.is-live) .anv-sound__bar:nth-child(5) { animation-duration: .78s; animation-delay: -.28s; }

@keyframes anv-eq {
    from { transform: scaleY(.16); }
    to   { transform: scaleY(1); }
}

/* 動きを減らす設定では波形を動かさない（状態は文字と濃さで伝わる） */
@media (prefers-reduced-motion: reduce) {
    .anv-sound__bar { transition: none; }
    .anv-sound.is-playing .anv-sound__bar { animation: none; }
}

/* 画面左上に常時固定。
   - 位置は年ナビ（右）と同じ値で対称にする
   - z-index 10 も年ナビと同じ段。ローディング（100）には隠れる
   - 足跡（z-index: -1）はこの下を通る。地の板を敷くと地球まで隠れるので敷かない */
.anv-back--fixed {
    position: fixed;
    top: clamp(16px, 2.2vw, 34px);
    left: clamp(16px, 2.2vw, 34px);
    z-index: 10;
}

/* -----------------------------------------------------------------
   下層ページ（index.php の受け皿）
   記念サイトはトップ1枚もの ＋ 404（404.php）だけなので、ここは
   「あとからページを足したとき、素の HTML で落ちない」ための最低限。
----------------------------------------------------------------- */
.anv-page {
    padding-top: clamp(72px, 10vw, 144px);
    padding-bottom: clamp(72px, 10vw, 144px);
}

.anv-page__title {
    font-size: clamp(22px, 2.6vw, 36px);
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: .1em;
}

.anv-page__title + * { margin-top: clamp(24px, 3vw, 40px); }

/* 進む向きの回（404 の行き先リンク）。
   **矢印の位置は DOM の順番が決める**（ラベル → 矢印）ので、CSS は向きだけ面倒を見る。 */
.anv-back--forward:hover .anv-back__icon {
    transform: translateX(3px);
}

/* -----------------------------------------------------------------
   404（404.php）
   HERO・OUTRO と同じ「1画面ぶんの中央寄せ」。記念サイトは1枚ものなので、
   出口は「記念サイトのトップ」「本体の SNS」「コーポレートサイト（左上の固定）」だけ。
   見出しの型は HERO のコピー（.anv-hero__catch）と同じ組み方で、1段小さくしてある。
----------------------------------------------------------------- */
.anv-notfound {
    text-align: center;
}

/* 目印の「404」。**年号と同じ DIN 系**で、地に沈む濃さにする
   （読ませる文字ではないので、本文より先に目に入らないようにする） */
.anv-notfound__num {
    font-family: var(--anv-font-din);
    font-size: clamp(88px, 13vw, 200px);
    font-weight: 400;
    line-height: 1;
    letter-spacing: .08em;
    text-indent: .08em;              /* 中央揃え時の字送り分のズレを補正 */
    color: var(--anv-text-year);
    opacity: .18;
}

.anv-notfound__title {
    margin-top: clamp(8px, 1.2vw, 18px);
    font-size: clamp(22px, 2.9vw, 42px);
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: .14em;
    text-indent: .14em;
}

.anv-notfound__text {
    margin-top: clamp(20px, 2.4vw, 34px);
    font-size: clamp(14px, 1.2vw, 16px);
}

/* 行き先。1行に並べ、狭い画面では折り返して縦に積む */
.anv-notfound__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: clamp(18px, 2.6vw, 40px);
    margin-top: clamp(40px, 5.2vw, 72px);
}

@media screen and (max-width: 767px) {
    /* SP は横に 2 つ並べると窮屈なので、必ず縦に積む */
    .anv-notfound__links {
        flex-direction: column;
        align-items: center;
    }

    .anv-notfound__text {
        text-align: left;
    }
}

/* -----------------------------------------------------------------
   足跡トレイル（画面左・つま先下向き／ガイドパスに沿って GSAP が配置）
----------------------------------------------------------------- */
.anv-foots {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--anv-foot-x);
    width: 0;                        /* 軸だけの箱。横スクロールを生まない */
    z-index: -1;                     /* 本文の背面に敷く */
    pointer-events: none;
}

/* 足跡を並べるためのガイドパス。viewBox を持たせず 1単位 = 1px で使う。
   経路を目で見たいときは stroke を付ける */
.anv-foots__guide {
    position: absolute;
    top: 0;
    left: 0;
    overflow: visible;
    fill: none;
    stroke: none;
}

/* 位置・角度・左右反転・表示は JS（GSAP）が1つずつ指定する */
.anv-foots__item {
    position: absolute;
    top: 0;
    left: 0;
    width: var(--anv-foot-size);
    aspect-ratio: 188.63 / 68.99;    /* foot_right.svg の viewBox 比 */
    background: var(--anv-foot-image) no-repeat center / contain;
    opacity: 0;
}

/* -----------------------------------------------------------------
   スクロール表示演出
----------------------------------------------------------------- */
.js-anv-reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .8s ease, transform .8s ease;
}

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

@media (prefers-reduced-motion: reduce) {
    .js-anv-reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* -----------------------------------------------------------------
   左余白が狭くなる幅：足跡も小さめに
----------------------------------------------------------------- */
@media screen and (max-width: 1360px) {
    .anv {
        --anv-foot-lane: 104px;      /* 足跡の実寸 30 + 7*2 = 44px ＋ 左右 30px ずつ */
        --anv-foot-size: 30px;
        --anv-foot-step: 48px;
        --anv-foot-offset: 7px;
        --anv-foot-edge: 33px;
        --anv-foot-arc: 80px;
    }
}

/* -----------------------------------------------------------------
   タブレット
----------------------------------------------------------------- */
@media screen and (max-width: 1024px) {
    .anv {
        --anv-col-gap: 72px;
        --anv-line-w: 6px;
        --anv-year-pad-t: 30px;
        --anv-year-pad-b: 16px;
    }

    .anv-card {
        padding: 24px 24px 28px;
    }

    .anv-card--logo {
        padding: 18px 20px 22px;
    }
}

/* -----------------------------------------------------------------
   スマートフォン（1カラム・ライン左寄せ）
----------------------------------------------------------------- */
@media screen and (max-width: 767px) {
    .anv {
        --anv-gutter: 24px;
        --anv-foot-lane: 66px;       /* 足跡の帯(約25px)＋左右20pxずつの隙間 */
        --anv-line-w: 4px;
        --anv-year-pad-t: 22px;
        --anv-year-pad-b: 12px;
        --anv-foot-size: 22px;
        --anv-foot-step: 38px;
        --anv-foot-offset: 4px;
        --anv-foot-edge: 33px;       /* 帯が画面端に寄らないよう軸を内側へ */
        --anv-foot-arc: 54px;

        line-height: 1.8;
    }

    /* SPではセンターラインを出さない */
    .anv-history__body {
        padding-left: 0;
    }

    .anv-history__list::before { content: none; }

    .anv-history__year {
        text-align: left;
        text-indent: 0;
    }

    .anv-history__item,
    .anv-history__item--left,
    .anv-history__item--right {
        width: 100%;
        margin-inline: 0;
        text-align: left;
    }

    .anv-history__item + .anv-history__item {
        margin-top: 36px;
    }

    .anv-history__item--left .anv-history__cards {
        align-items: stretch;
    }

    .anv-card { max-width: none; }

    /* ロゴだけは SP でも横いっぱいに広げない（ロゴが大写しになってしまうため） */
    .anv-card--logo { max-width: 240px; }

    .anv-message__body { text-align: left; }

    /* カンプ用の改行はSPでは無効化し、折り返しに任せる */
    .anv-message__body br { display: none; }
}
