:root {
  --ivory: #f7f1df;
  --paper: #fff9e9;
  --navy: #17283d;
  --brown: #7a5135;
  --brown-dark: #4c3123;
  --black: #15120f;
  --mustard: #d9a43a;
  --green: #7f9271;
  --line: rgba(23, 40, 61, 0.18);
  --shadow: 0 18px 45px rgba(23, 40, 61, 0.14);
  --radius: 8px;
  --max: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--navy);
  font-family: "Hiragino Sans", "Yu Gothic", "YuGothic", "Meiryo", sans-serif;
  line-height: 1.8;
  background:
    radial-gradient(circle at 20% 15%, rgba(217, 164, 58, 0.14), transparent 24rem),
    linear-gradient(90deg, rgba(23, 40, 61, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(23, 40, 61, 0.025) 1px, transparent 1px),
    var(--ivory);
  background-size: auto, 28px 28px, 28px 28px, auto;
}

body.is-fixed {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

:focus-visible {
  outline: 3px solid var(--mustard);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 100;
  padding: 0.6rem 0.9rem;
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius);
  transform: translateY(-160%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 241, 223, 0.92);
  backdrop-filter: blur(14px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(var(--max), calc(100% - 40px));
  min-height: 76px;
  margin: 0 auto;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 2px solid var(--navy);
  border-radius: 50%;
  background: var(--paper);
  font-size: 1.35rem;
  transform: rotate(-18deg);
}

.brand-small,
.brand-name {
  display: block;
  line-height: 1.25;
}

.brand-small {
  font-size: 0.75rem;
  color: var(--brown);
}

.brand-name {
  font-size: 1.08rem;
}

.global-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 0.92rem;
  font-weight: 700;
}

.global-nav a {
  position: relative;
}

.global-nav a:not(.nav-cta)::after {
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 2px;
  content: "";
  background: var(--mustard);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.24s ease;
}

.global-nav a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-cta {
  padding: 0.68rem 1rem;
  color: var(--paper);
  background: var(--navy);
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(23, 40, 61, 0.16);
}

.menu-button {
  display: none;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(76px, 10vw, 132px) 0 clamp(54px, 8vw, 98px);
}

.hero-inner,
.section,
.contact-inner,
.site-footer {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(320px, 0.82fr);
  align-items: center;
  gap: clamp(36px, 7vw, 88px);
}

.hero-bg-note {
  position: absolute;
  top: 124px;
  right: max(20px, calc((100vw - var(--max)) / 2));
  color: rgba(122, 81, 53, 0.09);
  font-family: Georgia, serif;
  font-size: clamp(3rem, 10vw, 8.5rem);
  font-weight: 900;
  line-height: 1;
  transform: rotate(-7deg);
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--brown);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--navy);
  line-height: 1.35;
  letter-spacing: 0;
}

h1 {
  max-width: 720px;
  font-family: Georgia, "Hiragino Mincho ProN", serif;
  font-size: clamp(2.8rem, 8vw, 5.8rem);
  line-height: 1.08;
}

h2 {
  font-family: Georgia, "Hiragino Mincho ProN", serif;
  font-size: clamp(2rem, 4vw, 3.1rem);
}

h3 {
  font-size: 1.15rem;
}

.hero-text,
.section-heading p,
.contact p,
.site-footer p {
  margin: 18px 0 0;
}

.hero-text {
  max-width: 620px;
  font-size: 1.04rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.78rem 1.25rem;
  border: 2px solid var(--navy);
  border-radius: 999px;
  font-weight: 800;
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.button:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 22px rgba(23, 40, 61, 0.18);
}

.button-primary {
  background: var(--mustard);
  color: var(--black);
}

.button-secondary {
  background: var(--paper);
}

.hero-visual {
  position: relative;
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-image {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 520px;
  object-fit: cover;
  object-position: 62% center;
}

.hero-visual::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(90deg, rgba(247, 241, 223, 0.56), transparent 36%),
    linear-gradient(180deg, transparent 70%, rgba(23, 40, 61, 0.16));
  pointer-events: none;
}

.file-card {
  position: absolute;
  width: 170px;
  padding: 18px;
  border: 1px solid rgba(122, 81, 53, 0.28);
  border-radius: var(--radius);
  background: #efe0bd;
  box-shadow: 0 12px 24px rgba(76, 49, 35, 0.12);
  transform: rotate(-7deg);
}

.file-card span {
  display: block;
  color: var(--brown);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.file-card strong {
  display: block;
  margin-top: 8px;
  line-height: 1.5;
}

.hero-file {
  left: 28px;
  top: 42px;
}

.stamp {
  position: absolute;
  right: 34px;
  top: 76px;
  padding: 10px 16px;
  border: 3px solid rgba(122, 81, 53, 0.78);
  color: var(--brown);
  font-weight: 900;
  transform: rotate(10deg);
}

.paw-trail {
  position: absolute;
  right: 64px;
  bottom: 56px;
  display: grid;
  gap: 14px;
  transform: rotate(-18deg);
}

.paw-trail span {
  width: 24px;
  height: 18px;
  border-radius: 50%;
  background: rgba(23, 40, 61, 0.22);
}

.section {
  padding: clamp(70px, 10vw, 116px) 0;
}

.section-muted {
  width: 100%;
  max-width: none;
  padding-right: max(20px, calc((100vw - var(--max)) / 2));
  padding-left: max(20px, calc((100vw - var(--max)) / 2));
  border-block: 1px solid var(--line);
  background: rgba(255, 249, 233, 0.56);
}

.section-heading {
  max-width: 720px;
  margin-bottom: 34px;
}

.trouble-grid,
.detective-grid,
.file-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.note-card,
.detective-card,
.case-file {
  position: relative;
  min-width: 0;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 10px 26px rgba(23, 40, 61, 0.08);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.note-card:hover,
.detective-card:hover,
.case-file:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.card-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 18px;
  border: 2px solid var(--navy);
  border-radius: 50%;
  background: var(--mustard);
  font-weight: 900;
}

.note-card p,
.service-item p,
.detective-card p,
.case-file p,
.flow-list p {
  margin: 12px 0 0;
}

.service-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.service-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: start;
  padding: 24px;
  border-bottom: 2px solid rgba(122, 81, 53, 0.18);
  background: rgba(255, 249, 233, 0.72);
}

