/* ==========================================================
   Aivory Inc. — corporate site
   ========================================================== */

:root {
  --ivory: #f7f3ea;
  --ivory-deep: #efe8d8;
  --paper: #fffdf8;
  --ink: #23201b;
  --ink-soft: #5c564c;
  --line: #ddd4c2;
  --accent: #9c7a46;
  --accent-deep: #7d602f;

  --font-sans: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  --font-serif: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --font-latin: "Cormorant Garamond", Georgia, serif;

  --container: 1120px;
  --gutter: 24px;
  --header-h: 72px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.9;
  letter-spacing: 0.03em;
  -webkit-font-smoothing: antialiased;
}

img, svg, iframe { display: block; max-width: 100%; }
a { color: inherit; }
ul { margin: 0; padding: 0; }

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 16px;
  z-index: 100;
}
.skip-link:focus { left: 8px; }

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

.sp-only { display: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(247, 243, 234, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  font-family: var(--font-latin);
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
}
.brand-name {
  font-family: var(--font-latin);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.site-nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 32px;
}
.site-nav a {
  font-size: 14px;
  text-decoration: none;
  color: var(--ink-soft);
  transition: color .2s;
}
.site-nav a:hover { color: var(--ink); }
.site-nav .nav-cta {
  color: var(--paper);
  background: var(--ink);
  padding: 9px 20px;
  border-radius: 999px;
}
.site-nav .nav-cta:hover { color: var(--paper); background: var(--accent-deep); }

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  cursor: pointer;
  position: relative;
}
.nav-toggle span {
  position: absolute;
  left: 11px;
  width: 22px;
  height: 1.5px;
  background: var(--ink);
  transition: transform .3s, opacity .3s;
}
.nav-toggle span:nth-child(1) { top: 15px; }
.nav-toggle span:nth-child(2) { top: 21px; }
.nav-toggle span:nth-child(3) { top: 27px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 30px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--ink); color: var(--paper); border: 1px solid var(--ink); }
.btn-primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn-ghost { border: 1px solid var(--ink); color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn-lg { padding: 18px 40px; font-size: 17px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 120px 0 140px;
}
.hero-inner { position: relative; z-index: 1; }
.eyebrow {
  margin: 0 0 24px;
  font-family: var(--font-latin);
  font-size: 18px;
  font-style: italic;
  color: var(--accent);
  letter-spacing: 0.08em;
}
.hero-title {
  margin: 0 0 32px;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(36px, 6vw, 68px);
  line-height: 1.45;
  letter-spacing: 0.06em;
}
.hero-lead {
  max-width: 560px;
  margin: 0 0 44px;
  color: var(--ink-soft);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 16px; }

.hero-ornament {
  position: absolute;
  right: -160px;
  top: 50%;
  width: 640px;
  height: 640px;
  transform: translateY(-50%);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, var(--paper) 0%, var(--ivory-deep) 55%, transparent 70%);
  pointer-events: none;
}
.hero-ornament::before,
.hero-ornament::after {
  content: "";
  position: absolute;
  inset: 60px;
  border: 1px solid var(--line);
  border-radius: 50%;
}
.hero-ornament::after {
  inset: 140px;
  border-color: rgba(156, 122, 70, 0.35);
}

/* ---------- Sections ---------- */
.section { padding: 120px 0; }
.section-alt { background: var(--paper); }

.section-label {
  margin: 0 0 8px;
  font-family: var(--font-latin);
  font-size: 18px;
  font-style: italic;
  color: var(--accent);
  letter-spacing: 0.1em;
}
.section-title {
  margin: 0 0 56px;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(26px, 3.4vw, 36px);
  letter-spacing: 0.08em;
  line-height: 1.5;
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 48px;
}
.about-body p { margin: 0 0 1.4em; font-size: 17px; }
.about-body p:last-child { margin-bottom: 0; }
.about-body strong { font-weight: 500; color: var(--accent-deep); }

