/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "M PLUS 2", "Hiragino Kaku Gothic ProN", sans-serif;
  font-feature-settings: "palt";
  line-height: 1.9;
  color: #f2ede4;
  background: #070b18;
  overflow-x: hidden;
}

/* 見出し用（歴史的経緯で .serif という名前のままだが、書体はゴシック） */
.serif { font-family: "M PLUS 2", "Hiragino Kaku Gothic ProN", sans-serif; font-weight: 700; }

a { color: inherit; }

img { max-width: 100%; display: block; }

.nowrap { white-space: nowrap; }

/* .sp = 改行はスマホのみ */
@media (min-width: 640px) { .sp { display: none; } }

/* ---------- sky canvas ---------- */
#sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: linear-gradient(#05070f, #10152c);
}

/* WebGL が使えない環境は CSS グラデーションで代替 */
.no-webgl #sky { display: none; }
.no-webgl body,
.no-webgl main { background: transparent; }
.no-webgl .hero,
.no-webgl .concept { background: linear-gradient(#05070f, #241f3d); }
.no-webgl .products { background: linear-gradient(#241f3d 0%, #b98a77 30%, #f3dfc8 70%, #f9efe1 100%); }
.no-webgl .contact, .no-webgl .footer { background: #f9efe1; }

/* ---------- topbar ---------- */
.topbar {
  position: fixed;
  top: 0; left: 0;
  z-index: 10;
  padding: 1.1rem clamp(1.2rem, 4vw, 2.5rem);
  color: #f2ede4;
  transition: color .8s ease;
}
body.light .topbar { color: #43362d; }
.wordmark {
  display: flex;
  align-items: center;
  gap: .55rem;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: .06em;
  font-size: .95rem;
}
.mark {
  width: 17px; height: 17px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  position: relative;
  display: inline-block;
}
.mark::after {
  content: "";
  position: absolute;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  top: 3px; left: 7.5px; /* 中心が、すこしずれている */
}

/* ---------- hero ---------- */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  /* 下を大きく開けて、重心を光学中心（画面の43%あたり）へ */
  padding: 0 1.5rem clamp(5rem, 13svh, 9rem);
  position: relative;
}
/* 大きな「目」= ロゴマーク。左上のワードマーク（.mark）と同比率:
 * 目玉 = 直径の35.3%、ずれ = 直径の (+11.8%, -14.7%)。枠だけ2/3の細さ */
.hero-mark {
  --d: clamp(200px, min(34vw, 38svh), 340px);
  width: var(--d);
  aspect-ratio: 1;
  border-radius: 50%;
  position: relative;
}
.hero-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: calc(var(--d) * .059) solid #f2ede4;
}
.hero-mark .pupil {
  position: absolute;
  width: 35.3%;
  aspect-ratio: 1;
  border-radius: 50%;
  left: 50%;
  top: 50%;
  margin: -17.65% 0 0 -17.65%;
  background: #f2ede4;
  /* JSなしでも、ロゴと同じ位置に「すこしずれて」いる */
  transform: translate(33%, -42%);
  will-change: transform;
}
.hero-name {
  margin-top: clamp(2.2rem, 5.5svh, 3.6rem);
  font-size: clamp(1.5rem, 3.6vw, 2.5rem);
  font-weight: 700;
  letter-spacing: .26em;
  text-indent: .26em;
  text-shadow: 0 0 40px rgba(120, 140, 255, .25);
}
@media (max-width: 640px) {
  .hero-name { font-size: 1.5rem; letter-spacing: .18em; text-indent: .18em; }
}
.scroll-cue {
  position: absolute;
  bottom: max(2.2rem, env(safe-area-inset-bottom) + 1.4rem);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .7rem;
  font-size: .72rem;
  letter-spacing: .3em;
  opacity: .6;
}
.scroll-cue i {
  width: 1px;
  height: 56px;
  background: currentColor;
  display: block;
  transform-origin: top;
  animation: cue 2.6s ease-in-out infinite;
}
@keyframes cue {
  0% { transform: scaleY(0); }
  45% { transform: scaleY(1); transform-origin: top; }
  46% { transform-origin: bottom; }
  90%, 100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ---------- concept ---------- */
.concept {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20svh 1.5rem 22svh;
}
.concept h2 {
  font-size: clamp(1.4rem, 3.2vw, 2rem);
  font-weight: 600;
  letter-spacing: .16em;
  margin-bottom: clamp(2.8rem, 6vw, 4.2rem);
  text-align: center;
  text-shadow: 0 1px 26px rgba(30, 18, 50, .55);
}
.concept-body {
  max-width: 36em;
  font-size: clamp(1rem, 1.9vw, 1.2rem);
  letter-spacing: .09em;
  line-height: 2.35;
  text-shadow: 0 1px 26px rgba(30, 18, 50, .55), 0 0 3px rgba(30, 18, 50, .35);
}
.concept-body p + p { margin-top: 1.7em; }
.concept-body strong { font-weight: 700; }

/* ---------- products: editorial index ---------- */
.vh {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.products {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14svh clamp(1.2rem, 4vw, 2.5rem) 10svh;
  color: #43362d;
}
.products-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid rgba(67, 54, 45, .22);
}
.products-head h2 {
  font-size: clamp(1.7rem, 4.4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: .1em;
}
.products-count {
  font-size: .72rem;
  letter-spacing: .28em;
  opacity: .45;
  font-variant-numeric: tabular-nums;
}

/* ガラスは1面だけ。行は罫線で区切る */
.index {
  list-style: none;
  margin-top: clamp(1.6rem, 3vw, 2.6rem);
  background: rgba(255, 251, 244, .68);
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 20px;
  backdrop-filter: blur(18px) saturate(112%);
  -webkit-backdrop-filter: blur(18px) saturate(112%);
  box-shadow: 0 18px 60px rgba(90, 60, 40, .14);
  padding: 0 clamp(1.2rem, 2.8vw, 2.4rem);
}
.index-row {
  position: relative;
  display: grid;
  grid-template-columns: 3rem 56px minmax(11rem, 1fr) minmax(0, 1.15fr) 1.6rem;
  align-items: center;
  column-gap: clamp(1rem, 2.2vw, 1.8rem);
  padding: clamp(1.5rem, 2.6vw, 2.3rem) 0;
}
.index-row + .index-row { border-top: 1px solid rgba(67, 54, 45, .18); }

.idx-num {
  font-size: .72rem;
  letter-spacing: .16em;
  opacity: .38;
  font-variant-numeric: tabular-nums;
  align-self: start;
  padding-top: .55em;
}
.idx-icon {
  width: 56px; height: 56px;
  border-radius: 15px;
  object-fit: contain;
  background: rgba(255, 255, 255, .85);
  padding: 4px;
  transition: transform .55s cubic-bezier(.22, 1, .36, 1);
}
.idx-name {
  font-size: clamp(1.25rem, 2.5vw, 1.8rem);
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1.45;
}
.idx-name a { text-decoration: none; }
/* リンクは名前だけを包み、クリック領域は行全体に広げる */
.idx-name a::after { content: ""; position: absolute; inset: 0; z-index: 2; }
.idx-catch {
  margin-top: .3em;
  font-size: clamp(.92rem, 1.5vw, 1.08rem);
  font-weight: 500;
  letter-spacing: .05em;
  line-height: 1.7;
  color: #8a4d2b;
}
.idx-body { font-size: .88rem; line-height: 1.95; opacity: .88; }
.idx-host {
  display: inline-block;
  margin-top: .55rem;
  font-size: .74rem;
  letter-spacing: .03em;
  opacity: .62;
}
.idx-go {
  justify-self: end;
  opacity: .3;
  transition: transform .55s cubic-bezier(.22, 1, .36, 1), opacity .4s ease;
}

/* ホバーした行だけ、静かに持ち上がる */
@media (hover: hover) and (min-width: 900px) {
  .index-row {
    margin: 0 calc(-1 * clamp(.8rem, 1.6vw, 1.2rem));
    padding-inline: clamp(.8rem, 1.6vw, 1.2rem);
    border-radius: 14px;
    transition: background .35s ease;
  }
  .index-row:hover,
  .index-row:focus-within { background: rgba(255, 255, 255, .55); }
  .index-row:hover .idx-icon, .index-row:focus-within .idx-icon { transform: scale(1.07); }
  .index-row:hover .idx-go,   .index-row:focus-within .idx-go   { opacity: .9; transform: translateX(6px); }
}
.index-row:has(:focus-visible) {
  outline: 2px solid #8a4d2b;
  outline-offset: 6px;
  border-radius: 10px;
}

@media (max-width: 899px) {
  .index { border-radius: 16px; padding: 0 clamp(1rem, 4vw, 1.4rem); }
  .index-row {
    grid-template-columns: 48px minmax(0, 1fr);
    grid-template-areas: "icon head" "body body";
    align-items: start;
    row-gap: .9rem;
    column-gap: 1rem;
    padding: 1.6rem 0;
  }
  .idx-icon { grid-area: icon; width: 48px; height: 48px; border-radius: 13px; }
  .idx-head { grid-area: head; padding-right: 2.8rem; }
  .idx-wrap { grid-area: body; }
  .idx-num { position: absolute; top: 1.75rem; right: 0; padding: 0; }
  .idx-go { display: none; }
  .idx-name { font-size: 1.18rem; }
  .idx-catch { font-size: .95rem; }
  .index-row:active { background: rgba(255, 255, 255, .38); }
}

/* ---------- contact ---------- */
.contact {
  min-height: 80svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8svh 1.5rem;
  color: #43362d;
}
.contact h2 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 600;
  letter-spacing: .12em;
  margin-bottom: 1.8rem;
}
.contact p { font-size: .98rem; opacity: .85; }
.contact p + p { margin-top: 1.1rem; }
.contact-btn {
  display: inline-block;
  margin-top: 2.6rem;
  padding: 1rem 3.2rem;
  border-radius: 999px;
  background: #3d312a;
  color: #fbf3e6;
  text-decoration: none;
  font-size: .95rem;
  letter-spacing: .12em;
  box-shadow: 0 10px 30px rgba(61, 49, 42, .25);
  transition: transform .35s cubic-bezier(.22, 1, .36, 1), box-shadow .35s;
}
.contact-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(61, 49, 42, .3);
}
.contact-note {
  margin-top: 1rem;
  font-size: .74rem;
  letter-spacing: .08em;
  opacity: .55;
}

/* ---------- footer ---------- */
.footer {
  text-align: center;
  padding: 4rem 1.5rem 3rem;
  color: #43362d;
}
.footer-about {
  font-size: .88rem;
  line-height: 2.1;
  opacity: .85;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .4rem 1.6rem;
  margin-top: 2.2rem;
  font-size: .8rem;
}
.footer-links a {
  text-decoration: none;
  opacity: .7;
  border-bottom: 1px solid transparent;
  transition: opacity .3s, border-color .3s;
}
.footer-links a:hover { opacity: 1; border-color: currentColor; }
.footer-copy {
  margin-top: 2.4rem;
  font-size: .72rem;
  letter-spacing: .1em;
  opacity: .5;
}

/* ---------- reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  filter: blur(5px);
  transition: opacity 1.2s ease, transform 1.2s cubic-bezier(.22, 1, .36, 1), filter 1.2s ease;
}
.reveal.in-view {
  opacity: 1;
  transform: none;
  filter: none;
}

/* ヒーローの入場: 目が開いたあとに、文字とキューが順に現れる */
.hero-name.reveal { transition-delay: 1.25s; }
.scroll-cue.reveal { transition-delay: 1.7s; transform: translate(-50%, 26px); }
.scroll-cue.reveal.in-view { opacity: .6; transform: translateX(-50%); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; filter: none; transition: none; }
  .scroll-cue i { animation: none; height: 30px; }
  .index-row, .idx-icon, .idx-go { transition: none; }
  .index-row:hover .idx-icon { transform: none; }
}
