/* ===== Variables ===== */
:root {
  --color-bg: #0f172a;
  --color-surface: #1e293b;
  --color-surface-alt: #334155;
  --color-text: #f8fafc;
  --color-text-muted: #94a3b8;
  --color-accent: #3b82f6;
  --color-accent-hover: #60a5fa;
  --color-accent-soft: rgba(59, 130, 246, 0.15);
  /* ThreeColors brand (logo) */
  --tc-red: #a30000;
  --tc-green: #00a358;
  --tc-blue: #0058a3;
  --tc-red-soft: rgba(163, 0, 0, 0.2);
  --tc-green-soft: rgba(0, 163, 88, 0.2);
  --tc-blue-soft: rgba(0, 88, 163, 0.2);
  --color-error: #f87171;
  --font-sans: 'Outfit', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-jp: 'Noto Sans JP', 'Outfit', sans-serif;
  --header-height: 64px;
  --container: min(1120px, 100% - 2rem);
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-jp);
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-accent); text-decoration: none; }
a:hover { color: var(--color-accent-hover); }
a:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
ul, ol { margin: 0; padding-left: 1.25em; }

/* スキップリンク（キーボードフォーカス時のみ表示） */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0.5rem;
  z-index: 200;
  padding: 0.75rem 1rem;
  background: var(--color-surface);
  color: var(--color-text);
  font-weight: 600;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: top 0.2s;
}
.skip-link:focus {
  top: 0.5rem;
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ===== Header ===== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-text);
}
.logo:hover { color: var(--color-text); }
.logo img { height: 32px; width: auto; flex-shrink: 0; }
.logo-text {
  font-family: var(--font-sans);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

@media (max-width: 380px) {
  .logo img { height: 28px; }
  .logo-text { font-size: 1rem; }
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text);
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}

.nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav a {
  display: block;
  padding: 0.5rem 0.75rem;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius);
  transition: color 0.2s, background 0.2s;
}
.nav a:hover { color: var(--color-text); background: var(--color-accent-soft); }
button:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
  }
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding: 1rem;
    display: none;
  }
  .nav.is-open { display: block; }
  .nav ul { flex-direction: column; align-items: stretch; }
  .nav a {
    padding: 0.875rem 1rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}

/* ===== Main ===== */
main {
  padding-top: var(--header-height);
  scroll-margin-top: var(--header-height);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 75vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1.5rem;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: hero-orb-float 18s ease-in-out infinite;
}
.hero-orb--red {
  width: min(320px, 70vw);
  height: min(320px, 70vw);
  background: var(--tc-red);
  top: 10%;
  left: 5%;
  animation-delay: 0s;
}
.hero-orb--green {
  width: min(280px, 60vw);
  height: min(280px, 60vw);
  background: var(--tc-green);
  top: 40%;
  right: 10%;
  animation-delay: -6s;
}
.hero-orb--blue {
  width: min(300px, 65vw);
  height: min(300px, 65vw);
  background: var(--tc-blue);
  bottom: 5%;
  left: 25%;
  animation-delay: -12s;
}

@keyframes hero-orb-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(3%, -4%) scale(1.05); }
  66% { transform: translate(-2%, 2%) scale(0.98); }
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 20%, transparent 70%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 560px;
}
.hero-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.hero-logo { margin: 0; height: 56px; width: auto; }
.hero-brand {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

@media (max-width: 768px) {
  .hero {
    min-height: 60vh;
    padding: 3rem 1rem;
  }
  .hero-logo { height: 48px; }
  .hero-brand { font-size: 1.4rem; }
  .hero-tagline { font-size: 0.95rem; }
  .hero-lead { font-size: 0.9rem; }
  .section { padding: 2.5rem 1rem; }
  .section-title { font-size: 1.5rem; }
}
.hero-tagline {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  color: var(--color-text-muted);
  font-weight: 500;
}
.hero-lead {
  margin: 0 0 2rem;
  font-size: 0.95rem;
  color: var(--color-text-muted);
  line-height: 1.7;
}

.hero-pills {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}
.hero-pill {
  padding: 0.5rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 999px;
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s, box-shadow 0.2s;
}
.hero-pill:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3); }
.hero-pill--red { background: var(--tc-red); }
.hero-pill--green { background: var(--tc-green); }
.hero-pill--blue { background: var(--tc-blue); }

/* ===== Sections ===== */
.section {
  padding: 4rem 1.5rem;
  scroll-margin-top: var(--header-height);
}
.section:nth-child(even) { background: var(--color-surface); }
.container { max-width: var(--container); margin: 0 auto; }

.section-title {
  margin: 0 0 2rem;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text);
  padding-bottom: 0.5rem;
  display: inline-block;
  background: linear-gradient(90deg, var(--tc-red), var(--tc-green), var(--tc-blue)) no-repeat bottom left;
  background-size: 100% 4px;
}

/* About */
.about-list {
  display: grid;
  gap: 0.75rem 1.5rem;
  margin: 0;
}
.about-list dt {
  font-weight: 600;
  color: var(--color-text-muted);
  grid-column: 1;
}
.about-list dd { margin: 0; grid-column: 2; }

@media (min-width: 500px) {
  .about-list { grid-template-columns: 120px 1fr; }
}

@media (max-width: 499px) {
  .about-list {
    grid-template-columns: 1fr;
    max-width: none;
  }
  .about-list dt { grid-column: 1; }
  .about-list dd { grid-column: 1; }
}

