/* =========================================================
   YAWARAKA TECH — style.css
   モバイルファースト / ブレークポイント 640px, 960px
   ========================================================= */

:root {
  /* ブランドカラー */
  --c-main: #4BAED1;
  --c-sub: #9DDCF1;
  --c-accent: #E9BD49;
  --c-text: #24465B;
  --c-bg: #FFFFFF;
  --c-section: #EFF8FC;
  --c-subtle: #F8FAFC;
  --c-line: #DCE9EF;
  /* 派生色：メインカラーを文字・ボタンで使うための濃い色（白背景で約5.3:1） */
  --c-main-ink: #1B7397;
  --c-text-muted: #4A6578;

  --font-brand: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Hiragino Sans", sans-serif;
  --font-base: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;

  --container: 1120px;
  --gutter: 20px;
  --section-y: 56px;
  --header-h: 64px;

  --r-s: 6px;
  --r-m: 12px;
  --r-pill: 999px;
  --frame: 2px solid var(--c-text);
}

@media (min-width: 640px) {
  :root { --gutter: 32px; --section-y: 72px; }
}
@media (min-width: 960px) {
  :root { --gutter: 40px; --section-y: 80px; --header-h: 72px; }
}

/* ---------- ベース ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 8px);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-base);
  font-size: 1rem;
  line-height: 1.8;
  overflow-wrap: anywhere;
  line-break: strict;
}

h1, h2, h3, p, ul, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--c-main-ink); }
button { font: inherit; color: inherit; }

:focus-visible {
  outline: 3px solid var(--c-main-ink);
  outline-offset: 3px;
  border-radius: 2px;
}

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.skip-link {
  position: absolute;
  left: 8px;
  top: -100px;
  z-index: 100;
  padding: 8px 16px;
  background: var(--c-text);
  color: #fff;
  border-radius: var(--r-s);
}
.skip-link:focus { top: 8px; }

/* ---------- ボタン・リンク ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 28px;
  border: 2px solid transparent;
  border-radius: var(--r-pill);
  font-weight: 700;
  text-decoration: none;
  line-height: 1.4;
  transition: background-color .15s, color .15s;
}
.button--primary { background: var(--c-main-ink); color: #fff; }
.button--primary:hover { background: var(--c-text); }
.button--secondary { background: #fff; color: var(--c-text); border-color: var(--c-text); }
.button--secondary:hover { background: var(--c-section); }
.button--accent { background: var(--c-accent); color: var(--c-text); }
.button--accent:hover { background: #F0CC6E; }
.button--large { min-height: 60px; padding-inline: 40px; font-size: 1.0625rem; }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  text-decoration: none;
}
.text-link::after { content: "→"; transition: transform .15s; }
.text-link:hover { text-decoration: underline; }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.text-link--external::after { content: "↗"; }

/* ---------- ヘッダー ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--c-line);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--c-text);
  text-decoration: none;
}
.brand__logo { width: 60px; height: 16px; }
.brand__name {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: .1em;
  line-height: 1;
  white-space: nowrap;
}

.menu-button {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 52px;
  height: 52px;
  margin-right: -8px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.menu-button__bars,
.menu-button__bars::before,
.menu-button__bars::after {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--c-text);
  border-radius: 2px;
  transition: transform .2s, background-color .2s;
}
.menu-button__bars { position: relative; margin-bottom: 2px; }
.menu-button__bars::before,
.menu-button__bars::after { content: ""; position: absolute; left: 0; }
.menu-button__bars::before { top: -7px; }
.menu-button__bars::after { top: 7px; }
.menu-button__label { font-size: .625rem; font-weight: 700; line-height: 1; margin-top: 6px; }

.menu-button[aria-expanded="true"] .menu-button__bars { background: transparent; }
.menu-button[aria-expanded="true"] .menu-button__bars::before { transform: translateY(7px) rotate(45deg); }
.menu-button[aria-expanded="true"] .menu-button__bars::after { transform: translateY(-7px) rotate(-45deg); }

/* スマホ：開閉式メニュー */
.global-nav {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  max-height: calc(100dvh - var(--header-h));
  overflow-y: auto;
  background: #fff;
  border-bottom: 1px solid var(--c-line);
  padding: 8px var(--gutter) 24px;
}
.js .global-nav { display: none; }
.js .global-nav.is-open { display: block; }
/* JS無効時：メニューを常に表示 */
html:not(.js) .menu-button { display: none; }
html:not(.js) .site-header { position: static; }
html:not(.js) .site-header__inner { flex-wrap: wrap; height: auto; padding-block: 16px; }
html:not(.js) .global-nav { position: static; width: 100%; padding: 8px 0 0; border: 0; }

