/* ==========================================================================
   knowtech — style.css
   白基調・静謐。紙(--paper)の上に藍墨(--ink)で組む。
   書体: Shippori Mincho(見出し) / Zen Kaku Gothic New(本文・UI)
   ========================================================================== */

:root {
  --paper: #f6f6f3;
  --sheet: #ffffff;
  --ink: #1e2a38;
  --ink-2: #566170;
  --ink-3: #8c959f;
  --rule: #dadcd7;
  --rule-strong: #b6bbb6;
  --ai: #2b4a7e;
  --ai-deep: #1f3860;
  --ai-tint: #e9eef6;

  --serif: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", YuMincho, "Noto Serif JP", serif;
  --sans: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;

  --wrap: 68rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --measure: 34em;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 5.5rem;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.9;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: var(--rule-strong);
  transition: text-decoration-color 0.2s var(--ease), color 0.2s var(--ease);
}
a:hover { text-decoration-color: currentColor; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--ai);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--ink);
  color: var(--sheet);
  text-decoration: none;
  border-radius: 2px;
}
.skip:focus { top: 1rem; }

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* 見出しは明朝。かなを詰めて、わずかに字間を空ける */
.serif {
  font-family: var(--serif);
  font-weight: 500;
  font-feature-settings: "palt" 1;
  letter-spacing: 0.04em;
  line-height: 1.5;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.6em 1.6em;
  border: 1px solid transparent;
  border-radius: 2px;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.btn-primary {
  background: var(--ai);
  border-color: var(--ai);
  color: var(--sheet);
}
.btn-primary:hover { background: var(--ai-deep); border-color: var(--ai-deep); }
.btn-quiet {
  background: transparent;
  border-color: var(--rule-strong);
  color: var(--ink);
}
.btn-quiet:hover { border-color: var(--ink); }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}
.site-header.scrolled { border-bottom-color: var(--rule); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4.5rem;
}

.wordmark {
  display: inline-flex;
  align-items: baseline;
  font-size: 1.125rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  line-height: 1;
}
.wordmark .know { font-weight: 400; }
.wordmark .tech { font-weight: 700; }
.wordmark .co {
  margin-left: 0.75em;
  font-size: 0.75rem;
  color: var(--ink-3);
  letter-spacing: 0.08em;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.nav-menu a {
  font-size: 0.875rem;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--ink-2);
  padding-block: 0.25rem;
  border-bottom: 1px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.nav-menu a:hover { color: var(--ink); border-bottom-color: var(--ink); }
.nav-menu .nav-cta {
  color: var(--ai);
  border: 1px solid var(--ai);
  border-radius: 2px;
  padding: 0.45rem 1.1rem;
}
.nav-menu .nav-cta:hover { background: var(--ai); color: var(--sheet); border-color: var(--ai); }

.nav-toggle {
  display: none;
  width: 2.75rem;
  height: 2.75rem;
  margin-right: -0.5rem;
  position: relative;
}
.nav-toggle span {
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  height: 1px;
  background: var(--ink);
  transition: transform 0.25s var(--ease), opacity 0.2s var(--ease);
}
.nav-toggle span:nth-child(1) { top: calc(50% - 4px); }
.nav-toggle span:nth-child(2) { top: calc(50% + 4px); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(4px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { transform: translateY(-4px) rotate(-45deg); }

/* ---------- hero ---------- */
.hero {
  padding-block: clamp(3rem, 8vw, 6.5rem) 0;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(2rem, 6vw, 6rem);
  align-items: stretch;
}
.hero-body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 3rem;
  padding-top: 0.5rem;
}
.hero-kicker {
  font-size: 0.875rem;
  letter-spacing: 0.1em;
  color: var(--ink-2);
}
.hero-lead {
  max-width: var(--measure);
  font-size: 1.0625rem;
  line-height: 2.1;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin-top: 2rem;
}

/* シグネチャー: 縦書きのミッション */
.hero-title {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.75rem, 5.5vw, 4rem);
  line-height: 1.3;
  letter-spacing: 0.16em;
  font-feature-settings: "vpal" 1;
  justify-self: end;
  padding-top: 0.25em;
  padding-left: 0.35em;
}
.hero-title .l {
  display: block;
  clip-path: inset(0 0 0 0);
}

@keyframes ink-down {
  from { clip-path: inset(0 0 100% 0); }
  to   { clip-path: inset(0 0 0 0); }
}
.hero-title.is-animated .l { animation: ink-down 1.1s var(--ease) both; }
.hero-title.is-animated .l:nth-child(2) { animation-delay: 0.9s; }

.hero-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: clamp(3rem, 7vw, 5.5rem);
}
.hero-facts li {
  border-top: 1px solid var(--rule-strong);
  padding-top: 1rem;
  font-size: 0.9375rem;
  line-height: 1.7;
}
.hero-facts b {
  display: block;
  font-weight: 500;
  color: var(--ink);
}
.hero-facts span {
  display: block;
  font-size: 0.8125rem;
  color: var(--ink-2);
}

