/* ==========================================================================
   tsunagime.com — corporate site
   Palette / spacing tokens live here; components below never hard-code color.
   ========================================================================== */

:root {
  color-scheme: light dark;

  --bg: #fbfbf9;
  --bg-alt: #f4f5f2;
  --surface: #ffffff;
  --surface-2: #ffffff;
  --ink: #14181c;
  --ink-2: #4c555f;
  --ink-3: #79828c;
  --line: #e3e5e0;
  --line-strong: #d3d6d0;
  --accent: #0d5c63;
  --accent-hover: #0a484e;
  --accent-ink: #ffffff;
  --accent-tint: #e6f0f0;
  --shadow-sm: 0 1px 2px rgba(16, 24, 28, .05);
  --shadow-md: 0 8px 28px rgba(16, 24, 28, .07), 0 1px 3px rgba(16, 24, 28, .04);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-pill: 999px;

  --wrap: 1120px;
  --gutter: clamp(20px, 5vw, 40px);

  --font: "Helvetica Neue", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Yu Gothic",
    YuGothic, Meiryo, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1012;
    --bg-alt: #10161a;
    --surface: #141b1e;
    --surface-2: #182024;
    --ink: #edf1f0;
    --ink-2: #aab4b6;
    --ink-3: #7d8789;
    --line: #232d30;
    --line-strong: #2e3a3d;
    --accent: #4fd1c5;
    --accent-hover: #7ee0d6;
    --accent-ink: #06211f;
    --accent-tint: #16292b;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, .45);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 { margin: 0; line-height: 1.35; letter-spacing: -.01em; font-weight: 700; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
svg { display: block; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--r-sm);
}
.skip:focus { left: 16px; }

/* --------------------------------------------------------------- header -- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 68px;
}

.brand { display: inline-flex; align-items: center; gap: 11px; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  flex: none;
}
.brand-mark svg { width: 22px; height: 22px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-size: 15px; letter-spacing: .04em; font-weight: 700; }
.brand-text i {
  font-style: normal;
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.nav { display: flex; gap: 30px; }
.nav a {
  font-size: 14px;
  color: var(--ink-2);
  transition: color .16s ease;
}
.nav a:hover { color: var(--ink); }

.header-actions { display: flex; align-items: center; gap: 12px; }

.lang {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  padding: 2px;
  background: var(--surface);
}
.lang button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-3);
  font-family: inherit;
  font-size: 12px;
  letter-spacing: .02em;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background .16s ease, color .16s ease;
}
.lang button:hover { color: var(--ink); }
.lang button.is-on {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

.menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  cursor: pointer;
  padding: 0;
  place-items: center;
  gap: 5px;
  align-content: center;
}
.menu-btn span {
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--ink);
  transition: transform .2s ease, opacity .2s ease;
}
.menu-btn[aria-expanded="true"] span:first-child { transform: translateY(3.25px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-3.25px) rotate(-45deg); }

.mobile-nav {
  display: none;
  flex-direction: column;
  border-top: 1px solid var(--line);
  padding: 8px var(--gutter) 16px;
}
.mobile-nav a {
  padding: 12px 0;
  font-size: 15px;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line);
}
.mobile-nav a:last-child { border-bottom: 0; }

/* ----------------------------------------------------------------- hero -- */

.hero { padding: clamp(56px, 9vw, 104px) 0 clamp(48px, 7vw, 88px); }

.hero-inner {
  display: grid;
  grid-template-columns: 1.04fr .96fr;
  gap: clamp(36px, 6vw, 72px);
  align-items: center;
}

.eyebrow {
  font-size: 12.5px;
  letter-spacing: .1em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 18px;
}

.hero h1 {
  font-size: clamp(30px, 4.6vw, 50px);
  line-height: 1.28;
  letter-spacing: -.02em;
  margin-bottom: 22px;
  /* 日本語の折り返しを文節単位に（対応ブラウザのみ・非対応でも通常の折り返し） */
  word-break: auto-phrase;
}

.lede {
  font-size: clamp(15px, 1.35vw, 17px);
  color: var(--ink-2);
  max-width: 46em;
}

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 0 24px;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .02em;
  border: 1px solid transparent;
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); }

.btn-ghost { border-color: var(--line-strong); color: var(--ink); background: var(--surface); }
.btn-ghost:hover { border-color: var(--ink-3); }

.hero-note {
  margin-top: 22px;
  font-size: 13px;
  color: var(--ink-3);
}

