/* dot-claw shared website styles */

:root {
  --ink: #0A0A0A;
  --ink-2: #1C1C1C;
  --ink-3: #3A3A3A;
  --paper: #FAFAF7;
  --paper-2: #F2F1EB;
  --paper-3: #EAE7DD;
  --line: #D9D7CF;
  --line-2: #C5C2B8;
  --mute: #8A8780;
  --accent: #2D3FE7;
  --font-sans: 'Inter Tight', 'Noto Sans JP', system-ui, sans-serif;
  --font-serif: 'Old Standard TT', 'Noto Serif JP', Georgia, serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
/* Horizontal overflow safety valve.
   `clip` (unlike `hidden`) does NOT create a scroll container,
   so position: sticky on .nav keeps working. */
html, body { overflow-x: hidden; overflow-x: clip; }
html, body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-feature-settings: 'ss01', 'cv11', 'tnum';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 17px;
  line-height: 1.65;
}

/* Japanese text: avoid breaking mid-word/phrase */
h1, h2, h3, h4, .display, .h-display, .h-title, .lede, .tagline,
.section-head h2, .page-header h1, .cat h3, .step h4, .why-card h3,
.case-card h3, .doc-card h4, .closing h2 {
  word-break: keep-all;
  overflow-wrap: break-word;
  line-break: strict;
  text-wrap: pretty;
}
/* Headline phrases: force line breaks at meaningful boundaries */
.ln { display: block; }

/* ==== Grid blowout prevention ====
   Grid/flex children default to min-width:auto, which lets long
   content push 1fr tracks wider than the viewport on mobile.
   Force min-width:0 on the children of every layout grid. */
.hero-grid > *,
.section-head > *,
.categories > *,
.process > *,
.plans > *,
.why > *,
.case-grid > *,
.docs-grid > *,
.contact-layout > *,
.founder > *,
.featured-case > *,
.plan-detail .grid > *,
.field-grid > *,
.footer-main > * {
  min-width: 0;
}

/* Media never wider than its box */
img, svg, video, iframe { max-width: 100%; }

/* Numerals always use sans for legibility — even inside serif headings.
   Heavier weight to prevent thin/illegible appearance. */
.price, .metric .val, .stat-value, .compare-table td, .info-row .val,
.price-block, .plan h3, .plan-detail .price-block,
.career-item .year, .footer-bottom, .case-card .metric .val {
  font-feature-settings: 'tnum', 'lnum';
  font-variant-numeric: tabular-nums lining-nums;
}

/* Numeric weight — all numbers display bolder for legibility */
.metric .val, .stat-value, .price-block, .plan h3,
.compare-table td, .info-row .val {
  font-weight: 600 !important;
}

/* Strong digit class — use for any inline number that feels thin */
.num, .digit, .price-block .digit, .plan h3 .digit {
  font-family: var(--font-sans);
  font-weight: 700;
  font-feature-settings: 'tnum', 'lnum';
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: -0.02em;
}

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

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 48px;
}

/* ============ Navigation ============ */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 250, 247, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 48px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo { display: flex; align-items: center; }
.nav-links { display: flex; align-items: center; gap: 8px; }

.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  padding: 10px 16px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
}
.nav-link:hover { color: var(--ink); background: var(--paper-2); }
.nav-link.current { color: var(--ink); }
.nav-item.current > .nav-link { color: var(--ink); }
.nav-item.current > .nav-link::after,
.nav-link.current::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 16px;
  right: 16px;
  height: 1.5px;
  background: var(--ink);
}
.nav-link { position: relative; }

.nav-cta {
  background: var(--ink);
  color: var(--paper);
  padding: 11px 18px 11px 20px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
}
.nav-cta:hover { background: var(--ink-2); }
.nav-cta:hover .cta-arrow { transform: translateX(2px); }
.cta-arrow { transition: transform 0.15s; display: inline-block; }

/* Dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown .caret {
  transition: transform 0.18s;
  opacity: 0.55;
}
.nav-dropdown.open .caret { transform: rotate(180deg); }
.nav-dropdown.open .nav-trigger { background: var(--paper-2); color: var(--ink); }

.nav-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 240px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  box-shadow: 0 8px 32px rgba(10,10,10,0.06), 0 2px 8px rgba(10,10,10,0.04);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
}
.nav-dropdown.open .nav-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav-menu a {
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  border-radius: 4px;
  transition: background 0.12s;
  text-decoration: none;
  color: var(--ink);
}
.nav-menu a:hover { background: var(--paper-2); }
.nav-menu a.current { background: var(--paper-2); }
.nav-menu .menu-label {
  font-size: 14px;
  font-weight: 500;
}
.nav-menu .menu-sub {
  font-size: 11px;
  color: var(--mute);
  margin-top: 2px;
  font-family: var(--font-sans);
  letter-spacing: 0.01em;
}

/* Mobile */
.nav-mobile-toggle {
  display: none;
  background: none;
  border: none;
  width: 40px;
  height: 40px;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 0;
}
.nav-mobile-toggle span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.2s, opacity 0.2s;
}
.nav-mobile-toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-mobile-toggle.open span:nth-child(2) { opacity: 0; }
.nav-mobile-toggle.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.nav-drawer {
  display: none;
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 16px 24px 32px;
  flex-direction: column;
}
.nav-drawer.open {
  display: flex;
  animation: drawer-in 0.2s ease-out;
}
@keyframes drawer-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.nav-drawer a {
  padding: 18px 8px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
}
.nav-drawer a small {
  font-size: 12px;
  color: var(--mute);
  font-weight: 400;
}
.nav-drawer a.current { color: var(--accent); }

