/* eXTEM Software Japan — site styles */
:root {
  --paper: #ffffff;
  --wash: #f3f5f6;
  --ink: #27313c;
  --sub: #5e656c;
  --rule: #e1e5e8;
  --brand: #ff7f45;      /* ロゴの e の色（グラデーションの中間） */
  --brand-text: #b5501f; /* 白地で読める濃さ */
  --brand-soft: #fff0e8;
  --ai: #2c6a8e;         /* AIが書いた箇所 */
  --ai-soft: #e6f0f6;
  --radius-s: 4px;
  --radius-m: 10px;
  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
  --font: "IBM Plex Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", Meiryo, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.85;
  font-feature-settings: "palt" 0;
  overflow-wrap: anywhere;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-text); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { line-height: 1.4; margin: 0; font-weight: 700; letter-spacing: 0.01em; word-break: auto-phrase; text-wrap: balance; }
.nw { white-space: nowrap; }
h1 { font-size: clamp(30px, 4.6vw, 50px); line-height: 1.3; letter-spacing: 0.02em; }
h2 { font-size: clamp(22px, 2.8vw, 30px); }
h3 { font-size: 19px; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.measure { max-width: 38em; }
.lead { font-size: clamp(16px, 1.6vw, 18px); color: var(--sub); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: var(--paper); padding: 8px 12px; z-index: 10; }

/* ---------- header ---------- */
.site-header { border-bottom: 1px solid var(--rule); background: var(--paper); position: sticky; top: 0; z-index: 5; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand img { width: 150px; height: auto; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; align-items: center; }
.nav a { display: block; padding: 8px 12px; color: var(--ink); text-decoration: none; font-size: 15px; border-radius: var(--radius-s); }
.nav a:hover { background: var(--wash); }
.nav a[aria-current="page"] { color: var(--brand-text); font-weight: 500; }
.nav .nav-contact { background: var(--ink); color: #fff; margin-left: 8px; padding: 8px 16px; }
.nav .nav-contact:hover { background: var(--brand-text); color: #fff; }
.menu-toggle { display: none; }

@media (max-width: 860px) {
  .menu-toggle {
    display: inline-flex; align-items: center; gap: 8px;
    background: none; border: 1px solid var(--rule); border-radius: var(--radius-s);
    font: inherit; font-size: 14px; color: var(--ink); padding: 6px 12px; cursor: pointer;
  }
  .nav { position: absolute; left: 0; right: 0; top: 72px; background: var(--paper); border-bottom: 1px solid var(--rule); display: none; }
  .nav.open { display: block; }
  .nav ul { flex-direction: column; align-items: stretch; padding: 8px var(--gutter) 16px; gap: 0; }
  .nav a { padding: 12px 4px; border-bottom: 1px solid var(--rule); border-radius: 0; }
  .nav .nav-contact { margin: 12px 0 0; text-align: center; border-radius: var(--radius-s); border: 0; }
}

/* ---------- sections ---------- */
section { padding: clamp(56px, 8vw, 104px) 0; }
section + section { border-top: 1px solid var(--rule); }
section.tinted { background: var(--wash); border-top: 0; }
section.tinted + section { border-top: 0; }
.section-head { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 40px; max-width: 40em; }
.section-head p { color: var(--sub); margin: 0; }

/* ---------- hero ---------- */
.hero { padding: clamp(48px, 7vw, 96px) 0 clamp(56px, 8vw, 104px); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero h1 { margin-bottom: 24px; }
.hero .lead { margin-bottom: 32px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
@media (max-width: 900px) { .hero .wrap { grid-template-columns: 1fr; } }

.btn { display: inline-block; padding: 12px 22px; border-radius: var(--radius-s); text-decoration: none; font-weight: 500; font-size: 15px; border: 1px solid var(--ink); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--brand-text); border-color: var(--brand-text); color: #fff; }
.btn-ghost { color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--wash); color: var(--ink); }

/* ---------- sync demo (the signature) ---------- */
.sync-demo { position: relative; }
.sync-panes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; position: relative; }
.pane {
  background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius-m);
  box-shadow: 0 1px 0 var(--rule), 0 12px 28px -18px rgba(35, 39, 43, .35);
  overflow: hidden;
}
.pane-bar { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: var(--wash); border-bottom: 1px solid var(--rule); font-size: 12.5px; color: var(--sub); }
.pane-bar .who { font-weight: 500; color: var(--ink); }
.pane-bar .live { display: inline-flex; align-items: center; gap: 6px; }
.pane-bar .live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #3a9b6a; }
.pane-body { padding: 14px 12px 16px; display: grid; gap: 10px; }
.pane-title { font-size: 13px; color: var(--sub); margin: 0 0 2px; }
.field { display: grid; gap: 3px; position: relative; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pane-title span { display: block; font-size: 11.5px; color: var(--sub); }
.by-ai { display: inline-block; margin-left: 6px; font-size: 10.5px; line-height: 1.5; padding: 0 5px; border-radius: 3px; color: #fff; background: var(--ai); vertical-align: 1px; }
.ai-field textarea { background: #f8fafb; color: var(--ink); cursor: default; }
.pane-ai .pane-bar .who::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--ai); margin-right: 6px; vertical-align: 1px; }
.pane-human .pane-bar .who::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-right: 6px; vertical-align: 1px; }
.field[data-writing]::after {
  content: attr(data-writing); position: absolute; right: 0; top: 0;
  font-size: 11px; line-height: 1.6; padding: 0 6px; border-radius: 3px; color: #fff; background: var(--brand);
}
.field[data-writing="AIが入力中"]::after { background: var(--ai); }
.field label { font-size: 12px; color: var(--sub); }
.field input, .field textarea {
  width: 100%; font: inherit; font-size: 15px; color: var(--ink);
  border: 1px solid var(--rule); border-radius: var(--radius-s); padding: 6px 8px; background: var(--paper);
  transition: background-color .9s ease, border-color .9s ease;
}
.field textarea { resize: none; line-height: 1.5; font-size: 14px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--ink); }
.field .flash { background: var(--brand-soft); border-color: var(--brand); transition: none; }
.field .flash-ai { background: var(--ai-soft); border-color: var(--ai); transition: none; }
.sync-link {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 28px; height: 28px; border-radius: 50%; background: var(--paper); border: 1px solid var(--rule);
  display: grid; place-items: center; color: var(--brand); font-size: 14px; z-index: 1;
}
.sync-link.pulse { animation: pulse .6s ease-out; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 127, 69, .45); } 100% { box-shadow: 0 0 0 12px rgba(255, 127, 69, 0); } }
.sync-caption { margin-top: 14px; font-size: 13.5px; color: var(--sub); }
@media (max-width: 560px) {
  .sync-panes { gap: 8px; }
  .pane-bar { padding: 6px 8px; font-size: 11.5px; }
  .pane-bar .live { font-size: 0; }
  .pane-body { padding: 10px 8px 12px; gap: 8px; }
  .field input, .field textarea { font-size: 16px; padding: 4px 6px; }
  .field textarea { font-size: 16px; }
  .ai-field textarea { font-size: 13px; }
  .row2 { grid-template-columns: 1fr; gap: 8px; }
  .pane-title span { font-size: 10.5px; }
  .sync-link { width: 22px; height: 22px; font-size: 11px; }
}
@media (max-width: 340px) {
  .sync-panes { grid-template-columns: 1fr; }
  .sync-link { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .field input, .field textarea { transition: none; }
  .sync-link.pulse { animation: none; }
}

/* ---------- services (home) ---------- */
.services { display: grid; gap: 0; border-top: 1px solid var(--ink); }
.service { display: grid; grid-template-columns: minmax(0, 15em) minmax(0, 1fr); gap: 16px 48px; padding: 32px 0; border-bottom: 1px solid var(--rule); }
.service h3 { font-size: 21px; }
.service p { margin: 0 0 12px; max-width: 36em; }
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font-size: 13px; padding: 2px 10px; border: 1px solid var(--rule); border-radius: 999px; color: var(--sub); background: var(--paper); }
@media (max-width: 720px) { .service { grid-template-columns: 1fr; } }