/* seam diagram */

.seam-card {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 18px;
  align-items: center;
  padding: clamp(20px, 3vw, 30px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
}

.seam-col { display: flex; flex-direction: column; gap: 9px; min-width: 0; }

.seam-label {
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 3px;
}

.chip {
  display: block;
  padding: 9px 13px;
  border-radius: var(--r-sm);
  background: var(--bg-alt);
  border: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seam-mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: stretch;
  gap: 10px;
  padding-top: 18px;
}
.seam-line {
  flex: 1;
  width: 0;
  border-left: 1.5px dashed var(--line-strong);
  min-height: 18px;
}
.seam-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-pill);
  background: var(--accent-tint);
  color: var(--accent);
  flex: none;
}
.seam-mark svg { width: 24px; height: 24px; }

/* ------------------------------------------------------------- sections -- */

.section { padding: clamp(56px, 8vw, 96px) 0; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--line); }

.kicker {
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 14px;
}

.section-title {
  font-size: clamp(22px, 2.9vw, 32px);
  line-height: 1.4;
  max-width: 20em;
  margin-bottom: clamp(32px, 4vw, 52px);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 2vw, 24px);
}

.card {
  position: relative;
  padding: clamp(22px, 2.4vw, 30px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}
.card h3 { font-size: 17px; margin-bottom: 12px; }
.card p { font-size: 14px; color: var(--ink-2); }

.card-num {
  display: block;
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 14px;
}

.card-plain {
  background: transparent;
  box-shadow: none;
  border: 0;
  border-top: 2px solid var(--accent);
  border-radius: 0;
  padding: 22px 0 0;
}

/* ------------------------------------------------------------- products -- */

.products {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 2vw, 24px);
}

.product {
  display: flex;
  flex-direction: column;
  padding: clamp(22px, 2.4vw, 30px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}

.product-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.product-head h3 { font-size: 17px; line-height: 1.5; }

.badge {
  flex: none;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  white-space: nowrap;
  margin-top: 3px;
}
.badge-live { background: var(--accent-tint); color: var(--accent); }
.badge-soon { background: var(--bg-alt); color: var(--ink-3); border: 1px solid var(--line-strong); }

.product-lede { font-size: 14px; color: var(--ink-2); margin-bottom: 18px; }

.product-points {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  margin-bottom: 20px;
}
.product-points li {
  position: relative;
  padding-left: 20px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-2);
}
.product-points li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 9px;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--accent);
  opacity: .55;
}

.product-link {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  transition: gap .16s ease;
}
.product-link:hover { gap: 11px; }
.product-link svg { width: 13px; height: 13px; }

.product-note {
  margin-top: auto;
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.7;
}

/* -------------------------------------------------------------- contact -- */

.contact-card {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
  padding: clamp(28px, 4vw, 52px);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}
.contact-card h2 { font-size: clamp(21px, 2.6vw, 28px); margin-bottom: 14px; }
.contact-card .kicker { margin-bottom: 12px; }

.contact-list { display: flex; flex-direction: column; gap: 16px; }
.contact-list li {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg-alt);
}
.contact-label { font-size: 12px; color: var(--ink-3); letter-spacing: .04em; }
.contact-list a {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  word-break: break-all;
}
.contact-list a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* --------------------------------------------------------------- footer -- */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-alt);
  padding: clamp(36px, 5vw, 56px) 0 28px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-brand-text { display: flex; flex-direction: column; line-height: 1.5; }
.footer-brand-text b { font-size: 14px; }
.footer-brand-text span { font-size: 12px; color: var(--ink-3); }

.footer-nav { display: flex; flex-wrap: wrap; gap: 24px; }
.footer-nav a { font-size: 13px; color: var(--ink-2); }
.footer-nav a:hover { color: var(--ink); }

.footer-legal {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding-top: 22px;
}
.footer-legal p { font-size: 11.5px; line-height: 1.75; color: var(--ink-3); max-width: 62ch; }
.footer-legal .copy { white-space: nowrap; }

/* ---------------------------------------------------------- 404 (light) -- */

.notfound {
  min-height: 72vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 80px 0;
}
.notfound h1 { font-size: clamp(26px, 4vw, 40px); margin-bottom: 14px; }
.notfound p { color: var(--ink-2); margin-bottom: 28px; }
.notfound .code {
  font-size: 12px;
  letter-spacing: .18em;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 16px;
}

