/* =============================================================
   ettract — FINALE LAYER (items 2-24 minus 10/11/21, + 26/27)
   Team / DL / ROI / TOC / split-text / sticky / divider /
   cursor-arrow / button-press / focus-ring / 404 / code-copy /
   terminal / search / a11y skip-link / :has() / container queries
   ============================================================= */

/* ============================================================
   [26] Focus ring ブランド化 — keyboard navigation ハイライト
   ============================================================ */
*:focus-visible {
  outline: 2px solid var(--accent-light) !important;
  outline-offset: 3px;
  border-radius: 6px;
  transition: outline-offset .15s var(--ease);
}

/* [27] Skip link (visually hidden until focused) */
.e-skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 10003;
  padding: 10px 16px; background: var(--accent);
  color: #fff; font-size: 13px; font-weight: 600; border-radius: 6px;
  transform: translateY(-200%); transition: transform .25s var(--ease);
}
.e-skip-link:focus-visible { transform: translateY(0); }

/* ============================================================
   [12] Button press feedback
   ============================================================ */
.btn, .btn-primary, .nav-cta, button, .badge-chip, .testimonial, .service-card, .case-card {
  transition: transform .15s var(--ease), box-shadow .2s var(--ease), border-color .3s var(--ease);
}
.btn:active, .btn-primary:active, .nav-cta:active, button:active {
  transform: scale(.97) !important;
}

/* [13] Form field focus glow */
input:focus, textarea:focus, select:focus {
  outline: none !important;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(124,58,237,.25), 0 0 20px rgba(124,58,237,.15) !important;
}

/* ============================================================
   [2] Team Section
   ============================================================ */
.team-section { padding: 89px 0; }
.team-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 21px;
  max-width: 900px; margin: 0 auto;
}
.team-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 34px 21px; text-align: center;
  transition: transform .3s var(--ease), border-color .3s var(--ease);
  min-width: 0;
}
.team-card:hover { transform: translateY(-4px); border-color: var(--glass-border-hover); }
.team-card__avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #06b6d4);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 800; color: #fff;
  margin: 0 auto 16px;
  box-shadow: 0 0 24px rgba(124,58,237,.4);
}
.team-card__name { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.team-card__role { font-size: 12px; color: var(--cyan-light); letter-spacing: 1px; margin-bottom: 13px; text-transform: uppercase; }
.team-card__bio  { font-size: 13px; color: var(--text-secondary); line-height: 1.7; }
@media (max-width: 768px) { .team-grid { grid-template-columns: 1fr; } }

/* ============================================================
   [3] 資料ダウンロード CTA
   ============================================================ */
.dl-section { padding: 89px 0; }
.dl-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 21px; max-width: 1132px; margin: 0 auto;
}
.dl-card {
  background: linear-gradient(145deg, rgba(124,58,237,.1), rgba(6,182,212,.05));
  border: 1px solid rgba(167,139,250,.25);
  border-radius: var(--radius); padding: 34px 21px;
  display: flex; flex-direction: column; gap: 16px; min-width: 0;
  transition: transform .3s var(--ease), border-color .3s var(--ease);
}
.dl-card:hover { transform: translateY(-4px); border-color: var(--accent-light); }
.dl-card__icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: rgba(124,58,237,.15);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent-light);
}
.dl-card__icon svg { width: 24px; height: 24px; stroke-width: 1.6; }
.dl-card__title { font-size: 15px; font-weight: 700; color: var(--text); }
.dl-card__desc { font-size: 13px; color: var(--text-secondary); line-height: 1.7; flex: 1; }
.dl-card__btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--cyan-light); font-weight: 600;
}
@media (max-width: 768px) { .dl-grid { grid-template-columns: 1fr; } }

/* ============================================================
   [4] ROI 計算機
   ============================================================ */
