/* ポートフォリオ(portfolio.html)。色・書体は styles.css と同じ(paper / ink / cobalt、Zen Kaku Gothic New) */
.site-header .nav a[aria-current="page"] { color: var(--cobalt); }

/* ---- ヒーローの写真(4作品を、整えて並べる) ---- */
.pf-bento { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, .8fr);
  grid-template-areas: "b2 b2 b3" "b1 b4 b3"; align-items: stretch; }
.pf-bento li { min-width: 0; display: flex; }
.pf-bento .b-1 { grid-area: b1; } .pf-bento .b-2 { grid-area: b2; } .pf-bento .b-3 { grid-area: b3; } .pf-bento .b-4 { grid-area: b4; }
.pf-bento a { position: relative; display: flex; flex-direction: column; flex: 1; min-width: 0; text-decoration: none; background: var(--white); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: 0 18px 40px -24px rgba(32, 53, 74, .5); transition: transform .2s ease, box-shadow .2s ease; }
.pf-bento a:hover { transform: translateY(-4px); box-shadow: 0 26px 50px -24px rgba(32, 53, 74, .6); }
.pf-bento img { display: block; width: 100%; height: auto; min-height: 0; object-fit: cover; object-position: top left; background: var(--mist); }
.pf-bento .b-2 img { aspect-ratio: 1100 / 640; flex: none; }
.pf-bento .b-1 img, .pf-bento .b-4 img { aspect-ratio: 1100 / 680; flex: none; }
.pf-bento .b-3 a { display: block; }
.pf-bento .b-3 img { position: absolute; left: 0; top: 0; width: 100%; height: calc(100% - 38px); object-fit: contain; object-position: center; background: var(--ink-deep); padding: 10px 6px 4px; }
.pf-bento .b-3 span { position: absolute; left: 0; right: 0; bottom: 0; height: 38px; }
.pf-bento .b-3 a { background: var(--ink-deep); border-color: var(--ink-deep); }
.pf-bento span { display: flex; align-items: center; gap: 8px; padding: 9px 12px; font-size: 13px; font-weight: 700; color: var(--ink-deep); background: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-bento .b-3 span { color: var(--paper); background: var(--ink-deep); }
.pf-bento b { font-size: 11px; letter-spacing: .08em; color: var(--cobalt); }
.pf-bento .b-3 b { color: var(--cobalt-light); }
.pf-hero .hero-lead b { color: var(--cobalt); }
.pf-hero .hero-title { font-size: clamp(34px, 5.4vw, 66px); }

/* ---- 導入 ---- */
.pf-intro { background: var(--mist); }
.pf-notes { list-style: none; margin: 32px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.pf-notes li { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); font-size: 15px; line-height: 1.8; color: var(--mute); }
.pf-notes b { display: block; color: var(--ink-deep); font-size: 17px; margin-bottom: 4px; }

/* ---- 作品 ---- */
.work { padding-block: clamp(56px, 8vw, 104px); position: relative; overflow: hidden; }
.work:nth-of-type(even) { background: var(--mist); }
.work-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.work.flip .work-copy { order: 2; }
.work-status { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 4px 14px; border: 1px solid var(--cobalt-light); border-radius: 999px; background: var(--white); font-size: 13px; font-weight: 700; color: var(--cobalt); }
.work-status .dot { width: 8px; height: 8px; border-radius: 50%; background: #2e9e5b; box-shadow: 0 0 0 4px rgba(46, 158, 91, .18); animation: pf-pulse 2s ease-in-out infinite; }
@keyframes pf-pulse { 50% { box-shadow: 0 0 0 8px rgba(46, 158, 91, 0); } }
html.no-motion .work-status .dot { animation: none; }
.work h2 { font-size: clamp(30px, 4.4vw, 48px); }
.work .lead { margin-top: 14px; }
.work-points { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 10px; }
.work-points li { position: relative; padding-left: 26px; font-size: 15px; line-height: 1.8; }
.work-points li::before { content: ""; position: absolute; left: 0; top: .62em; width: 14px; height: 8px; border-left: 3px solid var(--cobalt); border-bottom: 3px solid var(--cobalt); transform: rotate(-45deg) translateY(-50%); }
.work-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; padding: 0; font-size: 12.5px; font-weight: 700; color: var(--mute); }
.work-tags span { padding: 3px 12px; border-radius: 999px; background: var(--white); border: 1px solid var(--line); }
.work-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.work-fact { margin: 16px 0 0; font-size: 12.5px; color: var(--mute); line-height: 1.7; }

/* ---- デバイス枠(中に、動くデモを入れる) ---- */
.work-stage { display: grid; place-items: center; min-width: 0; }
.device { --w: 1100; --h: 680; --s: .5; position: relative; width: 100%; max-width: calc(var(--w) * 1px); }
.device-phone { max-width: 330px; }
.device-screen { position: relative; width: 100%; aspect-ratio: var(--w) / var(--h); overflow: hidden; background: var(--white); }
.device-phone { padding: 30px 12px 16px; background: var(--ink-deep); border-radius: 44px; box-shadow: var(--shadow), 0 0 0 2px #0e1c29 inset; }
.device-phone .device-screen { border-radius: 32px; }
.device-phone::before { content: ""; position: absolute; top: 11px; left: 50%; width: 64px; height: 8px; border-radius: 6px; background: #0e1c29; transform: translateX(-50%); z-index: 3; }
.device-browser { border-radius: 16px; background: var(--white); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; }
.device-bar { display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; background: var(--mist); border-bottom: 1px solid var(--line); font-size: 12px; color: var(--mute); }
.device-bar i { width: 10px; height: 10px; border-radius: 50%; background: #d4d8d6; }
.device-bar span { margin-left: 10px; padding: 2px 12px; border-radius: 999px; background: var(--white); border: 1px solid var(--line); }
.device-screen .poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top left; transition: opacity .5s ease; }
.device-screen iframe { position: absolute; left: 0; top: 0; width: calc(var(--w) * 1px); height: calc(var(--h) * 1px); border: 0; background: var(--white); transform: scale(var(--s)); transform-origin: 0 0; opacity: 0; transition: opacity .5s ease; }
.device.live iframe { opacity: 1; }
.device.live .poster { opacity: 0; pointer-events: none; }
.demo-caption { margin: 18px 0 0; text-align: center; font-size: 13px; font-weight: 700; color: var(--cobalt); }
.work-stage { align-content: center; }
.work-stage .glow { position: absolute; inset: 8% 4% auto auto; width: 60%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(closest-side, rgba(181, 200, 214, .55), transparent); z-index: -1; filter: blur(10px); }

/* ---- つくり方 ---- */
.pf-how { background: var(--paper); }
.pf-steps { list-style: none; margin: 32px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; counter-reset: s; }
.pf-steps li { position: relative; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 24px; box-shadow: var(--shadow); }
.pf-steps .n { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--cobalt); color: var(--white); font-weight: 900; }
.pf-steps h3 { margin: 12px 0 6px; font-size: 19px; color: var(--ink-deep); }
.pf-steps p { margin: 0; font-size: 14.5px; line-height: 1.8; color: var(--mute); }

/* ---- 大きく開く ---- */
.pf-modal { width: min(1200px, 96vw); height: min(860px, 92vh); max-width: none; max-height: none; padding: 0; border: 0; border-radius: 18px; background: var(--ink-deep); color: var(--paper); box-shadow: 0 40px 100px rgba(0, 0, 0, .5); overflow: hidden; }
.pf-modal::backdrop { background: rgba(14, 28, 41, .72); backdrop-filter: blur(4px); }
.pf-modal[open] { display: flex; flex-direction: column; }
.pf-modal-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; font-size: 14px; }
.pf-modal-bar button { font: inherit; font-weight: 700; color: var(--paper); background: rgba(250, 249, 246, .12); border: 1px solid rgba(250, 249, 246, .3); border-radius: 999px; padding: 6px 16px; cursor: pointer; }
.pf-modal-bar button:hover { background: rgba(250, 249, 246, .24); }
.pf-modal-body { position: relative; flex: 1; min-height: 0; background: var(--white); }
.pf-modal-body iframe { position: absolute; left: 0; top: 0; border: 0; background: var(--white); transform-origin: 0 0; }

@media (max-width: 860px) {
  .work-grid { grid-template-columns: minmax(0, 1fr); }
  .work.flip .work-copy { order: 0; }
  .pf-bento { margin-top: 12px; gap: 10px; }
  .pf-bento span { font-size: 11.5px; padding: 7px 9px; }
}
@media (prefers-reduced-motion: reduce) { .work-status .dot { animation: none; } .pf-bento a { transition: none; } }

/* ---- 数字で見る ---- */
.pf-stats { background: var(--ink-deep); color: var(--paper); padding-block: clamp(40px, 6vw, 72px); }
.pf-stat-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: clamp(18px, 3vw, 40px); text-align: center; }
.pf-stat-list b { display: block; font-size: clamp(40px, 6vw, 64px); line-height: 1.1; font-weight: 900; letter-spacing: .01em; color: var(--paper); font-variant-numeric: tabular-nums; }
.pf-stat-list small { font-size: .32em; margin-left: 4px; color: var(--cobalt-light); letter-spacing: .06em; }
.pf-stat-list li > span { display: block; margin-top: 6px; font-size: 13.5px; line-height: 1.6; color: rgba(250, 249, 246, .78); }
.pf-stat-note { margin: 28px 0 0; text-align: center; font-size: 12px; color: rgba(250, 249, 246, .6); }

/* ---- トップページに差し込む、ポートフォリオの入口 ---- */
.pf-teaser { padding-block: clamp(56px, 8vw, 96px); background: var(--paper); }
.pf-teaser-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.pf-teaser h2 { font-size: clamp(26px, 3vw, 38px); }
.pf-teaser-list { list-style: none; margin: 22px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; font-weight: 700; color: var(--cobalt); }
.pf-teaser-list li { padding: 4px 14px; border: 1px solid var(--cobalt-light); border-radius: 999px; background: var(--white); }
.pf-teaser .more { margin: 28px 0 0; }
@media (max-width: 860px) { .pf-teaser-grid { grid-template-columns: minmax(0, 1fr); } }
