/* =====================================================================
   TailCMS — Shared design system (site.css)
   Palette derived from the landing page: navy / indigo / periwinkle.
   Used by all marketing + docs pages. Fully responsive, mobile-first.
   ===================================================================== */

:root {
  /* Brand palette (from the landing page) */
  --tc-navy: #00005d;
  --tc-indigo: #293895;
  --tc-indigo-600: #333399;
  --tc-periwinkle: #c3c1ff;
  --tc-periwinkle-soft: #f2f1ff;

  /* Neutrals */
  --tc-ink: #0b1020;
  --tc-text: #26283b;
  --tc-muted: #6b6f86;
  --tc-faint: #a4a4a4;
  --tc-line: #e7e9f3;
  --tc-bg: #ffffff;
  --tc-bg-soft: #f6f6fe;
  --tc-bg-alt: #f5f7fb;

  /* Effects */
  --tc-radius: 14px;
  --tc-radius-lg: 22px;
  --tc-shadow-sm: 0 1px 2px rgba(13, 16, 45, .06), 0 2px 8px rgba(13, 16, 45, .05);
  --tc-shadow: 0 8px 30px rgba(13, 16, 45, .10);
  --tc-shadow-lg: 0 24px 60px rgba(13, 16, 45, .16);

  /* Layout */
  --tc-maxw: 1180px;
  --tc-gap: clamp(16px, 3vw, 32px);
  --tc-header-h: 72px;

  --tc-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    "Hiragino Sans", "Noto Sans JP", Meiryo, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.tc {
  margin: 0;
  font-family: var(--tc-font);
  color: var(--tc-text);
  background: var(--tc-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.tc img { max-width: 100%; height: auto; display: block; }
.tc a { color: inherit; text-decoration: none; }

/* ---------- Layout helpers ---------- */
.tc-container {
  width: 100%;
  max-width: var(--tc-maxw);
  margin-inline: auto;
  padding-inline: clamp(18px, 5vw, 40px);
}
.tc-section { padding-block: clamp(56px, 9vw, 120px); }
.tc-section--soft { background: var(--tc-bg-soft); }
.tc-section--alt { background: var(--tc-bg-alt); }

.tc-eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--tc-indigo-600);
  margin: 0 0 14px;
}
.tc-h1 { font-size: clamp(34px, 6vw, 60px); line-height: 1.08; letter-spacing: -.02em; color: var(--tc-ink); margin: 0 0 18px; font-weight: 800; }
.tc-h2 { font-size: clamp(26px, 4.4vw, 42px); line-height: 1.14; letter-spacing: -.01em; color: var(--tc-ink); margin: 0 0 14px; font-weight: 800; }
.tc-h3 { font-size: clamp(19px, 2.4vw, 24px); line-height: 1.25; color: var(--tc-ink); margin: 0 0 10px; font-weight: 700; }
.tc-lead { font-size: clamp(16px, 2.2vw, 20px); color: var(--tc-muted); margin: 0 0 28px; }
.tc-prose { color: var(--tc-text); }
.tc-prose p { margin: 0 0 18px; }
.tc-prose h2 { margin-top: 40px; }
.tc-prose h3 { margin-top: 28px; }
.tc-prose ul, .tc-prose ol { margin: 0 0 18px; padding-left: 22px; }
.tc-prose li { margin: 6px 0; }
.tc-center { text-align: center; }
.tc-measure { max-width: 880px; }
.tc-measure.tc-center { margin-inline: auto; }
/* Mobile menu is hidden by default; only shown on small screens when toggled.
   Without this it renders as a duplicate nav block on desktop. */
.tc-mobile { display: none; }

/* ---------- Buttons ---------- */
.tc-btn {
  --bg: var(--tc-indigo-600);
  --fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px;
  font-weight: 700; font-size: 15px;
  border-radius: 999px;
  background: var(--bg); color: var(--fg);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
  box-shadow: 0 6px 18px rgba(41, 56, 149, .25);
}
.tc-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(41, 56, 149, .32); }
.tc-btn:active { transform: translateY(0); }
.tc-btn--navy { --bg: var(--tc-navy); box-shadow: 0 6px 18px rgba(0, 0, 93, .28); }
.tc-btn--ghost {
  --bg: transparent; --fg: var(--tc-navy);
  border-color: var(--tc-line);
  box-shadow: none;
}
.tc-btn--ghost:hover { border-color: var(--tc-periwinkle); background: var(--tc-periwinkle-soft); box-shadow: none; }
.tc-btn--lg { padding: 15px 30px; font-size: 16px; }
.tc-btn--block { width: 100%; }