/* ----------------------------------------------------------- responsive -- */

@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; }
  .grid-3, .products { grid-template-columns: repeat(2, 1fr); }
  .contact-card { grid-template-columns: 1fr; }
}

@media (max-width: 780px) {
  .nav { display: none; }
  .menu-btn { display: grid; }
  .mobile-nav[data-open="true"] { display: flex; }
  .grid-3, .products { grid-template-columns: 1fr; }

  .seam-card { grid-template-columns: 1fr; gap: 14px; }
  .seam-mid { flex-direction: row; padding-top: 0; align-self: auto; }
  .seam-line { flex: 1; height: 0; width: auto; min-height: 0; border-left: 0; border-top: 1.5px dashed var(--line-strong); }
  .chip { white-space: normal; }

  .footer-inner { flex-direction: column; align-items: flex-start; }
}

/* ==========================================================================
   Guides (/guides/*) — bài viết dài. Base reset ở trên bỏ hết margin/bullet,
   nên prose phải tự dựng lại trong phạm vi .article, đừng đụng selector chung.
   ⚠️ Các trang này CHỈ có tiếng Nhật (không data-ja/data-en) → không đặt nút
   đổi ngôn ngữ lên header của chúng: site.js chỉ dịch phần tử có CẢ hai
   thuộc tính, bấm EN sẽ không có gì xảy ra và người đọc tưởng hỏng.
   ========================================================================== */
.article { max-width: 760px; margin: 0 auto; padding: clamp(28px, 5vw, 56px) 0 8px; }
.crumbs { display: flex; gap: 8px; align-items: center; font-size: .82rem; color: var(--ink-3); margin-bottom: 18px; }
.crumbs a { color: var(--ink-3); text-decoration: underline; text-underline-offset: 3px; }
.crumbs a:hover { color: var(--accent); }

.article h1 { font-size: clamp(1.6rem, 4.2vw, 2.25rem); margin-bottom: 14px; }
.article .lede { font-size: 1.03rem; color: var(--ink-2); line-height: 1.85; margin-bottom: 10px; }
.article .meta { font-size: .8rem; color: var(--ink-3); margin-bottom: 30px; }

.article h2 { font-size: clamp(1.2rem, 2.6vw, 1.45rem); margin: 42px 0 14px; padding-top: 22px; border-top: 1px solid var(--line); }
.article h3 { font-size: 1.03rem; margin: 26px 0 10px; }
.article p { line-height: 1.95; margin: 0 0 16px; color: var(--ink); }
.article ul, .article ol { margin: 0 0 18px; padding-left: 1.35em; }
.article ul { list-style: disc; }
.article ol { list-style: decimal; }
.article li { line-height: 1.9; margin-bottom: 7px; }
.article strong { font-weight: 700; }
/* ⚠️ :not(.btn) là bắt buộc — không có nó thì `.article a` (specificity 0,1,1) thắng
   `.btn-primary` (0,1,0) và ghi đè color thành var(--accent), tức chữ teal trên nền teal:
   nút biến thành một viên thuốc rỗng. Đã dính đúng lỗi này ở bản preview 2026-09-12. */
.article a:not(.btn) { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.article code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em;
  background: var(--bg-alt); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }

/* Bảng so sánh — phải cuộn ngang được trên mobile, đừng để vỡ layout. */
.table-scroll { overflow-x: auto; margin: 0 0 20px; border: 1px solid var(--line); border-radius: var(--r-md); }
.article table { border-collapse: collapse; width: 100%; min-width: 480px; font-size: .92rem; }
.article th, .article td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.article thead th { background: var(--bg-alt); font-weight: 700; white-space: nowrap; }
.article tbody tr:last-child td { border-bottom: 0; }

.note { border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--surface);
  border-radius: var(--r-sm); padding: 14px 16px; margin: 0 0 22px; font-size: .93rem; color: var(--ink-2); }
.note p:last-child { margin-bottom: 0; }

.article .cta-row { margin: 30px 0 10px; }
.guide-next { margin: 46px 0 10px; padding: 20px 22px; background: var(--bg-alt); border-radius: var(--r-md); }
.guide-next h2 { margin: 0 0 12px; padding-top: 0; border-top: 0; font-size: 1.02rem; }
.guide-next ul { list-style: none; padding-left: 0; margin-bottom: 0; }
.guide-next li { margin-bottom: 8px; }