.service-number {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--paper);
  font-family: Georgia, serif;
  font-weight: 900;
}

.portrait {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 0.82;
  height: auto;
  margin-bottom: 18px;
  border: 2px solid var(--navy);
  border-radius: var(--radius);
  object-fit: cover;
  object-position: center 35%;
  box-shadow: 0 12px 24px rgba(23, 40, 61, 0.1);
}

.role,
.case-label {
  display: inline-flex;
  width: fit-content;
  margin: 0 0 8px;
  padding: 0.18rem 0.58rem;
  border-radius: 999px;
  background: rgba(127, 146, 113, 0.18);
  color: var(--brown);
  font-size: 0.78rem;
  font-weight: 900;
}

.case-file {
  min-height: 220px;
  background:
    linear-gradient(90deg, rgba(122, 81, 53, 0.11) 0 10px, transparent 10px),
    var(--paper);
}

.case-file::after {
  position: absolute;
  right: 22px;
  bottom: 18px;
  content: "PAW";
  color: rgba(122, 81, 53, 0.18);
  font-family: Georgia, serif;
  font-size: 2rem;
  font-weight: 900;
  transform: rotate(-12deg);
}

.flow-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  padding: 0;
  margin: 0;
  list-style: none;
  counter-reset: flow;
}

.flow-list li {
  position: relative;
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.flow-list span {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 16px;
  border-radius: 50%;
  background: var(--mustard);
  color: var(--black);
  font-family: Georgia, serif;
  font-weight: 900;
}

.contact {
  padding: clamp(72px, 10vw, 118px) 0;
}

.contact-inner {
  position: relative;
  padding: clamp(36px, 6vw, 64px);
  border: 2px solid var(--navy);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(217, 164, 58, 0.2), rgba(127, 146, 113, 0.22)),
    var(--paper);
  box-shadow: var(--shadow);
}

.contact-inner::after {
  position: absolute;
  right: clamp(18px, 5vw, 52px);
  top: clamp(18px, 5vw, 42px);
  content: "しっぽ受付";
  padding: 8px 14px;
  border: 2px solid rgba(122, 81, 53, 0.62);
  color: var(--brown);
  font-weight: 900;
  transform: rotate(8deg);
}

.contact .button {
  margin-top: 26px;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 34px 0;
  border-top: 1px solid var(--line);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-weight: 700;
}

.footer-brand {
  margin: 0;
  font-weight: 900;
}

.section-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.section-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 860px) {
  .header-inner {
    min-height: 68px;
  }

  .menu-button {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 2px solid var(--navy);
    border-radius: 50%;
    background: var(--paper);
  }

  .menu-button-line,
  .menu-button-line::before,
  .menu-button-line::after {
    display: block;
    width: 18px;
    height: 2px;
    content: "";
    background: var(--navy);
    transition: transform 0.2s ease;
  }

  .menu-button-line {
    position: relative;
  }

  .menu-button-line::before,
  .menu-button-line::after {
    position: absolute;
    left: 0;
  }

  .menu-button-line::before {
    top: -6px;
  }

  .menu-button-line::after {
    top: 6px;
  }

  .menu-button[aria-expanded="true"] .menu-button-line {
    background: transparent;
  }

  .menu-button[aria-expanded="true"] .menu-button-line::before {
    transform: translateY(6px) rotate(45deg);
  }

  .menu-button[aria-expanded="true"] .menu-button-line::after {
    transform: translateY(-6px) rotate(-45deg);
  }

  .global-nav {
    position: absolute;
    left: 20px;
    right: 20px;
    top: calc(100% + 8px);
    display: grid;
    gap: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

  .global-nav.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .global-nav a {
    padding: 12px;
  }

  .nav-cta {
    margin-top: 6px;
    text-align: center;
  }

  .hero-inner {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    min-height: 430px;
  }

  .hero-image {
    min-height: 430px;
    object-position: 67% center;
  }

  .trouble-grid,
  .detective-grid,
  .file-grid,
  .service-list,
  .flow-list {
    grid-template-columns: 1fr;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .header-inner,
  .hero-inner,
  .section,
  .contact-inner,
  .site-footer {
    width: min(100% - 28px, var(--max));
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand-name {
    font-size: 0.98rem;
  }

  .hero {
    padding-top: 54px;
  }

  .hero-actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .hero-visual {
    min-height: 380px;
  }

  .hero-image {
    min-height: 380px;
    object-position: 68% center;
  }

  .file-card,
  .stamp,
  .paw-trail {
    transform: scale(0.82);
  }

  .file-card {
    left: 8px;
    top: 18px;
  }

  .stamp {
    right: 4px;
    top: 54px;
  }

  .note-card,
  .detective-card,
  .case-file,
  .flow-list li {
    padding: 22px;
  }

  .service-item {
    grid-template-columns: 1fr;
  }

  .contact-inner::after {
    position: static;
    display: inline-block;
    margin-bottom: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }

  .section-reveal {
    opacity: 1;
    transform: none;
  }
}
