/* =========================================================
   Tokens
========================================================= */
:root{
  --bg: #1C1A17;
  --bg-elevated: #26221E;
  --bg-elevated-2: #302A24;
  --text: #F3EDE4;
  --text-muted: #A79C8E;
  --accent: #C97B63;
  --accent-soft: rgba(201,123,99,0.16);
  --accent-blue: #6E93A8;
  --moon: #F3D27A;
  --line: rgba(243,237,228,0.10);
  --line-strong: rgba(243,237,228,0.18);

  --kids-bg: #FFF6E9;
  --kids-ink: #4A3A2C;
  --kids-ink-muted: #7A6A57;
  --kids-pink: #F4A9A8;
  --kids-green: #B8D8A8;
  --kids-sky: #A8D4E0;
  --kids-yellow: #F3D27A;

  --font-head: "Zen Kaku Gothic New", "Noto Sans JP", sans-serif;
  --font-body: "Noto Sans JP", sans-serif;
  --font-round: "Zen Maru Gothic", "Noto Sans JP", sans-serif;

  --content-w: 960px;
  --header-h: 64px;
  --ease: cubic-bezier(.22,.68,0,1);
  --ease-bounce: cubic-bezier(.34,1.56,.64,1);
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *, *::before, *::after{ animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body{
  margin:0;
  background: var(--sky-bottom, var(--bg));
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* 飾り(雲・光・月など)がはみ出しても、ページが横にずれないようにする */
html, body{ overflow-x: clip; }

h1,h2,h3,h4{
  font-family: var(--font-head);
  margin: 0;
  line-height: 1.35;
}

a{ color: inherit; text-decoration: none; }
button{ font: inherit; color: inherit; }
img{ max-width: 100%; height: auto; display:block; }

::selection{ background: var(--accent); color: var(--bg); }

:focus-visible{
  outline: 2px solid var(--accent-blue);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link{
  position:absolute; left: 12px; top: -60px;
  z-index: 200;
  padding: 8px 14px;
  background: var(--accent); color: var(--bg);
  border-radius: 8px;
  font-size: .88rem;
}
.skip-link:focus{ top: 12px; }

.section-inner{
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 0 24px;
}

.section{ padding: 120px 0; }
@media (max-width: 600px){ .section{ padding: 88px 0; } }

.section-kicker{
  font-family: var(--font-round);
  color: var(--accent);
  font-size: .8rem;
  letter-spacing: .2em;
  margin: 0 0 4px;
}

.section-title{
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}

.section-lead{
  color: var(--text-muted);
  margin: 0 0 48px;
  font-size: 0.98rem;
}

.br-pc{ display: inline; }
@media (max-width:600px){ .br-pc{ display:none; } }

/* =========================================================
   仮データの目印
   data-todo が付いた要素は「仮」と小さく表示する。
   URL に ?todo を付けると、仮の場所を枠で囲んで一覧しやすくする。
========================================================= */
[data-todo]{ position: relative; }
.stat[data-todo]::after,
.case-metric[data-todo]::after{
  content: "仮";
  position:absolute; top: -8px; right: -8px;
  font-size: .62rem; line-height: 1;
  padding: 3px 5px;
  border-radius: 6px;
  background: var(--bg-elevated-2);
  color: var(--text-muted);
  border: 1px dashed var(--line-strong);
}
html.show-todo [data-todo]{
  outline: 2px dashed #E5B567;
  outline-offset: 4px;
}
html.show-todo [data-todo]::before{
  content: "仮: " attr(data-todo);
  position:absolute; left: 0; top: -22px;
  z-index: 5;
  font-size: .68rem; line-height: 1.6;
  padding: 0 6px;
  background: #E5B567; color: #1C1A17;
  border-radius: 4px;
  white-space: nowrap;
}

/* =========================================================
   Header / Nav
========================================================= */
.site-header{
  position: fixed;
  top:0; left:0; right:0;
  z-index: 100;
  height: var(--header-h);
  display:flex;
  align-items:center;
  justify-content: space-between;
  padding: 0 28px;
  background: rgba(28,26,23,0.72);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .3s var(--ease), transform .4s var(--ease);
}
.site-header.is-scrolled{ box-shadow: 0 8px 24px rgba(0,0,0,0.25); }

.brand{
  display:inline-flex; align-items:center; gap: 8px;
  font-family: var(--font-round);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}
.brand-moon{ color: var(--moon); transition: transform .6s var(--ease-bounce); }
.brand:hover .brand-moon{ transform: rotate(-25deg) scale(1.1); }

.main-nav{ display:flex; gap: 26px; position: relative; }
.main-nav a{
  font-size: 0.86rem;
  color: var(--text-muted);
  padding: 6px 0;
  transition: color .25s var(--ease);
}
.main-nav a:hover,
.main-nav a.is-current{ color: var(--text); }

/* 現在地の下線。JSで left / width を動かしてスライドさせる */
.nav-indicator{
  position:absolute; bottom: -2px; left: 0;
  height: 2px; width: 0;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0;
  transition: left .45s var(--ease), width .45s var(--ease), opacity .3s;
}
.nav-indicator.is-on{ opacity: 1; }

.scroll-progress{
  position:absolute; left:0; right:0; bottom:-1px;
  height: 2px;
  pointer-events:none;
}
.scroll-progress span{
  display:block; height:100%;
  width: 100%;
  transform-origin: left;
  transform: scaleX(var(--p, 0));
  background: linear-gradient(90deg, var(--accent-blue), var(--accent), var(--moon));
}

.nav-toggle{
  display:none;
  flex-direction: column;
  gap: 5px;
  background:none;
  border:none;
  cursor:pointer;
  padding: 8px;
}
.nav-toggle span{
  width:22px; height:2px;
  background: var(--text);
  display:block;
  transition: transform .3s var(--ease), opacity .3s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1){ transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2){ opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3){ transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 900px){
  .nav-toggle{ display:flex; }
  /* スマホのメニューは画面いっぱい。項目が上から順に すっと出てくる */
  .main-nav{
    position:fixed;
    left: 0; right: 0; top: var(--header-h);
    height: calc(100svh - var(--header-h));
    flex-direction: column;
    justify-content: center;
    gap: 0;
    background: rgba(20,19,26,0.97);
    padding: 24px 32px 64px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .35s var(--ease);
  }
  .main-nav.is-open{ opacity: 1; pointer-events: auto; }
  .main-nav a{
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
    font-family: var(--font-head);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .4s var(--ease), transform .5s var(--ease), color .25s;
  }
  .main-nav.is-open a{ opacity: 1; transform: none; }
  .main-nav.is-open a:nth-child(1){ transition-delay: 60ms; }
  .main-nav.is-open a:nth-child(2){ transition-delay: 105ms; }
  .main-nav.is-open a:nth-child(3){ transition-delay: 150ms; }
  .main-nav.is-open a:nth-child(4){ transition-delay: 195ms; }
  .main-nav.is-open a:nth-child(5){ transition-delay: 240ms; }
  .main-nav.is-open a:nth-child(6){ transition-delay: 285ms; }
  .main-nav.is-open a:nth-child(7){ transition-delay: 330ms; }
  .main-nav.is-open a:nth-child(8){ transition-delay: 375ms; }
  .main-nav a.is-current{ color: var(--accent); }
  .nav-indicator{ display:none; }
}
html.nav-open{ overflow: hidden; }

/* 下へ読んでいる間はヘッダーを引っこめる */
.site-header.is-hidden{ transform: translateY(-100%); }
.site-header.is-hidden .scroll-progress{ transform: translateY(1px); } /* 読んだ量のバーだけは画面の上端に残す */

/* =========================================================
   右端の現在地ドット
========================================================= */
.dot-nav{
  position: fixed;
  right: 22px; top: 50%;
  transform: translateY(-50%);
  z-index: 90;
  display:flex; flex-direction: column; gap: 14px;
  opacity: 0;
  transition: opacity .4s var(--ease);
}
.dot-nav.is-visible{ opacity: 1; }
.dot-nav a{
  position: relative;
  display:block;
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--text-muted);
  transition: transform .35s var(--ease-bounce), background .3s, border-color .3s;
}
.dot-nav a:hover{ transform: scale(1.3); border-color: var(--text); }
.dot-nav a.is-current{
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.35);
}
.dot-nav a.is-seen:not(.is-current){ background: var(--text-muted); }
.dot-nav .dot-label{
  position:absolute; right: 22px; top: 50%;
  transform: translate(6px, -50%);
  white-space: nowrap;
  font-size: .75rem;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--bg-elevated-2);
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s var(--ease);
}
.dot-nav a:hover .dot-label,
.dot-nav a:focus-visible .dot-label{ opacity: 1; transform: translate(0, -50%); }
/* kids-zone の上では見やすい色に切り替える */
.dot-nav.on-light a{ border-color: var(--kids-ink-muted); }
.dot-nav.on-light a.is-seen:not(.is-current){ background: var(--kids-ink-muted); }

@media (max-width: 1100px){ .dot-nav{ display:none; } }

/* =========================================================
   Buttons / links (共通)
========================================================= */
.btn{
  display:inline-flex; align-items:center; gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 500;
  transition: background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
  will-change: transform;
}
.btn--primary{
  background: var(--accent);
  color: var(--bg);
  box-shadow: 0 8px 28px rgba(201,123,99,.28);
}
.btn--primary:hover{ background: #D88D75; box-shadow: 0 10px 36px rgba(201,123,99,.42); }
.btn--primary svg{ transition: transform .3s var(--ease); }
.btn--primary:hover svg{ transform: translateY(3px); }
.btn--ghost{
  border: 1px solid var(--line-strong);
  color: var(--text);
}
.btn--ghost:hover{ border-color: var(--text-muted); background: rgba(243,237,228,.04); }

.text-link{
  display:inline-flex; align-items:center; gap: 6px;
  color: var(--accent);
  font-size: 0.88rem;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size .35s var(--ease);
}
.text-link:hover{ background-size: 100% 1px; }
.text-link span{ transition: transform .3s var(--ease); }
.text-link:hover span{ transform: translateX(3px); }

.tag-list{
  list-style:none;
  display:flex; flex-wrap: wrap; gap: 6px;
  margin: 0; padding: 0;
}
.tag-list li{
  font-size: .72rem;
  line-height: 1;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--text-muted);
}

/* =========================================================
   Hero
========================================================= */
.hero{
  min-height: 100svh;
  display:flex;
  flex-direction: column;
  align-items:center;
  justify-content:center;
  text-align:center;
  position: relative;
  padding: calc(var(--header-h) + 48px) 24px 124px;
  overflow: hidden;
}

.hero-orb{
  position:absolute;
  width: 62vw; height: 62vw;
  max-width: 720px; max-height: 720px;
  border-radius: 50%;
  top: 50%; left: 50%;
  transform: translate(-50%,-55%);
  background: radial-gradient(circle at 42% 38%, var(--accent-soft), transparent 68%);
  filter: blur(10px);
  animation: orb-breathe 9s ease-in-out infinite;
  pointer-events: none;
}
@keyframes orb-breathe{
  0%,100%{ transform: translate(-50%,-55%) scale(1); }
  50%{ transform: translate(-50%,-55%) scale(1.08); }
}

.hero-inner{ position: relative; max-width: 720px; }

.hero-eyebrow{
  font-family: var(--font-round);
  color: var(--accent);
  font-size: 0.85rem;
  letter-spacing: .12em;
  margin: 0 0 18px;
  opacity:0;
  animation: rise .7s var(--ease) forwards;
  animation-delay: .1s;
}

.hero-title{
  font-size: clamp(2rem, 5.4vw, 3.4rem);
  font-weight: 900;
  margin-bottom: 26px;
}
.hero-line{
  display:block;
  opacity:0;
  transform: translateY(16px);
  animation: rise .8s var(--ease) forwards;
  animation-delay: calc(0.25s + var(--d) * 0.14s);
}
.hero-em{
  font-style: normal;
  background: linear-gradient(transparent 62%, rgba(201,123,99,.45) 62%) 0 0 / 0 100% no-repeat;
  animation: marker .9s var(--ease) calc(1.1s + var(--m, 0) * .22s) forwards;
}
@keyframes marker{ to{ background-size: 100% 100%; } }
@keyframes rise{
  to{ opacity:1; transform: translateY(0); }
}

.hero-lead{
  color: var(--text-muted);
  font-size: 1rem;
  margin: 0 0 36px;
  opacity:0;
  animation: rise .8s var(--ease) forwards;
  animation-delay: .75s;
}

.hero-stats{
  list-style:none;
  display:flex; justify-content:center;
  gap: 12px;
  margin: 0 0 40px; padding: 0;
  opacity:0;
  animation: rise .8s var(--ease) forwards;
  animation-delay: .9s;
}
.stat{
  min-width: 150px;
  padding: 14px 18px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(38,34,30,.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.stat-num{
  display:block;
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 2rem;
  line-height: 1.1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.stat-num small{ font-size: .5em; font-weight: 700; color: var(--text-muted); margin: 0 1px; }
.stat-label{
  display:block;
  margin-top: 6px;
  font-size: .72rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.hero-ctas{
  display:flex; justify-content:center; flex-wrap: wrap;
  gap: 12px;
  opacity:0;
  animation: rise .8s var(--ease) forwards;
  animation-delay: 1.05s;
}

@media (max-width: 600px){
  .hero-stats{ gap: 8px; }
  .stat{ min-width: 0; flex: 1; padding: 12px 6px 10px; }
  .stat-num{ font-size: 1.5rem; }
  .stat-label{ font-size: .66rem; }
  .hero-ctas .btn{ width: 100%; justify-content:center; }
}

/* スクロールのヒント: 何もしないで3秒たつと出てくる(JSで .is-shown) */
.scroll-hint{
  position:absolute;
  bottom: 28px; left:50%;
  transform: translate(-50%, 8px);
  display:flex; flex-direction: column; align-items:center; gap: 6px;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity .6s var(--ease), transform .6s var(--ease);
  pointer-events: none;
}
.scroll-hint.is-shown{ opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.scroll-hint-text{ font-size: .68rem; letter-spacing: .2em; font-family: var(--font-round); }
.scroll-hint-line{
  display:block;
  width:1px; height: 42px;
  background: linear-gradient(var(--text-muted), transparent);
  transform-origin: top;
  animation: hint-move 1.8s ease-in-out infinite;
}
@keyframes hint-move{
  0%{ transform: scaleY(0); opacity: 1; }
  60%{ transform: scaleY(1); opacity: 1; }
  100%{ transform: scaleY(1); opacity: 0; }
}

/* =========================================================
   Reveal-on-scroll
========================================================= */
.reveal{
  opacity:0;
  transform: translateY(22px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
.reveal.is-visible{
  opacity:1;
  transform: translateY(0);
}

/* =========================================================
   About
========================================================= */

.timeline{
  list-style:none;
  margin:0; padding:0;
  position: relative;
}
/* 縦線は、スクロールに合わせて上から伸びる(JSで --tl を 0〜1) */
.timeline::before,
.timeline::after{
  content:"";
  position:absolute; left: 0; top: 0; bottom: 0;
  width: 1px;
}
.timeline::before{ background: var(--line); }
.timeline::after{
  background: linear-gradient(var(--accent), var(--moon));
  transform-origin: top;
  transform: scaleY(var(--tl, 0));
}
.timeline-item{
  position: relative;
  padding: 0 0 40px 30px;
}
.timeline-item:last-child{ padding-bottom:0; }
.timeline-item::before{
  content:"";
  position:absolute;
  left:-5px; top: 6px;
  width:11px; height:11px;
  border-radius:50%;
  background: var(--bg);
  border: 2px solid var(--line-strong);
  z-index: 1;
  transition: background .4s, border-color .4s, box-shadow .4s;
}
.timeline-item.is-lit::before{
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft);
}
.timeline-year{
  display:block;
  font-family: var(--font-round);
  color: var(--accent);
  font-size: 0.85rem;
  margin-bottom: 6px;
}
.timeline-content h3{
  font-size: 1.05rem;
  margin-bottom: 8px;
}
.timeline-content p{
  color: var(--text-muted);
  margin:0;
  font-size: 0.94rem;
}

/* =========================================================
   Skills
========================================================= */
.skills-grid{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.skill-group{
  padding: 22px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-elevated);
}
.skill-group h3{
  font-size: 0.9rem;
  color: var(--accent-blue);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.skill-group ul{
  list-style:none;
  margin:0; padding:0;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.skill-group li{ padding: 4px 0; }

@media (max-width: 800px){
  .skills-grid{ grid-template-columns: repeat(2,1fr); }
}

/* =========================================================
   Works — ケーススタディ
========================================================= */
.case-list{
  display:grid;
  gap: 24px;
}
.case-card{
  position: relative;
  padding: 32px 32px 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(160deg, var(--bg-elevated), var(--bg) 70%);
  overflow: hidden;
  transition: border-color .4s var(--ease);
}
/* ポインターに追従する、ほのかな光 */
.case-card::before{
  content:"";
  position:absolute; inset: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, -200px), rgba(201,123,99,.10), transparent 60%);
  pointer-events:none;
  transition: opacity .4s;
}
.case-card:hover{ border-color: var(--line-strong); }

.case-head{ margin-bottom: 22px; }
.case-no{
  display:block;
  font-family: var(--font-round);
  font-size: .75rem;
  letter-spacing: .14em;
  color: var(--accent);
  margin-bottom: 4px;
}
.case-head h3{ font-size: 1.25rem; margin-bottom: 12px; }

.case-flow{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 0 0 22px;
  counter-reset: flow;
}
.case-flow > div{
  position: relative;
  padding: 0 22px 0 0;
}
.case-flow > div + div{ padding-left: 22px; border-left: 1px solid var(--line); }
.case-flow dt{
  font-size: .78rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  display:flex; align-items:center; gap: 8px;
}
.case-flow dt::before{
  counter-increment: flow;
  content: counter(flow);
  display:inline-grid; place-items:center;
  width: 20px; height: 20px;
  border-radius: 50%;
  font-size: .68rem;
  background: var(--bg-elevated-2);
  color: var(--accent);
}
.case-flow dd{
  margin: 0;
  color: var(--text-muted);
  font-size: .9rem;
  line-height: 1.75;
}

.case-metric{
  padding: 16px 18px;
  border-radius: 14px;
  background: rgba(0,0,0,.18);
  border: 1px solid var(--line);
  margin-bottom: 16px;
}
.metric-title{ margin: 0 0 10px; font-size: .78rem; color: var(--text-muted); }
.metric-row{
  display:grid;
  grid-template-columns: 56px 1fr 52px;
  align-items:center;
  gap: 12px;
  font-size: .78rem;
}
.metric-row + .metric-row{ margin-top: 8px; }
.metric-row span{ color: var(--text-muted); }
.metric-row b{ text-align: right; font-variant-numeric: tabular-nums; }
.metric-row.is-after b{ color: var(--moon); }
.bar{
  height: 10px;
  border-radius: 999px;
  background: rgba(243,237,228,.06);
  overflow: hidden;
}
.bar i{
  display:block; height:100%;
  border-radius: inherit;
  background: var(--text-muted);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 1.1s var(--ease) .2s;
}
.metric-row.is-after .bar i{ background: linear-gradient(90deg, var(--accent), var(--moon)); transition-delay: .5s; }
.case-metric.is-visible .bar i,
.is-visible .case-metric .bar i{ transform: scaleX(var(--v)); }

.case-more{
  margin-bottom: 16px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.case-more summary{
  cursor: pointer;
  list-style: none;
  font-size: .86rem;
  color: var(--text);
  display:flex; align-items:center; gap: 8px;
}
.case-more summary::-webkit-details-marker{ display:none; }
.case-more summary::before{
  content:"+";
  display:inline-grid; place-items:center;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  font-size: .8rem;
  transition: transform .3s var(--ease);
}
.case-more[open] summary::before{ transform: rotate(45deg); }
.case-more p{
  margin: 10px 0 0 28px;
  color: var(--text-muted);
  font-size: .9rem;
}

@media (max-width: 760px){
  .case-card{ padding: 26px 20px 22px; }
  .case-flow{ grid-template-columns: 1fr; gap: 14px; }
  .case-flow > div,
  .case-flow > div + div{ padding: 0 0 0 0; border-left: none; }
}

/* =========================================================
   スマホの枠(アプリ画面を見せる)
========================================================= */
.phone{
  position: relative;
  width: 100%;
  aspect-ratio: 390 / 844;
  border-radius: 28px;
  padding: 7px;
  background: #0E0D0B;
  box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 24px 48px rgba(0,0,0,.45);
  overflow: hidden;
  transition: transform .5s var(--ease);
}
.phone img{
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 22px;
}
.phone::after{ /* ノッチ */
  content:"";
  position:absolute; top: 12px; left: 50%;
  width: 34%; height: 14px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #0E0D0B;
}

/* =========================================================
   Projects — calm zone (base theme)
========================================================= */
.projects-subhead{
  font-size: 1.05rem;
  margin-bottom: 24px;
  color: var(--text-muted);
}

.project-card--calm{
  display:grid;
  grid-template-columns: 200px 1fr;
  gap: 40px;
  align-items:center;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 32px 40px;
}
.project-card--calm .phone{ transform: rotate(-3deg); }
.project-card--calm:hover .phone{ transform: rotate(0) translateY(-6px); }

.status-badge{
  display:inline-block;
  margin: 0 0 10px;
  font-size: .72rem;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(110,147,168,.16);
  color: #9EC0D2;
}
.project-body h4{ font-size: 1.25rem; margin-bottom: 10px; }
.project-body > p{
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 0 0 14px;
}
.project-body .tag-list{ margin-bottom: 14px; }
.project-points{
  list-style:none;
  margin: 0 0 18px; padding: 0;
  font-size: .86rem;
}
.project-points li{
  position: relative;
  padding-left: 20px;
  margin-bottom: 4px;
}
.project-points li::before{
  content:"";
  position:absolute; left: 2px; top: .62em;
  width: 8px; height: 8px;
  border-radius: 50%;
  border: 2px solid var(--accent);
}

@media (max-width: 640px){
  .project-card--calm{ grid-template-columns: 1fr; padding: 28px 22px; gap: 28px; }
  .project-card--calm .phone{ max-width: 180px; margin: 0 auto; }
}

/* =========================================================
   Projects — kids zone (tone switch happens here)
========================================================= */
.kids-zone{
  margin-top: 170px;
  padding: 80px 0 110px;
  background: var(--kids-bg);
  color: var(--kids-ink);
  position: relative;
}

.kids-zone .projects-subhead--kids{
  position: relative;
  font-family: var(--font-round);
  color: var(--kids-ink);
  font-weight: 700;
  font-size: 1.3rem;
  margin-bottom: 32px;
}

.projects-row--kids{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.project-card--kids{
  display:flex; flex-direction: column;
  background: #fff;
  border-radius: 28px;
  padding: 24px 24px 26px;
  box-shadow: 0 10px 0 rgba(74,58,44,0.06);
  transition: transform .4s var(--ease-bounce), box-shadow .4s var(--ease);
}
.project-card--kids:hover{
  transform: translateY(-8px) rotate(-0.6deg);
  box-shadow: 0 18px 0 rgba(74,58,44,0.07);
}
.project-card--kids:nth-child(2):hover{ transform: translateY(-8px) rotate(0.6deg); }

.phone--kids{
  width: 58%;
  margin: 0 auto 22px;
  border-radius: 24px;
  padding: 5px;
  box-shadow: 0 0 0 4px var(--kids-yellow), 0 14px 28px rgba(74,58,44,.18);
}
.phone--kids img{ border-radius: 19px; }
.phone--kids::after{ height: 10px; top: 9px; }
.project-card--kids:nth-child(2) .phone--kids{ box-shadow: 0 0 0 4px var(--kids-sky), 0 14px 28px rgba(74,58,44,.18); }
.project-card--kids:nth-child(3) .phone--kids{ box-shadow: 0 0 0 4px var(--kids-pink), 0 14px 28px rgba(74,58,44,.18); }
.project-card--kids:hover .phone--kids{ transform: translateY(-4px) rotate(-2deg); }
.phone--blank{
  display:grid; place-items:center;
  background: #FCEBDD;
  color: var(--kids-pink);
}
.phone--blank::after{ background: #F1D9C6; }

.project-card--kids .project-body{ display:flex; flex-direction: column; flex: 1; }
.status-badge--kids{
  align-self: flex-start;
  background: #EAF4E3;
  color: #5B8A4B;
}
.project-card--kids h4{
  font-family: var(--font-round);
  color: var(--kids-ink);
  font-size: 1.1rem;
  margin-bottom: 8px;
}
.project-card--kids .project-body > p{
  color: var(--kids-ink-muted);
  font-size: 0.88rem;
}
.tag-list--kids li{ border-color: #EADCC8; color: var(--kids-ink-muted); }
.kids-btn{
  align-self: flex-start;
  margin-top: auto;
  display:inline-flex; align-items:center; gap: 6px;
  color: #fff;
  background: var(--accent);
  padding: 10px 20px;
  border-radius: 999px;
  font-family: var(--font-round);
  font-weight: 700;
  font-size: 0.86rem;
  box-shadow: 0 4px 0 #A55E48;
  transition: transform .15s var(--ease), box-shadow .15s var(--ease);
}
.kids-btn:hover{ transform: translateY(-2px); box-shadow: 0 6px 0 #A55E48; }
.kids-btn:active{ transform: translateY(3px); box-shadow: 0 1px 0 #A55E48; }

@media (max-width: 860px){
  .projects-row--kids{ grid-template-columns: 1fr; max-width: 420px; margin: 0 auto; }
  .phone--kids{ width: 44%; }
}

/* =========================================================
   Characters
========================================================= */
.character-list{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.character-card{
  text-align:center;
  padding: 32px 22px;
  background: var(--bg-elevated);
  border-radius: 24px;
  border: 1px solid var(--line);
}
.character-visual{
  position: relative;
  width: 132px; height: 132px;
  margin: 0 auto 20px;
  padding: 0;
  border: none;
  border-radius: 50%;
  display:flex; align-items:center; justify-content:center;
  background: var(--bg-elevated-2);
  overflow:hidden;
}
button.character-visual{ cursor: pointer; transition: transform .3s var(--ease-bounce); }
button.character-visual:hover{ transform: scale(1.05); }
button.character-visual:active{ transform: scale(.95); }

.character-visual--piko{ background: radial-gradient(circle at 50% 40%, #EAF4FF, var(--kids-sky)); overflow: visible; }
.piko{ animation: piko-float 3.2s ease-in-out infinite; overflow: visible; }
@keyframes piko-float{
  0%,100%{ transform: translateY(0); }
  50%{ transform: translateY(-5px); }
}
.piko-bang{ display:none; }
.piko.is-surprised .piko-hatena{ display:none; }
.piko.is-surprised .piko-bang{ display:inline; }
.piko.is-boing{ animation: piko-boing .65s ease-in-out; transform-origin: 50% 92%; }
@keyframes piko-boing{
  0%  { transform: scale(1,1); }
  18% { transform: scale(.75,1.48); }
  38% { transform: scale(1.18,.8); }
  55% { transform: scale(.9,1.14); }
  72% { transform: scale(1.06,.94); }
  88% { transform: scale(.98,1.03); }
  100%{ transform: scale(1,1); }
}

.character-visual--dango{ background: radial-gradient(circle at 50% 40%, #FFF3D0, var(--kids-yellow)); }
.dango-img{
  position:absolute;
  width: 78%;
  transition: opacity .2s, transform .45s var(--ease-bounce);
}
.dango-img--curl{ opacity: 0; transform: scale(.6) rotate(-90deg); width: 70%; }
.character-visual--dango.is-curled .dango-img--walk{ opacity: 0; transform: scale(.7); }
.character-visual--dango.is-curled .dango-img--curl{ opacity: 1; transform: scale(1) rotate(0); }
.character-visual--dango.is-rolling .dango-img--curl{ animation: dango-roll .9s var(--ease) ; }
@keyframes dango-roll{
  0%{ transform: translateX(0) rotate(0); }
  45%{ transform: translateX(16px) rotate(200deg); }
  100%{ transform: translateX(0) rotate(360deg); }
}

/* ねむひつじ: 元画像は横長(1024x512)なので、ひつじの顔あたりを丸く切り抜く */
.character-visual--nemu{ background: #FBF7EF; }
.nemu-img{
  position:absolute;
  /* 画像は ひつじのまわりだけに切り出してある。顔が円の中央に来るように置く */
  width: 123%; max-width: none;
  left: -12.1%; top: -6.6%;
  transition: opacity .6s var(--ease);
}
.nemu-img--blue{ opacity: 0; }
.character-visual--nemu[data-scarf="blue"] .nemu-img--blue{ opacity: 1; }
.character-visual--nemu[data-scarf="blue"] .nemu-img--red{ opacity: 0; }

.character-card h3{
  font-family: var(--font-round);
  font-size: 1.1rem;
  margin-bottom: 10px;
}
.character-card p{
  color: var(--text-muted);
  font-size: 0.88rem;
  margin: 0;
}

.nemu-toggle{
  display:inline-flex;
  position: relative;
  gap: 0;
  margin-top: 18px;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.nemu-btn{
  position: relative; z-index: 1;
  font-family: var(--font-round);
  font-size: 0.82rem;
  padding: 6px 16px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor:pointer;
  transition: background .3s var(--ease), color .3s var(--ease);
}
.nemu-btn.is-active[data-scarf="red"]{ background: var(--accent); color: var(--bg); }
.nemu-btn.is-active[data-scarf="blue"]{ background: var(--accent-blue); color: var(--bg); }

@media (max-width: 860px){
  .character-list{ grid-template-columns: 1fr; max-width: 380px; margin: 0 auto; }
}

/* =========================================================
   Notes
========================================================= */
.notes-list{
  display:flex;
  flex-direction: column;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow:hidden;
}
.note-card{
  display:flex; align-items:center; justify-content: space-between; gap: 16px;
  background: var(--bg);
  padding: 24px 28px;
  transition: background .3s var(--ease);
}
.note-card:hover{ background: var(--bg-elevated); }
.note-card h3{ font-size: 1rem; margin-bottom: 4px; }
.note-card p{ color: var(--text-muted); font-size: 0.86rem; margin:0; }
.note-arrow{
  flex-shrink: 0;
  display:grid; place-items:center;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  color: var(--text-muted);
  transition: transform .35s var(--ease), background .3s, color .3s, border-color .3s;
}
.note-card:hover .note-arrow{ transform: translateX(4px); background: var(--accent); border-color: var(--accent); color: var(--bg); }

/* =========================================================
   Contact
========================================================= */
.contact{ text-align: center; }
.contact .section-lead{ margin-bottom: 32px; }
.contact-links{ display:flex; justify-content:center; gap: 16px; }
.contact-link{
  display:inline-flex;
  align-items:center;
  gap: 10px;
  padding: 14px 26px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 0.95rem;
  transition: border-color .25s var(--ease), color .25s var(--ease), background .25s var(--ease);
}
.contact-link:hover{ border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* =========================================================
   Footer
========================================================= */
.site-footer{
  text-align:center;
  padding: 36px 24px 44px;
  color: var(--text-muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--line);
}

/* =========================================================
   空(スクロールで時間が進む)
   色は JS が --sky-top / --sky-bottom / --stars / --glow / --glow-a に入れる
========================================================= */
.sky{
  position: fixed; inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(to bottom, var(--sky-top, #14131A), var(--sky-bottom, var(--bg)));
  overflow: hidden;
}
.sky-glow{
  position:absolute; left: -20%; right: -20%; bottom: -40vh;
  height: 90vh;
  background: radial-gradient(ellipse at 50% 100%, var(--glow, #E39A6E), transparent 62%);
  opacity: var(--glow-a, 0);
}
.sky-stars{ position:absolute; inset:0; opacity: var(--stars, 1); }
.sky-stars i{
  position:absolute;
  width: var(--s, 2px); height: var(--s, 2px);
  border-radius: 50%;
  background: var(--text);
  opacity: var(--o, .5);
  animation: twinkle var(--t, 4s) ease-in-out var(--delay, 0s) infinite;
}
@keyframes twinkle{
  0%,100%{ opacity: calc(var(--o, .5) * .2); }
  50%{ opacity: var(--o, .5); }
}
/* 月と太陽。位置は JS が transform で動かす */
.sky-body{
  position:absolute; left: 0; top: 0;
  width: 84px; height: 84px;
  margin: -42px 0 0 -42px;
  will-change: transform;
  backface-visibility: hidden;
}
.sky-moon, .sky-sun{
  position:absolute; inset: 0;
  width: 100%; height: 100%;
}
.sky-moon{ filter: drop-shadow(0 0 22px rgba(243,210,122,.45)); opacity: .85; }
.sky-sun{
  border-radius: 50%;
  background: radial-gradient(circle at 45% 40%, #FFF3C4, #F6C36A 60%, #EE9C55);
  box-shadow: 0 0 60px 18px rgba(246,195,106,.35), 0 0 140px 50px rgba(246,195,106,.14);
  opacity: .9;
}
/* 出番でないほうは、画面の外で見えなくしておく(JSで .is-off) */
.sky-body.is-off{ visibility: hidden; }

/* ヘッダーの時計 */
.sky-clock{
  margin-right: auto;
  margin-left: 14px;
  display:inline-flex; align-items:center; gap: 5px;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: .7rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  cursor: default;
}
.sky-clock-icon{ color: var(--moon); }

/* =========================================================
   見出しの文字が1文字ずつ出てくる
========================================================= */
.split-ch{
  display:inline-block;
  opacity: 0;
  transform: translateY(.45em) rotate(6deg);
  transition: opacity .6s var(--ease), transform .7s var(--ease-bounce);
  transition-delay: calc(var(--i) * 38ms);
}
.is-split.is-visible .split-ch{ opacity: 1; transform: none; }
[data-split="bounce"] .split-ch{
  transform: translateY(-.8em) scale(.6);
  transition: opacity .3s, transform .6s var(--ease-bounce);
  transition-delay: calc(var(--i) * 55ms);
}

/* =========================================================
   子ども向けゾーンのふち・飾り
========================================================= */
.kids-edge{
  position:absolute; left: 0; right: 0;
  top: -88px; height: 90px;
  pointer-events: none;
}
.kids-wave{
  position:absolute; left:0; bottom: 0;
  width: 100%; height: 100%;
  fill: var(--kids-bg);
  display:block;
}
.kids-wave--bottom{
  top: auto; bottom: -68px; height: 70px;
}
/* ガーランド(旗)。ゾーンが見えたら上から順に落ちてくる */
.bunting{
  position:absolute; left: 0; top: -38px;
  width: 100%; height: 70px;
  overflow: visible;
}
.bunting-string{ stroke: rgba(243,237,228,.35); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.bunting-flags{
  list-style:none; margin:0; padding:0;
  position:absolute; left:0; right:0; top: -38px; height: 70px;
}
.bunting-flags li{
  position:absolute;
  width: 22px; height: 26px;
  margin-left: -11px;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: 50% 0;
  transform: rotate(var(--r, 0deg)) scaleY(0);
  transition: transform .7s var(--ease-bounce);
  transition-delay: calc(var(--i) * 45ms + .1s);
}
.kids-zone.is-entered .bunting-flags li{ transform: rotate(var(--r, 0deg)) scaleY(1); }

/* ふちを歩くだんごむし */
.edge-dango{
  position:absolute; left: 0; top: 0;
  width: 70px; height: auto;
  margin: -54px 0 0 -35px;
  transform-origin: 50% 90%;
  will-change: transform;
}
.edge-dango.is-walking{ animation: dango-step .32s ease-in-out infinite; }
@keyframes dango-step{
  0%,100%{ translate: 0 0; }
  50%{ translate: 0 -3px; }
}

.kids-deco{ position:absolute; inset: 0; pointer-events:none; overflow: hidden; }
.deco{
  position:absolute;
  height: auto;
  transform: translateY(calc(var(--ky, 0) * var(--depth, .3) * -120px));
  will-change: transform;
}
.deco--cloud1{ width: 200px; left: -40px; top: 40px; opacity: .9; }
.deco--cloud2{ width: 150px; right: -30px; top: 140px; opacity: .7; }
.deco--flower{ width: 54px; left: 3%; bottom: 120px; }
.deco--clover{ width: 50px; right: 4%; bottom: 60px; }
.deco--ladybug{ width: 34px; right: 7%; top: 46%; rotate: -30deg; }
.deco--star{ width: 36px; left: 6%; top: 38%; animation: deco-spin 9s linear infinite; }
@keyframes deco-spin{ to{ rotate: 360deg; } }
.kids-zone > .section-inner{ position: relative; }

@media (max-width: 860px){
  .deco--flower, .deco--clover, .deco--ladybug, .deco--star{ display:none; }
  .edge-dango{ width: 54px; margin: -42px 0 0 -27px; }
}

/* =========================================================
   3Dで傾くカード(PCのみ。JSで --rx / --ry / --gx / --gy)
========================================================= */
[data-tilt]{ transform-style: preserve-3d; }
[data-tilt].is-tilting{
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-4px);
  transition: transform .12s linear;
}
[data-tilt].is-tilt-out{ transition: transform .6s var(--ease-bounce); }
[data-tilt]{ position: relative; }
[data-tilt]::after{
  content:"";
  position:absolute; inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(380px circle at var(--gx, 50%) var(--gy, 0%), rgba(255,255,255,.14), transparent 55%);
  opacity: 0;
  transition: opacity .4s;
}
[data-tilt].is-tilting::after{ opacity: 1; }
.project-card--kids[data-tilt]::after{ background: radial-gradient(380px circle at var(--gx, 50%) var(--gy, 0%), rgba(255,255,255,.55), transparent 55%); }

/* =========================================================
   キャラクターの反応(追加)
========================================================= */
/* ピコ: 視線と まばたき */
.piko-look{ transition: transform .25s var(--ease); }
.piko-eyes{ transform-box: fill-box; transform-origin: center; animation: piko-blink 4.6s infinite; }
@keyframes piko-blink{
  0%, 92%, 100%{ transform: scaleY(1); }
  95%{ transform: scaleY(.1); }
}

/* ねむひつじ: Zzz がふわふわ上がる。さわると止まって起きる */
.nemu-wrap{ position: relative; width: 132px; margin: 0 auto; }
.nemu-zzz{
  position:absolute; right: -14px; top: -6px;
  z-index: 2;
  font-family: var(--font-round);
  font-weight: 700;
  color: var(--text-muted);
  pointer-events: none;
}
.nemu-zzz i{
  position:absolute; right: 0; top: 0;
  font-style: normal;
  opacity: 0;
  animation: zzz 3.6s ease-out infinite;
  animation-delay: calc(var(--n, 0) * 1.2s);
}
.nemu-zzz i:nth-child(1){ --n:0; font-size: .7rem; }
.nemu-zzz i:nth-child(2){ --n:1; font-size: .85rem; }
.nemu-zzz i:nth-child(3){ --n:2; font-size: 1.05rem; }
@keyframes zzz{
  0%{ opacity: 0; transform: translate(0, 18px) rotate(-10deg); }
  20%{ opacity: .9; }
  100%{ opacity: 0; transform: translate(16px, -26px) rotate(12deg); }
}
.character-card--nemu:hover .nemu-zzz i{ animation-play-state: paused; opacity: 0; transition: opacity .2s; }
.character-card--nemu:hover .character-visual--nemu{ animation: nemu-wake .5s var(--ease-bounce); }
@keyframes nemu-wake{
  0%,100%{ transform: none; }
  40%{ transform: translateY(-5px) scale(1.04); }
}
/* スカーフを切り替えたときの きらきら(JSで生成) */
.sparkle{
  position:absolute; left: 50%; top: 58%;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--c);
  pointer-events: none;
  z-index: 3;
  animation: sparkle .8s var(--ease) forwards;
}
@keyframes sparkle{
  0%{ transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100%{ transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.2); opacity: 0; }
}

@media (max-width: 600px){
  .sky-clock{ margin-left: 10px; }
  .sky-body{ width: 60px; height: 60px; margin: -30px 0 0 -30px; }
}

/* =========================================================
   遊びの要素: 冒険の記録・どんぐり・実績
========================================================= */
.visually-hidden{
  position:absolute !important;
  width:1px; height:1px;
  overflow:hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}
.section{ position: relative; }

/* ヘッダーの「冒険の記録」ボタン */
.quest-chip{
  display:inline-flex; align-items:center; gap: 6px;
  margin-left: 22px;
  padding: 3px 10px 3px 3px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(243,237,228,.03);
  cursor: pointer;
  transition: border-color .3s, background .3s, transform .3s var(--ease-bounce);
}
.quest-chip:hover{ border-color: var(--line-strong); background: rgba(243,237,228,.07); }
.quest-chip.is-bump{ animation: chip-bump .6s var(--ease-bounce); }
@keyframes chip-bump{
  0%,100%{ transform: none; }
  35%{ transform: scale(1.18); }
}
.quest-ring{ position: relative; width: 28px; height: 28px; flex-shrink: 0; }
.quest-ring svg{ width:100%; height:100%; transform: rotate(-90deg); }
.quest-ring circle{ fill: none; stroke-width: 3; }
.quest-ring-bg{ stroke: var(--line-strong); }
.quest-ring-fg{
  stroke: var(--moon);
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: calc(100 - var(--pct, 0));
  transition: stroke-dashoffset .8s var(--ease);
}
.quest-ring img{
  position:absolute; left: 50%; top: 50%;
  width: 10px; height: auto;
  transform: translate(-50%, -50%);
}
.quest-count{ font-size: .78rem; font-variant-numeric: tabular-nums; font-weight: 700; }
.quest-count small{ font-weight: 400; color: var(--text-muted); }

@media (max-width: 900px){
  .quest-chip{ margin-left: 0; margin-right: 6px; }
}

/* かくれた どんぐり: ふだんは うすく、ポインターが近づくと光る(JSで --near 0〜1) */
.acorn{
  position:absolute;
  z-index: 3;
  width: 30px; height: 44px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  opacity: calc(.14 + var(--near, 0) * .86);
  transform: rotate(var(--rot, 0deg)) scale(calc(.9 + var(--near, 0) * .25));
  filter: drop-shadow(0 0 calc(var(--near, 0) * 12px) rgba(243,210,122,.9));
  transition: opacity .25s, transform .3s var(--ease-bounce), filter .25s;
}
.acorn img{ width:100%; height:100%; object-fit: contain; pointer-events: none; }
.acorn:focus-visible{ --near: 1; }
.acorn.is-found{ display: none; }
/* タッチ端末: ポインターが無いので、少し見えやすくして ときどき揺らす */
@media (hover: none){
  .acorn{ opacity: .38; animation: acorn-wiggle 5s ease-in-out infinite; animation-delay: var(--wd, 0s); }
}
@keyframes acorn-wiggle{
  0%, 86%, 100%{ rotate: 0deg; }
  89%{ rotate: -14deg; }
  92%{ rotate: 12deg; }
  95%{ rotate: -6deg; }
}
.kids-zone .acorn{ opacity: calc(.22 + var(--near, 0) * .78); }

/* ヘッダーへ飛んでいく どんぐり(JSで生成) */
.acorn-fly{
  position: fixed; z-index: 300;
  width: 30px; height: auto;
  pointer-events: none;
}

/* トースト */
.toast-stack{
  position: fixed;
  right: 20px; bottom: 20px;
  z-index: 250;
  display:flex; flex-direction: column; align-items: flex-end; gap: 10px;
  pointer-events: none;
}
.toast{
  display:flex; align-items:center; gap: 12px;
  min-width: 240px; max-width: 340px;
  padding: 12px 16px 12px 12px;
  border-radius: 16px;
  background: rgba(38,34,30,.94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line-strong);
  box-shadow: 0 14px 36px rgba(0,0,0,.4);
  animation: toast-in .5s var(--ease-bounce) both;
}
.toast.is-leaving{ animation: toast-out .35s var(--ease) forwards; }
@keyframes toast-in{ from{ opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes toast-out{ to{ opacity: 0; transform: translateX(24px); } }
.toast-icon{
  flex-shrink: 0;
  display:grid; place-items:center;
  width: 38px; height: 38px;
  border-radius: 12px;
  background: rgba(243,210,122,.14);
  font-size: 1.15rem;
}
.toast-icon img{ width: 16px; height: auto; }
.toast-kicker{ display:block; font-size: .68rem; color: var(--moon); letter-spacing: .08em; }
.toast-title{ display:block; font-size: .9rem; font-weight: 700; line-height: 1.5; }
.toast-desc{ display:block; font-size: .74rem; color: var(--text-muted); line-height: 1.5; }

/* PCでは右端の現在地ドットと重ならないよう、少し内側に出す */
@media (min-width: 1101px){ .toast-stack{ right: 56px; } }
@media (max-width: 600px){
  .toast-stack{ left: 12px; right: 12px; bottom: 12px; align-items: stretch; }
  .toast{ max-width: none; }
}

/* 冒険の記録パネル */
.quest-panel{
  width: min(520px, calc(100vw - 32px));
  max-height: min(720px, calc(100svh - 48px));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  background: var(--bg-elevated);
  color: var(--text);
  box-shadow: 0 30px 80px rgba(0,0,0,.55);
  overflow: auto;
}
.quest-panel::backdrop{ background: rgba(10,9,8,.6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.quest-panel[open]{ animation: panel-in .45s var(--ease-bounce); }
@keyframes panel-in{ from{ opacity: 0; transform: translateY(20px) scale(.97); } }
.quest-panel-head{
  position: sticky; top: 0; z-index: 1;
  display:flex; align-items:center; justify-content: space-between;
  padding: 20px 24px 14px;
  background: var(--bg-elevated);
}
.quest-panel-head h2{ font-size: 1.15rem; }
.quest-close{
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: none;
  font-size: 1.2rem; line-height: 1;
  cursor: pointer;
}
.quest-meter{
  display:grid; grid-template-columns: auto 1fr auto; align-items:center; gap: 12px;
  padding: 0 24px;
  font-size: .82rem;
}
.quest-meter span{ color: var(--text-muted); }
.quest-meter .bar i{
  background: linear-gradient(90deg, var(--accent), var(--moon));
  transform: scaleX(var(--pct, 0));
}
.quest-acorn-slots{
  display:flex; gap: 10px;
  padding: 18px 24px 6px;
}
.acorn-slot{
  display:grid; place-items:center;
  width: 44px; height: 44px;
  border-radius: 12px;
  border: 1px dashed var(--line-strong);
}
.acorn-slot img{ width: 18px; height: auto; opacity: .12; filter: grayscale(1); }
.acorn-slot.is-found{ border-style: solid; border-color: rgba(243,210,122,.4); background: rgba(243,210,122,.08); }
.acorn-slot.is-found img{ opacity: 1; filter: none; }

.ach-list{
  list-style:none;
  margin: 0; padding: 14px 24px 8px;
  display:grid; gap: 8px;
}
.ach{
  display:flex; align-items:center; gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.12);
}
.ach-icon{
  flex-shrink: 0;
  display:grid; place-items:center;
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--bg-elevated-2);
  font-size: 1.05rem;
  filter: grayscale(1);
  opacity: .45;
}
.ach-name{ display:block; font-size: .88rem; font-weight: 700; color: var(--text-muted); }
.ach-desc{ display:block; font-size: .74rem; color: var(--text-muted); }
.ach.is-unlocked{ border-color: rgba(243,210,122,.28); background: rgba(243,210,122,.05); }
.ach.is-unlocked .ach-icon{ filter: none; opacity: 1; background: rgba(243,210,122,.14); }
.ach.is-unlocked .ach-name{ color: var(--text); }
.quest-panel-foot{
  display:flex; align-items:center; justify-content: space-between; gap: 12px;
  padding: 10px 24px 22px;
  font-size: .72rem;
  color: var(--text-muted);
}
.quest-panel-foot p{ margin: 0; }
.quest-reset{
  border: 1px solid var(--line-strong);
  background: none;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: .72rem;
  color: var(--text-muted);
  cursor: pointer;
}
.quest-reset:hover{ color: var(--text); }

/* Contact の「冒険の結果」 */
.quest-result{
  max-width: 560px;
  margin: 0 auto 36px;
  padding: 22px 24px;
  border-radius: 20px;
  border: 1px dashed var(--line-strong);
  background: rgba(38,34,30,.5);
}
.quest-result.is-complete{ border-style: solid; border-color: rgba(243,210,122,.4); background: rgba(243,210,122,.06); }
.quest-result-acorns{ display:flex; justify-content:center; gap: 8px; margin-bottom: 10px; }
.quest-result-acorns img{ width: 16px; height: auto; opacity: .15; filter: grayscale(1); transition: opacity .4s, filter .4s; }
.quest-result-acorns img.is-found{ opacity: 1; filter: none; }
.quest-result-msg{ margin: 0 0 6px; font-size: .92rem; }
button.text-link{ border: none; padding: 0; background-color: transparent; cursor: pointer; font-family: inherit; }
.quest-secret{
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  text-align: left;
}
.quest-secret h3{ font-size: 1rem; margin-bottom: 10px; color: var(--moon); }
.quest-secret ul{ margin: 0; padding-left: 1.2em; font-size: .86rem; color: var(--text-muted); }
.quest-secret li{ margin-bottom: 6px; }
.quest-secret b{ color: var(--text); font-weight: 700; }
.quest-secret code{
  font-size: .8em;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(0,0,0,.25);
  color: #E3A48F;
}
.quest-secret:not([hidden]){ animation: rise .8s var(--ease) both; }

/* ひみつのコマンドのごほうび: 空の色が いっきに一周して、どんぐりが全部光る */
.is-konami .sky{ animation: konami-sky 2.4s ease-in-out; }
@keyframes konami-sky{
  50%{ filter: hue-rotate(180deg) brightness(1.7); }
}
.is-konami .acorn{ --near: 1 !important; }

/* =========================================================
   How I Build
========================================================= */
.craft-subhead{
  font-size: 1.05rem;
  margin: 0 0 20px;
  color: var(--text-muted);
}
.craft-subhead + .cycle,
.craft-subhead + .craft-tabs{ margin-top: 0; }

/* AI駆動開発のサイクル: 5つの段。.is-active が順番に移っていく */
.cycle{
  list-style:none;
  margin: 0 0 72px; padding: 0;
  display:grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  position: relative;
}
/* 段をつなぐ線(最後から最初へ戻る矢印は ::after) */
.cycle::before{
  content:"";
  position:absolute; left: 10%; right: 10%; top: 26px;
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--line-strong) 0 6px, transparent 6px 12px);
}
.cycle-step{
  position: relative;
  padding: 0 4px;
  text-align: center;
}
.cycle-no{
  position: relative; z-index: 1;
  display:grid; place-items:center;
  width: 52px; height: 52px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 2px solid var(--line-strong);
  font-family: var(--font-round);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-muted);
  transition: background .4s, border-color .4s, color .4s, transform .5s var(--ease-bounce), box-shadow .4s;
}
.cycle-step h4{ font-size: .95rem; margin-bottom: 6px; transition: color .4s; }
.cycle-step p{ margin: 0; font-size: .8rem; line-height: 1.7; color: var(--text-muted); }
.cycle-step.is-active .cycle-no{
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
  transform: scale(1.12);
  box-shadow: 0 0 0 8px var(--accent-soft);
}
.cycle-step.is-done .cycle-no{ border-color: var(--accent); color: var(--accent); }
.cycle-step.is-active h4{ color: var(--moon); }
code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .86em;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(0,0,0,.25);
  color: #E3A48F;
}

@media (max-width: 760px){
  .cycle{ grid-template-columns: 1fr; gap: 0; }
  .cycle::before{ left: 25px; right: auto; top: 26px; bottom: 26px; width: 2px; height: auto;
    background: repeating-linear-gradient(180deg, var(--line-strong) 0 6px, transparent 6px 12px); }
  .cycle-step{ display:grid; grid-template-columns: 52px 1fr; column-gap: 16px; text-align: left; padding: 0 0 18px; }
  .cycle-no{ grid-row: span 2; margin: 0; }
  .cycle-step h4{ align-self: end; }
}

/* 設計の見どころ: タブ */
.craft-tabs{
  position: relative;
  display:flex; flex-wrap: wrap; gap: 4px;
  padding: 4px;
  margin-bottom: 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(38,34,30,.6);
  width: fit-content;
  max-width: 100%;
}
.craft-tabs [role="tab"]{
  position: relative; z-index: 1;
  border: none;
  background: none;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: .86rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: color .3s;
}
.craft-tabs [role="tab"][aria-selected="true"]{ color: var(--bg); font-weight: 700; }
.craft-tab-indicator{
  position:absolute; left: 0; top: 0;
  border-radius: 999px;
  background: var(--accent);
  transition: transform .45s var(--ease-bounce), width .45s var(--ease-bounce), height .3s;
}
.craft-panels{ margin-bottom: 72px; }
.craft-panel{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
  padding: 28px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
}
.craft-panel[hidden]{ display: none; }
.craft-panel > *{ min-width: 0; } /* 長いコードでパネルが広がらないように */
.craft-panel:not([hidden]){ animation: panel-swap .5s var(--ease) both; }
@keyframes panel-swap{ from{ opacity: 0; transform: translateY(10px); } }
.craft-points{ list-style:none; margin: 0; padding: 0; display:grid; gap: 14px; }
.craft-points li{
  position: relative;
  padding-left: 22px;
  font-size: .88rem;
  color: var(--text-muted);
  line-height: 1.75;
}
.craft-points li::before{
  content:"";
  position:absolute; left: 2px; top: .55em;
  width: 9px; height: 9px;
  border-radius: 3px;
  background: var(--accent);
  rotate: 45deg;
}
.craft-points b{ display:block; color: var(--text); }

.code-card{
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #15130F;
}
.code-card figcaption{
  display:flex; align-items:center; gap: 6px;
  padding: 8px 14px;
  font-size: .72rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--line);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.code-card figcaption::before{
  content:"";
  width: 8px; height: 8px; border-radius: 50%;
  background: #E5786B;
  box-shadow: 13px 0 0 #E5B567, 26px 0 0 #8CC07A;
  margin-right: 30px;
}
.code-card pre{
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  font-size: .76rem;
  line-height: 1.7;
}
.code-card code{ background: none; padding: 0; color: #E9DFD1; font-size: 1em; }
.code-card .tok-c{ color: #8E8577; }
.code-card .tok-k{ color: #E3A48F; }
.code-card .tok-s{ color: #B9D89A; }
.code-card .tok-n{ color: #F3D27A; }

@media (max-width: 760px){
  .craft-panel{ grid-template-columns: 1fr; padding: 22px 18px; }
  .craft-tabs{ border-radius: 18px; }
  .craft-tabs [role="tab"]{ padding: 8px 12px; font-size: .8rem; }
}

/* 開発ログ */
.devlog-head{ display:flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.devlog-head .craft-subhead{ margin-bottom: 4px; }
.devlog-level{ margin: 0; display:flex; align-items: baseline; gap: 8px; font-size: .8rem; color: var(--text-muted); }
.devlog-level b{ font-family: var(--font-head); font-size: 1.6rem; color: var(--moon); font-variant-numeric: tabular-nums; }
.devlog-lead{ margin: 0 0 28px; font-size: .88rem; color: var(--text-muted); }

/* 横に並んだ節目。線が左から伸び、点が順に灯る(JSで --lt 0〜1) */
.log-track{
  list-style:none;
  margin: 0; padding: 0 0 8px;
  position: relative;
  display:grid;
  grid-template-columns: repeat(11, 1fr);
}
.log-track::before,
.log-track::after{
  content:"";
  position:absolute; left: 4%; right: 4%; top: 15px;
  height: 3px; border-radius: 3px;
}
.log-track::before{ background: var(--line); }
.log-track::after{
  background: linear-gradient(90deg, var(--accent-blue), var(--accent), var(--moon));
  transform-origin: left;
  transform: scaleX(var(--lt, 0));
  transition: transform .2s linear;
}
.log-item{ position: relative; display:flex; flex-direction: column; align-items:center; }
.log-dot{
  position: relative; z-index: 1;
  display:grid; place-items:center;
  width: 32px; height: 32px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  background: var(--bg);
  cursor: pointer;
  transition: border-color .3s, background .3s, transform .4s var(--ease-bounce);
}
.log-dot::after{
  content:"";
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--line-strong);
  transition: background .3s;
}
.log-dot span{
  position:absolute; top: 40px; left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: .72rem;
  font-family: var(--font-round);
  color: var(--text-muted);
}
.log-item.is-lit .log-dot{ border-color: var(--accent); }
.log-item.is-lit .log-dot::after{ background: var(--accent); }
.log-item:last-child.is-lit .log-dot::after{ background: var(--moon); box-shadow: 0 0 12px var(--moon); }
.log-dot:hover, .log-dot:focus-visible, .log-item.is-open .log-dot{ transform: scale(1.2); }

.log-card{
  position:absolute; bottom: calc(100% + 10px); left: 50%;
  z-index: 5;
  width: 200px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg-elevated-2);
  border: 1px solid var(--line-strong);
  box-shadow: 0 12px 30px rgba(0,0,0,.4);
  font-size: .76rem;
  line-height: 1.6;
  color: var(--text-muted);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 6px);
  transition: opacity .25s, transform .3s var(--ease);
}
.log-card b{ display:block; color: var(--text); font-size: .84rem; margin-bottom: 2px; }
.log-v{ display:none; font-style: normal; color: var(--moon); margin-right: 8px; font-family: var(--font-round); }
@media (max-width: 760px){ .log-v{ display:inline; } }
.log-item:first-child .log-card{ left: 0; transform: translate(0, 6px); }
.log-item:last-child .log-card{ left: auto; right: 0; transform: translate(0, 6px); }
.log-dot:hover + .log-card,
.log-dot:focus-visible + .log-card,
.log-item.is-open .log-card{ opacity: 1; transform: translate(-50%, 0); }
.log-item:first-child .log-dot:hover + .log-card,
.log-item:first-child .log-dot:focus-visible + .log-card,
.log-item:first-child.is-open .log-card,
.log-item:last-child .log-dot:hover + .log-card,
.log-item:last-child .log-dot:focus-visible + .log-card,
.log-item:last-child.is-open .log-card{ transform: none; }

/* スマホ: 縦に並べて、説明は常に見せる */
@media (max-width: 760px){
  .log-track{ grid-template-columns: 1fr; padding: 0; }
  .log-track::before, .log-track::after{ left: 15px; right: auto; top: 16px; bottom: 16px; width: 3px; height: auto; }
  .log-track::after{ transform-origin: top; transform: scaleY(var(--lt, 0)); }
  .log-item{ flex-direction: row; align-items: flex-start; gap: 14px; padding-bottom: 16px; }
  .log-dot{ flex-shrink: 0; }
  .log-dot span{ position: static; transform: none; display:none; }
  .log-card{
    position: static; width: auto;
    opacity: 1; transform: none; pointer-events: auto;
    background: none; border: none; box-shadow: none; padding: 4px 0 0;
  }
  .log-item:first-child .log-card, .log-item:last-child .log-card{ transform: none; }
}

/* =========================================================
   子ども向けアプリ: 目玉の横長カード・2つのボタン
========================================================= */
.kids-lead{
  position: relative;
  margin: -20px 0 28px;
  font-size: .9rem;
  color: var(--kids-ink-muted);
}
.kids-actions{
  margin-top: auto;
  display:flex; flex-wrap: wrap; gap: 8px;
}
.kids-actions .kids-btn{ margin-top: 0; }
/* App Store へのリンクは、白地にふちどりの控えめな形 */
.kids-btn--store{
  background: #fff;
  color: var(--kids-ink);
  border: 2px solid #EADCC8;
  box-shadow: 0 4px 0 #EADCC8;
}
.kids-btn--store:hover{ box-shadow: 0 6px 0 #EADCC8; }
.kids-btn--store:active{ box-shadow: 0 1px 0 #EADCC8; }

/* 目玉(だんごむしのぼうけん)は2列ぶんの横長 */
.project-card--wide{
  grid-column: span 2;
  flex-direction: row;
  align-items: center;
  gap: 28px;
}
.project-card--wide .phone--kids{
  flex-shrink: 0;
  width: 34%;
  margin: 0;
}
.project-card--wide h4{ font-size: 1.3rem; }

@media (max-width: 860px){
  .project-card--wide{ grid-column: auto; flex-direction: column; align-items: stretch; gap: 0; }
  .project-card--wide .phone--kids{ width: 44%; margin: 0 auto 22px; }
}
/* 2つ並べても1行に収まるよう、カード内のボタンは少し小さく */
.kids-actions .kids-btn{ padding: 8px 13px; font-size: .8rem; }
.project-card--wide .kids-actions .kids-btn{ padding: 10px 20px; font-size: .86rem; }
@media (min-width: 861px){
  .project-card--wide .phone--kids{ width: 26%; }
}
/* フォントの違いで折り返さないよう、2つのボタンは半分ずつの幅に固定する */
.kids-actions{ display: grid; grid-template-columns: 1fr 1fr; }
.kids-actions .kids-btn{ justify-content: center; white-space: nowrap; padding: 8px 6px; font-size: .78rem; }
.project-card--wide .kids-actions{ grid-template-columns: auto auto; justify-content: start; }

/* だんごむし(目玉)は1行まるごと、その下にピコのシリーズ3本 */
@media (min-width: 861px){
  .project-card--wide{ grid-column: 1 / -1; }
  .project-card--wide .phone--kids{ width: 20%; max-width: 190px; }
}
/* じっくり向き合うアプリは縦に並べる */
.project-card--calm + .project-card--calm{ margin-top: 24px; }
.project-card--calm:nth-of-type(2) .phone{ transform: rotate(3deg); }
.project-card--calm:nth-of-type(2):hover .phone{ transform: rotate(0) translateY(-6px); }

/* =========================================================
   ピコと仲間達(ピコとけいさん に登場する3匹)
========================================================= */
.piko-friends{
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px dashed var(--line-strong);
}
.piko-friends-title{
  font-family: var(--font-round);
  font-size: .9rem;
  color: var(--text);
  margin-bottom: 6px;
}
.piko-friends-note{ font-size: .78rem !important; margin-top: 6px !important; }
.piko-trio{
  display:flex; align-items:flex-end; justify-content:center;
  gap: 2px;
  height: 100px;
  margin: 0 auto;
}
.piko-pal{
  position: relative;
  width: 54px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}
/* 動かすのは中の絵だけ(ボタンの位置は動かさないので、押す場所がずれない) */
.piko-body{
  position: relative;
  display:block;
  transform-origin: 50% 100%;
  animation: piko-idle 3.4s ease-in-out infinite;
}
.piko-pal--blue{ width: 62px; z-index: 1; order: 2; } /* まんなかの子は少し大きく */
.piko-pal--blue .piko-body{ animation-delay: -.6s; }
.piko-pal--pink{ order: 1; }
.piko-pal--pink .piko-body{ animation-delay: -1.7s; }
.piko-pal--green{ order: 3; }
.piko-pal--green .piko-body{ animation-delay: -2.6s; }
.piko-face{ display:block; width: 100%; height: auto; filter: drop-shadow(0 6px 8px rgba(0,0,0,.25)); }
.piko-face--happy{ position:absolute; left:0; bottom:0; opacity: 0; }
.piko-pal.is-happy .piko-face--happy{ opacity: 1; }
.piko-pal.is-happy .piko-face--normal{ opacity: 0; }
.piko-pal:hover{ filter: brightness(1.06); }
.piko-pal:focus-visible{ outline-offset: 2px; border-radius: 50%; }
@keyframes piko-idle{
  0%,100%{ translate: 0 0; }
  50%{ translate: 0 -4px; }
}
.piko-pal.is-hop .piko-body{ animation: piko-hop .7s cubic-bezier(.33,0,.66,1); }
@keyframes piko-hop{
  0%  { transform: scale(1,1) translateY(0); }
  15% { transform: scale(1.18,.78) translateY(0); }
  42% { transform: scale(.9,1.12) translateY(-30px); }
  65% { transform: scale(1.2,.75) translateY(0); }
  80% { transform: scale(.95,1.05) translateY(-8px); }
  100%{ transform: scale(1,1) translateY(0); }
}

/* =========================================================
   効果音ボタン・フッター
========================================================= */
.sound-toggle{
  display:grid; place-items:center;
  width: 34px; height: 34px;
  margin-left: 8px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: color .3s, border-color .3s, background .3s;
}
.sound-toggle:hover{ color: var(--text); border-color: var(--line-strong); }
.sound-toggle .sound-wave{ display:none; }
.sound-toggle[aria-pressed="true"]{ color: var(--moon); border-color: rgba(243,210,122,.35); }
.sound-toggle[aria-pressed="true"] .sound-wave{ display:inline; }
.sound-toggle[aria-pressed="true"] .sound-off{ display:none; }
@media (max-width: 900px){
  .sound-toggle{ margin: 0 6px 0 0; }
  .quest-chip{ margin-right: 6px; }
}
@media (max-width: 380px){
  .sky-clock{ display:none; } /* とても狭い画面では時計を省く */
}

.site-footer{ display:flex; flex-direction: column; align-items:center; gap: 8px; padding-top: 44px; }
.site-footer p{ margin: 0; }
.footer-note{ font-size: .74rem; opacity: .8; }
.to-top{
  display:inline-flex; align-items:center; gap: 8px;
  margin-bottom: 10px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-size: .82rem;
  transition: border-color .3s, background .3s;
}
.to-top svg{ color: var(--moon); transition: transform .6s var(--ease-bounce); }
.to-top:hover{ border-color: var(--moon); background: rgba(243,210,122,.06); }
.to-top:hover svg{ transform: translateY(-4px) rotate(-20deg); }

/* =========================================================
   折りたたみ(スマホのみ)。zutsurun の ExpandRow と同じ手ざわり
========================================================= */
.fold-toggle{ display: none; }
.fold-body.is-foldable{
  overflow: hidden;
  opacity: 0;
  transition: height .36s cubic-bezier(.22,1,.36,1), opacity .29s cubic-bezier(.22,1,.36,1);
}
.fold-body.is-foldable.is-open{ opacity: 1; }

@media (max-width: 760px){
  .fold-toggle{
    display:flex; align-items:center; gap: 12px;
    width: 100%;
    margin: 4px 0 0;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(38,34,30,.55);
    color: var(--text);
    text-align: left;
    cursor: pointer;
    transition: border-color .3s, background .3s;
  }
  .fold-toggle.is-open{ border-color: var(--line-strong); background: rgba(38,34,30,.8); }
  .fold-toggle:active{ background: rgba(48,42,36,.9); }
  .fold-text{ flex: 1; min-width: 0; display:flex; flex-direction: column; gap: 2px; }
  .fold-label{ font-size: .86rem; font-weight: 700; }
  .fold-summary{
    font-size: .74rem; color: var(--text-muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .fold-body.is-foldable > *{ margin-top: 14px; }
  /* 子ども向けゾーン・カードの中では明るい色に */
  .case-card .fold-toggle{ background: rgba(0,0,0,.14); }
}

/* 右の丸ボタン: 押すと1秒かけて1回転し、⌄ と ✕ がふわっと入れ替わる */
.row-open-btn{
  flex: none;
  display:inline-grid; place-items:center;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  color: var(--text-muted);
  transition: color .3s, border-color .3s;
}
.fold-toggle.is-open .row-open-btn{ color: var(--accent); border-color: var(--accent); }
.spin-icon{ display:inline-grid; transition: transform 1s cubic-bezier(.45,0,.25,1); }
.spin-icon > svg{ grid-area: 1 / 1; transition: opacity .45s ease .2s; }
.spin-icon .spin-open{ opacity: 0; }
.fold-toggle.is-open .spin-icon{ transform: rotate(360deg); }
.fold-toggle.is-open .spin-icon .spin-closed{ opacity: 0; }
.fold-toggle.is-open .spin-icon .spin-open{ opacity: 1; }

/* =========================================================
   スマホの下のナビ
========================================================= */
.section-dock{ display: none; }
@media (max-width: 900px){
  .section-dock{
    position: fixed; z-index: 95;
    left: 10px; right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    display:flex; align-items:center; gap: 6px;
    padding: 6px;
    border-radius: 999px;
    background: rgba(24,22,26,.86);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border: 1px solid var(--line-strong);
    box-shadow: 0 12px 30px rgba(0,0,0,.35);
    transition: transform .4s var(--ease), opacity .3s;
  }
  html.nav-open .section-dock{ transform: translateY(140%); opacity: 0; }
  .dock-chips{
    flex: 1; min-width: 0;
    display:flex; gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent);
            mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent);
    padding: 0 10px;
  }
  .dock-chips::-webkit-scrollbar{ display: none; }
  .dock-chip{
    flex: none;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: .76rem;
    color: var(--text-muted);
    white-space: nowrap;
    transition: background .3s, color .3s;
  }
  .dock-chip.is-seen{ color: #CFC5B8; }
  .dock-chip.is-current{ background: var(--accent); color: var(--bg); font-weight: 700; }
  .dock-next{
    flex: none;
    display:inline-flex; align-items:center; gap: 4px;
    padding: 8px 14px;
    border-radius: 999px;
    border: none;
    background: rgba(243,210,122,.16);
    color: var(--moon);
    font-size: .76rem;
    cursor: pointer;
  }
  .dock-next-label{ opacity: .8; }
  .dock-next-name{ font-weight: 700; }
  
  /* 下のナビの分だけ、ページの最後とお知らせを上げる */
  body{ padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .toast-stack{ bottom: calc(76px + env(safe-area-inset-bottom)); }
}

/* =========================================================
   スマホでは、カードを短くする(画面の左に小さな画面、右に説明)
========================================================= */
@media (max-width: 760px){
  .project-card--calm{
    grid-template-columns: 92px 1fr;
    gap: 16px;
    align-items: start;
    padding: 18px 16px;
  }
  .project-card--calm .phone{ max-width: none; margin: 0; border-radius: 16px; padding: 4px; transform: none !important; }
  .project-card--calm .phone img{ border-radius: 12px; }
  .project-card--calm .phone::after{ height: 6px; top: 8px; }
  .project-card--calm .project-body h4{ font-size: 1.05rem; }
  .project-card--calm .fold-toggle, .project-card--calm .fold-body{ grid-column: 1 / -1; }

  .projects-row--kids{ gap: 14px; }
  .project-card--kids, .project-card--wide{
    display:grid;
    grid-template-columns: 92px 1fr;
    gap: 14px;
    padding: 18px 16px;
    align-items: start;
  }
  .project-card--kids .phone--kids,
  .project-card--wide .phone--kids{ width: 100%; margin: 0; border-radius: 16px; padding: 3px; }
  .phone--kids img{ border-radius: 13px; }
  .phone--kids::after{ height: 5px; top: 7px; }
  .project-card--kids h4, .project-card--wide h4{ font-size: 1rem; }
  .project-card--kids .project-body > p{ font-size: .82rem; margin-bottom: 10px; }
  .project-card--kids .tag-list{ display: none; } /* 技術タグは PC だけ */
  .project-card--kids .status-badge{ font-size: .66rem; margin-bottom: 6px; }

  /* キャラクターは横にスワイプして見る */
  .character-list{
    display:flex; gap: 14px;
    max-width: none;
    margin: 0 -24px;
    padding: 4px 24px 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .character-list::-webkit-scrollbar{ display: none; }
  .character-card{ flex: 0 0 82%; scroll-snap-align: center; }
}

/* スマホのお知らせは1行の小さな形にして、本文をなるべく隠さない */
@media (max-width: 600px){
  .toast{ min-width: 0; padding: 7px 12px 7px 7px; gap: 8px; border-radius: 999px; }
  .toast-icon{ width: 28px; height: 28px; border-radius: 50%; font-size: .9rem; }
  .toast-desc{ display: none; }
  .toast-kicker{ display: none; }
  .toast-title{ font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .toast-title::before{ content: "🏅 "; }
  .section{ padding: 64px 0; }
  .section-lead{ margin-bottom: 32px; }
}

/* About(ヒーロー)の下の経歴・Contact の文 */
.devlog{ position: relative; }
.contact-lead span{ display: block; white-space: nowrap; }
@media (max-width: 600px){
  /* 1行が画面幅に収まるよう、文字を少しだけ小さく */
  .contact-lead{ font-size: min(.98rem, 3.55vw); }
}

/* 経歴の技術タグ */
.tl-tags{
  list-style:none;
  display:flex; flex-wrap: wrap; gap: 6px;
  margin: 10px 0 0; padding: 0;
}
.tl-tags li{
  font-size: .72rem; line-height: 1;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--text-muted);
  background: rgba(38,34,30,.4);
}
.timeline-item.is-lit .tl-tags li{ border-color: rgba(201,123,99,.35); }

/* =========================================================
   子ども向けゾーン: 晴れた空(ピコとけいさん と同じ色と雲)
========================================================= */
.kids-zone{
  --kz-top: #bfe2ff;
  --kz-mid: #dff0ff;
  --kz-bottom: #eef7ff;
  background: linear-gradient(to bottom, var(--kz-top) 0, var(--kz-mid) 520px, var(--kz-bottom) 100%);
}
.kids-wave{ fill: var(--kz-top); }
.kids-wave--bottom{ fill: var(--kz-bottom); }
/* 雲の帯は、上のほうで ゆっくり左右に流れる */
.kids-sky{ position:absolute; left:0; right:0; top: 0; height: 320px; overflow: hidden; pointer-events: none; }
.kids-sky-band{
  position:absolute; top: 10px; left: -10%; right: -10%;
  height: 100%;
  background: url(assets/images/characters/sky_clouds.webp) center top / 1400px auto repeat-x;
  opacity: .95;
  animation: sky-drift 28s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes sky-drift{
  from{ transform: translateX(-5%); }
  to  { transform: translateX(5%); }
}
/* 飾りの雲は、画面の横をゆっくり流れていく(奥のほうが遅い) */
.deco--cloud1, .deco--cloud2{ animation: cloud-across linear infinite; }
.deco--cloud1{ left: 0; animation-duration: 70s; animation-delay: -22s; }
.deco--cloud2{ left: 0; right: auto; animation-duration: 95s; animation-delay: -60s; }
@keyframes cloud-across{
  from{ translate: -260px 0; }
  to  { translate: calc(100vw + 40px) 0; }
}
.kids-zone .projects-subhead--kids, .kids-lead{ text-shadow: 0 1px 0 rgba(255,255,255,.6); }

/* =========================================================
   Cast: 紹介文の下の絵(ハチ・月で眠る ねむひつじ)
========================================================= */
.cast-extra{
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--line-strong);
}
/* ハチ: 2コマを切り替えて はばたき、ふわふわ浮く */
.bee{
  position: relative;
  width: 92px; height: 112px;
  margin: 4px auto 0;
  animation: bee-hover 2.6s ease-in-out infinite;
}
.bee-frame{ position:absolute; left:0; bottom:0; width: 100%; height: auto; filter: drop-shadow(0 6px 6px rgba(0,0,0,.25)); }
.bee-frame--a{ animation: bee-flap-a .16s linear infinite; }
.bee-frame--b{ animation: bee-flap-b .16s linear infinite; }
@keyframes bee-flap-a{ 0%, 49.9%{ opacity: 1; } 50%, 100%{ opacity: 0; } }
@keyframes bee-flap-b{ 0%, 49.9%{ opacity: 0; } 50%, 100%{ opacity: 1; } }
@keyframes bee-hover{
  0%,100%{ transform: translate(0, 0) rotate(-3deg); }
  50%{ transform: translate(6px, -8px) rotate(3deg); }
}
.bee.is-dive{ animation: bee-dive .9s cubic-bezier(.5,0,.3,1); }
@keyframes bee-dive{
  0%{ transform: none; }
  35%{ transform: translate(-14px, -18px) rotate(-12deg); }
  65%{ transform: translate(18px, 14px) rotate(14deg) scale(1.08); }
  100%{ transform: none; }
}
/* 月で眠る ねむひつじ: ゆりかごのように ゆっくり揺れる */
.nemu-moon{
  display:block;
  width: 150px; height: auto;
  margin: 0 auto;
  transform-origin: 50% 85%;
  animation: moon-rock 6s ease-in-out infinite;
  filter: drop-shadow(0 8px 14px rgba(0,0,0,.3));
}
@keyframes moon-rock{
  0%,100%{ transform: rotate(-4deg) translateY(0); }
  50%{ transform: rotate(4deg) translateY(-4px); }
}

/* Cast の自動の動き: ねむひつじが少し起きる */
.character-card.is-waking .character-visual--nemu{ animation: nemu-wake .5s var(--ease-bounce); }
@media (max-width: 760px){
  /* 目玉のカードも、スマホでは他のカードと同じ小さなボタン2つに */
  .project-card--wide .kids-actions{ grid-template-columns: 1fr 1fr; }
  .project-card--wide .kids-actions .kids-btn{ padding: 8px 6px; font-size: .78rem; }
}

/* =========================================================
   Cast: 4枚になったので PC は 2×2 に
========================================================= */
@media (min-width: 861px){
  .character-list{ grid-template-columns: repeat(2, 1fr); }
}

/* ピコと仲間達のピコ(水色)は縦長に見えるので、少しだけ つぶす */
.piko-pal--blue .piko-face{ transform: scale(1.05, .9); transform-origin: 50% 100%; }

/* =========================================================
   たまご(ピコとくく)
========================================================= */
.character-visual--egg{ background: radial-gradient(circle at 50% 45%, #F2FAE6, #CFE8B4); overflow: visible; }
.egg-stage{
  position: relative;
  display:block;
  width: 100%; height: 100%;
}
.egg-frame{
  position:absolute; left: 50%; bottom: 14%;
  width: auto; max-width: 92%;
  height: 62%;
  object-fit: contain;
  transform: translateX(-50%) scale(.85);
  opacity: 0;
  transition: opacity .45s var(--ease), transform .55s var(--ease-bounce);
  filter: drop-shadow(0 6px 8px rgba(40,70,20,.25));
  image-rendering: auto;
}
/* 育つほど少しずつ大きく(おとなは はみ出すくらい) */
.egg-frame[data-step="3"]{ height: 58%; }
.egg-frame[data-step="4"]{ height: 52%; }
.egg-frame[data-step="5"]{ height: 54%; }
.egg-frame[data-step="6"]{ height: 76%; }
.egg-frame[data-step="7"]{ height: 96%; bottom: 6%; }
.egg-stage[data-step="0"] .egg-frame[data-step="0"],
.egg-stage[data-step="1"] .egg-frame[data-step="1"],
.egg-stage[data-step="2"] .egg-frame[data-step="2"],
.egg-stage[data-step="3"] .egg-frame[data-step="3"],
.egg-stage[data-step="4"] .egg-frame[data-step="4"],
.egg-stage[data-step="5"] .egg-frame[data-step="5"],
.egg-stage[data-step="6"] .egg-frame[data-step="6"],
.egg-stage[data-step="7"] .egg-frame[data-step="7"]{ opacity: 1; transform: translateX(-50%) scale(1); }
/* ひびが入る前は ぐらぐら揺れる */
.egg-stage.is-wobble{ animation: egg-wobble .6s ease-in-out; transform-origin: 50% 86%; }
@keyframes egg-wobble{
  0%,100%{ transform: rotate(0); }
  20%{ transform: rotate(-9deg); }
  40%{ transform: rotate(8deg); }
  60%{ transform: rotate(-5deg); }
  80%{ transform: rotate(3deg); }
}
/* 生まれた瞬間は ぱっと光る */
.egg-stage.is-burst::after{
  content:"";
  position:absolute; left: 50%; top: 55%;
  width: 20px; height: 20px;
  margin: -10px 0 0 -10px;
  border-radius: 50%;
  background: radial-gradient(circle, #FFFBE0, rgba(243,210,122,0) 70%);
  animation: egg-burst .7s var(--ease) forwards;
  pointer-events: none;
}
@keyframes egg-burst{ to{ transform: scale(9); opacity: 0; } }

.egg-progress{ margin-top: 14px; }
.egg-dots{
  list-style:none;
  display:flex; justify-content:center; gap: 6px;
  margin: 0; padding: 0;
}
.egg-dots li{
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--line-strong);
  transition: background .3s, transform .3s var(--ease-bounce);
}
.egg-dots li.is-done{ background: #8CC07A; }
.egg-dots li.is-current{ background: #B9E39A; transform: scale(1.4); }
.egg-label{ margin: 8px 0 0 !important; font-family: var(--font-round); font-size: .82rem !important; color: #B9E39A !important; }

/* =========================================================
   スマホの Cast: 左右に動かせることが分かるように
========================================================= */
.cast-pager{ display: none; }
@media (max-width: 760px){
  .character-card{ flex-basis: 78%; }
  /* 右端を少し暗くぼかして「まだ続きがある」ことを見せる */
  .character-list{
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 84%, rgba(0,0,0,.35) 100%);
            mask-image: linear-gradient(90deg, #000 0, #000 84%, rgba(0,0,0,.35) 100%);
  }
  .character-list.is-end{ -webkit-mask-image: none; mask-image: none; }
  .character-list.is-nudge{ animation: cast-nudge 1.1s var(--ease) 2; }
  .cast-pager{
    display:flex; align-items:center; justify-content:center; gap: 12px;
    margin-top: 8px;
  }
  .cast-arrow{
    display:grid; place-items:center;
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 1px solid var(--line-strong);
    background: rgba(38,34,30,.7);
    color: var(--text);
    cursor: pointer;
    transition: opacity .3s, border-color .3s;
  }
  .cast-arrow:disabled{ opacity: .3; }
  .cast-arrow:not(:disabled):active{ border-color: var(--accent); }
  .cast-dots{ display:flex; gap: 8px; }
  .cast-dots button{
    width: 9px; height: 9px;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: var(--line-strong);
    transition: width .35s var(--ease), background .3s;
    cursor: pointer;
  }
  .cast-dots button.is-current{ width: 24px; background: var(--accent); }
  .cast-count{ font-size: .74rem; color: var(--text-muted); font-variant-numeric: tabular-nums; min-width: 34px; text-align: center; }
}
/* 「横に動くよ」の合図: 少しだけ左へずれて戻る */
@keyframes cast-nudge{
  0%,100%{ translate: 0 0; }
  40%{ translate: -34px 0; }
  60%{ translate: -34px 0; }
}

/* Certs: 1件ずつは小さく、年・名前・種類を1行で */
.cert-rows{
  list-style:none; margin: 0; padding: 0;
  display:grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
}
.cert-row{
  display:flex; align-items:center; gap: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(38,34,30,.55);
}
.cert-year{ font-family: var(--font-round); font-size: .8rem; color: var(--accent); font-variant-numeric: tabular-nums; }
.cert-name{ flex: 1; min-width: 0; font-size: .9rem; font-weight: 700; }
.cert-org{
  flex: none;
  font-size: .66rem; line-height: 1;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--text-muted);
}
@media (max-width: 600px){
  .cert-rows{ grid-template-columns: 1fr; gap: 8px; }
  .cert-row{ padding: 10px 14px; }
  .cert-name{ font-size: .86rem; }
}

/* 経歴: 期間・成果の数字・詳しい内容 */
.timeline-period{
  display:inline-block;
  margin-left: 10px;
  font-size: .72rem;
  color: var(--text-muted);
  font-family: var(--font-body);
}
.tl-results{
  list-style:none;
  display:flex; flex-wrap: wrap; gap: 8px;
  margin: 12px 0 0; padding: 0;
}
.tl-results li{
  position: relative;
  padding: 5px 12px 5px 26px;
  border-radius: 10px;
  background: rgba(243,210,122,.1);
  border: 1px solid rgba(243,210,122,.28);
  color: var(--moon);
  font-size: .8rem;
  font-weight: 700;
}
.tl-results li::before{
  content:"";
  position:absolute; left: 10px; top: 50%;
  width: 8px; height: 8px; margin-top: -4px;
  border-radius: 2px;
  rotate: 45deg;
  background: var(--moon);
}
/* スキルは6つのまとまり。PCは3列 */
.skills-grid{ grid-template-columns: repeat(3, 1fr); }
@media (max-width: 800px){ .skills-grid{ grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px){ .skills-grid{ grid-template-columns: 1fr; } }

/* Skills: 個人開発で使っている技術の印 */
.skill-indie{ color: var(--moon); margin-left: 2px; font-weight: 700; }
.skills-note{ margin: 14px 0 0; font-size: .78rem; color: var(--text-muted); }

/* たまご: みどり以外のたまごは育たず、ときどき ゆらゆら揺れるだけ(JSで .is-wobble をランダムに付ける) */
.egg-others{
  display:flex; justify-content:center; align-items:flex-end; gap: 10px;
  margin-top: 14px;
}
.egg-other{
  width: 30px; height: auto;
  transform-origin: 50% 90%;
  filter: drop-shadow(0 4px 4px rgba(0,0,0,.25));
}
.egg-other.is-wobble{ animation: egg-other-wobble var(--dur, .9s) ease-in-out; }
@keyframes egg-other-wobble{
  0%,100%{ transform: rotate(0); }
  20%{ transform: rotate(calc(var(--amp, 10deg) * -1)); }
  45%{ transform: rotate(var(--amp, 10deg)); }
  70%{ transform: rotate(calc(var(--amp, 10deg) * -.5)); }
  85%{ transform: rotate(calc(var(--amp, 10deg) * .3)); }
}

/* ほかの色のたまごは、カードの下の空いたところを埋めるように大きめに並べる */
.character-card--egg{ display:flex; flex-direction: column; }
.character-card--egg .egg-others{
  flex: 1;
  flex-wrap: wrap;
  align-content: center;
  gap: 12px 16px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--line-strong);
}
.character-card--egg .egg-other{ width: 46px; }
@media (max-width: 760px){
  .character-card--egg .egg-others{ gap: 14px 20px; }
  .character-card--egg .egg-other{ width: 54px; }
}

/* =========================================================
   About の中の小見出し(Career・Skills・Certs)
========================================================= */
.about-subhead{
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: .02em;
}
.about-subhead span{
  display:block;
  font-family: var(--font-round);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .14em;
  color: var(--accent);
  margin-bottom: 2px;
}
/* About の中の続き(Skills・Certs)は、上の余白を詰めて ひとまとまりに見せる */
.section[data-group="hero"] + .section[data-group="hero"]{ padding-top: 24px; }
.section.about, .section.skills{ padding-bottom: 56px; }

/* Apps: App Store へのボタンが1つだけのとき */
.kids-actions .kids-btn--only{ grid-column: 1 / -1; justify-self: start; padding: 9px 18px; }

/* スマホ: 次へボタンは、下のナビのすぐ上・右端に浮かべる(PCでは出さない) */
.dock-next{ display: none !important; }
@media (max-width: 900px){
  .dock-next{
    display: inline-flex !important;
    position: fixed; z-index: 96;
    right: 14px;
    bottom: calc(72px + env(safe-area-inset-bottom));
    padding: 8px 14px;
    background: rgba(24,22,26,.88);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(243,210,122,.35);
    box-shadow: 0 8px 20px rgba(0,0,0,.35);
    transition: transform .4s var(--ease), opacity .3s;
  }
  html.nav-open .dock-next{ transform: translateY(260%); opacity: 0; }
  .dock-chips{ padding: 0 12px; }
  .toast-stack{ bottom: calc(124px + env(safe-area-inset-bottom)); }
}

/* 流れ星を描くキャンバス(空のレイヤーの中・星の上) */
.sky-meteor{ position:absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* Notes: まだ公開していない記事(リンクにしない) */
.note-card.is-upcoming{ cursor: default; }
.note-card.is-upcoming:hover{ background: var(--bg); }
.note-card.is-upcoming h3{ color: var(--text-muted); }
.note-soon{
  flex-shrink: 0;
  font-size: .7rem; line-height: 1;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px dashed var(--line-strong);
  color: var(--text-muted);
}

/* スマホ: 「先頭へ」は左下、「次へ」は右下。どちらも下のナビのすぐ上に浮かぶ */
.dock-top{ display: none; }
@media (max-width: 900px){
  .dock-top{
    position: fixed; z-index: 96;
    left: 14px;
    bottom: calc(72px + env(safe-area-inset-bottom));
    display:inline-flex; align-items:center; gap: 4px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: rgba(24,22,26,.88);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    color: var(--text);
    font-size: .76rem;
    box-shadow: 0 8px 20px rgba(0,0,0,.35);
    cursor: pointer;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity .45s var(--ease), transform .45s var(--ease);
  }
  .dock-top.is-shown{ opacity: 1; transform: none; pointer-events: auto; }
  html.nav-open .dock-top{ opacity: 0; pointer-events: none; }
  /* 最後まで来たら「次へ」は ふわっと消える */
  .dock-next.is-gone{ opacity: 0; transform: translateY(10px) scale(.92); pointer-events: none; }
}

/* =========================================================
   仕上げ(1): タイポグラフィと質感
========================================================= */
/* 日本語の見出しは約物を詰めて、引き締める */
h1, h2, h3, h4, .hero-title, .btn, .main-nav a{ font-feature-settings: "palt"; }
.hero-title{ letter-spacing: .04em; line-height: 1.18; font-size: clamp(2.5rem, 6.4vw, 4.6rem); }

/* セクションの見出し: 番号 + 細い線、大きく太いタイトル、背景に大きな白抜きの番号 */
.section-inner{ position: relative; }
.section-kicker{
  display:inline-flex; align-items:center; gap: 12px;
  font-size: .78rem;
  letter-spacing: .24em;
}
.section-kicker::after{
  content:"";
  width: 48px; height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
}
.section-title{
  font-size: clamp(2.4rem, 5.4vw, 4.4rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -.01em;
  margin-bottom: 18px;
}
.section-num{
  position:absolute;
  right: 0; top: -0.28em;
  z-index: 0;
  font-family: var(--font-head);
  font-weight: 900;
  font-size: clamp(7rem, 17vw, 15rem);
  line-height: 1;
  letter-spacing: -.04em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(243,237,228,.09);
  pointer-events: none;
  user-select: none;
  transform: translateY(var(--num-y, 0px));
  will-change: transform;
}
.section-inner > *:not(.section-num):not(.acorn){ position: relative; z-index: 1; }
@media (max-width: 600px){
  .section-num{ font-size: 6.5rem; top: -.18em; right: -6px; }
}
/* About の中の小見出しも、少し大きく */
.about-subhead{ font-size: clamp(1.4rem, 2.6vw, 1.9rem); font-weight: 900; }

/* Skills: 縦のリストをやめて、タグの並びに(短く・見渡しやすく) */
.skill-group{ padding: 20px 20px 22px; }
.skill-group ul{ display:flex; flex-wrap: wrap; gap: 6px; }
.skill-group li{
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(243,237,228,.03);
  font-size: .8rem;
  color: var(--text);
  line-height: 1.5;
  transition: border-color .25s, background .25s;
}
.skill-group li:hover{ border-color: rgba(201,123,99,.6); background: var(--accent-soft); }

/* 太陽は本文の後ろを通るので、まぶしすぎないように */
.sky-sun{ opacity: .62 !important; box-shadow: 0 0 50px 14px rgba(246,195,106,.22), 0 0 120px 40px rgba(246,195,106,.08); }

/* 空に、ごく細かい粒子の質感(フィルムのような手ざわり)を重ねる */
.sky::after{
  content:"";
  position:absolute; inset: -50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .06;
  pointer-events: none;
}

/* =========================================================
   磨き込み(2): Contact を「最後の主役」に
========================================================= */
.contact .section-lead{ margin-bottom: 36px; }
.contact-links{ margin-bottom: 56px; }
.contact-link{
  gap: 16px;
  padding: 16px 18px 16px 28px;
  border: none;
  background: linear-gradient(135deg, var(--accent), #e8a27e);
  color: #1d1a17;
  font-weight: 700;
  box-shadow: 0 14px 40px -14px rgba(201,123,99,.7);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.contact-link:hover{ color: #1d1a17; background: linear-gradient(135deg, var(--accent), #e8a27e); box-shadow: 0 20px 50px -14px rgba(201,123,99,.85); }
.contact-link-text{ display:flex; flex-direction:column; align-items:flex-start; line-height: 1.2; font-size: 1.15rem; letter-spacing: .02em; }
.contact-link-text small{ font-size: .7rem; font-weight: 500; letter-spacing: .08em; opacity: .72; margin-bottom: 3px; }
.contact-link-arrow{
  display:grid; place-items:center;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(29,26,23,.14);
  font-size: 1.05rem;
  transition: transform .35s var(--ease);
}
.contact-link:hover .contact-link-arrow{ transform: translateX(4px) rotate(-45deg); }
/* どんぐりの記録は、連絡先のあとの「おまけ」として少し控えめに */
.contact .quest-result{ margin-bottom: 0; }

/* フッターの「先頭へもどる」が見えているあいだは、浮いている「先頭へ」を隠す(重複させない) */
.dock-top.is-shown.is-footer{ opacity: 0; pointer-events: none; transform: translateY(8px); }
/* スマホ: 数行にわたるリード文は、中央寄せだと行頭がそろわず読みにくいので左寄せ */
@media (max-width: 560px){
  .hero-lead{ text-align: left; font-size: .98rem; }
}
/* スマホ: アプリカードの説明は、細い列でも読みやすい大きさに */
@media (max-width: 760px){
  .project-card--calm .project-body > p:not(.status-badge){ font-size: .88rem; line-height: 1.75; }
  .project-card--calm .status-badge{ font-size: .7rem; padding: 4px 10px; }
}
/* スマホ: 最初の画面に「つくったものを見る」まで収める */
@media (max-width: 560px){
  .hero{ padding-top: calc(var(--header-h) + 28px); justify-content: flex-start; }
  .hero-title{ font-size: clamp(2.3rem, 10.5vw, 2.9rem); margin-bottom: 20px; }
  .hero-lead{ font-size: .92rem; line-height: 1.85; }
}
/* ヒーローにいる間は、下のメニューと「次へ」を下に引っこめておく(スクロールしたら ふわっと出る) */
@media (max-width: 900px){
  html.at-hero .section-dock{ transform: translateY(140%); opacity: 0; pointer-events: none; }
  html.at-hero .dock-next{ opacity: 0; transform: translateY(10px) scale(.92); pointer-events: none; }
}

/* ヒーロー: 左にアイコン、右にキャッチコピー3行(「工夫と」「効率と」「持続性」が順に浮かび上がる) */
.hero-head{
  display: flex; align-items: center; justify-content: center;
  gap: clamp(20px, 3.4vw, 44px);
  margin-bottom: 30px;
}
.hero-avatar{
  flex: 0 0 auto;
  width: clamp(104px, 15vw, 196px); height: auto; aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
  box-shadow: 0 0 0 6px var(--bg), 0 0 0 7px var(--line-strong), 0 24px 60px -20px rgba(201,123,99,.45);
  opacity: 0;
  transform: scale(.9);
  animation: avatar-in .9s var(--ease) .15s forwards;
}
@keyframes avatar-in{ to{ opacity: 1; transform: scale(1); } }
.hero-head .hero-title{
  text-align: left;
  margin: 0;
  font-size: clamp(2.6rem, 6vw, 4.8rem);
  line-height: 1.16;
  letter-spacing: .04em;
}
@media (max-width: 560px){
  .hero-head{ gap: 20px; margin-bottom: 22px; }
  .hero-head .hero-title{ font-size: clamp(2.3rem, 11vw, 2.9rem); }
}
@media (prefers-reduced-motion: reduce){
  .hero-avatar{ animation: none; opacity: 1; transform: none; }
}


/* =========================================================
   Focus: 3つの問い
========================================================= */
.questions{
  list-style: none; margin: 0 0 72px; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  counter-reset: q;
}
.question{
  position: relative;
  padding: 26px 24px 24px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(201,123,99,.10), rgba(38,34,30,.55) 55%);
  counter-increment: q;
  overflow: hidden;
  transition: transform .4s var(--ease), border-color .4s var(--ease);
}
.question:hover{ transform: translateY(-4px); border-color: rgba(201,123,99,.45); }
/* 背景に、うすく大きな「?」 */
.question::after{
  content: "?";
  position: absolute; right: 12px; bottom: -34px;
  font-family: var(--font-round);
  font-size: 9rem; font-weight: 900; line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(243,237,228,.07);
  pointer-events: none;
}
.question-tag{
  display: inline-block;
  font-family: var(--font-round);
  font-size: .72rem; letter-spacing: .12em;
  color: var(--accent);
  margin-bottom: 14px;
}
.question-tag i{ font-style: normal; opacity: .5; margin: 0 2px; }
.question h3{
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  font-weight: 900;
  line-height: 1.45;
  letter-spacing: .02em;
  font-feature-settings: "palt";
  margin: 0 0 14px;
}
.question p{ margin: 0; font-size: .86rem; line-height: 1.8; color: var(--text-muted); position: relative; }
.craft-note{ margin: -8px 0 22px; font-size: .86rem; color: var(--text-muted); }
@media (max-width: 760px){
  .questions{ grid-template-columns: 1fr; gap: 12px; margin-bottom: 56px; }
  .question{ padding: 20px 20px 18px; }
  .question h3 br{ display: none; }
}

/* =========================================================
   Apps: 「自分が便利なアプリ」「子どもと楽しむアプリ」も横に並べる
========================================================= */
/* PC: 自分が便利なアプリは2枚を横に並べる */
@media (min-width: 1000px){
  .app-list{ display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; align-items: start; }
  .app-list .project-card--calm + .project-card--calm{ margin-top: 0; }
  /* 上に「画面+状態+名前」、下に説明を全幅で */
  .app-list .project-card--calm{
    display: grid; grid-template-columns: 112px 1fr;
    column-gap: 24px; row-gap: 0; align-content: start; align-items: start;
    padding: 30px 30px 28px;
  }
  .app-list .project-body{ display: contents; }
  .app-list .phone{ grid-column: 1; grid-row: 1 / 3; width: 112px; margin: 0 0 22px; }
  .app-list .status-badge{ grid-column: 2; grid-row: 1; align-self: end; justify-self: start; margin-bottom: 8px; }
  .app-list .project-card h4{ grid-column: 2; grid-row: 2; align-self: start; }
  .app-list .project-body > :not(.status-badge):not(h4){ grid-column: 1 / -1; }
}
/* スマホ: Cast と同じく、横にスワイプして見る */
@media (max-width: 760px){
  .app-list, .projects-row--kids{
    display: flex; gap: 14px;
    max-width: none;
    margin: 0 -24px;
    padding: 4px 24px 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    align-items: flex-start;
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 84%, rgba(0,0,0,.35) 100%);
            mask-image: linear-gradient(90deg, #000 0, #000 84%, rgba(0,0,0,.35) 100%);
  }
  .app-list::-webkit-scrollbar, .projects-row--kids::-webkit-scrollbar{ display: none; }
  .app-list > *, .projects-row--kids > *{ flex: 0 0 84%; scroll-snap-align: center; }
  .app-list .project-card--calm + .project-card--calm{ margin-top: 0; }
  .app-list.is-end, .projects-row--kids.is-end{ -webkit-mask-image: none; mask-image: none; }
  .app-list.is-nudge, .projects-row--kids.is-nudge{ animation: cast-nudge 1.1s var(--ease) 2; }
  /* 子どもゾーン(明るい背景)の操作部品 */
  .kids-zone .cast-arrow{ background: rgba(255,255,255,.75); border-color: rgba(60,50,40,.18); color: var(--kids-ink); }
  .kids-zone .cast-dots button{ background: rgba(60,50,40,.2); }
  .kids-zone .cast-dots button.is-current{ background: var(--accent); }
  .kids-zone .cast-count{ color: var(--kids-ink); opacity: .7; }
}

/* =========================================================
   About: スマホで1画面におおむね収める
========================================================= */
@media (max-width: 760px){
  .section.about{ padding-top: 64px; }
  .section.about, .section.skills{ padding-bottom: 20px; }
  .section[data-group="hero"] + .section[data-group="hero"]{ padding-top: 20px; }
  .section.certifications{ padding-bottom: 64px; }
  .about .section-title{ margin-bottom: 18px; }
  .about-subhead{ margin-bottom: 10px; }
  .skills-note{ margin-top: 8px; }
}
/* スマホのアプリカード: 上に「小さな画面+状態+名前」、下に説明を全幅で(細い列で縦に伸びないように) */
@media (max-width: 760px){
  .app-list .project-card, .projects-row--kids .project-card{
    display: grid;
    grid-template-columns: 68px 1fr;
    column-gap: 14px; row-gap: 0;
    align-content: start;
    padding: 18px 18px 16px;
  }
  .app-list .project-body, .projects-row--kids .project-body{ display: contents; }
  .app-list .phone, .projects-row--kids .phone{ grid-column: 1; grid-row: 1 / 3; width: 68px; align-self: start; margin: 0 0 14px; }
  .app-list .status-badge, .projects-row--kids .status-badge{ grid-column: 2; grid-row: 1; align-self: end; justify-self: start; margin-bottom: 6px; white-space: nowrap; }
  .app-list .project-card h4, .projects-row--kids .project-card h4{ grid-column: 2; grid-row: 2; align-self: start; margin-bottom: 14px; }
  .app-list .project-body > :not(.status-badge):not(h4),
  .projects-row--kids .project-body > :not(.status-badge):not(h4){ grid-column: 1 / -1; }
}

/* Focus: 「気をつけている考え方」「AI駆動開発の実践」の2つのまとまり */
.focus-subhead{ margin-bottom: 20px; }
.focus-subhead + .craft-note{ margin: -10px 0 32px; }
.craft .craft-subhead{ font-size: .95rem; letter-spacing: .04em; }
.section-title + .focus-subhead{ margin-top: 36px; }
@media (max-width: 760px){ .section-title + .focus-subhead{ margin-top: 24px; } }

/* =========================================================
   アプリのカードの高さをそろえる(並んだカードは同じ高さ・ボタンは下にそろえる)
========================================================= */
/* PC: 子どもと楽しむアプリ(縦長のカード) */
@media (min-width: 761px){
  .projects-row--kids{ align-items: stretch; }
  .project-card--kids:not(.project-card--wide) .project-body{ flex: 1; display: flex; flex-direction: column; }
  .project-card--kids:not(.project-card--wide) .kids-actions{ margin-top: auto; }
}
/* PC: 自分が便利なアプリ(2枚) / スマホ: 横スワイプのカード
   説明の段(3段目)が余りを受け持ち、その下の折りたたみ・リンクは下にそろう */
@media (min-width: 1000px){
  .app-list{ align-items: stretch; }
  .app-list .project-card--calm{ grid-template-areas: var(--card-areas); grid-template-rows: var(--card-rows); }
}
@media (max-width: 760px){
  .app-list, .projects-row--kids{ align-items: stretch; }
  .app-list .project-card, .projects-row--kids .project-card{ grid-template-areas: var(--card-areas); grid-template-rows: var(--card-rows); }
}
/* カードの中の置き場所を名前で決める(説明の段 desc が余りを受け持つ) */
.app-list .project-card, .projects-row--kids .project-card{
  --card-areas: "phone badge" "phone title" "desc desc" "toggle toggle" "fold fold" "link link";
  --card-rows: auto auto 1fr auto auto auto;
}
@media (min-width: 1000px), (max-width: 760px){
  .app-list .phone, .projects-row--kids .phone{ grid-area: phone; }
  .app-list .status-badge, .projects-row--kids .status-badge{ grid-area: badge; }
  .app-list .project-card h4, .projects-row--kids .project-card h4{ grid-area: title; }
  .app-list .project-body > p:not(.status-badge), .projects-row--kids .project-body > p:not(.status-badge){ grid-area: desc; }
  .app-list .fold-toggle{ grid-area: toggle; }
  .app-list .fold-body{ grid-area: fold; }
  .app-list .text-link, .projects-row--kids .kids-actions{ grid-area: link; }
  .projects-row--kids .tag-list{ grid-area: fold; }
}

/* Focus「AI駆動開発の実践」: スマホでは サイクル・設計の工夫・開発ログ を折りたたみにして、最初は1画面ほどに収める
   (折りたたみのボタンが見出しを兼ねるので、元の小見出しは隠す) */
@media (max-width: 760px){
  .craft-subhead--fold, .devlog-head{ display: none; }
  .craft .fold-toggle{ margin-bottom: 12px; }
}
