/* ========== 基本 ========== */
:root {
  --sky: #31d0fb;
  --sky-deep: #14c2f2;
  --green: #7ec96e;
  --green-deep: #5fb350;
  --cream: #fffaf0;
  --yellow: #ffe9a8;
  --brown: #5b4a3f;
  --accent: #ff8fab;
  --radius: 22px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", sans-serif;
  color: var(--brown);
  background: var(--cream);
  font-weight: 500;
  line-height: 1.8;
}

img { max-width: 100%; height: auto; }

/* ========== ヘッダー ========== */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 12px rgba(91, 74, 63, 0.08);
}

.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--brown);
  font-weight: 900;
  font-size: 1.05rem;
}

.logo-chick {
  width: 34px;
  transition: transform 0.3s;
}

.logo:hover .logo-chick { transform: rotate(-12deg) scale(1.1); }

.nav {
  display: flex;
  gap: 6px;
}

.nav a {
  text-decoration: none;
  color: var(--brown);
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 999px;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}

.nav a:hover {
  background: var(--yellow);
}

/* ========== ヒーロー ========== */
.hero {
  position: relative;
  height: 100svh;
  min-height: 560px;
  max-height: 760px;
  background: linear-gradient(180deg, #31d0fb 0%, #1cb8f3 55%, #0fa3e9 100%);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-top: 70px;
}

.sun {
  position: absolute;
  top: 72px;
  right: -3%;
  width: clamp(140px, 18vw, 210px);
  animation:
    sunspin 40s linear infinite,
    sunpulse 1.5s ease-in-out infinite alternate;
}

@keyframes sunspin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* 大きくなったり小さくなったり（alternateで往復） */
@keyframes sunpulse {
  from { scale: 1; }
  to   { scale: 1.12; }
}

.cloud {
  position: absolute;
  top: 180px;
  left: 0;
  width: clamp(150px, 20vw, 240px);
  opacity: 0.95;
  will-change: transform;
  animation: drift 75s linear infinite;
}

/* 左端から出発 → 右端の外へ消える → （画面外でワープ）→ 左端の外から再登場 */
@keyframes drift {
  0%     { transform: translateX(0); }
  84%    { transform: translateX(100vw); }
  84.01% { transform: translateX(-260px); }
  100%   { transform: translateX(0); }
}

.hero-copy {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: 24px 20px 0;
}

.hero-copy h1 {
  font-size: clamp(1.3rem, 5vw, 2.1rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-shadow: 0 2px 0 rgba(255,255,255,0.6);
}

.hero-copy p {
  margin-top: 8px;
  font-weight: 700;
  font-size: clamp(0.9rem, 2.4vw, 1.15rem);
  color: #3e6b80;
}

/* どうぶつタワー */
.stage {
  position: relative;
  z-index: 2;
  width: min(560px, 92vw);
  height: clamp(330px, 56vh, 580px);
  margin-top: 24px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.tower-img {
  height: 100%;
  width: auto;
  max-width: none;
  transform-origin: 50% 100%;
  animation: wobble 5s ease-in-out infinite;
  will-change: transform;
}

@keyframes wobble {
  0%, 100% { rotate: -1.2deg; }
  50%      { rotate: 1.2deg; }
}

/* 地面（いったん非表示。戻すときは display:none を消す） */
.ground { display: none; }

.ground {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 70px;
  background: linear-gradient(var(--green), var(--green-deep));
}

.ground::before {
  content: "";
  position: absolute;
  top: -34px;
  left: -6%;
  width: 112%;
  height: 70px;
  background: var(--green);
  border-radius: 50% 50% 0 0;
}

/* ========== セクション共通 ========== */
.section {
  padding: 72px 20px;
  scroll-margin-top: 64px; /* 固定ヘッダー分。ナビで飛んだとき見出しが隠れないように */
}

.section-inner {
  max-width: 960px;
  margin: 0 auto;
}

.section-title {
  font-size: clamp(1.25rem, 3.4vw, 1.7rem);
  font-weight: 900;
  text-align: center;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

.title-emoji { margin-right: 10px; }

.section-sub {
  text-align: center;
  margin-bottom: 36px;
  color: #99897d;
  font-size: 0.95rem;
}

/* ========== 作品 ========== */
.works { background: var(--cream); }

.work-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.work-card {
  font-family: inherit;
  color: inherit;
  text-align: center;
  background: #fff;
  border: 3px solid #f1e4d0;
  border-radius: var(--radius);
  padding: 24px 18px 20px;
  cursor: pointer;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.work-card:hover {
  transform: translateY(-6px) rotate(-0.5deg);
  box-shadow: 0 12px 24px rgba(91, 74, 63, 0.15);
  border-color: var(--yellow);
}

.work-thumb {
  width: 110px;
  height: 110px;
  border-radius: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  font-size: 2.4rem;
}

.thumb-icon {
  overflow: hidden;
  background: #f1e4d0;
}
.work-thumb.thumb-icon img,
.modal-thumb.thumb-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.thumb-ptb { background: #FED823; }
.thumb-mcd { background: #FED823; }

.card-note {
  font-size: 0.7rem;
  color: #b8a591;
}

.work-card h3 { font-size: 1.15rem; font-weight: 900; }

.work-card p { font-size: 0.88rem; color: #99897d; }

.work-more {
  margin-top: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--accent);
}

/* ========== News ========== */
.news { background: #f7ab00; }

.news-list {
  list-style: none;
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.news-item {
  background: #fff;
  border-radius: 16px;
  padding: 14px 22px;
  display: flex;
  align-items: baseline;
  gap: 18px;
  cursor: pointer;
  border: 3px solid transparent;
  transition: transform 0.2s, border-color 0.2s;
  font-family: inherit;
  color: inherit;
  text-align: left;
  width: 100%;
}

.news-item:hover {
  transform: translateX(6px);
  border-color: var(--accent);
}

.news-date {
  font-size: 0.85rem;
  font-weight: 700;
  color: #b8a591;
  white-space: nowrap;
}

.news-title { font-weight: 700; }

/* ========== 会社情報 ========== */
.company {
  background: var(--cream);
  padding-bottom: 150px;
}

.company-card {
  background: #fff;
  border: 3px solid #f1e4d0;
  border-radius: var(--radius);
  padding: 12px 30px;
  max-width: 760px;
  margin: 0 auto;
}

.company-table { font-size: 0.92rem; }

.company-table > div {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 16px;
  padding: 16px 4px;
  border-bottom: 2px dashed #f1e4d0;
}

.company-table > div:last-child { border-bottom: none; }

.company-table dt { font-weight: 900; }

.company-table a { color: var(--accent); font-weight: 700; }

/* ========== フッター ========== */
.footer {
  background: #3ab483;
  text-align: center;
  padding: 26px 20px 30px;
  color: #fff;
  font-weight: 700;
  position: relative;
}

.footer-panda {
  width: 64px;
  position: absolute;
  top: -58px;
  left: 50%;
  translate: -50% 0;
}

/* ========== ポップアップ ========== */
.modal[hidden] { display: none; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(62, 107, 128, 0.55);
  backdrop-filter: blur(3px);
}

.modal-card {
  position: relative;
  background: var(--cream);
  border-radius: 26px;
  max-width: 520px;
  width: 100%;
  max-height: 84vh;
  overflow-y: auto;
  padding: 36px 30px 30px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  animation: pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pop {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--brown);
  font-size: 1.4rem;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
  line-height: 1;
}

.modal-close:hover { transform: rotate(90deg); background: var(--accent); color: #fff; }

.modal-thumb {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  font-size: 2.2rem;
}

.modal-thumb img { width: 74%; }

.modal-body h3 {
  text-align: center;
  font-size: 1.35rem;
  font-weight: 900;
  margin-bottom: 4px;
}

.modal-tag {
  display: block;
  text-align: center;
  font-size: 0.85rem;
  color: #99897d;
  margin-bottom: 16px;
}

.modal-body p { font-size: 0.95rem; }

.modal-badges {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 10px;
}

.modal-badges .badge {
  display: inline-block;
  background: #fff;
  border: 2px solid var(--brown);
  border-radius: 999px;
  padding: 4px 16px;
  font-size: 0.85rem;
  font-weight: 700;
}

.modal-links {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
  flex-wrap: wrap;
}

.modal-links a {
  text-decoration: none;
  background: var(--brown);
  color: #fff;
  font-weight: 700;
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 0.9rem;
  transition: transform 0.2s, background 0.2s;
}

.modal-links a:hover { transform: scale(1.06); background: var(--accent); }

.modal-note {
  margin-top: 18px;
  font-size: 0.75rem;
  color: #b8a591;
  text-align: center;
}

.modal-news-date {
  display: block;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #b8a591;
  margin-bottom: 10px;
}

/* ========== アニメーション（スクロールで登場） ========== */
.reveal {
  opacity: 0;
  translate: 0 30px;
  transition: opacity 0.7s, translate 0.7s;
}

.reveal.is-visible {
  opacity: 1;
  translate: 0 0;
}

/* ========== スマホ ========== */
@media (max-width: 640px) {
  .logo span { font-size: 0.75rem; }
  .nav a { padding: 6px 10px; font-size: 0.75rem; }
  .stage { height: 51vh; }
  .company-table > div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .section { padding: 56px 16px; }
  .company { padding-bottom: 140px; }
}
