/* takikawa.gaip.jp：滝川 勝也（東海ガス株式会社）のオンライン名刺（簡素な版。2026-12-02）
   金属の名刺 → 紙の名刺（横型の表・裏、縦書き、縦型）。下部のボタン（連絡先に追加・ホームページ）は画面の下に固定。
   本番の CSP は style-src 'self'。HTML に style 属性を書かない（値は takikawa.js が CSS 変数で渡す）。 */

:root {
  --bg: #05070c;
  --plate: #101012;      /* 金属の名刺の黒 */
  --ink: #eef0ec;        /* 名刺の白 */
  --flame: #3d9bff;      /* ガスの炎の青 */
  --flame-hi: #b4e0ff;
  --warm: #ffd59a;
  --lines: url("/assets/card-lines.webp?v=20261202e");
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", Meiryo, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

:focus-visible { outline: 2px solid var(--flame-hi); outline-offset: 4px; }

/* 背景の青い明かり */
.glow {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 70vh;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 64% 100% at 50% 100%, rgba(61, 155, 255, .3), rgba(61, 155, 255, .09) 46%, transparent 72%);
  animation: breathe 4.6s ease-in-out infinite alternate;
}

.page {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: clamp(34px, 8vw, 64px);
  /* 下は、固定したボタンの帯（約 104px）に最後の名刺が隠れないだけ空ける */
  padding: clamp(36px, 9vw, 80px) 4vw calc(140px + env(safe-area-inset-bottom));
  perspective: 1200px;
}

/* ---------- 金属の名刺 ---------- */

.card-wrap {
  position: relative;
  width: min(92vw, 640px);
  transform-style: preserve-3d;
}

.card-wrap::after {
  content: "";
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: -14%;
  height: 13%;
  background: radial-gradient(ellipse at center, rgba(61, 155, 255, .42), transparent 70%);
  pointer-events: none;
}

.card {
  --rx: 0;
  --ry: 0;
  position: relative;
  aspect-ratio: 1700 / 1020;
  border-radius: 2.353% / 3.922%;
  background: var(--plate);
  overflow: hidden;
  transform: rotateX(calc(var(--rx) * 1deg)) rotateY(calc(var(--ry) * 1deg));
  box-shadow:
    0 0 0 1px rgba(238, 239, 235, .12),
    0 34px 60px -24px rgba(0, 0, 0, .95),
    0 0 90px -12px rgba(61, 155, 255, .42);
  cursor: pointer;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  will-change: transform;
}

.card-art {
  display: block;
  width: 100%;
  height: 100%;
  opacity: .9;            /* 光の帯が通ったときに線が明るく見えるよう、少し落としておく */
  pointer-events: none;
}

.card-flame, .card-shine, .card-glare, .card-ring { position: absolute; pointer-events: none; }

.card-flame, .card-shine {
  inset: 0;
  -webkit-mask: var(--lines) center / 100% 100% no-repeat;
  mask: var(--lines) center / 100% 100% no-repeat;
}

/* 紋章の線が、ガスの炎の色でゆっくり灯る */
.card-flame {
  background: radial-gradient(ellipse 17% 30% at 50% 50%, rgba(104, 182, 255, .95), rgba(104, 182, 255, .55) 60%, transparent 100%);
  opacity: 0;
}

/* 白い線の上を、光の帯が左から右へ通る */
.card-shine {
  background: linear-gradient(104deg, transparent 0 41%, var(--flame-hi) 46%, #fff 50%, var(--warm) 54%, transparent 59% 100%);
  background-size: 280% 100%;
  background-position: 100% 0;
  background-repeat: no-repeat;
}

/* 傾きに合わせて動く照り返し */
.card-glare {
  --gx: 50%;
  --gy: 0%;
  --glare: 0;
  inset: 0;
  background: radial-gradient(circle at var(--gx) var(--gy), rgba(255, 255, 255, .17), rgba(180, 224, 255, .06) 30%, transparent 52%);
  opacity: var(--glare);
}

/* 点火の輪 */
.card-ring {
  left: 50%;
  top: 50%;
  width: 100%;
  aspect-ratio: 1;
  margin: -50% 0 0 -50%;
  border-radius: 50%;
  background: radial-gradient(circle, transparent 56%, rgba(61, 155, 255, .5) 63%, rgba(255, 255, 255, .92) 67%, rgba(61, 155, 255, .35) 70%, transparent 74%);
  opacity: 0;
  transform: scale(.12);
}

/* ---------- 紙の名刺 ---------- */

.papers {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  gap: clamp(28px, 7vw, 52px);
  width: min(92vw, 640px);
}

.paper {
  display: block;
  height: auto;
  border-radius: 3px;
  background: #fdfdfc;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, .25),
    0 26px 48px -18px rgba(0, 0, 0, .9),
    0 0 70px -22px rgba(61, 155, 255, .55);
}
.paper--wide { width: 100%; }
.paper--tall { width: min(74%, 360px); }

/* ---------- 下部のボタン（画面の下に固定。2026-12-02 の指定：スクロールしても常に押せるように） ---------- */

.actions {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 320px));
  justify-content: center;
  gap: clamp(8px, 2.4vw, 14px);
  padding: 26px max(12px, env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  /* 後ろの名刺が透けて読みにくくならないよう、下から暗くする。帯そのものは押せない（ボタンだけ押せる） */
  background: linear-gradient(to top, rgba(5, 7, 12, .97) 0, rgba(5, 7, 12, .9) 62%, rgba(5, 7, 12, 0) 100%);
  pointer-events: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: clamp(7px, 2vw, 12px);
  min-height: 64px;
  padding: 0 clamp(8px, 3vw, 28px);
  border: 1px solid rgba(238, 240, 236, .5);
  border-radius: 999px;
  background: rgba(12, 16, 26, .94);
  color: var(--ink);
  font-size: clamp(15px, 4.5vw, 19px);
  font-weight: 700;
  letter-spacing: .06em;
  pointer-events: auto;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .25s, color .25s, border-color .25s, transform .25s;
}
.btn:hover, .btn:focus-visible { border-color: var(--flame-hi); background: rgba(24, 34, 52, .92); }
.btn:active { transform: scale(.98); }