/* ---------- sections ---------- */
.section {
  padding-block: clamp(5rem, 10vw, 8.5rem);
  border-top: 1px solid var(--rule);
}
.section-grid {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 2rem 3rem;
  align-items: start;
}
.section-name {
  position: sticky;
  top: 5.5rem;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: 0.2em;
  color: var(--ink-2);
  line-height: 1.5;
  padding-top: 0.5rem;
}
.section-name::before {
  content: "";
  display: block;
  width: 1.5rem;
  height: 1px;
  background: var(--ink);
  margin-bottom: 1rem;
}
.section-body { min-width: 0; }
.section-heading {
  font-size: clamp(1.625rem, 3vw, 2.125rem);
}
.section-lead {
  max-width: var(--measure);
  margin-top: 1.25rem;
  color: var(--ink-2);
}

/* 強み */
.strengths {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem 2.5rem;
  margin-top: clamp(2.5rem, 5vw, 4rem);
}
.strengths li {
  border-top: 1px solid var(--rule-strong);
  padding-top: 1.5rem;
}
.strengths .item-title { font-size: 1.1875rem; }
.item-title {
  font-size: 1.25rem;
}
.item-text {
  margin-top: 0.75rem;
  font-size: 0.9375rem;
  color: var(--ink-2);
}

/* 事業内容: 表のように並べる */
.services {
  margin-top: clamp(2.5rem, 5vw, 4rem);
  border-top: 1px solid var(--rule-strong);
}
.service {
  display: grid;
  grid-template-columns: 12rem minmax(0, 1fr);
  gap: 0.5rem 2rem;
  padding-block: 1.75rem;
  border-bottom: 1px solid var(--rule);
}
.service .item-title { font-size: 1.125rem; }
.service .item-text { margin-top: 0; max-width: 40em; }

/* 開発の流れ: 一本の線で結ぶ */
.process {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding-top: 2rem;
}
.process::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--ai);
}
.step {
  position: relative;
}
.step::before {
  content: "";
  position: absolute;
  top: calc(-2rem + 1px);
  left: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--ai);
}
.step:first-child::before { background: var(--ai); }
.step-num {
  font-family: var(--serif);
  font-size: 0.875rem;
  letter-spacing: 0.1em;
  color: var(--ai);
}
.step-when {
  margin-left: 0.75em;
  font-size: 0.8125rem;
  color: var(--ink-3);
  letter-spacing: 0.06em;
}
.step .item-title { margin-top: 0.5rem; }

/* 会社概要 */
.about-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 3rem 4rem;
  margin-top: clamp(2.5rem, 5vw, 4rem);
}
.values-title {
  font-size: 0.875rem;
  letter-spacing: 0.12em;
  color: var(--ink-2);
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--rule-strong);
}
.values li {
  padding-block: 1.5rem;
  border-bottom: 1px solid var(--rule);
}
.values .item-title { font-size: 1.125rem; }

.company > div {
  display: grid;
  grid-template-columns: 6.5em minmax(0, 1fr);
  gap: 1rem;
  padding-block: 1rem;
  border-bottom: 1px solid var(--rule);
  font-size: 0.9375rem;
}
.company > div:first-child { border-top: 1px solid var(--rule-strong); }
.company dt {
  color: var(--ink-2);
  letter-spacing: 0.06em;
}

/* ---------- contact ---------- */
.contact {
  padding-block: clamp(5rem, 10vw, 8.5rem);
  border-top: 1px solid var(--rule);
  background: var(--sheet);
}
.contact-heading {
  font-size: clamp(1.875rem, 4vw, 2.75rem);
}
.contact-lead {
  max-width: var(--measure);
  margin-top: 1.5rem;
  color: var(--ink-2);
}
.contact-mail {
  display: inline-block;
  margin-top: 2.5rem;
  font-family: var(--serif);
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  letter-spacing: 0.02em;
  line-height: 1.3;
  text-decoration-color: var(--rule-strong);
  word-break: break-all;
}
.contact-mail:hover { color: var(--ai); text-decoration-color: var(--ai); }
.contact-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 2rem;
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--ink-2);
}
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin-top: 2.5rem;
}

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--rule);
  padding-block: 2.5rem;
  font-size: 0.8125rem;
  color: var(--ink-2);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--ink); }
.footer-addr { width: 100%; letter-spacing: 0.04em; }

/* ---------- estimate page ---------- */
.est-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.est-header .header-inner { min-height: 4.5rem; }
.est-header .back {
  font-size: 0.875rem;
  color: var(--ink-2);
  text-decoration: none;
  letter-spacing: 0.06em;
}
.est-header .back:hover { color: var(--ink); }
.est-main {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(2rem, 6vw, 5rem) var(--gutter) 5rem;
}
.est-sheet {
  width: 100%;
  max-width: 38rem;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: clamp(1.75rem, 5vw, 3rem);
}
.est-start h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
}
.est-start p {
  margin-top: 1rem;
  color: var(--ink-2);
  max-width: var(--measure);
}
.est-start .btn { margin-top: 2rem; }