/* ============ Hero / Page header ============ */
.page-header {
  padding: 120px 0 96px;
  border-bottom: 1px solid var(--line);
}
.page-header h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(52px, 7.5vw, 96px);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin-top: 24px;
  word-break: keep-all;
  overflow-wrap: break-word;
  line-break: strict;
  text-wrap: pretty;
}
/* No italic — use color accent only */
.page-header h1 em { font-style: normal; color: var(--accent); }
em { font-style: normal; }
.page-header .lede {
  font-size: 19px;
  line-height: 1.75;
  color: var(--ink-2);
  max-width: 660px;
  margin-top: 32px;
  font-weight: 400;
}

/* ============ Section ============ */
section {
  padding: 96px 0;
  border-bottom: 1px solid var(--line);
}
.section-head {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 48px;
  margin-bottom: 64px;
}
.section-head .label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--mute);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding-top: 8px;
}
.section-head h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(38px, 4.6vw, 60px);
  line-height: 1.22;
  letter-spacing: -0.012em;
  word-break: keep-all;
  overflow-wrap: break-word;
  line-break: strict;
  text-wrap: pretty;
}
.section-head h2 em { font-style: normal; color: var(--accent); }
.section-head .desc {
  margin-top: 24px;
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink-2);
  max-width: 580px;
  font-weight: 400;
}

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
  cursor: pointer;
  border: none;
  font-family: inherit;
}
.btn-primary {
  background: var(--ink);
  color: var(--paper);
}
.btn-primary:hover { background: var(--ink-2); }
.btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-2);
}
.btn-secondary:hover { border-color: var(--ink); }
.btn .arrow {
  transition: transform 0.15s;
}
.btn:hover .arrow { transform: translateX(2px); }

/* ============ Footer ============ */
.footer {
  padding: 80px 0 48px;
  background: var(--ink);
  color: var(--paper);
}
.footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 48px;
}
.footer-main {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 64px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.footer h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  margin-bottom: 20px;
  font-weight: 500;
}
.footer-links { display: flex; flex-direction: column; gap: 12px; }
.footer-links a {
  font-size: 14px;
  color: rgba(255,255,255,0.8);
  transition: color 0.15s;
}
.footer-links a:hover { color: var(--paper); }
.footer-bottom {
  padding-top: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}

/* ============ Responsive ============ */
@media (max-width: 900px) {
  /* Base */
  html, body { font-size: 15px; }
  .container, .nav-inner, .footer-inner { padding: 0 20px; }

  /* Nav */
  .nav-inner { height: 64px; }
  .nav-link, .nav-cta, .nav-dropdown { display: none; }
  .nav-mobile-toggle { display: flex; }

  /* Page header */
  .page-header { padding: 56px 0 48px; }
  .page-header h1 { font-size: clamp(30px, 8.5vw, 52px); margin-top: 16px; }
  .page-header .lede { font-size: 16px; margin-top: 20px; }

  /* Section */
  section { padding: 56px 0; }
  .section-head { grid-template-columns: 1fr; gap: 12px; margin-bottom: 36px; }
  .section-head h2 { font-size: clamp(26px, 6.8vw, 38px); }
  .section-head .desc { font-size: 15px; margin-top: 16px; }

  /* Japanese headings: keep-all forbids mid-phrase breaks, which can
     overflow narrow screens. Allow emergency breaks on mobile only
     (`anywhere` still prefers natural break points when they exist). */
  h1, h2, h3, h4,
  .page-header h1, .section-head h2,
  .cat h3, .why-card h3, .case-card h3,
  .closing h2, .hero h1 {
    overflow-wrap: anywhere;
  }

  /* Footer */
  .footer { padding: 56px 0 36px; }
  .footer-main { grid-template-columns: 1fr 1fr; gap: 32px; padding-bottom: 40px; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; font-size: 11px; }

  /* Buttons */
  .btn { padding: 13px 20px; font-size: 14px; }
}