.btn--primary {
  border-color: transparent;
  background: linear-gradient(180deg, #f1f8ff, var(--flame-hi));
  color: #071223;
  box-shadow: 0 0 0 1px rgba(180, 224, 255, .55), 0 12px 38px -8px rgba(61, 155, 255, .85);
}
.btn--primary:hover, .btn--primary:focus-visible { border-color: transparent; background: linear-gradient(180deg, #fff, #d6eeff); }

/* ---------- 動き（.js：boot.js、.is-lit：名刺の画像が読めたら takikawa.js が付ける） ---------- */

.js:not(.is-lit) .card-wrap { opacity: 0; }
.js:not(.is-lit) .card-art { clip-path: ellipse(0% 0% at 50% 50%); }
.js .card-shine { opacity: 0; }

/* 名刺が起き上がり、紋章に火が入って全体へ広がり、線の上を光が通る */
.js.is-lit .card-wrap { animation: rise 1.1s cubic-bezier(.16, .84, .24, 1) both; }
.js.is-lit .card-art { animation: ignite 1.75s .45s cubic-bezier(.4, 0, .2, 1) both; }
.js.is-lit .card-ring { animation: ring 1.25s .5s ease-out both; }
.js.is-lit .card-shine {
  opacity: 1;
  transition: opacity .3s 2.2s;
  animation: sweep 6s -1.5s ease-in-out infinite;
}
.js.is-lit .card-flame { animation: flame 3.8s 2.3s ease-in-out infinite; }
.js.is-lit .card.is-pulse .card-ring { animation: ring-again 1.1s ease-out both; }
.js.is-lit .card.is-pulse .card-shine { animation: sweep-once 1.15s ease-in-out both; }

/* 紙の名刺：画面に入ったら、下からそっと現れる */
.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition: opacity .8s cubic-bezier(.2, .75, .2, 1), transform .8s cubic-bezier(.2, .75, .2, 1);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

@keyframes rise {
  from { opacity: 0; transform: translate3d(0, 48px, 0) rotateX(52deg) scale(.88); }
  to { opacity: 1; transform: none; }
}
@keyframes ignite {
  0% { clip-path: ellipse(0% 0% at 50% 50%); }
  30%, 46% { clip-path: ellipse(13.6% 24.6% at 50% 50%); }
  100% { clip-path: ellipse(75% 75% at 50% 50%); }
}
@keyframes ring {
  0% { opacity: 0; transform: scale(.12); }
  14% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.5); }
}
@keyframes ring-again {
  0% { opacity: 0; transform: scale(.12); }
  14% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.5); }
}
@keyframes sweep {
  0%, 62% { background-position: 100% 0; }
  100% { background-position: 0% 0; }
}
@keyframes sweep-once {
  from { background-position: 100% 0; }
  to { background-position: 0% 0; }
}
@keyframes flame {
  0%, 100% { opacity: 0; }
  38% { opacity: .62; }
  45% { opacity: .44; }
  54% { opacity: .68; }
  64% { opacity: .5; }
}
@keyframes breathe {
  from { opacity: .68; }
  to { opacity: 1; }
}

/* ---------- 画面の大きさ ---------- */

@media (min-width: 720px) {
  .papers { grid-template-columns: 1fr 1fr; align-items: start; }
  .paper--wide { grid-column: 1 / -1; }
  .paper--tall { width: 100%; max-width: none; }
}

/* ---------- 視差効果を減らす：動かさず、完成した状態で見せる ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .card-wrap, .js [data-reveal] { opacity: 1 !important; transform: none !important; }
  .js .card-art { clip-path: none !important; opacity: 1; }
  .card-shine, .card-flame, .card-ring { display: none; }
  .card { transform: none; }
}