.est-progress {
  display: flex;
  gap: 4px;
}
.est-progress i {
  flex: 1;
  height: 2px;
  background: var(--rule);
  transition: background-color 0.3s var(--ease);
}
.est-progress i.on { background: var(--ai); }
.est-count {
  margin-top: 1.25rem;
  font-family: var(--serif);
  font-size: 0.875rem;
  letter-spacing: 0.1em;
  color: var(--ink-3);
}
.est-q {
  margin-top: 0.5rem;
  font-size: clamp(1.25rem, 3vw, 1.5rem);
}
.est-sub {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--ink-2);
}
.est-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1.75rem;
}
.est-option {
  display: grid;
  grid-template-columns: 1rem minmax(0, 1fr);
  gap: 0.875rem;
  align-items: start;
  width: 100%;
  text-align: left;
  padding: 0.875rem 1rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--sheet);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.6;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.est-option::before {
  content: "";
  width: 0.75rem;
  height: 0.75rem;
  margin-top: 0.35em;
  border-radius: 50%;
  border: 1px solid var(--rule-strong);
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.est-option:hover { border-color: var(--ai); background: var(--ai-tint); }
.est-option:hover::before { border-color: var(--ai); background: var(--ai); }
.est-option small {
  display: block;
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--ink-2);
}
.est-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: 0.8125rem;
  color: var(--ink-2);
}
.est-total b {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.5rem;
  color: var(--ink);
  letter-spacing: 0.02em;
}
.est-total b small {
  margin-left: 0.25em;
  font-size: 0.8125rem;
  font-family: var(--sans);
  color: var(--ink-2);
}
.est-link {
  margin-top: 1.25rem;
  font-size: 0.875rem;
  color: var(--ink-2);
  text-decoration: underline;
  text-underline-offset: 0.22em;
  text-decoration-color: var(--rule-strong);
}
.est-link:hover { color: var(--ink); text-decoration-color: currentColor; }

.est-result .est-count { margin-top: 0; }
.est-price {
  margin-top: 0.75rem;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(3rem, 9vw, 4.5rem);
  line-height: 1.1;
  letter-spacing: 0.02em;
}
.est-price small {
  margin-left: 0.2em;
  font-size: 1.25rem;
  font-family: var(--sans);
  font-weight: 400;
  color: var(--ink-2);
}
.est-note {
  margin-top: 1.25rem;
  font-size: 0.875rem;
  color: var(--ink-2);
  max-width: var(--measure);
}
.est-result .btn { margin-top: 2rem; }
.est-result .est-link { display: block; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .strengths { grid-template-columns: 1fr; gap: 2rem; }
  .about-cols { grid-template-columns: 1fr; }
  .process { grid-template-columns: 1fr 1fr; }
  .process::before { display: none; }
  .step { padding-left: 1.5rem; }
  .step::before { top: 0.5rem; left: 0; }
  .step:first-child::before { background: var(--paper); }
}

@media (max-width: 760px) {
  html { scroll-padding-top: 4.5rem; }

  .nav-toggle { display: block; }
  .nav-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem var(--gutter) 1.25rem;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
  }
  .nav-menu.open { display: flex; }
  .nav-menu li { border-bottom: 1px solid var(--rule); }
  .nav-menu li:last-child { border-bottom: 0; padding-top: 1rem; }
  .nav-menu a {
    display: block;
    padding-block: 0.9rem;
    font-size: 1rem;
    border-bottom: 0;
  }
  .nav-menu a:hover { border-bottom: 0; }
  .nav-menu .nav-cta { display: inline-block; text-align: center; padding: 0.7rem 1.2rem; }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .hero-title {
    grid-row: 1;
    justify-self: end;
    padding-left: 0;
    padding-right: 0.1em;
  }
  .hero-body { padding-top: 0; gap: 1.5rem; }
  .hero-facts { grid-template-columns: 1fr; gap: 0; }
  .hero-facts li { padding-block: 0.9rem; }
  .hero-facts li:last-child { border-bottom: 1px solid var(--rule-strong); }

  .section-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .section-name { position: static; padding-top: 0; }

  .service { grid-template-columns: 1fr; gap: 0.25rem; }
  .process { grid-template-columns: 1fr; gap: 2rem; }
  .company > div { grid-template-columns: 5.5em minmax(0, 1fr); gap: 0.75rem; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 420px) {
  .hero-actions .btn { width: 100%; }
  .contact-actions .btn { width: 100%; }
}

/* ---------- motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .hero-title.is-animated .l { clip-path: none; }
}