/* ---------- feature split ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.split.reverse { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
@media (max-width: 900px) { .split, .split.reverse { grid-template-columns: 1fr; } }
.shot { border: 1px solid var(--rule); border-radius: var(--radius-m); overflow: hidden; background: var(--paper); box-shadow: 0 18px 40px -28px rgba(35, 39, 43, .45); }
figure { margin: 0; }
figcaption { font-size: 13.5px; color: var(--sub); margin-top: 10px; }

.facts { list-style: none; padding: 0; margin: 20px 0 28px; display: grid; gap: 10px; }
.facts li { padding-left: 18px; position: relative; }
.facts li::before { content: ""; position: absolute; left: 0; top: .78em; width: 8px; height: 2px; background: var(--brand); }

/* ---------- products ---------- */
.products { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.product h3 { font-size: 18px; margin-bottom: 6px; }
.product p { color: var(--sub); font-size: 15px; margin-bottom: 8px; }
.product a { font-size: 15px; }
.upcoming { margin-top: 40px; padding: 20px 24px; border: 1px dashed #c4cacf; border-radius: var(--radius-m); color: var(--sub); }
.upcoming strong { color: var(--ink); }
@media (max-width: 760px) { .products { grid-template-columns: 1fr; gap: 24px; } }

/* ---------- news ---------- */
.news { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.news li { display: grid; grid-template-columns: 8.5em minmax(0, 1fr); gap: 4px 24px; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.news time { color: var(--sub); font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .news li { grid-template-columns: 1fr; } }

/* ---------- technology page ---------- */
.page-hero { padding: clamp(48px, 7vw, 88px) 0 clamp(32px, 4vw, 48px); }
.page-hero .kicker { color: var(--sub); margin-bottom: 12px; }
.page-hero h1 { font-size: clamp(28px, 4.6vw, 48px); margin-bottom: 20px; }
.page-hero .shot { margin-top: clamp(32px, 5vw, 56px); }

.points { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
.points h3 { margin-bottom: 8px; }
.points p { color: var(--sub); margin: 0; }
@media (max-width: 820px) { .points { grid-template-columns: 1fr; gap: 28px; } }

.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 28px; }
@media (max-width: 720px) { .gallery { grid-template-columns: 1fr; } }

.uses { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--ink); }
.use { padding: 20px 20px 20px 0; border-bottom: 1px solid var(--rule); }
.use + .use { padding-left: 20px; border-left: 1px solid var(--rule); }
.use h3 { font-size: 17px; margin-bottom: 6px; }
.use p { font-size: 15px; color: var(--sub); margin: 0; }
.use .badge { display: inline-block; font-size: 12px; color: var(--brand-text); border: 1px solid var(--brand); border-radius: 999px; padding: 0 8px; margin-bottom: 8px; }
@media (max-width: 900px) {
  .uses { grid-template-columns: 1fr 1fr; }
  .use, .use + .use { padding: 20px 16px 20px 0; border-left: 0; }
  .use:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--rule); }
}
@media (max-width: 520px) { .uses { grid-template-columns: 1fr; } .use:nth-child(even) { padding-left: 0; border-left: 0; } }

.mechanism { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
@media (max-width: 900px) { .mechanism { grid-template-columns: 1fr; } }
.diagram { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 20px; }
.diagram svg { width: 100%; height: auto; display: block; }

.patents { display: grid; gap: 0; border-top: 1px solid var(--ink); }
.patent { display: grid; grid-template-columns: minmax(0, 14em) minmax(0, 1fr); gap: 12px 48px; padding: 32px 0; border-bottom: 1px solid var(--rule); }
.patent .no { font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.patent .meta { color: var(--sub); font-size: 14px; }
.patent h3 { margin-bottom: 10px; }
.patent dl { margin: 16px 0 0; display: grid; grid-template-columns: 9em minmax(0, 1fr); gap: 8px 16px; }
.patent dt { color: var(--sub); font-size: 14px; padding-top: 2px; }
.patent dd { margin: 0; }
@media (max-width: 720px) { .patent { grid-template-columns: 1fr; } .patent dl { grid-template-columns: 1fr; gap: 2px; } .patent dd { margin-bottom: 10px; } }

.note { font-size: 14px; color: var(--sub); }
.callout { border-left: 3px solid var(--brand); padding: 4px 0 4px 20px; max-width: 40em; }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: #c9ced3; padding: 56px 0 32px; font-size: 14px; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 32px; }
.footer-grid .name { color: #fff; font-weight: 700; font-size: 16px; margin-bottom: 8px; }
.footer-nav { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 24px; }
.copyright { margin-top: 40px; padding-top: 20px; border-top: 1px solid #3a4046; color: #8f979e; font-size: 13px; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr; } }

.cta { text-align: left; }
.cta .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.cta h2 { margin-bottom: 6px; }
.cta p { margin: 0; color: var(--sub); }

/* ---------- services: steps (実際の順序なので番号つき) ---------- */
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--ink); }
.steps li { counter-increment: step; padding: 20px 20px 4px 0; }
.steps li + li { padding-left: 20px; border-left: 1px solid var(--rule); }
.steps li::before { content: counter(step); display: block; font-weight: 700; font-size: 28px; line-height: 1; color: var(--brand); margin-bottom: 12px; font-variant-numeric: tabular-nums; }
.steps h3 { font-size: 17px; margin-bottom: 6px; }
.steps p { font-size: 15px; color: var(--sub); margin: 0; }
@media (max-width: 860px) {
  .steps { grid-template-columns: 1fr; }
  .steps li, .steps li + li { padding: 18px 0; border-left: 0; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 2.2em minmax(0, 1fr); column-gap: 12px; }
  .steps li::before { grid-row: span 2; margin: 0; }
}

/* ---------- products: open source ---------- */
.oss-list { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.oss { border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 24px 26px 26px; background: var(--paper); }
.oss:first-child { border-color: var(--ink); }
.oss .status { display: inline-block; font-size: 12.5px; margin: 0 0 12px; padding: 1px 10px; border-radius: 999px; border: 1px dashed var(--sub); color: var(--sub); }
.oss h3 { margin-bottom: 10px; }
.oss .origin { font-size: 14.5px; color: var(--sub); }
@media (max-width: 860px) { .oss-list { grid-template-columns: 1fr; } }

/* ---------- video (クリックで初めてYouTubeを読み込む) ---------- */
.video { position: relative; aspect-ratio: 1600 / 1149; border-radius: var(--radius-m); overflow: hidden; background: #000; border: 1px solid var(--rule); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-poster { display: block; position: absolute; inset: 0; }
.video-poster img { width: 100%; height: 100%; object-fit: cover; }
.video-poster .play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; gap: 10px; padding: 12px 20px 12px 16px;
  background: rgba(35, 39, 43, .88); color: #fff; border-radius: 999px; font-size: 15px; font-weight: 500;
}
.video-poster .play::before { content: ""; width: 0; height: 0; border-left: 12px solid #fff; border-top: 8px solid transparent; border-bottom: 8px solid transparent; }
.video-poster:hover .play, .video-poster:focus-visible .play { background: var(--brand-text); }
.video.playing { aspect-ratio: 16 / 9; }

/* ---------- company ---------- */
.profile { display: grid; grid-template-columns: 9em minmax(0, 1fr); margin: 0; border-top: 1px solid var(--ink); max-width: 52em; }
.profile dt, .profile dd { padding: 14px 0; border-bottom: 1px solid var(--rule); margin: 0; }
.profile dt { color: var(--sub); font-size: 15px; }
@media (max-width: 560px) { .profile { grid-template-columns: 1fr; } .profile dt { border-bottom: 0; padding-bottom: 0; } .profile dd { padding-top: 2px; } }

.timeline { list-style: none; margin: 0; padding: 0; max-width: 52em; }
.timeline li { display: grid; grid-template-columns: 8em minmax(0, 1fr); gap: 4px 24px; padding: 12px 0 12px 20px; border-left: 2px solid var(--rule); position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 22px; width: 10px; height: 10px; border-radius: 50%; background: var(--paper); border: 2px solid var(--brand); }
.timeline time { color: var(--sub); font-variant-numeric: tabular-nums; }
.timeline p { margin: 0; }
@media (max-width: 560px) { .timeline li { grid-template-columns: 1fr; } }

.access { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px; }
.map { border: 1px solid var(--rule); border-radius: var(--radius-m); overflow: hidden; min-height: 360px; }
.map iframe { width: 100%; height: 100%; min-height: 360px; border: 0; display: block; }
.photos { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; gap: 12px; }
.photos img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-s); }
.photos img:nth-child(3) { grid-column: 1 / -1; aspect-ratio: 16 / 9; object-position: center 60%; }
@media (max-width: 860px) { .access { grid-template-columns: 1fr; } }

.policy ol { padding-left: 1.4em; margin: 0; display: grid; gap: 14px; }
.policy ul { margin: 6px 0 0; padding-left: 1.2em; }

/* ---------- contact ---------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 80px); }
.contact-grid h2 { font-size: 18px; color: var(--sub); font-weight: 500; margin-bottom: 4px; }
.contact-grid h3 { font-size: 17px; margin-top: 32px; }
.contact-mail, .contact-tel { font-size: clamp(26px, 4vw, 36px); font-weight: 700; margin: 0 0 6px; line-height: 1.3; }
.contact-mail a, .contact-tel a { color: var(--ink); text-decoration-color: var(--brand); text-decoration-thickness: 2px; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }

/* ---------- products: 2009年とこれから ---------- */
.then-now { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 28px; margin-top: 48px; }
.then-now figcaption strong { color: var(--ink); margin-right: 4px; }
.then-now-note { grid-column: 1 / -1; font-size: 14px; color: var(--sub); max-width: 52em; margin: 0; }
@media (max-width: 720px) { .then-now { grid-template-columns: 1fr; } }