/* ---------- Header ---------- */
.tc-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--tc-line);
}
.tc-header__bar {
  height: var(--tc-header-h);
  display: flex; align-items: center; gap: 18px;
}
.tc-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; color: var(--tc-navy); }
.tc-brand img { height: 30px; width: auto; }
.tc-brand__text { height: 18px; }
.tc-nav { display: flex; align-items: center; gap: 4px; margin-left: 14px; }
.tc-nav a {
  padding: 9px 14px; border-radius: 10px; font-weight: 600; font-size: 15px; color: var(--tc-text);
  transition: background .15s ease, color .15s ease;
}
.tc-nav a:hover { background: var(--tc-periwinkle-soft); color: var(--tc-navy); }
.tc-nav a[aria-current="page"] { color: var(--tc-indigo-600); }
.tc-header__spacer { flex: 1; }
.tc-header__cta { display: flex; align-items: center; gap: 10px; }
.tc-burger {
  display: none; width: 44px; height: 44px; border: 1px solid var(--tc-line);
  border-radius: 12px; background: #fff; cursor: pointer; align-items: center; justify-content: center;
}
.tc-burger span, .tc-burger span::before, .tc-burger span::after {
  content: ""; display: block; width: 20px; height: 2px; background: var(--tc-navy); border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
.tc-burger span { position: relative; }
.tc-burger span::before { position: absolute; top: -6px; }
.tc-burger span::after { position: absolute; top: 6px; }
body.tc--menu-open .tc-burger span { background: transparent; }
body.tc--menu-open .tc-burger span::before { transform: translateY(6px) rotate(45deg); }
body.tc--menu-open .tc-burger span::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Footer ---------- */
.tc-footer { background: var(--tc-navy); color: #cfd2f2; padding-block: clamp(48px, 7vw, 76px) 28px; }
.tc-footer a { color: #cfd2f2; }
.tc-footer a:hover { color: #fff; }
.tc-footer__grid {
  display: grid; gap: 36px;
  grid-template-columns: 1.6fr repeat(3, 1fr);
}
.tc-footer__brand img { height: 30px; filter: brightness(0) invert(1); }
.tc-footer__brand p { color: #9aa0d8; max-width: 320px; margin: 14px 0 0; font-size: 14px; }
.tc-footer h4 { color: #fff; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 14px; }
.tc-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tc-footer__bottom {
  margin-top: 40px; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, .12);
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
  font-size: 13px; color: #9aa0d8;
}

/* ---------- Cards / grids ---------- */
.tc-grid { display: grid; gap: var(--tc-gap); }
.tc-grid--3 { grid-template-columns: repeat(3, 1fr); }
.tc-grid--2 { grid-template-columns: repeat(2, 1fr); }
.tc-card {
  background: #fff; border: 1px solid var(--tc-line); border-radius: var(--tc-radius-lg);
  padding: clamp(22px, 3vw, 32px); box-shadow: var(--tc-shadow-sm);
  transition: transform .2s ease, box-shadow .25s ease, border-color .2s ease;
}
.tc-card:hover { transform: translateY(-4px); box-shadow: var(--tc-shadow); border-color: var(--tc-periwinkle); }
.tc-card__icon {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  background: var(--tc-periwinkle-soft); color: var(--tc-indigo-600); margin-bottom: 16px;
}
.tc-card__icon svg { width: 26px; height: 26px; }

/* ---------- Hero ---------- */
.tc-hero { position: relative; overflow: hidden; padding-block: clamp(56px, 9vw, 116px); }
.tc-hero::before {
  content: ""; position: absolute; inset: -20% -10% auto; height: 540px; z-index: 0;
  background:
    radial-gradient(600px 300px at 20% 0%, rgba(195, 193, 255, .55), transparent 60%),
    radial-gradient(600px 320px at 90% 10%, rgba(41, 56, 149, .18), transparent 60%);
  pointer-events: none;
}
.tc-hero > * { position: relative; z-index: 1; }
.tc-hero__cta { display: flex; flex-wrap: wrap; gap: 14px; }
.tc-badges { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 26px; color: var(--tc-muted); font-size: 14px; }
.tc-badges span { display: inline-flex; align-items: center; gap: 7px; }

/* ---------- Pricing ---------- */
.tc-toggle { display: inline-flex; padding: 5px; background: var(--tc-bg-alt); border: 1px solid var(--tc-line); border-radius: 999px; gap: 4px; }
.tc-toggle button { border: 0; background: transparent; padding: 9px 20px; border-radius: 999px; font-weight: 700; color: var(--tc-muted); cursor: pointer; }
.tc-toggle button.is-active { background: var(--tc-navy); color: #fff; }
.tc-price__cards { grid-template-columns: repeat(3, 1fr); align-items: stretch; }
.tc-plan { display: flex; flex-direction: column; }
.tc-plan--featured { border-color: var(--tc-indigo-600); box-shadow: var(--tc-shadow-lg); position: relative; }
.tc-plan__tag { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); background: var(--tc-indigo-600); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .06em; padding: 5px 14px; border-radius: 999px; }
.tc-plan__price { font-size: 44px; font-weight: 800; color: var(--tc-ink); margin: 10px 0 2px; }
.tc-plan__price small { font-size: 16px; font-weight: 600; color: var(--tc-muted); }
.tc-plan ul { list-style: none; margin: 18px 0 24px; padding: 0; display: grid; gap: 12px; }
.tc-plan li { display: flex; gap: 10px; align-items: flex-start; color: var(--tc-text); }
.tc-plan li svg { flex: none; width: 20px; height: 20px; color: var(--tc-indigo-600); margin-top: 3px; }
.tc-plan .tc-btn { margin-top: auto; }

/* ---------- Docs layout ---------- */
.tc-docs { display: grid; grid-template-columns: 252px 1fr; gap: clamp(24px, 4vw, 56px); align-items: start; }
.tc-docs__side { position: sticky; top: calc(var(--tc-header-h) + 18px); }
.tc-docs__side nav { display: grid; gap: 4px; }
.tc-docs__side h5 { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--tc-faint); margin: 18px 0 8px; }
.tc-docs__side a { padding: 8px 12px; border-radius: 10px; color: var(--tc-text); font-size: 15px; }
.tc-docs__side a:hover { background: var(--tc-bg-alt); }
.tc-docs__side a[aria-current="page"] { background: var(--tc-periwinkle-soft); color: var(--tc-indigo-600); font-weight: 700; }
.tc-codeblock {
  background: #0b1020; color: #e7e9ff; border-radius: var(--tc-radius); padding: 18px 20px;
  overflow: auto; font-size: 14px; line-height: 1.6; margin: 0 0 18px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.tc-codeblock .k { color: var(--tc-periwinkle); }
.tc-codeblock .s { color: #9be7a3; }

/* ---------- Misc ---------- */
.tc-pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; background: var(--tc-periwinkle-soft); color: var(--tc-indigo-600); font-weight: 700; font-size: 13px; }
.tc-divider { height: 1px; background: var(--tc-line); border: 0; margin: 0; }
.tc-page-hero { padding-block: clamp(48px, 7vw, 92px) clamp(28px, 4vw, 44px); background: linear-gradient(180deg, var(--tc-periwinkle-soft), #fff); border-bottom: 1px solid var(--tc-line); }

/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 960px) {
  .tc-grid--3, .tc-price__cards { grid-template-columns: repeat(2, 1fr); }
  .tc-footer__grid { grid-template-columns: 1fr 1fr; }
  .tc-docs { grid-template-columns: 1fr; }
  .tc-docs__side { position: static; }
  .tc-docs__side nav { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; }
}

@media (max-width: 768px) {
  .tc-nav, .tc-header__cta .tc-btn--ghost { display: none; }
  .tc-burger { display: inline-flex; }
  /* Mobile dropdown menu */
  .tc-mobile {
    position: fixed; inset: var(--tc-header-h) 0 auto; z-index: 55;
    background: #fff; border-bottom: 1px solid var(--tc-line);
    box-shadow: var(--tc-shadow); padding: 14px clamp(18px, 5vw, 40px) 24px;
    display: none; flex-direction: column; gap: 4px;
    max-height: calc(100dvh - var(--tc-header-h)); overflow-y: auto;
  }
  body.tc--menu-open .tc-mobile { display: flex; }
  .tc-mobile a { padding: 13px 12px; border-radius: 10px; font-weight: 600; }
  .tc-mobile a:hover { background: var(--tc-bg-alt); }
  .tc-mobile .tc-btn { margin-top: 10px; }
}

@media (max-width: 600px) {
  .tc-grid--2, .tc-grid--3, .tc-price__cards, .tc-footer__grid { grid-template-columns: 1fr; }
  .tc-hero__cta .tc-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .tc-btn:hover, .tc-card:hover { transform: none; }
}

/* =====================================================================
   Requested fixes (buttons + docs mobile fit)
   ===================================================================== */

/* Solid buttons keep WHITE text. The global `.tc a { color: inherit }` rule
   was more specific than `.tc-btn` and turned the label dark. Also keep all
   button labels on a single line. */
.tc-btn { white-space: nowrap; }
.tc a.tc-btn:not(.tc-btn--ghost),
.tc-btn:not(.tc-btn--ghost),
.tc-btn:not(.tc-btn--ghost):hover {
  color: #fff !important;
}
.tc a.tc-btn--ghost,
.tc-btn--ghost { color: var(--tc-navy) !important; }
.tc-btn--ghost:hover { color: var(--tc-navy) !important; }

/* Smaller header CTA on phones so "無料で始める" never wraps to 2 lines */
@media (max-width: 767px) {
  .tc-header__cta .tc-btn { font-size: 13px; padding: 9px 14px; }
}

/* Docs page: fit within 100vw on phones (long code blocks were forcing width) */
.tc-docs, .tc-docs > *, .tc-prose { min-width: 0; }
.tc-prose { max-width: 100%; }
.tc-codeblock { max-width: 100%; overflow-x: auto; }
.tc-prose pre, .tc-prose code, .tc-prose table { max-width: 100%; overflow-x: auto; }
@media (max-width: 960px) {
  .tc-docs__side { max-width: 100%; }
  .tc-docs__side nav { grid-auto-flow: row; grid-auto-columns: auto; overflow-x: visible; }
}

/* =====================================================================
   Treat tablets like phones: use the mobile layout for everything that
   is not a PC (<= 1024px). Appended last so it wins over the desktop rules.
   ===================================================================== */
@media (max-width: 1024px) {
  /* header: hamburger instead of the desktop nav */
  .tc-nav,
  .tc-header__cta .tc-btn--ghost { display: none !important; }
  .tc-burger { display: inline-flex !important; }

  /* slide-down mobile menu (same as the phone breakpoint) */
  .tc-mobile {
    position: fixed;
    inset: var(--tc-header-h) 0 auto;
    z-index: 55;
    background: #fff;
    border-bottom: 1px solid var(--tc-line);
    box-shadow: var(--tc-shadow);
    padding: 14px clamp(18px, 5vw, 40px) 24px;
    display: none;
    flex-direction: column;
    gap: 4px;
    max-height: calc(100dvh - var(--tc-header-h));
    overflow-y: auto;
  }
  body.tc--menu-open .tc-mobile { display: flex !important; }
  .tc-mobile a { padding: 13px 12px; border-radius: 10px; font-weight: 600; }
  .tc-mobile a:hover { background: var(--tc-bg-alt); }
  .tc-mobile .tc-btn { margin-top: 10px; }

  /* single-column content (like the phone layout) */
  .tc-grid--3,
  .tc-grid--2,
  .tc-price__cards,
  .tc-footer__grid { grid-template-columns: 1fr !important; }

  /* docs: stacked sidebar + content */
  .tc-docs { grid-template-columns: 1fr !important; }
  .tc-docs__side { position: static !important; max-width: 100%; }
  .tc-docs__side nav {
    grid-auto-flow: row !important;
    grid-auto-columns: auto !important;
    overflow-x: visible !important;
  }

  /* smaller header CTA so "無料で始める" never wraps */
  .tc-header__cta .tc-btn { font-size: 13px; padding: 9px 14px; }
}