.global-nav__list a {
  display: block;
  padding: 16px 4px;
  border-bottom: 1px solid var(--c-line);
  color: var(--c-text);
  font-weight: 700;
  text-decoration: none;
}
.global-nav__list li:last-child a { border-bottom: 0; }
.global-nav__cta {
  margin-top: 16px;
  text-align: center;
  background: var(--c-accent);
  border-radius: var(--r-pill);
}

@media (min-width: 960px) {
  .menu-button { display: none; }
  .js .global-nav,
  .global-nav {
    display: block;
    position: static;
    max-height: none;
    overflow: visible;
    padding: 0;
    border: 0;
    background: none;
  }
  .global-nav__list { display: flex; align-items: center; gap: 4px; }
  .global-nav__list a {
    padding: 8px 14px;
    border: 0;
    font-size: .9375rem;
    border-radius: var(--r-pill);
  }
  .global-nav__list a:hover { background: var(--c-section); }
  .global-nav__cta { margin: 0 0 0 8px; padding-inline: 20px !important; }
  .global-nav__list .global-nav__cta:hover { background: #F0CC6E; }
}

/* ---------- ファーストビュー ---------- */
.hero { padding-block: 40px 16px; }
.hero__inner { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; }

.hero__title {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: clamp(2.125rem, 8.5vw, 3.5rem);
  line-height: 1.35;
  letter-spacing: .02em;
}
.hero__lead {
  margin-top: 16px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-text-muted);
}

.achievement-badge {
  display: inline-block;
  margin-top: 24px;
  border-radius: var(--r-m);
  line-height: 0;
}
.achievement-badge img { width: 140px; height: auto; }
@media (min-width: 960px) { .achievement-badge img { width: 160px; } }

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}
.hero__actions .button { flex: 1 1 auto; padding-inline: 20px; white-space: nowrap; }

/* 漫画のコマ風ビジュアル */
.hero__visual {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: auto auto;
  gap: 10px;
}
.panel {
  position: relative;
  display: grid;
  place-items: center;
  border: var(--frame);
  background: #fff;
  padding: 16px;
}
.panel--main {
  grid-column: 1 / -1;
  aspect-ratio: 5 / 3;
  background: var(--c-section);
}
.panel__logo { width: 44%; max-width: 240px; }
/* 絵全体を見せる（切り抜かない）。画像は 5:3 の横長で用意する */
.panel__image { width: 100%; height: 100%; object-fit: cover; }
.panel--main:has(.panel__image) { padding: 0; }
.panel--before, .panel--after { aspect-ratio: 1 / 1; }
.panel--before::after,
.panel--after::after {
  content: "";
  position: absolute;
  bottom: 14px;
  width: 22%;
  aspect-ratio: 1;
}
.panel--before::after { left: 14px; background: var(--c-main); }
.panel--after { border-radius: var(--r-m); }
.panel--after::after { right: 14px; background: var(--c-accent); border-radius: 50%; }

.bubble {
  position: relative;
  padding: 10px 12px;
  border: var(--frame);
  background: #fff;
  font-size: clamp(.6875rem, 3.2vw, .9375rem);
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  white-space: nowrap;
  margin-bottom: 28%;
}
.bubble--square { border-radius: 0; }
.bubble--round { border-radius: 999px; padding-inline: 14px; background: var(--c-section); }

@media (min-width: 960px) {
  .hero { padding-block: 72px 80px; }
  .hero__inner {
    grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
    align-items: center;
    gap: 48px;
  }
  .hero__lead { font-size: 1.125rem; margin-top: 24px; }
  .hero__actions .button { flex: 0 0 auto; padding-inline: 28px; }
  .hero__visual { gap: 12px; }
  /* 横長の絵の下に、吹き出しのコマを2つ並べる */
  .panel--before, .panel--after { aspect-ratio: auto; min-height: 112px; }
  .panel--before::after, .panel--after::after { width: 36px; }
  .bubble { margin-bottom: 0; }
}

/* ---------- セクション共通 ---------- */
.section { padding-block: var(--section-y); }
.section--tinted { background: var(--c-section); }

.section-heading { margin-bottom: 32px; }
.section-heading--center { text-align: center; }
.section-heading__en {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .16em;
  color: var(--c-main-ink);
}
/* ロゴの3図形を小さく添える */
.section-heading__en::before {
  content: "";
  width: 30px;
  height: 8px;
  background: url("/assets/images/brand/logo.svg") center / contain no-repeat;
}
.section-heading__ja {
  margin-top: 4px;
  font-size: 1.5rem;
  line-height: 1.5;
}
.section-heading__lead { margin-top: 12px; color: var(--c-text-muted); }

@media (min-width: 960px) {
  .section-heading { margin-bottom: 40px; }
  .section-heading__ja { font-size: 2rem; }
}