/* Services */
.services-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}
.service-card {
  padding: 1.25rem 1.5rem;
  background: var(--color-surface-alt);
  border-radius: var(--radius);
  font-weight: 500;
  border-left: 4px solid;
  transition: transform 0.2s, box-shadow 0.2s;
}
.service-card:hover {
  transform: translateX(4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
.service-card--red { border-left-color: var(--tc-red); }
.service-card--green { border-left-color: var(--tc-green); }
.service-card--blue { border-left-color: var(--tc-blue); }

.service-card-title { display: block; }
.service-card--with-body .service-card-title { margin-bottom: 0.5rem; }
.service-card-desc {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--color-text-muted);
  line-height: 1.7;
}
.service-card-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--color-text-muted);
}
.service-card-list li { padding: 0.15em 0; }
.service-card-list li::before { content: '・'; margin-right: 0.25em; }

.services-lead {
  margin: 0 0 2rem;
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* Works */
.works-block { margin-bottom: 2.5rem; }
.works-block:last-child { margin-bottom: 0; }
.works-subtitle {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  font-weight: 600;
  padding-left: 0.75rem;
  border-left: 4px solid;
}
.works-block--red .works-subtitle { border-left-color: var(--tc-red); }
.works-block--green .works-subtitle { border-left-color: var(--tc-green); }
.works-block--blue .works-subtitle { border-left-color: var(--tc-blue); }
.works-list {
  margin: 0;
  padding-left: 1.25em;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.35em 1.5em;
}

/* Contact */
.contact-lead { margin: 0 0 0.25rem; }
.contact-note {
  margin: 0 0 1.5rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.contact-form {
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.form-row label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 500;
  font-size: 0.95rem;
}
.required { color: var(--color-error); }
.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font: inherit;
  font-family: var(--font-jp);
  color: var(--color-text);
  background: var(--color-surface-alt);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  transition: border-color 0.2s;
}
.form-row select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  border-color: var(--color-accent);
}
.form-row input:focus-visible,
.form-row select:focus-visible,
.form-row textarea:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* オートコンプリート・自動入力で白背景にならないようにする */
.form-row input:-webkit-autofill,
.form-row input:-webkit-autofill:hover,
.form-row input:-webkit-autofill:focus,
.form-row input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px var(--color-surface-alt) inset !important;
  box-shadow: 0 0 0 1000px var(--color-surface-alt) inset !important;
  -webkit-text-fill-color: var(--color-text) !important;
  caret-color: var(--color-text);
}
.form-row input::placeholder {
  color: var(--color-text-muted);
}
.form-row input:-webkit-autofill::first-line {
  -webkit-text-fill-color: var(--color-text);
}
.btn-primary:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 2px;
}
.form-row textarea { resize: vertical; min-height: 120px; }

/* フォームエラー（サイトデザインに合わせた表示） */
.form-row.is-invalid input,
.form-row.is-invalid select,
.form-row.is-invalid textarea {
  border-color: var(--tc-red);
  box-shadow: 0 0 0 1px var(--tc-red);
}
.form-error {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.875rem;
  color: var(--color-error);
  font-weight: 500;
}
.form-error:empty { display: none; }
.form-error--global { margin-bottom: 1rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font: inherit;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.btn-primary {
  background: var(--color-accent);
  color: white;
  align-self: flex-start;
}
.btn-primary:hover { background: var(--color-accent-hover); }
.btn-primary:active { transform: scale(0.98); }

/* 送信ボタン：ローディング表示 */
.btn-loading-spinner {
  display: none;
  width: 1.1em;
  height: 1.1em;
  margin-right: 0.5em;
  vertical-align: -0.2em;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: white;
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
}
.btn-primary.is-loading .btn-loading-spinner {
  display: inline-block;
}
.btn-primary.is-loading .btn-label {
  display: inline;
}
@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

.form-actions { margin-top: 0.5rem; }

/* 送信完了メッセージ（サイトデザインに合わせた表示） */
.contact-success {
  display: none;
  max-width: 560px;
  padding: 1.5rem 1.5rem 1.5rem 1.25rem;
  background: var(--color-surface-alt);
  border-radius: var(--radius);
  border-left: 4px solid var(--tc-green);
}
.section-contact.is-submitted .contact-form { display: none; }
.section-contact.is-submitted .contact-success {
  display: block;
}
.contact-success[hidden] { display: none !important; }
.contact-success-title {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-text);
}
.contact-success-text {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* ===== Footer ===== */
.site-footer {
  position: relative;
  padding: 2rem 1.5rem;
  background: var(--color-surface);
  border-top: 1px solid rgba(255,255,255,0.06);
}
.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--tc-red), var(--tc-green), var(--tc-blue));
}
.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  text-align: center;
}
.copyright {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.footer-logo { display: inline-flex; }
.footer-logo img { height: 28px; width: auto; display: block; }
.footer-company-name { display: inline-block; }
.footer-nav a {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}
.footer-nav a:hover { color: var(--color-accent); }

/* ===== Privacy page ===== */
.page-privacy .site-header { position: relative; }
.page-privacy main { padding-top: 0; }
.page-privacy .section:first-of-type { padding-top: 2rem; }
.privacy-content {
  max-width: 720px;
  margin: 0 auto;
}
.privacy-content h2 { font-size: 1.25rem; margin: 2rem 0 0.75rem; }
.privacy-content h2:first-child { margin-top: 0; }
.privacy-content p { margin: 0 0 1rem; }
.privacy-content ul { margin: 0 0 1rem; }
