/* ==========================================================
   株式会社典企画  style.css
   構成：左右の縦帯で画面を額縁のように囲むレイアウト（パソコン）
   色　：ブランドブルー＋印刷のプロセスカラー（C・M・Y・K）
   ========================================================== */

:root {
  --blue: #0068b7;      /* 今のサイトのブランドブルー */
  --blue-deep: #00508d;
  --cyan: #00a0e9;
  --magenta: #e4007f;
  --yellow: #ffe100;    /* ロゴの黄色に近い色 */
  --ink: #222222;
  --gray: #6b6b6b;
  --line: #d8dde3;
  --paper: #ffffff;
  --paper-2: #f3f5f8;

  --font: "Zen Kaku Gothic New", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  --mincho: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", serif;

  --rail: 96px;          /* 左右の縦帯の幅 */
  --sp-header: 64px;     /* スマホのヘッダーの高さ */
  --container: 1040px;
}

/* ---------- リセット・基本 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--sp-header); }
@media (min-width: 1024px) { html { scroll-padding-top: 0; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.9;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-underline-offset: 0.2em; }
a:hover { color: var(--blue-deep); }
:focus-visible { outline: 3px solid var(--magenta); outline-offset: 3px; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p, dl, dd, figure { margin: 0; }

.container { width: min(100% - 48px, var(--container)); margin-inline: auto; }

.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 100;
  padding: 8px 16px; background: var(--ink); color: #fff;
}
.skip-link:focus { top: 8px; }

.pc-only { display: none; }
@media (min-width: 768px) { .pc-only { display: inline; } }
@media (min-width: 768px) { .sp-only { display: none; } }

/* ==========================================================
   額縁レイアウト（パソコン：幅1024px以上）
   ========================================================== */
.rail { display: none; }

@media (min-width: 1024px) {
  .rail {
    position: fixed; top: 0; bottom: 0; z-index: 40;
    width: var(--rail);
    display: flex; flex-direction: column; align-items: center; justify-content: space-between;
    padding: 28px 0 32px;
    background: var(--paper);
  }
  .rail--left  { left: 0;  border-right: 1px solid var(--line); }
  .rail--right { right: 0; border-left:  1px solid var(--line); }

  .frame { margin-inline: var(--rail); }

  /* 左：ロゴと縦書きの社名 */
  .rail__logo img { width: 56px; }
  .rail__name {
    writing-mode: vertical-rl;
    font-family: var(--mincho); font-weight: 700;
    font-size: 1rem; letter-spacing: 0.4em;
    margin-top: 28px; margin-bottom: auto;
  }

  /* 右：縦書きメニュー */
  .rail__nav { display: flex; flex-direction: column; align-items: center; gap: 28px; }
  .rail__nav a, .rail__contact {
    writing-mode: vertical-rl;
    font-weight: 700; font-size: 0.9375rem; letter-spacing: 0.25em;
    color: var(--ink); text-decoration: none;
    padding-inline: 4px;
    border-left: 2px solid transparent;
  }
  .rail__nav a:hover, .rail__contact:hover { color: var(--blue); border-left-color: var(--blue); }
  .rail__contact {
    background: var(--blue); color: #fff;
    padding: 16px 10px; border: 0;
  }
  .rail__contact:hover { background: var(--blue-deep); color: #fff; }
}

/* ==========================================================
   スマホ・タブレットのヘッダー（幅1023px以下）
   ========================================================== */
.sp-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--sp-header);
  padding-inline: 20px;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.sp-header__logo img { width: 44px; }
@media (min-width: 1024px) { .sp-header { display: none; } }