/* ---------- 制作作品 ---------- */
.filter {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.filter__button {
  flex: none;
  min-height: 40px;
  padding: 6px 16px;
  border: 1.5px solid var(--c-text);
  border-radius: var(--r-pill);
  background: #fff;
  font-size: .875rem;
  font-weight: 700;
  cursor: pointer;
}
.filter__button:hover { background: var(--c-section); }
.filter__button[aria-pressed="true"] { background: var(--c-text); color: #fff; }

@media (min-width: 640px) {
  .filter { flex-wrap: wrap; overflow: visible; }
}

.work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}
@media (min-width: 640px) { .work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .work-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; } }

.work-card {
  display: flex;
  flex-direction: column;
  border: var(--frame);
  border-radius: var(--r-s);
  background: #fff;
  overflow: hidden;
}
.work-card[hidden] { display: none; }
.work-card__thumb {
  aspect-ratio: 4 / 3;
  border-bottom: var(--frame);
}
.work-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.work-card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  padding: 20px;
}
.work-card__title { font-size: 1.125rem; line-height: 1.5; }
.work-card__text { font-size: .9375rem; color: var(--c-text-muted); flex: 1; }
.work-card__actions { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: auto; padding-top: 8px; }
.work-card__soon { font-size: .875rem; color: var(--c-text-muted); }
.work-card--consult { border-style: dashed; background: var(--c-subtle); }
.work-card--consult .work-card__body { justify-content: center; padding: 28px 24px; }
.work-card__eyebrow { font-size: .75rem; font-weight: 700; letter-spacing: .12em; color: var(--c-main-ink); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags li {
  padding: 2px 10px;
  border-radius: var(--r-pill);
  background: var(--c-section);
  font-size: .75rem;
  font-weight: 700;
}

.thumb-placeholder {
  display: grid;
  place-items: center;
  background: var(--c-section);
  color: var(--c-text-muted);
  font-size: .8125rem;
}
.thumb-placeholder span::before {
  content: "";
  display: block;
  width: 64px;
  height: 18px;
  margin: 0 auto 10px;
  background: url("/assets/images/brand/logo.svg") center / contain no-repeat;
  opacity: .6;
}
.works-status { padding: 24px 0; color: var(--c-text-muted); }
.section-more { margin-top: 32px; text-align: right; }

/* ---------- 出版実績 ---------- */
.achievement {
  display: grid;
  gap: 32px;
  padding: 28px 24px;
  border: var(--frame);
  border-radius: var(--r-m);
  background: #fff;
}
.achievement__cover {
  width: min(220px, 70%);
  margin-inline: auto;
}
.achievement__cover[hidden] { display: none; }
.achievement__cover img { width: 100%; border: 1px solid var(--c-line); }
.achievement__body { display: grid; gap: 14px; align-content: start; justify-items: start; }
.achievement__label {
  font-size: .875rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--c-text-muted);
}
.achievement__result {
  display: grid;
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: clamp(1.625rem, 6.4vw, 2.5rem);
  line-height: 1.35;
}
.achievement__category { font-size: .6em; }
.achievement__result mark {
  background: linear-gradient(transparent 58%, var(--c-accent) 58%);
  color: inherit;
  padding-inline: 2px;
}
.achievement__title { font-size: 1.25rem; line-height: 1.5; }
.achievement__subtitle { margin-top: -6px; font-size: .9375rem; color: var(--c-text-muted); }
.achievement__meta { font-size: .875rem; color: var(--c-text-muted); }
.achievement .button { margin-top: 8px; }

@media (min-width: 640px) {
  .achievement { padding: 40px; }
  .achievement.has-cover { grid-template-columns: 220px minmax(0, 1fr); gap: 40px; }
  .achievement__cover { width: 100%; }
}
@media (min-width: 960px) {
  .achievement { padding: 56px 64px; }
  .achievement.has-cover { grid-template-columns: 260px minmax(0, 1fr); gap: 64px; }
}

/* ---------- サービス ---------- */
.service-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
@media (min-width: 960px) { .service-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; } }

.service-card {
  padding: 28px 24px;
  border: 1px solid var(--c-line);
  border-radius: var(--r-m);
  background: var(--c-subtle);
}
.service-card__icon { width: 48px; height: 48px; color: var(--c-main); margin-bottom: 16px; }
.service-card__title { font-size: 1.125rem; margin-bottom: 8px; }
.service-card p { color: var(--c-text-muted); font-size: .9375rem; }

/* ---------- 会社概要 ---------- */
.about { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; }
.about__concept { display: grid; gap: 12px; }
.about__logo { width: 120px; margin-bottom: 8px; }
.about__catch {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 1.375rem;
}
.about__table {
  border-top: 1px solid var(--c-line);
  background: #fff;
  border-radius: var(--r-s);
}
.about__table > div {
  display: grid;
  gap: 4px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--c-line);
}
.about__table dt { font-weight: 700; font-size: .875rem; }

