/* ===================================================================
   株式会社IA MIRACOLO コーポレートサイト 共通CSS
   デザイン方針: 黒の面・白地・罫線・欧文ワードマークで、情報を精確に整理して見せる(project-plan.md §4)
   =================================================================== */

:root {
  --bg:        #FFFFFF;  /* 背景: 純白 */
  --text:      #0C0D0F;  /* 見出し・強い罫線: ほぼ黒 */
  --text-body: #3A3F47;  /* 説明文 */
  --text-sub:  #5A606A;  /* 補助テキスト(日付・ラベル) */
  --line:      #E1E4E8;  /* 罫線 */
  --dark:      #0C0D0F;  /* 黒の面 */
  --dark-text: #F2F3F5;  /* 黒の面の文字 */
  --dark-sub:  #A3A9B2;  /* 黒の面の補助テキスト */
  --dark-line: #24272C;  /* 黒の面の罫線 */

  --font-latin: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Noto Sans JP", "Hiragino Kaku Gothic ProN", sans-serif;

  --header-h: 72px;
  --gutter: clamp(20px, 4vw, 40px);
}

/* ------------------------------------------------------------------
   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.85;
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration: none;
}

h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.45;
  margin: 0 0 0.75em;
  color: inherit;
}

p {
  margin: 0 0 1.2em;
}

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

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

/* フォーカスリングは文字色と同色にし、白地でも黒の面でも見えるようにする */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid currentColor;
  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(--dark-text);
  color: var(--dark);
  font-size: 13px;
  text-decoration: none;
  transition: top 0.15s ease;
}

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

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* 英字ラベル: 欧文の小さなグレー文字。飾りは付けない */
.eyebrow {
  display: block;
  font-family: var(--font-latin);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.12em;
  color: var(--text-sub);
  margin-bottom: 12px;
}

/* ------------------------------------------------------------------
   Header (黒の面)
   ------------------------------------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--dark);
  color: var(--dark-text);
  border-bottom: 1px solid var(--dark-line);
}

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

.logo {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 14px;
  text-decoration: none;
  color: var(--dark-text);
  line-height: 1.3;
}

.logo-en {
  font-family: var(--font-latin);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.logo-ja {
  font-size: 11px;
  color: var(--dark-sub);
  letter-spacing: 0.06em;
}

.nav-toggle {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  background: none;
  border: 1px solid var(--dark-line);
  color: var(--dark-text);
  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(--dark-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: 36px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  position: relative;
  display: inline-block;
  color: #D5D9DF;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 6px 0;
}

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

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a[aria-current="page"] {
  color: var(--dark-text);
}

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

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

.section {
  padding: clamp(64px, 10vw, 112px) 0;
}

.section + .section {
  border-top: 1px solid var(--line);
}

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

.section-head h2 {
  font-size: clamp(22px, 2.6vw, 26px);
  line-height: 1.4;
  letter-spacing: 0.02em;
  margin: 0;
}

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

/* ------------------------------------------------------------------
   Hero (top page / 黒の面)
   ------------------------------------------------------------------ */
.hero {
  background-color: var(--dark);
  color: var(--dark-text);
  padding: clamp(80px, 12vw, 136px) 0 clamp(48px, 6vw, 72px);
}

.hero-title {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.6vw, 20px);
  margin: 0 0 clamp(48px, 7vw, 88px);
}

.hero-kicker {
  font-size: clamp(13px, 1.4vw, 16px);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.2em;
  color: var(--dark-sub);
}

.hero-wordmark {
  font-family: var(--font-latin);
  font-size: clamp(56px, 11vw, 164px);
  font-weight: 600;
  line-height: 0.92;
  letter-spacing: -0.035em;
}

.hero-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px 28px;
  padding-top: 32px;
  border-top: 1px solid var(--dark-line);
}

.hero-lead {
  font-size: clamp(16px, 1.6vw, 18px);
  line-height: 1.8;
  color: #E2E5E9;
  margin: 0;
}

.hero-cta {
  margin: 0;
}

/* ------------------------------------------------------------------
   Page header (下層ページ共通 / 黒の面)
   ------------------------------------------------------------------ */
.page-header {
  background-color: var(--dark);
  color: var(--dark-text);
  padding: clamp(64px, 9vw, 112px) 0 clamp(40px, 5vw, 56px);
}

