/* ===================================================================
   株式会社IA MIRACOLO コーポレートサイト 共通CSS
   デザイン方針: 余白と罫線とタイポグラフィで品を出す(project-plan.md §4)
   =================================================================== */

:root {
  --bg:        #FAFAF9;  /* 背景: わずかに暖かい白 */
  --text:      #1F2A3A;  /* 本文: 濃紺 */
  --text-sub:  #5B6472;  /* 補助テキスト */
  --line:      #D9DCDE;  /* 罫線 */
  --accent:    #2F6E75;  /* アクセント: 彩度を抑えた青緑 */
  --accent-bg: #EEF3F3;  /* アクセント淡色 */
  --footer-bg: #1F2A3A;  /* フッター背景 */

  --font-heading: "Zen Old Mincho", "Hiragino Mincho ProN", serif;
  --font-body: "Noto Sans JP", "Hiragino Kaku Gothic ProN", sans-serif;

  --header-h: 64px;
}

/* ------------------------------------------------------------------
   Reset / base
   ------------------------------------------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.9;
  letter-spacing: 0.03em;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration: none;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.5;
  margin: 0 0 0.75em;
  color: var(--text);
}

p {
  margin: 0 0 1.2em;
}

ul, ol {
  margin: 0 0 1.2em;
  padding-left: 1.4em;
}

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

/* Focus ring visible for keyboard users */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 200;
  padding: 10px 18px;
  background-color: var(--text);
  color: #fff;
  font-size: 13px;
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 12px;
}

.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px;
}

/* 英字ラベル: 短い罫線を添えた小さなキャプション */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--accent);
  margin-bottom: 14px;
}

.eyebrow::before {
  content: "";
  width: 20px;
  height: 1px;
  background-color: var(--accent);
}

/* ------------------------------------------------------------------
   Header
   ------------------------------------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(250, 250, 249, 0.92);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
}

.logo {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text);
  line-height: 1.3;
}

.logo:hover {
  text-decoration: none;
}

.logo-en {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.logo-ja {
  font-size: 10px;
  color: var(--text-sub);
  letter-spacing: 0.14em;
}

.nav-toggle {
  display: none;
  position: relative;
  width: 42px;
  height: 42px;
  background: none;
  border: 1px solid var(--line);
  cursor: pointer;
  padding: 0;
}

.nav-toggle-icon,
.nav-toggle-icon::before,
.nav-toggle-icon::after {
  position: absolute;
  left: 50%;
  width: 20px;
  height: 1px;
  background-color: var(--text);
  transform: translateX(-50%);
  transition: transform 0.2s ease;
}

.nav-toggle-icon {
  top: 50%;
  margin-top: -0.5px;
}

.nav-toggle-icon::before {
  content: "";
  top: -7px;
}

.nav-toggle-icon::after {
  content: "";
  top: 7px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon {
  background-color: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon::before {
  top: 0;
  transform: translateX(-50%) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon::after {
  top: 0;
  transform: translateX(-50%) rotate(-45deg);
}

.site-nav ul {
  display: flex;
  gap: 32px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  position: relative;
  display: inline-block;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  letter-spacing: 0.06em;
  padding: 6px 0;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background-color: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.25s ease;
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after {
  transform: scaleX(1);
}

.site-nav a[aria-current="page"] {
  color: var(--accent);
}

.site-nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

/* ------------------------------------------------------------------
   Main / sections
   ------------------------------------------------------------------ */
main {
  display: block;
  counter-reset: service;
}

.section {
  padding: clamp(56px, 9vw, 88px) 0;
}

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

/* 見出し(左)+ 本文(右)の2カラム。モバイルは縦積み */
.section-grid {
  display: grid;
  gap: 28px;
}

.section-head h2 {
  font-size: clamp(22px, 3vw, 26px);
  letter-spacing: 0.06em;
  margin: 0;
}

@media (min-width: 880px) {
  .section-grid {
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 64px;
  }
}

/* ------------------------------------------------------------------
   Hero (top page)
   ------------------------------------------------------------------ */
.hero {
  padding: clamp(72px, 12vw, 128px) 0 clamp(56px, 9vw, 96px);
}

.hero h1 {
  font-size: clamp(28px, 4.6vw, 42px);
  letter-spacing: 0.07em;
  margin-bottom: 0.6em;
}

.hero h1::before {
  content: "";
  display: block;
  width: 44px;
  height: 2px;
  background-color: var(--accent);
  margin-bottom: clamp(20px, 3vw, 32px);
}