.roi-section { padding: 89px 0; background: var(--bg-alt); }
.roi-calc {
  max-width: 900px; margin: 0 auto;
  background: var(--bg-card); backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border); border-radius: var(--radius-lg);
  padding: 55px; display: grid; grid-template-columns: 1fr 1fr; gap: 55px;
}
@media (max-width: 768px) {
  .roi-calc { grid-template-columns: 1fr; padding: 34px 21px; gap: 34px; }
}
.roi-inputs { display: flex; flex-direction: column; gap: 21px; }
.roi-field { display: flex; flex-direction: column; gap: 8px; }
.roi-field label { font-size: 13px; color: var(--text-secondary); font-weight: 600; }
.roi-field input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px; border-radius: 2px;
  background: rgba(124,58,237,.25); outline: none;
}
.roi-field input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #06b6d4);
  cursor: pointer; box-shadow: 0 0 10px rgba(124,58,237,.5);
}
.roi-field input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #06b6d4);
  cursor: pointer; border: none;
}
.roi-field__row { display: flex; justify-content: space-between; align-items: baseline; }
.roi-field__value { font-size: 20px; font-weight: 700; color: var(--accent-light); }
.roi-result { display: flex; flex-direction: column; justify-content: center; gap: 21px; padding: 21px; background: rgba(6,182,212,.05); border-radius: var(--radius); border: 1px solid rgba(6,182,212,.2); }
.roi-metric { }
.roi-metric__label { font-size: 12px; color: var(--text-tertiary); letter-spacing: 1.5px; text-transform: uppercase; }
.roi-metric__value { font-size: 36px; font-weight: 800; background: var(--gradient-text); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1.2; }
.roi-metric__unit { font-size: 14px; color: var(--text-secondary); margin-left: 4px; }
.roi-disclaimer { font-size: 11px; color: var(--text-tertiary); margin-top: 8px; line-height: 1.6; }

/* ============================================================
   [5] Blog TOC sidebar
   ============================================================ */
@media (min-width: 1280px) {
  .article-page { position: relative; }
  .e-toc {
    position: fixed; top: 144px; right: max(21px, calc(50% - 620px - 240px));
    width: 220px; max-height: calc(100vh - 200px); overflow-y: auto;
    padding: 21px; background: var(--bg-card);
    border: 1px solid var(--glass-border); border-radius: var(--radius);
    backdrop-filter: blur(12px); z-index: 10;
  }
  .e-toc__title { font-size: 11px; letter-spacing: 2px; color: var(--text-tertiary); text-transform: uppercase; margin-bottom: 13px; }
  .e-toc__list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
  .e-toc__link {
    display: block; font-size: 12px; color: var(--text-secondary);
    text-decoration: none; line-height: 1.5;
    padding-left: 8px; border-left: 2px solid transparent;
    transition: all .2s var(--ease);
  }
  .e-toc__link.is-h3 { padding-left: 16px; font-size: 11px; color: var(--text-tertiary); }
  .e-toc__link.is-active { color: var(--accent-light); border-left-color: var(--accent); }
  .e-toc__link:hover { color: var(--text); }
}
@media (max-width: 1279px) { .e-toc { display: none; } }

/* [6] Split-text: DISABLED — hero は style-enhance.css の kinetic-reveal を使用 */

/* ============================================================
   [7] Sticky section — "選ばれる 3 つの理由" enhancement
   (既存 #strengths が sticky-enhanced 挙動に)
   ============================================================ */
@supports (position: sticky) {
  .strengths-sticky-wrap { position: relative; }
  /* currently strengths use a simple grid, not pinning. This is opt-in */
}

/* ============================================================
   [8] SVG Section Dividers
   ============================================================ */
.e-divider {
  width: 100%; height: 89px; display: block;
  margin: 0; position: relative; overflow: hidden; pointer-events: none;
}
.e-divider svg { width: 100%; height: 100%; display: block; }

/* ============================================================
   [9] Magnetic Arrow Cursor — enhanced via finale.js
   ============================================================ */
.e-cursor-ring.is-arrow {
  width: 48px; height: 48px;
  border: 1.5px solid var(--accent-light);
  background: rgba(124,58,237,.15);
  transform-origin: center center;
}
.e-cursor-ring.is-arrow::after {
  content: '↗';
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 600; color: var(--text);
  transform: translate(-50%,-50%); left: 50%; top: 50%;
}