.nav-toggle {
  display: flex; align-items: center; gap: 10px;
  background: none; border: 0; color: var(--ink); cursor: pointer;
  font: 700 0.875rem var(--font); padding: 8px 0;
}
.nav-toggle__bar,
.nav-toggle__bar::before,
.nav-toggle__bar::after {
  display: block; width: 22px; height: 2px; background: var(--ink); position: relative;
  transition: transform .2s, background-color .2s;
}
.nav-toggle__bar::before, .nav-toggle__bar::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bar::before { top: -7px; }
.nav-toggle__bar::after  { top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar::after  { transform: translateY(-7px) rotate(-45deg); }

.sp-nav {
  position: absolute; top: var(--sp-header); left: 0; right: 0;
  background: var(--paper); border-bottom: 1px solid var(--line);
  display: none;
}
.sp-nav.is-open { display: block; }
.sp-nav ul { padding: 4px 20px 16px; }
.sp-nav a {
  display: block; padding: 14px 4px; border-bottom: 1px solid var(--line);
  color: var(--ink); font-weight: 700; text-decoration: none;
}

/* ==========================================================
   ヒーロー
   ========================================================== */
.hero {
  background: var(--blue);
  color: #fff;
  padding: clamp(40px, 7vw, 88px) 0 0;
}
.hero__sheet {
  position: relative;
  width: min(100% - 64px, var(--container));
  margin-inline: auto;
  padding: clamp(40px, 7vw, 88px) clamp(20px, 5vw, 64px) clamp(48px, 7vw, 88px);
  margin-bottom: clamp(40px, 7vw, 88px);   /* 上の余白（.hero の padding-top）と同じにして、トンボとカラーバーが重ならないようにする */
}
@media (min-width: 1024px) {
  .hero { min-height: 100vh; display: flex; flex-direction: column; }
  .hero__sheet {
    flex: 1;                                   /* 画面の高さいっぱいに広げ、トンボを四隅へ */
    display: flex; flex-direction: column; justify-content: center;   /* 内容は上下中央 */
  }
}

/* トンボ（裁断位置を示す印刷の目印） */
.trim { position: absolute; width: 36px; height: 36px; }
.trim::before, .trim::after { content: ""; position: absolute; background: rgba(255,255,255,.85); }
.trim::before { width: 100%; height: 1px; }
.trim::after  { width: 1px; height: 100%; }
.trim--tl { top: 0; left: 0; }
.trim--tl::before { top: 0; left: -18px; }       .trim--tl::after { left: 0; top: -18px; }
.trim--tr { top: 0; right: 0; }
.trim--tr::before { top: 0; right: -18px; }      .trim--tr::after { right: 0; top: -18px; }
.trim--bl { bottom: 0; left: 0; }
.trim--bl::before { bottom: 0; left: -18px; }    .trim--bl::after { left: 0; bottom: -18px; }
.trim--br { bottom: 0; right: 0; }
.trim--br::before { bottom: 0; right: -18px; }   .trim--br::after { right: 0; bottom: -18px; }

.hero__title {
  font-size: clamp(2.75rem, 8vw, 6.5rem);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: 0.02em;
}
.hero__lead {
  margin-top: clamp(24px, 3vw, 40px);
  max-width: 34em;
  font-size: clamp(0.9375rem, 1.5vw, 1.125rem);
  line-height: 2;
}

/* カラーバー（印刷物の端に入る色見本） */
.colorbar { display: flex; height: 14px; }
.colorbar--thin { height: 6px; }
.colorbar span { flex: 1; }
.colorbar__c { background: var(--cyan); }
.colorbar__m { background: var(--magenta); }
.colorbar__y { background: var(--yellow); }
.colorbar__k { background: var(--ink); }

/* ==========================================================
   セクション共通
   ========================================================== */
.section { padding-block: clamp(72px, 11vw, 144px); }
.section__title {
  font-size: clamp(1.625rem, 3.2vw, 2.375rem);
  font-weight: 900;
  line-height: 1.4;
  letter-spacing: 0.03em;
}
.section__lead { margin-top: 12px; color: var(--gray); }

/* ---------- 私たちの考え ---------- */
.concept__grid {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.concept__item { padding: clamp(28px, 4vw, 48px) clamp(20px, 3vw, 36px) clamp(32px, 4vw, 52px); }
.concept__item h3 { font-size: clamp(1.375rem, 2.4vw, 1.875rem); font-weight: 900; line-height: 1.35; }
.concept__item p { margin-top: 20px; font-size: 0.9375rem; }
.concept__item--c { background: var(--cyan); color: #fff; }
.concept__item--y { background: var(--yellow); color: var(--ink); }
.concept__item--m { background: var(--magenta); color: #fff; }
@media (max-width: 767px) { .concept__grid { grid-template-columns: 1fr; } }

/* ---------- 会社について（縦書き） ---------- */
.about { background: var(--paper-2); }
.about__inner {
  display: flex; flex-direction: row-reverse;   /* 縦書きは右から読むので、メッセージを右に置く */
  justify-content: center; align-items: center;
  gap: clamp(48px, 8vw, 120px);
}
.about__message {
  writing-mode: vertical-rl;
  font-family: var(--mincho);
}
.about__title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: 0.12em;
}
.about__body {
  margin-block-start: clamp(32px, 4vw, 56px);
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 2.3;
  letter-spacing: 0.12em;
}

/* スマホは縦書きだと幅が足りないので横書きに切り替える */
@media (max-width: 767px) {
  .about__inner { flex-direction: column; align-items: center; gap: 40px; }
  .about__message { writing-mode: horizontal-tb; text-align: center; }
  .about__body { margin-block-start: 24px; line-height: 2.1; letter-spacing: 0.04em; }
}

/* ---------- できること ---------- */
/* 種類ごとにまとめ、見出しの左の色（C・M・Y・K）で種類を見分ける */
.services__group { margin-top: clamp(40px, 5vw, 64px); }
.services__group-title {
  font-size: clamp(1.125rem, 1.8vw, 1.375rem);
  font-weight: 900;
  line-height: 1.5;
  padding-left: 14px;
  border-left: 6px solid var(--group-color, var(--blue));
}
.services__group--print { --group-color: var(--cyan); }
.services__group--sign  { --group-color: var(--magenta); }
.services__group--goods { --group-color: var(--yellow); }
.services__group--web   { --group-color: var(--ink); }

/* 面付け（印刷の割り付け）のように、細い線で区切った格子に並べる */
.services__grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.service {
  padding: clamp(24px, 3vw, 32px) clamp(20px, 2.4vw, 28px) clamp(28px, 3vw, 36px);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.service__icon {
  width: 48px; height: 48px;
  fill: none; stroke: var(--blue); stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.service__title { margin-top: 14px; font-size: 1.0625rem; font-weight: 900; line-height: 1.5; }
.service__text { margin-top: 8px; font-size: 0.9375rem; line-height: 1.8; color: #444; }

/* ここにないものも相談できることの案内 */
.services__consult {
  margin-top: clamp(40px, 5vw, 64px);
  padding: clamp(24px, 3.5vw, 40px);
  background: var(--paper-2);
  border-top: 4px solid var(--blue);
}
.services__consult-title { font-size: clamp(1.125rem, 2vw, 1.375rem); font-weight: 900; line-height: 1.5; }
.services__consult p + p { margin-top: 10px; }
.services__consult-mail a { font-weight: 700; }

@media (max-width: 1023px) { .services__grid { grid-template-columns: repeat(3, 1fr); } }

/* スマホ：説明文を省き、アイコンと名前を横に並べた2列の一覧にして、ひと目で見渡せるようにする */
@media (max-width: 767px) {
  .services__grid { grid-template-columns: repeat(2, 1fr); margin-top: 12px; }
  .service {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 8px;
  }
  .service__icon { flex: none; width: 26px; height: 26px; stroke-width: 2.2; }
  .service__title { margin-top: 0; font-size: 0.8125rem; line-height: 1.4; letter-spacing: 0; }
  .service__text { display: none; }
}

/* スマホ：タップした項目の説明を、画面の下から出すパネル（main.js で2枚を交互に使う） */
.services__hint { margin-top: 12px; font-size: 0.875rem; color: var(--gray); }
.service-sheet { display: none; }

@media (max-width: 767px) {
  .service { cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background-color .2s; }
  .service[aria-expanded="true"] { background: var(--paper-2); }
  .service[aria-expanded="true"] .service__title { color: var(--blue); }

  .service-sheet {
    display: block;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    padding: 20px 20px calc(24px + env(safe-area-inset-bottom));
    background: var(--paper);
    border-top: 4px solid var(--sheet-color, var(--blue));
    box-shadow: 0 -8px 24px rgba(0, 30, 60, .12);
    transform: translateY(110%);
    visibility: hidden;
    transition: transform .32s cubic-bezier(.2,.7,.2,1), visibility 0s linear .32s;
  }
  .service-sheet.is-open {
    transform: none;
    visibility: visible;
    transition: transform .32s cubic-bezier(.2,.7,.2,1), visibility 0s;
  }
  .service-sheet__head { display: flex; align-items: center; gap: 10px; padding-right: 72px; }
  .service-sheet__head .service__icon { flex: none; width: 32px; height: 32px; }
  .service-sheet__title { font-size: 1.0625rem; font-weight: 900; line-height: 1.4; }
  .service-sheet__text { margin-top: 10px; font-size: 0.9375rem; line-height: 1.8; }
  .service-sheet__close {
    position: absolute; top: 16px; right: 16px;
    font: 700 0.8125rem var(--font);
    padding: 6px 12px; border: 2px solid var(--ink); background: var(--paper); color: var(--ink);
    cursor: pointer;
  }
}
@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
  .service-sheet, .service-sheet.is-open { transition: none; }
}

/* ---------- アクセス ---------- */
.access { border-top: 1px solid var(--line); }
.access__inner {
  display: grid; gap: 48px;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  align-items: start;
}
.access__list {
  margin-top: 32px;
  display: grid; grid-template-columns: 5.5em 1fr;
  border-top: 1px solid var(--line);
}
.access__list dt, .access__list dd {
  padding: 14px 0; border-bottom: 1px solid var(--line); line-height: 1.7;
}
.access__list dt { font-weight: 700; color: var(--gray); font-size: 0.9375rem; }
.access__mail { word-break: break-all; }
.access__map iframe {
  display: block; width: 100%; aspect-ratio: 4 / 3; border: 0; background: var(--paper-2);
}
@media (max-width: 899px) { .access__inner { grid-template-columns: 1fr; } }

/* ---------- フッター ---------- */
.site-footer { background: var(--ink); color: rgba(255,255,255,.75); font-size: 0.875rem; }
.site-footer__inner {
  padding-block: 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap;
}

/* ==========================================================
   オープニング（約3.6秒）
   1. トンボの線が引かれる → 線が消えて四隅のトンボだけが残る
   2. C・M・Yの版がずれた位置から重なり、白い見出しになる
   3. 説明文とカラーバーが現れる
   画面を押す・キーを押す・スクロールすると、その場で終わる（main.js）
   2回目以降の表示と「動きを減らす」設定の人には出さない
   ========================================================== */
.hero__title { position: relative; }
.hero__title-text { display: block; }
.plate {
  position: absolute; inset: 0;
  mix-blend-mode: screen;   /* C・M・Yが重なると白に近くなる */
  opacity: 0;
  pointer-events: none;
}
.plate--c { color: var(--cyan); }
.plate--m { color: var(--magenta); }
.plate--y { color: var(--yellow); }

.guide { position: absolute; background: rgba(255,255,255,.7); opacity: 0; pointer-events: none; }
.guide--top, .guide--bottom { left: -18px; right: -18px; height: 1px; transform-origin: left center; }
.guide--left, .guide--right { top: -18px; bottom: -18px; width: 1px; transform-origin: center top; }
.guide--top { top: 0; }
.guide--bottom { bottom: 0; transform-origin: right center; }
.guide--left { left: 0; transform-origin: center bottom; }
.guide--right { right: 0; }

html:not(.skip-opening) .guide--top,
html:not(.skip-opening) .guide--bottom { animation: guide-x 2.08s cubic-bezier(.6,0,.2,1) both; }
html:not(.skip-opening) .guide--left,
html:not(.skip-opening) .guide--right { animation: guide-y 2.08s cubic-bezier(.6,0,.2,1) .14s both; }
html:not(.skip-opening) .trim { animation: fade-in .55s ease 1.66s both; }

html:not(.skip-opening) .plate--c { animation: plate-c 1.8s cubic-bezier(.2,.7,.2,1) .69s both, plate-out .55s ease 3.04s forwards; }
html:not(.skip-opening) .plate--m { animation: plate-m 1.8s cubic-bezier(.2,.7,.2,1) .69s both, plate-out .55s ease 3.04s forwards; }
html:not(.skip-opening) .plate--y { animation: plate-y 1.8s cubic-bezier(.2,.7,.2,1) .69s both, plate-out .55s ease 3.04s forwards; }
html:not(.skip-opening) .hero__title-text { animation: fade-in .55s ease 2.49s both; }

html:not(.skip-opening) .hero__lead  { animation: rise-in .83s ease 2.77s both; }
html:not(.skip-opening) .hero .colorbar span { animation: bar-in .62s cubic-bezier(.2,.7,.2,1) both; transform-origin: left center; }
html:not(.skip-opening) .hero .colorbar__c { animation-delay: 2.22s; }
html:not(.skip-opening) .hero .colorbar__m { animation-delay: 2.36s; }
html:not(.skip-opening) .hero .colorbar__y { animation-delay: 2.49s; }
html:not(.skip-opening) .hero .colorbar__k { animation-delay: 2.63s; }

@keyframes guide-x {
  0%   { opacity: 1; transform: scaleX(0); }
  55%  { opacity: 1; transform: scaleX(1); }
  100% { opacity: 0; transform: scaleX(1); }
}
@keyframes guide-y {
  0%   { opacity: 1; transform: scaleY(0); }
  55%  { opacity: 1; transform: scaleY(1); }
  100% { opacity: 0; transform: scaleY(1); }
}
@keyframes plate-c { from { opacity: 0; transform: translate(-18px, -10px); } 20% { opacity: 1; } to { opacity: 1; transform: none; } }
@keyframes plate-m { from { opacity: 0; transform: translate(16px, 8px); }   20% { opacity: 1; } to { opacity: 1; transform: none; } }
@keyframes plate-y { from { opacity: 0; transform: translate(6px, -16px); }  20% { opacity: 1; } to { opacity: 1; transform: none; } }
@keyframes plate-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes bar-in  { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* 念のため：動きを減らす設定では、どの状態でもアニメーションしない */
@media (prefers-reduced-motion: reduce) {
  .guide, .plate { display: none; }
  .trim, .hero__title-text, .hero__lead, .hero .colorbar span { animation: none !important; }
}

/* ==========================================================
   ループ（約2.4秒）：トンボの線が引かれ直し、見出しの版がずれてまた重なる
   main.js が一定間隔で .hero__sheet に .is-looping を付けて再生する
   ========================================================== */
.hero__sheet.is-looping .guide--top,
.hero__sheet.is-looping .guide--bottom { animation: guide-x 2.4s cubic-bezier(.6,0,.2,1) both; }
.hero__sheet.is-looping .guide--left,
.hero__sheet.is-looping .guide--right { animation: guide-y 2.4s cubic-bezier(.6,0,.2,1) .1s both; }
.hero__sheet.is-looping .hero__title-text { animation: loop-text 2.4s linear both; }
.hero__sheet.is-looping .plate--c { animation: loop-c 2.4s cubic-bezier(.45,0,.2,1) both; }
.hero__sheet.is-looping .plate--m { animation: loop-m 2.4s cubic-bezier(.45,0,.2,1) both; }
.hero__sheet.is-looping .plate--y { animation: loop-y 2.4s cubic-bezier(.45,0,.2,1) both; }

/* 白い文字を、重なったC・M・Yの版にすり替えて動かす。
   版が重なり終わったら、版の下で白い文字を先に戻し、最後に版を外す。
   こうすると、文字が消える瞬間ができない。 */
@keyframes loop-text { 0%, 80% { opacity: 0; } 92%, 100% { opacity: 1; } }
@keyframes loop-c { 0% { opacity: 1; transform: none; } 30%, 45% { transform: translate(-18px, -10px); } 80%, 100% { opacity: 1; transform: none; } }
@keyframes loop-m { 0% { opacity: 1; transform: none; } 30%, 45% { transform: translate(16px, 8px); }   80%, 100% { opacity: 1; transform: none; } }
@keyframes loop-y { 0% { opacity: 1; transform: none; } 30%, 45% { transform: translate(6px, -16px); }  80%, 100% { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .hero__sheet.is-looping .hero__title-text { animation: none !important; }
}
