/* ==========================================================================
   ALMA corporate — 夜の庭(3D)の上に、太い明朝で言い切る。
   章ごとに組み方を変える: 縦書き / 中央 / 段組。番号は漢数字。飾りは罫線と余白だけ。
   ========================================================================== */
:root {
  --night: #05080c;
  --ink: #f4efe6;
  --edge: 0 0 2px rgba(5, 8, 12, 0.95), 0 1px 3px rgba(5, 8, 12, 0.85);   /* 文字の縁を締める暗い影。月や明るい背景に重なっても読める(輪郭線は使わない) */
  --ink-2: rgba(244, 239, 230, 0.78);
  --ink-3: rgba(244, 239, 230, 0.5);
  --line: rgba(244, 239, 230, 0.18);
  --line-strong: rgba(244, 239, 230, 0.55);
  --font: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  --font-en: "Cinzel", "Shippori Mincho", serif;   /* 英字は大文字専用の碑文体。字間は控えめに */
  --gutter: clamp(20px, 5vw, 80px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: auto; }
body {
  margin: 0; background: var(--night); color: var(--ink);
  font-family: var(--font); font-size: 16px; line-height: 2; letter-spacing: 0.04em;
  font-feature-settings: "palt" 1; -webkit-font-smoothing: antialiased; overflow-x: clip;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }

body { text-shadow: var(--edge); }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
/* 読込中の表示: 画面中央下の短い線が読込の進みで伸び、上に小さく LOADING。3D の準備が済んだら(body.is-ready)消える */
.loader { position: fixed; left: 50%; bottom: 16vh; width: 160px; transform: translateX(-50%); z-index: 3; pointer-events: none; text-align: center; transition: opacity 0.8s ease 0.2s; }
.loader::before { content: "LOADING"; display: block; margin-bottom: 12px; font-family: "Cinzel", serif; font-size: 10px; letter-spacing: 0.42em; color: var(--ink); opacity: 0.45; animation: breathe 2.4s ease-in-out infinite; }
.loader__bar { display: block; height: 1px; width: 100%; background: rgba(244, 239, 230, 0.12); position: relative; }
.loader__bar::after { content: ""; position: absolute; inset: 0; background: var(--ink); opacity: 0.7; transform: scaleX(var(--p, 0)); transform-origin: left center; transition: transform 0.3s ease-out; }
.is-ready .loader { opacity: 0; }
.vignette { position: fixed; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(to top, rgba(3, 6, 10, 0.75) 0%, rgba(3, 6, 10, 0.2) 35%, rgba(3, 6, 10, 0) 60%); }
.grain {
  position: fixed; inset: 0; z-index: 2; pointer-events: none; opacity: 0.06; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

p, dd, h3, .lead, .body, .gate__jp, .title { word-break: auto-phrase; line-break: strict; text-wrap: pretty; }
html.jawrap-keepall :is(p, dd, h3, .lead, .body, .gate__jp, .title) { word-break: keep-all; overflow-wrap: anywhere; }  /* auto-phrase 非対応(Safari 等)は jawrap.js が文節境界に ZWSP を入れる */
.sentence { display: inline-block; }
.nowrap { white-space: nowrap; }
.br-sp { display: none; }
.br-pc { display: inline; }   /* PC でだけ効く改行(狭幅では自然充填) */

/* ---- ヘッダー ---- */
.top { position: fixed; inset: 0 0 auto 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; padding: 26px var(--gutter); }
.mark { display: inline-flex; align-items: baseline; gap: 14px; }
.mark__en { font-family: var(--font-en); font-size: 28px; font-weight: 600; letter-spacing: 0.1em; }
.mark__jp { font-size: 15px; letter-spacing: 0.24em; color: var(--ink-2); }
.top__nav { display: flex; align-items: center; gap: 26px; font-family: var(--font-en); font-size: 12.5px; font-weight: 500; letter-spacing: 0.16em; }
.top__nav a { position: relative; display: inline-flex; align-items: center; line-height: 1; padding: 6px 0; color: var(--ink-2); transition: color 0.3s; }  /* 上下対称にして、ボタンと文字の中心を揃える */
.top__nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform 0.4s var(--ease); }
.top__nav a:hover, .top__nav a.is-active { color: var(--ink); }
.top__nav a:hover::after, .top__nav a.is-active::after { transform: scaleX(1); }
.top__cta { display: inline-flex; align-items: center; line-height: 1; border: 1px solid var(--line-strong); padding: 11px calc(18px - 0.16em) 11px 18px !important; color: var(--ink) !important; }  /* 字間ぶんを右で相殺して中央に */
.top__cta::after { display: none; }
.top__cta:hover { background: var(--ink); color: #000 !important; }
.menu { display: none; width: 44px; height: 44px; align-items: center; justify-content: center; border: 1px solid var(--line-strong); }
.menu span, .menu span::before, .menu span::after { display: block; width: 18px; height: 1px; background: var(--ink); position: relative; }
.menu span::before, .menu span::after { content: ""; position: absolute; left: 0; }
.menu span::before { top: -6px; } .menu span::after { top: 6px; }

/* ---- 章の共通 ---- */
main { position: relative; z-index: 3; }
.ch { position: relative; min-height: 100svh; display: grid; padding: 150px var(--gutter) 120px; }
.ch__inner { width: 100%; max-width: 1120px; margin-inline: auto; }
.en-sub { font-family: var(--font-en); font-size: 12px; letter-spacing: 0.2em; color: var(--ink-3); margin: -8px 0 16px; }
.en { font-family: var(--font-en); font-size: clamp(22px, 2.3vw, 34px); font-weight: 500; letter-spacing: 0.14em; padding-left: 0.14em; color: var(--ink); margin: 0 0 14px; text-shadow: 0 2px 40px rgba(0,0,0,0.9), var(--edge); }

.title { font-size: clamp(30px, 4.2vw, 62px); font-weight: 500; line-height: 1.4; letter-spacing: 0.1em; margin: 0 0 30px; text-shadow: 0 4px 60px rgba(0,0,0,0.8), var(--edge); }
.title--s { font-size: clamp(24px, 2.6vw, 38px); }
.title .line { display: block; overflow: hidden; margin-inline: -0.15em; padding-inline: 0.15em; }
.title .line > span { display: block; white-space: normal; text-wrap: balance; }
.sub { font-size: clamp(16px, 1.45vw, 21px); font-weight: 600; margin: 0 0 30px; letter-spacing: 0.08em; text-shadow: 0 1px 24px rgba(0,0,0,0.9), var(--edge); }
.lead { font-size: clamp(15px, 1.15vw, 17px); color: var(--ink-2); margin: 0 0 30px; max-width: 44em; text-shadow: 0 1px 24px rgba(0,0,0,0.9), var(--edge); }
.body { color: var(--ink-2); margin: 0; font-size: 15px; line-height: 2; text-shadow: 0 1px 24px rgba(0,0,0,0.9), var(--edge); }

.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 44px; }
.btn { display: inline-flex; align-items: center; min-height: 54px; padding: 0 32px; border: 1px solid var(--line-strong); font-size: 14px; letter-spacing: 0.2em; color: var(--ink); transition: background-color 0.3s, color 0.3s; }
.btn:hover { background: var(--ink); color: #000; }
.btn--primary { background: var(--ink); color: #000; border-color: var(--ink); }
.btn--primary:hover { background: transparent; color: var(--ink); }

/* ---- 0. ヒーロー: 3 枚の縦パネル ---- */
.ch--hero { padding: 0; min-height: 100svh; overflow: hidden; }
.gate { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3, 1fr); }
.gate__panel {
  position: relative; display: grid; place-content: center; text-align: center; gap: 10px;
  border-left: 1px solid rgba(244, 239, 230, 0.14);
  transition: background-color 0.5s var(--ease);
}
.gate__panel:first-child { border-left: 0; }
.gate__panel:hover { background: rgba(244, 239, 230, 0.05); }
.gate__en { font-family: var(--font-en); font-size: clamp(30px, 3.4vw, 50px); font-weight: 500; letter-spacing: 0.16em; padding-left: 0.16em; text-shadow: 0 2px 40px rgba(0,0,0,0.9), var(--edge); }
.gate__jp { font-size: 13px; letter-spacing: 0.22em; color: var(--ink-2); text-shadow: 0 1px 20px rgba(0,0,0,0.9), var(--edge); transition: color 0.3s; }
.gate__panel:hover .gate__jp { color: var(--ink); }
.ghost {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%); z-index: 2;
  writing-mode: vertical-rl; font-family: var(--font-en); font-size: min(clamp(56px, 8vw, 132px), 13svh); font-weight: 400; letter-spacing: 0.12em; max-height: 88svh;
  color: rgba(244, 239, 230, 0.16); pointer-events: none; user-select: none;
}
.hero__copy {
  position: absolute; left: 0; right: 0; bottom: 36px; z-index: 2; margin: 0; text-align: center;
  font-size: clamp(16px, 1.6vw, 24px); font-weight: 600; letter-spacing: 0.16em; text-shadow: 0 2px 30px rgba(0,0,0,0.9), var(--edge);
}
.hero__copy span { display: block; font-size: 12px; font-weight: 400; letter-spacing: 0.2em; color: var(--ink-2); margin-top: 8px; }
.hint { display: none; }

/* ---- 見出しの発光(参考: 白→青灰のグラデーションに、青白い柔らかな光) ---- */
.title .line > span, .en, .gate__en, .hero__copy, .ghost {
  background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 40%, #b8c8d8 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 1px 2px rgba(5, 8, 12, 0.9)) drop-shadow(0 0 5px rgba(196, 220, 244, 0.55)) drop-shadow(0 0 18px rgba(150, 190, 230, 0.35));
  text-shadow: none;
}
.ghost { filter: none; background-image: linear-gradient(180deg, rgba(244,239,230,0.22), rgba(244,239,230,0.06)); }  /* shorthand だと background-clip が戻り、四角く塗られる */
.hero__copy span { background: none; -webkit-background-clip: initial; background-clip: initial; color: var(--ink-2); filter: none; }
@keyframes breathe { 0%, 100% { filter: drop-shadow(0 1px 2px rgba(5, 8, 12, 0.9)) drop-shadow(0 0 5px rgba(196, 220, 244, 0.5)) drop-shadow(0 0 18px rgba(150, 190, 230, 0.3)); } 50% { filter: drop-shadow(0 1px 2px rgba(5, 8, 12, 0.9)) drop-shadow(0 0 7px rgba(206, 226, 246, 0.7)) drop-shadow(0 0 26px rgba(160, 200, 240, 0.45)); } }
.gate__en, .en { animation: breathe 6s ease-in-out infinite; }

/* ---- 中央組み ---- */
.ch--center { align-items: center; }
.ch--center .ch__inner { text-align: center; }
.ch--center .lead, .ch--center .sub { margin-inline: auto; }

/* ---- 章内の小見出し ---- */
.subhead { font-size: clamp(20px, 1.9vw, 26px); font-weight: 600; letter-spacing: 0.1em; margin: clamp(56px, 6vw, 88px) 0 14px; }
.ch--center .subhead + .lead { margin-bottom: 26px; }

/* ---- 一覧: 罫線の行 ---- */
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-strong); text-align: left; }
.rows > li { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 10px 48px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.rows > li > h3, .rows > li > b { font-size: clamp(19px, 1.8vw, 26px); font-weight: 600; line-height: 1.55; margin: 0; letter-spacing: 0.06em; }
.rows--main > li:first-child > h3 { font-size: clamp(22px, 2.3vw, 32px); }
.rows > li > div > b { display: block; font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.rows__year { font-size: 18px; font-weight: 700; letter-spacing: 0.06em; color: var(--ink-2); }

/* ---- 三段組(FDE / 理由) ---- */
.cols { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--line-strong); text-align: left; }
.cols > li { padding: 32px 32px 32px 0; border-right: 1px solid var(--line); }
.cols > li + li { padding-left: 32px; }
.cols > li:last-child { border-right: 0; }
.cols h3 { font-size: clamp(18px, 1.5vw, 22px); font-weight: 600; line-height: 1.6; margin: 0 0 12px; letter-spacing: 0.04em; white-space: nowrap; }

/* ---- 実績: 4 列 ---- */
.works { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 1px solid var(--line-strong); text-align: left; }
.works > li { border-right: 1px solid var(--line); }
.works > li:last-child { border-right: 0; }
.work { display: grid; align-content: start; gap: 12px; padding: 28px 24px 28px 0; height: 100%; transition: opacity 0.3s; }
.works > li + li .work { padding-left: 24px; }
.works:hover .work { opacity: 0.55; }
.works .work:hover { opacity: 1; }
.work__type { font-size: 12.5px; letter-spacing: 0.1em; color: var(--ink-3); }
.work__name { font-family: var(--font-en); font-size: clamp(22px, 2vw, 30px); font-weight: 500; letter-spacing: 0.06em; line-height: 1.2; }
.work__name--jp { font-family: var(--font); }
.work__name--jp { font-size: clamp(20px, 1.8vw, 26px); }
.work .body { font-size: 14px; }
.work__meta { font-size: 12.5px; color: var(--ink-3); border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 4px; }
.work__meta em { font-style: normal; font-weight: 700; font-size: 15px; color: var(--ink); }

/* ---- 会社概要 ---- */
.rows--dl { margin: 0; text-align: left; max-width: 760px; margin-inline: auto; }
.rows--dl > div { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.rows--dl dt { color: var(--ink-3); font-size: 14px; padding-top: 2px; letter-spacing: 0.1em; }
.rows--dl dd { margin: 0; font-size: 16px; }

/* ---- お問い合わせ ---- */
.contact { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(28px, 6vw, 96px); align-items: start; text-align: left; }
.contact__head { text-align: left; }
.contact__head .title { white-space: nowrap; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; letter-spacing: 0.1em; }
.field label b { color: var(--ink-3); font-weight: 400; margin-left: 8px; font-size: 12px; }
.field input, .field textarea { width: 100%; font: inherit; color: var(--ink); background: rgba(0, 0, 0, 0.62); border: 0; border-bottom: 1px solid var(--line-strong); padding: 12px 6px; transition: border-color 0.3s; }
.field input:focus, .field textarea:focus { outline: 0; border-color: var(--ink); }
.field textarea { min-height: 150px; resize: vertical; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
form .btn { display: flex; width: max-content; margin-left: auto; }  /* 送信ボタンは右寄せ(フォームの入力欄の右端に揃える) */
.note { font-size: 12px; color: var(--ink-3); margin: 14px 0 0; text-align: right; }

.foot { margin-top: clamp(48px, 7vw, 96px); padding-top: 24px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-2); text-align: left; }
.foot p { margin: 0 0 8px; }
.foot .mark__en { font-size: 18px; margin-right: 10px; }
.foot__links { display: flex; gap: 22px; color: var(--ink-3); }
.foot__credit { font-size: 11px; color: var(--ink-3); line-height: 1.7; }

/* ---- 初期状態(JS が有効なとき) ---- */
.js .title .line > span { transform: translateY(110%); }
.js .sub, .js .lead, .js .actions, .js .en, .js .en-sub, .js .gate__panel, .js .hero__copy, .js .ghost { opacity: 0; transform: translateY(14px); }
.js [data-reveal] > * { opacity: 0; transform: translateY(14px); }

/* ---- レスポンシブ ---- */
@media (max-width: 1023px) {
  .top__nav { display: none; }
  .menu { display: inline-flex; }
  .top__nav.is-open { display: flex; flex-direction: column; align-items: stretch; gap: 0; position: absolute; left: var(--gutter); right: var(--gutter); top: calc(100% + 6px); background: rgba(3, 6, 10, 0.95); border: 1px solid var(--line); padding: 8px 0; }
  .top__nav.is-open a { padding: 12px 20px; }
  .top__nav.is-open .top__cta { margin: 8px 16px; text-align: center; }
  .cols { grid-template-columns: 1fr; }
  .cols > li { border-right: 0; border-bottom: 1px solid var(--line); padding: 22px 0 !important; }
  .cols h3 { white-space: normal; }
  .cols > li:last-child { border-bottom: 0; }
  .works { grid-template-columns: repeat(2, 1fr); }
  .works > li:nth-child(2) { border-right: 0; }
  .works > li:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .works > li:nth-child(3) .work { padding-left: 0; }
}
@media (max-width: 820px) {
  .sentence { display: inline; }
  .sentence.nowrap { white-space: normal; }
  .br-pc { display: none; }
  .ch { padding: 110px var(--gutter) 80px; }
  .vignette { background: linear-gradient(to top, rgba(3, 6, 10, 0.9) 0%, rgba(3, 6, 10, 0.5) 50%, rgba(3, 6, 10, 0.1) 100%); }
  .gate { grid-template-columns: 1fr; grid-template-rows: repeat(3, 1fr); padding: 80px 0 130px; }  /* 下はコピーの場所 */
  .gate__panel { border-left: 0; border-top: 1px solid rgba(244, 239, 230, 0.14); }
  .ghost { display: none; }
  .hero__copy { bottom: 18px; font-size: 15px; }
  .rows > li { grid-template-columns: 1fr; gap: 6px; padding: 20px 0; }
  .rows--dl > div { grid-template-columns: 1fr; gap: 2px; }
  .works { grid-template-columns: 1fr; }
  .works > li { border-right: 0; border-bottom: 1px solid var(--line); }
  .works > li + li .work { padding-left: 0; }
  .contact { grid-template-columns: 1fr; }
  .br-sp { display: inline; }
}
@media (prefers-reduced-motion: reduce) {
  .gate__en, .en { animation: none; }
  .js .title .line > span, .js .sub, .js .lead, .js .actions, .js .en, .js .en-sub, .js .gate__panel, .js .hero__copy, .js .ghost, .js [data-reveal] > * { opacity: 1; transform: none; }
  .hint span::after { animation: none; }
}