.hero-lead {
  font-size: clamp(15px, 2vw, 17px);
  color: var(--text-sub);
  max-width: 38em;
  margin-bottom: 2.4em;
}

/* ------------------------------------------------------------------
   Page header (下層ページ共通)
   ------------------------------------------------------------------ */
.page-header {
  padding: clamp(56px, 9vw, 88px) 0 clamp(32px, 5vw, 48px);
  border-bottom: 1px solid var(--line);
}

.page-title {
  font-size: clamp(26px, 3.6vw, 34px);
  letter-spacing: 0.06em;
  margin: 0;
}

/* ------------------------------------------------------------------
   Buttons (ghost)
   ------------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 13px 24px;
  border: 1px solid var(--text);
  color: var(--text);
  background-color: transparent;
  text-decoration: none;
  font-size: 14px;
  letter-spacing: 0.08em;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn::after {
  content: "\2192"; /* → */
  font-size: 14px;
  transition: transform 0.2s ease;
}

.btn:hover {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #fff;
  text-decoration: none;
}

.btn:hover::after {
  transform: translateX(4px);
}

.btn-accent {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-accent:hover {
  background-color: var(--accent);
  color: #fff;
}

/* ------------------------------------------------------------------
   Card list (トップの事業ダイジェスト。罫線区切り・影なし)
   ------------------------------------------------------------------ */
.card-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  counter-reset: card;
}

.card-list li {
  border-top: 1px solid var(--line);
  counter-increment: card;
}

.card-list a {
  position: relative;
  display: block;
  padding: 24px 36px 28px 0;
  text-decoration: none;
  color: inherit;
}

.card-list a::before {
  content: "0" counter(card);
  display: block;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 10px;
}

.card-list a::after {
  content: "\2192"; /* → */
  position: absolute;
  right: 4px;
  top: 26px;
  font-size: 14px;
  color: var(--text-sub);
  transition: transform 0.2s ease, color 0.2s ease;
}

.card-list a:hover::after,
.card-list a:focus-visible::after {
  transform: translateX(4px);
  color: var(--accent);
}

.card-list h3 {
  font-size: 18px;
  letter-spacing: 0.04em;
  margin-bottom: 0.4em;
  transition: color 0.2s ease;
}

.card-list a:hover h3 {
  color: var(--accent);
}

.card-list p {
  color: var(--text-sub);
  font-size: 15px;
  margin-bottom: 0;
}

@media (min-width: 720px) {
  .card-list {
    grid-template-columns: 1fr 1fr;
    column-gap: 56px;
  }
}

/* ------------------------------------------------------------------
   Service sections (/services/)
   ------------------------------------------------------------------ */
.service-section .section-head h2 {
  font-size: clamp(21px, 2.8vw, 25px);
}

.service-section .section-head h2::before {
  counter-increment: service;
  content: "0" counter(service);
  display: block;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 12px;
}

.service-body > p:first-child {
  margin-top: -0.4em; /* 見出しとの視線高さを揃える */
}

.service-body h3 {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin: 2em 0 0.8em;
}

.service-body ol {
  margin: 0 0 1.6em;
  padding-left: 1.6em;
}

.service-body ol li {
  padding: 4px 0;
}

.service-body .btn {
  margin-top: 0.6em;
}

/* News list */
.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.news-list li {
  border-top: 1px solid var(--line);
  display: flex;
  gap: 32px;
  padding: 22px 4px;
  align-items: baseline;
}

.news-list li:last-child {
  border-bottom: 1px solid var(--line);
}