@media (min-width: 640px) {
  .about__table > div { grid-template-columns: 8em 1fr; gap: 16px; }
}
@media (min-width: 960px) {
  .about { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 64px; align-items: start; }
}

/* ---------- お問い合わせ ---------- */
.contact__inner { text-align: center; }
.contact__text { margin-bottom: 32px; }
.contact__actions { display: grid; justify-items: center; gap: 12px; }
.contact .button { width: min(100%, 360px); }
.contact__address { font-size: .875rem; color: var(--c-text-muted); }
.contact__address span { color: var(--c-text); font-weight: 700; }
.contact__fallback { padding: 16px 24px; border: 1px solid var(--c-line); border-radius: var(--r-m); background: var(--c-subtle); }

/* ---------- フッター ---------- */
.site-footer {
  padding-block: 48px 32px;
  background: var(--c-text);
  color: #fff;
}
.site-footer__inner { display: grid; gap: 28px; }
.site-footer a { color: #fff; }
.brand--footer .brand__name { font-size: 1rem; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: .875rem; }
.footer-nav a { text-decoration: none; }
.footer-nav a:hover { text-decoration: underline; }
.site-footer :focus-visible { outline-color: var(--c-sub); }
.copyright { font-size: .75rem; opacity: .85; }

@media (min-width: 960px) {
  .site-footer__inner { grid-template-columns: auto 1fr; align-items: center; }
  .footer-nav { justify-content: flex-end; }
  .copyright { grid-column: 1 / -1; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.2); }
}

/* ---------- 下層ページ共通 ---------- */
.section--page { padding-top: 32px; }
@media (min-width: 960px) { .section--page { padding-top: 48px; } }

.breadcrumb { margin-bottom: 32px; font-size: .8125rem; }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 0; padding: 0; list-style: none; }
.breadcrumb li + li::before { content: "/"; margin-right: 8px; color: var(--c-text-muted); }
.breadcrumb [aria-current] { color: var(--c-text-muted); }

/* ---------- 漫画閲覧 ---------- */
.reader { padding-block: 32px 72px; }
.reader__head { max-width: calc(800px + var(--gutter) * 2); }
.reader__title { font-size: 1.375rem; line-height: 1.5; }
.reader__episode { margin-top: 4px; font-weight: 700; color: var(--c-main-ink); }
.reader__message {
  max-width: calc(800px + var(--gutter) * 2);
  margin-block: 24px;
  padding-block: 32px;
  text-align: center;
  color: var(--c-text-muted);
}

.reader-toc {
  margin-top: 20px;
  border: 1px solid var(--c-line);
  border-radius: var(--r-m);
  background: var(--c-subtle);
}
.reader-toc summary {
  min-height: 48px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
}
.reader-toc__list { margin: 0; padding: 0 16px 12px; list-style: none; }
.reader-toc__list a {
  display: block;
  padding: 10px 4px;
  border-top: 1px solid var(--c-line);
  text-decoration: none;
}
.reader-toc__list a[aria-current] { color: var(--c-text); font-weight: 700; }
.reader-toc__list a[aria-current]::before { content: "▶ "; font-size: .75em; color: var(--c-main); }

/* 画像は画面幅いっぱい（PCは最大800px）、ページ間の余白なし */
.reader__pages {
  width: 100%;
  max-width: 800px;
  margin: 24px auto;
  background: var(--c-subtle);
}
.reader__pages img { width: 100%; height: auto; }

.reader__foot { max-width: calc(800px + var(--gutter) * 2); }
.reader-trial {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin-bottom: 32px;
  padding: 28px 24px;
  border: var(--frame);
  border-radius: var(--r-m);
  text-align: center;
}
.reader-trial[hidden] { display: none; }
.reader-trial__label { font-weight: 700; font-size: 1.0625rem; }
.reader-trial__text { color: var(--c-text-muted); font-size: .9375rem; }
.reader-trial .button { margin-top: 8px; }
.reader__back { margin-top: 32px; text-align: center; }

.pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}
.pager[hidden] { display: none; }
.pager a {
  display: grid;
  gap: 2px;
  min-height: 56px;
  padding: 10px 16px;
  border: var(--frame);
  border-radius: var(--r-s);
  font-weight: 700;
  text-decoration: none;
  color: var(--c-text);
  line-height: 1.4;
}
.pager a:hover { background: var(--c-section); }
.pager__next { text-align: right; }
.pager__sub { font-size: .75rem; font-weight: 400; color: var(--c-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 404 ---------- */
.not-found { text-align: center; }
.not-found__logo { margin: 0 auto 24px; }
.not-found__text { margin: 16px 0 32px; color: var(--c-text-muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