.page-header .eyebrow {
  color: var(--dark-sub);
  margin-bottom: 16px;
}

.page-title {
  font-size: clamp(30px, 4.4vw, 48px);
  line-height: 1.3;
  letter-spacing: 0.02em;
  margin: 0;
}

/* ------------------------------------------------------------------
   Buttons
   ------------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid var(--text);
  color: var(--text);
  background-color: transparent;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.btn:hover {
  background-color: var(--text);
  color: var(--bg);
}

/* 黒の面に置くボタン: 白の枠線のみ。hover で白地・黒文字に反転 */
.btn-light {
  min-height: 52px;
  padding: 0 28px;
  font-size: 15px;
  border-color: var(--dark-text);
  color: var(--dark-text);
}

.btn-light:hover {
  background-color: var(--dark-text);
  color: var(--dark);
}

/* ------------------------------------------------------------------
   Card list (トップの事業ダイジェスト。罫線区切りの2列グリッド)
   ------------------------------------------------------------------ */
.card-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  column-gap: 48px;
}

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

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

.card-list h3 {
  font-size: 18px;
  margin-bottom: 0.5em;
}

.card-list a:hover h3,
.card-list a:focus-visible h3 {
  text-decoration: underline;
  text-underline-offset: 0.25em;
  text-decoration-thickness: 1px;
}

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

/* ------------------------------------------------------------------
   Service sections (/services/)
   ------------------------------------------------------------------ */
.service-body {
  color: var(--text-body);
}

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

.service-body h3 {
  font-size: 15px;
  color: var(--text);
  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: 40px;
  padding: 22px 0;
  align-items: baseline;
}

.news-list li:first-child {
  border-top-color: var(--text);
}

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

.news-list time {
  font-family: var(--font-latin);
  font-weight: 500;
  color: var(--text-sub);
  font-size: 15px;
  letter-spacing: 0.02em;
  min-width: 9em;
  white-space: nowrap;
}

.news-list a {
  font-weight: 500;
  text-decoration: none;
}

.news-list a:hover,
.news-list a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

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

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

.article-meta time {
  font-family: var(--font-latin);
  font-weight: 500;
  color: var(--text-sub);
  font-size: 15px;
}

.article-title {
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.4;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--text);
  margin-bottom: 1.4em;
}

.article-body {
  color: var(--text-body);
}

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

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

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

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

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

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

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

.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(--text-sub);
}

/* Contact */
.contact-section {
  color: var(--text-body);
}

.contact-panel {
  max-width: 640px;
  padding: clamp(24px, 4vw, 36px) 0;
  margin: 2em 0 3em;
  border-top: 1px solid var(--text);
  border-bottom: 1px solid var(--line);
}

.contact-email {
  font-family: var(--font-latin);
  font-size: clamp(18px, 2.4vw, 22px);
  font-weight: 600;
  color: var(--text);
  margin: 0 0 1em;
}

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

.contact-section h2 {
  font-size: 19px;
  color: var(--text);
  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;
  color: var(--text-body);
}

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

/* ------------------------------------------------------------------
   Footer (黒の面)
   ------------------------------------------------------------------ */
.site-footer {
  background-color: var(--dark);
  color: var(--dark-text);
  padding: clamp(48px, 7vw, 64px) 0 48px;
}

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

.footer-logo {
  font-family: var(--font-latin);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
}

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

.footer-nav a {
  color: #D5D9DF;
  font-size: 14px;
  text-decoration: none;
}

.footer-nav a:hover,
.footer-nav a:focus-visible,
.footer-nav a[aria-current="page"] {
  color: var(--dark-text);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.footer-copy {
  color: var(--dark-sub);
  font-size: 12px;
  margin: 0;
  padding-top: 24px;
  border-top: 1px solid var(--dark-line);
}

@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 {
    transition: none;
  }
}

/* ------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------ */
@media (max-width: 768px) {
  :root {
    --header-h: 64px;
  }

  .logo-ja {
    font-size: 10px;
  }

  .nav-toggle {
    display: block;
    flex-shrink: 0;
  }

  .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(--dark);
    /* 画面外へ 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 var(--gutter);
  }

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

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

  .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;
  }
}