/* Services */
.service-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.service-card {
  position: relative;
  background: var(--ivory);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 40px 32px 36px;
  transition: transform .3s, box-shadow .3s;
}
.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px -24px rgba(35, 32, 27, 0.35);
}
.service-num {
  position: absolute;
  top: 24px;
  right: 28px;
  font-family: var(--font-latin);
  font-size: 34px;
  color: var(--line);
  line-height: 1;
}
.service-icon {
  width: 52px;
  height: 52px;
  margin-bottom: 24px;
  color: var(--accent);
}
.service-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.service-en {
  margin: 2px 0 18px;
  font-family: var(--font-latin);
  font-style: italic;
  font-size: 15px;
  color: var(--accent);
}
.service-card > p { margin: 0 0 20px; font-size: 15px; color: var(--ink-soft); }
.service-points {
  list-style: none;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.service-points li {
  position: relative;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: 6px;
}
.service-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.8em;
  width: 8px;
  height: 1px;
  background: var(--accent);
}

/* Company */
.company-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  align-items: start;
}
.company-table { margin: 0; border-top: 1px solid var(--line); }
.company-table > div {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.company-table dt { font-weight: 500; color: var(--ink-soft); font-size: 15px; }
.company-table dd { margin: 0; }
.company-table a { color: var(--accent-deep); }
.plain-list { list-style: none; }

.map {
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  background: var(--ivory-deep);
}
.map iframe { width: 100%; height: 100%; border: 0; filter: grayscale(0.4) sepia(0.12); }

/* Contact */
.contact { background: var(--ink); color: var(--paper); }
.contact-inner { text-align: center; }
.contact .section-title { margin-bottom: 24px; }
.contact-lead { margin: 0 0 40px; color: #cfc8bb; }
.contact .btn-primary { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.contact .btn-primary:hover { background: var(--ivory-deep); border-color: var(--ivory-deep); }
.contact-note { margin: 24px 0 0; font-size: 13px; color: #a39c8f; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ivory-deep);
  padding: 64px 0 28px;
  font-size: 14px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
  padding-bottom: 40px;
}
.footer-address { margin: 16px 0 0; color: var(--ink-soft); line-height: 1.8; }
.footer-nav {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
}
.footer-nav a { text-decoration: none; color: var(--ink-soft); }
.footer-nav a:hover { color: var(--ink); text-decoration: underline; }
.copyright {
  margin: 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-family: var(--font-latin);
  font-size: 14px;
  color: var(--ink-soft);
  letter-spacing: 0.08em;
}

/* ---------- Sub pages (privacy, 404) ---------- */
.page-header { padding: 96px 0 48px; }
.page-header .section-title { margin-bottom: 0; }
.prose { max-width: 760px; padding-bottom: 120px; }
.prose h2 {
  margin: 48px 0 12px;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
}
.prose p, .prose li { color: var(--ink-soft); }
.prose ul { padding-left: 1.4em; }
.prose .meta { margin-top: 56px; font-size: 14px; }

.notfound { padding: 140px 0; text-align: center; }
.notfound .eyebrow { font-size: 64px; margin-bottom: 8px; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .service-card { transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .service-list { grid-template-columns: 1fr; max-width: 620px; }
  .company-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; gap: 0; }
}

@media (max-width: 760px) {
  :root { --gutter: 16px; --header-h: 64px; }
  body { font-size: 15px; }
  .sp-only { display: inline; }
  .pc-only { display: none; }

  .nav-toggle { display: block; }
  .site-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--ivory);
    border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 24px;
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s, transform .25s, visibility .25s;
  }
  .site-nav.is-open { opacity: 1; transform: none; visibility: visible; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .site-nav li a { display: block; padding: 14px 0; font-size: 15px; border-bottom: 1px solid var(--line); }
  .site-nav li:last-child a { border-bottom: 0; }
  .site-nav .nav-cta { margin-top: 16px; text-align: center; }

  .hero { padding: 72px 0 96px; }
  .hero-ornament { width: 420px; height: 420px; right: -220px; top: 30%; opacity: .7; }
  .hero-actions .btn { flex: 1 1 auto; }

  .section { padding: 80px 0; }
  .section-title { margin-bottom: 40px; }
  .service-card { padding: 32px 22px 28px; }

  .company-table > div { grid-template-columns: 1fr; gap: 2px; padding: 16px 0; }
  .btn-lg { padding: 16px 24px; font-size: 15px; width: 100%; }
  .footer-inner { flex-direction: column; }
}