/* ============================================================
   [14] Success celebration
   ============================================================ */
.e-success-tick {
  position: fixed; inset: 0; z-index: 10004;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10,10,25,.6); backdrop-filter: blur(8px);
  animation: success-bg .5s ease;
  pointer-events: none;
}
.e-success-tick svg { width: 96px; height: 96px; }
.e-success-tick circle { fill: none; stroke: var(--cyan); stroke-width: 4; stroke-dasharray: 290; stroke-dashoffset: 290; animation: success-circle .6s ease forwards; }
.e-success-tick path { fill: none; stroke: var(--cyan); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 50; stroke-dashoffset: 50; animation: success-check .4s .4s ease forwards; }
@keyframes success-bg { 0% { opacity: 0; } 100% { opacity: 1; } }
@keyframes success-circle { to { stroke-dashoffset: 0; } }
@keyframes success-check { to { stroke-dashoffset: 0; } }

/* ============================================================
   [15] Code block with Copy button + basic syntax highlight
   ============================================================ */
.article-body pre {
  position: relative; background: rgba(10,10,22,.7);
  border: 1px solid var(--glass-border); border-radius: 10px;
  padding: 21px 55px 21px 21px; overflow-x: auto;
  margin: 21px 0 34px; font-size: 13px; line-height: 1.7;
  color: var(--text-secondary);
}
.article-body pre code { background: none; padding: 0; color: inherit; font-family: 'SF Mono', 'Fira Code', Menlo, monospace; }
.e-copy-btn {
  position: absolute; top: 10px; right: 10px;
  padding: 6px 10px; background: rgba(124,58,237,.15);
  border: 1px solid rgba(167,139,250,.3); border-radius: 6px;
  font-size: 11px; color: var(--accent-light); font-weight: 600;
  cursor: pointer; transition: all .2s var(--ease);
}
.e-copy-btn:hover { background: rgba(124,58,237,.3); color: #fff; }
.e-copy-btn.is-copied { background: rgba(16,185,129,.2); border-color: #10b981; color: #6ee7b7; }
/* primitive syntax highlight — accent keywords */
.tok-keyword { color: #c4b5fd; }
.tok-string  { color: #6ee7b7; }
.tok-number  { color: #67e8f9; }
.tok-comment { color: var(--text-tertiary); font-style: italic; }

/* ============================================================
   [16] 404 — animated ASCII / glitch brand
   ============================================================ */
.err-page { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 144px 21px; position: relative; }
.err-code {
  font: 900 clamp(80px, 18vw, 200px) 'SF Mono', monospace;
  background: var(--gradient-text);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  line-height: 1; margin-bottom: 21px;
  position: relative; letter-spacing: -.05em;
}
.err-code::before, .err-code::after {
  content: '404'; position: absolute; top: 0; left: 0; right: 0;
  background: inherit; -webkit-background-clip: text; background-clip: text; color: transparent;
}
.err-code::before { transform: translateX(-3px); clip-path: polygon(0 0, 100% 0, 100% 33%, 0 33%); animation: glitch1 3s infinite; }
.err-code::after  { transform: translateX(3px);  clip-path: polygon(0 66%, 100% 66%, 100% 100%, 0 100%); animation: glitch2 3s infinite; }
@keyframes glitch1 { 0%,90%,100% { transform: translateX(-3px); } 92% { transform: translateX(-7px); } 94% { transform: translateX(3px); } 96% { transform: translateX(-2px); } }
@keyframes glitch2 { 0%,90%,100% { transform: translateX(3px); } 91% { transform: translateX(7px); } 93% { transform: translateX(-3px); } 97% { transform: translateX(2px); } }
.err-msg { font-size: 18px; color: var(--text-secondary); margin-bottom: 34px; }
.err-cta { display: inline-flex; gap: 13px; }

/* ============================================================
   [17] View Transitions 拡張 — shared elements
   ============================================================ */
@supports (view-transition-name: none) {
  .hero-title { view-transition-name: hero-title-shared; }
  .nav-logo { view-transition-name: brand-logo-shared; }
  ::view-transition-group(hero-title-shared), ::view-transition-group(brand-logo-shared) {
    animation-duration: .55s;
  }
}

/* ============================================================
   [18] Container Queries — service-card 内部を親幅で自動調整
   ============================================================ */
.services-grid { container-type: inline-size; }
@container (max-width: 340px) {
  .service-card h3 { font-size: 14px; }
  .service-card p  { font-size: 12.5px; }
  .service-card .service-tags span { padding: 2px 6px; font-size: 10px; }
}

/* ============================================================
   [19] :has() smart states
   ============================================================ */
/* カードがタグ多数 (6 個超) の場合、padding を詰める */
.service-card:has(.service-tags span:nth-child(n+7)) { padding: 21px !important; }
/* article に pre があればトップに余白確保 */
.article-body:has(pre) h2:first-of-type { margin-top: 34px !important; }

/* ===== minmax(0,1fr) パッチ — 監査で発見の残り Grid ===== */
@media (min-width: 1025px) {
  .tech-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .form-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .tech-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 1024px) { .testimonials { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }
@media (max-width: 640px)  { .testimonials { grid-template-columns: minmax(0, 1fr) !important; } }
.tech-grid > *, .form-row > * { min-width: 0; }

/* ============================================================
   [20] speculationrules — added via HTML
   ============================================================ */

/* ============================================================
   [22] Prompt-style search UI (blog page)
   ============================================================ */
.blog-search {
  max-width: 720px; margin: 21px auto 55px;
  padding: 13px 21px; border-radius: 100px;
  background: var(--bg-card); border: 1px solid var(--glass-border);
  display: flex; align-items: center; gap: 13px;
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.blog-search:focus-within {
  border-color: var(--accent-light);
  box-shadow: 0 0 24px rgba(124,58,237,.2);
}
.blog-search__icon { color: var(--text-tertiary); flex-shrink: 0; }
.blog-search input {
  flex: 1; background: transparent; border: none; outline: none;
  font-size: 14px; color: var(--text); font-family: inherit;
}
.blog-search input::placeholder { color: var(--text-tertiary); }

/* [22b] Hide filtered-out blog cards */
.blog-card.is-hidden { display: none; }
.blog-empty-state {
  display: none; text-align: center; padding: 55px 21px;
  color: var(--text-tertiary); font-size: 14px;
}
.blog-empty-state.is-visible { display: block; }

/* ============================================================
   [23] AI-Assisted writing badge
   ============================================================ */
.ai-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 100px;
  background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.3);
  font-size: 11px; color: #6ee7b7; font-weight: 600;
  letter-spacing: .02em;
}
.ai-badge::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: #10b981; box-shadow: 0 0 8px rgba(16,185,129,.6);
  animation: ai-pulse 2s infinite;
}
@keyframes ai-pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }

/* ============================================================
   [24] Terminal-style Claude Code demo
   ============================================================ */
.term-demo {
  max-width: 820px; margin: 34px auto;
  background: #0c0c1a; border: 1px solid rgba(167,139,250,.25);
  border-radius: 12px; overflow: hidden;
  font-family: 'SF Mono', 'Fira Code', Menlo, monospace;
  box-shadow: 0 20px 60px rgba(0,0,0,.35), 0 0 40px rgba(124,58,237,.2);
}
.term-demo__bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; background: rgba(255,255,255,.04);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.term-demo__dot { width: 12px; height: 12px; border-radius: 50%; }
.term-demo__dot.r { background: #ff5f56; }
.term-demo__dot.y { background: #ffbd2e; }
.term-demo__dot.g { background: #27c93f; }
.term-demo__title { margin-left: 13px; font-size: 12px; color: var(--text-tertiary); letter-spacing: .02em; }
.term-demo__body {
  padding: 21px; min-height: 240px; font-size: 13px;
  line-height: 1.7; color: #d4d4e6;
}
.term-demo__body .prompt { color: #6ee7b7; }
.term-demo__body .comment { color: var(--text-tertiary); }
.term-demo__body .typed { white-space: pre-wrap; word-break: break-all; }
.term-demo__body .cursor-blink::after {
  content: '▊'; color: var(--cyan-light);
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }
