/* Cape Light エフェクトラボ共通UI
   正本色は公式サイト site-test/sass/_variables.scss に合わせる。 */

:root {
  --brand: #53a9af;
  --brand-dark: #327f86;
  --brand-deep: #286b70;
  --accent: #8cac88;
  --accent-soft: #eef6ed;
  --text: #3f4648;
  --text-2: #526061;
  --text-3: #707c7c;
  --surface: #fffdf8;
  --surface-1: #fbfaf4;
  --surface-2: #eaf6f4;
  --line: rgba(83, 169, 175, 0.24);
  --shadow: 0 18px 42px rgba(63, 70, 72, 0.08);
  --font-ui: Montserrat, "Noto Sans JP", "Hiragino Sans", Meiryo, sans-serif;
  --font-body: "Noto Sans JP", "Hiragino Sans", Meiryo, sans-serif;

  /* 初期デモとの互換トークン。個別エフェクトの色指定を壊さないため残す。 */
  --cl-orange: #f08f00;
  --cl-orange-light: #cd853f;
  --cl-accent: #d35400;
  --cl-accent-hover: #a04000;
  --cl-brown: #312114;
  --cl-base: #4d4136;
  --cl-bg: #fafafa;
  --cl-white: #ffffff;
  --lab-font-en: var(--font-ui);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background-color: var(--surface-1);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { display: block; max-width: 100%; }
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(83, 169, 175, 0.45);
  outline-offset: 4px;
}

.lab-container {
  width: min(1120px, calc(100% - 48px));
  margin-inline: auto;
}

/* 一覧: ナビゲーション */
.lab-header {
  position: relative;
  overflow: hidden;
  padding: 22px 0 86px;
  background:
    radial-gradient(circle at 82% 62%, rgba(83, 169, 175, 0.16), transparent 27%),
    linear-gradient(135deg, rgba(255, 253, 248, 0.98), rgba(234, 246, 244, 0.8));
  border-bottom: 1px solid var(--line);
}
.lab-header::after {
  content: "";
  position: absolute;
  top: 112px;
  right: max(-7vw, -80px);
  width: clamp(150px, 21vw, 270px);
  aspect-ratio: 1;
  border: 1px solid rgba(40, 107, 112, 0.25);
  border-radius: 50%;
  box-shadow: 0 0 0 34px rgba(83, 169, 175, 0.04), 0 0 0 68px rgba(83, 169, 175, 0.025);
  pointer-events: none;
}
.lab-nav {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(40, 107, 112, 0.13);
}
.lab-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 1.05rem;
  font-weight: 700;
  text-decoration: none;
}
.lab-brand img {
    width:154.5px;
    height: auto;
    display: block;
  }

.lab-brand-mark {
  position: relative;
  width: 24px;
  height: 32px;
  border: 2px solid var(--text);
  border-top: 0;
  border-radius: 2px 2px 6px 6px;
}
.lab-brand-mark::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 4px;
  width: 12px;
  height: 8px;
  border: 2px solid var(--text);
  border-radius: 10px 10px 0 0;
}
.lab-brand-mark::after {
  content: "";
  position: absolute;
  top: -13px;
  right: -10px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #f2c66d;
  opacity: 0.75;
}
.lab-header-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--brand-deep);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}
.lab-header-back span { transition: transform 0.2s ease; }
.lab-header-back:hover span { transform: translate(2px, -2px); }

/* 一覧: ヒーロー */
.lab-hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: clamp(52px, 8vw, 110px);
  align-items: center;
  padding-top: clamp(72px, 11vw, 132px);
}
.lab-kicker,
.lab-section-label {
  margin: 0 0 18px;
  color: var(--brand-dark);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.lab-kicker::before,
.lab-section-label::before {
  content: "";
  display: inline-block;
  width: 34px;
  height: 1px;
  margin: 0 12px 4px 0;
  background: currentColor;
}
.lab-head { margin: 0; }
.lab-head-main {
  display: block;
  max-width: 8em;
  color: var(--text);
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 1.08;
  white-space: nowrap;
}
.lab-head-sub {
  display: block;
  margin-top: 18px;
  color: var(--brand-deep);
  font-family: var(--font-ui);
  font-size: clamp(0.7rem, 1vw, 0.84rem);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.lab-hero-note {
  position: relative;
  padding: 28px 30px;
  overflow: hidden;
  background: rgba(255, 253, 248, 0.66);
  border: 1px solid rgba(83, 169, 175, 0.2);
  border-radius: 2px 24px 24px 24px;
  box-shadow: 0 22px 56px rgba(40, 107, 112, 0.09);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.lab-header-lead,
.lab-header-guide {
  margin: 0;
  color: var(--text-2);
  font-size: 0.93rem;
}
.lab-header-guide { margin-top: 12px; }
.lab-header-count {
  margin: 26px 0 0;
  color: var(--brand-dark);
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  display: inline-flex;
  padding: 7px 12px;
  border: 1px solid rgba(83, 169, 175, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
}

.lab-section-intro {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 32px;
  padding: 78px 0 30px;
  border-bottom: 1px solid rgba(83, 169, 175, 0.16);
  margin-bottom: 24px;
}
.lab-section-intro .lab-section-label { margin: 0; }
.lab-section-intro > p:last-child {
  margin: 0;
  color: var(--text-3);
  font-size: 0.84rem;
}

/* 一覧: カード */
.lab-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 24px;
  padding: 0 0 88px;
}
.lab-card {
  grid-column: span 4;
  min-width: 0;
  overflow: hidden;
  background: rgba(255, 253, 248, 0.96);
  border: 1px solid rgba(83, 169, 175, 0.16);
  border-radius: 4px 22px 22px 22px;
  box-shadow: 0 8px 24px rgba(63, 70, 72, 0.045);
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}
.lab-card:hover {
  transform: translateY(-8px);
  border-color: rgba(83, 169, 175, 0.42);
  box-shadow: var(--shadow);
}
.lab-card-link { display: block; height: 100%; color: inherit; text-decoration: none; }
.lab-card-thumb {
  position: relative;
  aspect-ratio: 16 / 10.5;
  overflow: hidden;
  background: var(--surface-2);
}
.lab-card-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(140deg, rgba(40, 107, 112, 0.02), rgba(40, 107, 112, 0.2));
  opacity: 0;
  transition: opacity 0.35s ease;
}
.lab-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.lab-card:hover .lab-card-thumb img { transform: scale(1.045); }
.lab-card:hover .lab-card-thumb::after { opacity: 1; }
.lab-card-view {
  position: absolute;
  z-index: 2;
  right: 14px;
  bottom: 14px;
  display: grid;
  place-items: center;
  width: 48px;
  aspect-ratio: 1;
  color: var(--surface);
  background: var(--brand-deep);
  border-radius: 50%;
  font-family: var(--font-ui);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.lab-card:hover .lab-card-view { opacity: 1; transform: translateY(0); }
.lab-card-body { padding: 22px 22px 24px; }
.lab-card-no {
  display: inline-flex;
  margin: 0 0 13px;
  padding: 4px 8px;
  border: 1px solid rgba(83, 169, 175, 0.24);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--brand-dark);
  font-family: var(--font-ui);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.16em;
}
.lab-card-title {
  min-height: 3.15em;
  margin: 0 0 10px;
  color: var(--text);
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.58;
}
.lab-card-desc {
  min-height: 6.5em;
  margin: 0 0 18px;
  color: var(--text-2);
  font-size: 0.8rem;
  line-height: 1.75;
}
.lab-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.lab-card-tech {
  margin: 0;
  color: var(--text-3);
  font-family: var(--font-ui);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.lab-card-arrow { color: var(--brand-dark); transition: transform 0.25s ease; }
.lab-card:hover .lab-card-arrow { transform: translate(2px, -2px); }

.lab-footer {
  padding: 30px 0;
  color: var(--text-3);
  background: var(--surface);
  border-top: 1px solid var(--line);
  font-size: 0.76rem;
}
.lab-footer .lab-container { display: flex; justify-content: space-between; gap: 24px; }
.lab-footer p { margin: 0; }
.lab-footer a { color: var(--brand-deep); font-weight: 700; text-decoration: none; }
.lab-footer a span { margin-left: 6px; }

/* 各デモ共通 */
.demo-page { min-height: 100vh; background: var(--surface-1); }
.demo-header {
  position: relative;
  padding: 24px clamp(24px, 5vw, 72px) 28px;
  text-align: left;
  background: linear-gradient(135deg, var(--surface), rgba(234, 246, 244, 0.72));
  border-bottom: 1px solid var(--line);
}
.demo-back {
  display: inline-block;
  margin-bottom: 20px;
  color: var(--brand-deep);
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
}
.demo-back:hover { text-decoration: underline; text-underline-offset: 4px; }
.demo-title {
  margin: 0 0 6px;
  color: var(--text);
  font-size: clamp(1.35rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.45;
}
.demo-tech {
  margin: 0;
  color: var(--brand-dark);
  font-family: var(--font-ui);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.demo-stage { position: relative; min-height: 60vh; }
.demo-usage {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 64px;
}
.demo-usage h2 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 0.95rem;
}
.demo-usage p { margin: 0; color: var(--text-2); font-size: 0.86rem; }
.lab-badge-pc {
  display: inline-block;
  margin-top: 12px;
  padding: 5px 11px;
  color: var(--brand-deep);
  background: var(--surface-2);
  border-radius: 999px;
  font-size: 0.7rem;
}

@media (max-width: 900px) {
  .lab-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lab-card { grid-column: span 1; }
  .lab-hero { grid-template-columns: 1fr; gap: 42px; }
  .lab-hero-note { max-width: 620px; }
  .lab-card-title,
  .lab-card-desc { min-height: 0; }
}

@media (max-width: 600px) {
  .lab-container { width: min(100% - 32px, 1120px); }
  .lab-header { padding-top: 14px; padding-bottom: 46px; }
  .lab-header::after { top: 150px; right: -90px; }
  .lab-brand { font-size: 0.92rem; }
  .lab-brand-mark { transform: scale(0.86); }
  .lab-header-back { font-size: 0.72rem; }
  .lab-hero { padding-top: 66px; }
  .lab-head-main { font-size: clamp(2.25rem, 10.5vw, 3rem); }
  .lab-hero-note { padding: 24px 22px; border-radius: 2px 18px 18px 18px; }
  .lab-section-intro { display: block; padding-top: 48px; }
  .lab-section-intro > p:last-child { margin-top: 13px; }
  .lab-grid { grid-template-columns: 1fr; gap: 18px; padding-bottom: 56px; }
  .lab-card-view { opacity: 1; transform: none; }
  .lab-footer .lab-container { display: block; }
  .lab-footer a { display: inline-block; margin-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