.news-list time {
  color: var(--text-sub);
  font-size: 14px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.news-list a {
  text-decoration: none;
  color: var(--text);
}

.news-list a:hover,
.news-list a:focus-visible {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

/* Article */
.article {
  max-width: 720px;
}

.article-meta {
  margin-bottom: 0.4em;
}

.article-meta time {
  color: var(--text-sub);
  font-size: 14px;
  letter-spacing: 0.04em;
}

.article-title {
  font-size: clamp(22px, 3vw, 28px);
  letter-spacing: 0.05em;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.4em;
}

.article-back {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.article-back a {
  font-size: 14px;
  text-decoration: none;
}

.article-back a::before {
  content: "\2190"; /* ← */
  margin-right: 10px;
  display: inline-block;
  transition: transform 0.2s ease;
}

.article-back a:hover {
  text-decoration: underline;
}

.article-back a:hover::before {
  transform: translateX(-4px);
}

/* Definition list (company overview) */
.info-dl {
  border-top: 1px solid var(--line);
  margin: 0 0 2em;
}

.info-dl > div {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  padding: 22px 4px;
  gap: 8px 32px;
}

.info-dl dt {
  width: 160px;
  flex-shrink: 0;
  font-weight: 500;
  font-size: 15px;
  color: var(--text-sub);
  letter-spacing: 0.05em;
}

.info-dl dd {
  margin: 0;
  flex: 1;
  min-width: 200px;
}

.info-dl dd ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.company-note {
  color: var(--text-sub);
  font-size: 15px;
}

/* Dash list (— で始まる箇条書き) */
.dash-list {
  list-style: none;
  margin: 0 0 1.6em;
  padding: 0;
}

.dash-list li {
  padding: 6px 0 6px 1.4em;
  position: relative;
}

.dash-list li::before {
  content: "\2014"; /* — */
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* Contact */
.contact-panel {
  background-color: #fff;
  border: 1px solid var(--line);
  max-width: 640px;
  padding: clamp(24px, 4vw, 36px) clamp(24px, 4vw, 40px);
  margin: 2em 0 3em;
}

.contact-email {
  font-size: clamp(17px, 2.4vw, 20px);
  font-weight: 500;
  letter-spacing: 0.04em;
  margin: 0 0 1em;
}

.contact-panel p:last-child {
  margin-bottom: 0;
}

.contact-section h2 {
  font-size: 19px;
  letter-spacing: 0.05em;
  padding-top: 1.2em;
  border-top: 1px solid var(--line);
  margin-top: 0.4em;
}

.contact-note {
  color: var(--text-sub);
  font-size: 14px;
  margin-top: 2.4em;
}

/* Legal / privacy */
.legal-body {
  max-width: 720px;
}

.legal-body h2 {
  font-size: 17px;
  letter-spacing: 0.05em;
  margin-top: 2.2em;
  padding-top: 1.4em;
  border-top: 1px solid var(--line);
}

/* ------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------ */
.site-footer {
  background-color: var(--footer-bg);
  color: #FAFAF9;
  padding: clamp(48px, 7vw, 72px) 0 32px;
}

.footer-inner {
  display: grid;
  gap: 28px;
}

.footer-logo {
  font-family: var(--font-heading);
  font-size: 20px;
  letter-spacing: 0.08em;
  margin: 0;
}

.footer-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 14px 28px;
}

.footer-nav a {
  color: rgba(250, 250, 249, 0.85);
  font-size: 13px;
  text-decoration: none;
  letter-spacing: 0.06em;
}

.footer-nav a:hover,
.footer-nav a:focus-visible {
  color: #FAFAF9;
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.footer-nav a[aria-current="page"] {
  color: #FAFAF9;
}

.footer-copy {
  color: #9AA3AD;
  font-size: 12px;
  letter-spacing: 0.06em;
  margin: 0;
  padding-top: 24px;
  border-top: 1px solid rgba(250, 250, 249, 0.16);
}

@media (min-width: 720px) {
  .footer-inner {
    grid-template-columns: 1fr auto;
    align-items: start;
    gap: 40px;
  }

  .footer-copy {
    grid-column: 1 / -1;
    margin-top: 8px;
  }
}

/* ------------------------------------------------------------------
   Fade-in (scroll)
   ------------------------------------------------------------------ */
.fade-in {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .site-nav a::after,
  .btn::after,
  .card-list a::after,
  .article-back a::before {
    transition: none;
  }
}

/* ------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------ */
@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: fixed;
    top: calc(var(--header-h) + 1px);
    left: 0;
    right: 0;
    /* ヘッダーの backdrop-filter が fixed の基準をヘッダーに変えるため、bottom: 0 ではなく高さを明示する */
    height: calc(100vh - var(--header-h) - 1px);
    height: calc(100dvh - var(--header-h) - 1px);
    background-color: var(--bg);
    /* 画面外へ translate すると横スクロール幅に数えられるため、その場でフェードさせる */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    overflow-y: auto;
  }

  .site-nav.is-open {
    opacity: 1;
    visibility: visible;
  }

  .site-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 12px 24px;
  }

  .site-nav li {
    border-bottom: 1px solid var(--line);
  }

  .site-nav a {
    display: block;
    padding: 16px 4px;
    font-size: 15px;
  }

  .site-nav a::after {
    content: none;
  }

  .info-dl > div {
    flex-direction: column;
    gap: 4px;
  }

  .info-dl dt {
    width: auto;
  }

  .news-list li {
    flex-direction: column;
    gap: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }

  .site-nav {
    transition: none;
  }
}
