/*
  色の三層構造：原始色 → 意味色 → 部品色
  写真の赤い灯りと夜の黒を基調にする。
*/
:root {
  --p-night-950: oklch(0.115 0.008 28);
  --p-night-900: oklch(0.155 0.012 28);
  --p-night-850: oklch(0.19 0.016 28);
  --p-brick-300: oklch(0.66 0.088 27);
  --p-brick-400: oklch(0.62 0.082 27);
  --p-brick-500: oklch(0.59 0.07 27);
  --p-brick-700: oklch(0.35 0.06 27);
  --p-brick-850: oklch(0.245 0.035 27);

  --surface-page: var(--p-night-950);
  --surface-raised: var(--p-night-900);
  --text-primary: var(--p-brick-300);
  --text-body: var(--p-brick-400);
  --text-muted: var(--p-brick-500);
  --line-subtle: var(--p-brick-850);
  --accent-active: var(--p-brick-300);

  --header-bg: oklch(0.115 0.008 28 / 0.88);
  --image-grade: saturate(0.7) contrast(1.08) brightness(0.66) sepia(0.08);
  --font-serif: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif CJK JP", "Noto Serif JP", serif;
  --font-sans: "Hiragino Kaku Gothic ProN", "Yu Gothic", "YuGothic", "Noto Sans CJK JP", "Noto Sans JP", sans-serif;
  --page-pad: clamp(20px, 4vw, 64px);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; background: var(--surface-page); }
body {
  min-width: 0;
  overflow-x: clip;
  color: var(--text-body);
  background: var(--surface-page);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.85;
  letter-spacing: 0.055em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.menu-open { overflow: hidden; }
::selection { color: var(--surface-page); background: var(--text-primary); }
a { color: inherit; text-decoration: none; }
button { color: inherit; background: none; border: 0; font: inherit; cursor: pointer; }
img { display: block; width: 100%; max-width: 100%; }
picture { display: block; }
h1, h2, h3 { font-family: var(--font-serif); font-weight: 400; line-height: 1.45; text-wrap: balance; }
p { max-width: 72ch; }
:focus-visible { outline: 2px solid var(--accent-active); outline-offset: 5px; }
.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  min-height: 44px;
  padding: 10px 16px;
  color: var(--surface-page);
  background: var(--text-primary);
  transform: translateY(-160%);
  transition: transform 180ms var(--ease-out);
}
.skip-link:focus { transform: translateY(0); }
.page-noise {
  position: fixed;
  z-index: 60;
  inset: 0;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.75'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

/* 固定案内 */
.site-header {
  position: fixed;
  z-index: 40;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 80px;
  padding: calc(12px + env(safe-area-inset-top)) var(--page-pad) 12px;
  border-bottom: 1px solid transparent;
  transition: background-color 240ms ease, border-color 240ms ease, transform 240ms var(--ease-out);
}
.site-header.is-scrolled { background: var(--header-bg); border-color: var(--line-subtle); backdrop-filter: blur(16px); }
.brand { display: inline-flex; align-items: center; gap: 12px; min-height: 48px; }
.brand-sigil { position: relative; display: flex; align-items: flex-end; gap: 3px; width: 23px; height: 27px; }
.brand-sigil::after { position: absolute; inset: 0; border: 1px solid var(--text-muted); content: ""; transform: rotate(45deg) scale(0.72); }
.brand-sigil i { display: block; width: 2px; background: var(--text-primary); transform: skewY(-28deg); }
.brand-sigil i:nth-child(1) { height: 10px; }
.brand-sigil i:nth-child(2) { height: 19px; }
.brand-sigil i:nth-child(3) { height: 14px; }
.brand-name { display: flex; align-items: baseline; gap: 8px; color: var(--text-primary); font-family: var(--font-serif); font-size: 16px; letter-spacing: 0.17em; }
.brand-name small { font-family: var(--font-sans); font-size: 12px; letter-spacing: 0.1em; }
.desktop-nav { display: none; }
.menu-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-width: 64px; min-height: 48px; font-size: 12px; letter-spacing: 0.14em; }
.menu-lines { display: grid; gap: 6px; width: 22px; }
.menu-lines i { display: block; width: 100%; height: 1px; background: var(--text-primary); transition: transform 200ms ease; }
.menu-lines i:last-child { width: 65%; justify-self: end; }
.menu-toggle:hover .menu-lines i:last-child { transform: scaleX(1.5); transform-origin: right; }

/* 目次の全画面表示 */
.menu-overlay { position: fixed; z-index: 80; inset: 0; }
.menu-overlay[hidden] { display: none; }
.menu-backdrop { position: absolute; inset: 0; background: oklch(0.08 0.006 28 / 0.75); opacity: 0; transition: opacity 220ms ease; }
.menu-panel {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  width: min(88vw, 430px);
  height: 100%;
  padding: calc(18px + env(safe-area-inset-top)) 24px calc(24px + env(safe-area-inset-bottom));
  overflow-y: auto;
  background:
    linear-gradient(oklch(0.115 0.008 28 / 0.9), oklch(0.115 0.008 28 / 0.96)),
    url("../assets/tokyo-night-617-960.webp") center / cover;
  border-left: 1px solid var(--line-subtle);
  transform: translateX(100%);
  transition: transform 260ms var(--ease-out);
}
.menu-overlay.is-open .menu-backdrop { opacity: 1; }
.menu-overlay.is-open .menu-panel { transform: translateX(0); }
.menu-panel-top { display: flex; align-items: center; justify-content: space-between; min-height: 52px; color: var(--text-muted); font-size: 12px; }
.menu-close { position: relative; width: 48px; height: 48px; }
.menu-close::before, .menu-close::after { position: absolute; top: 50%; left: 12px; width: 24px; height: 1px; background: var(--text-primary); content: ""; }
.menu-close::before { transform: rotate(45deg); }
.menu-close::after { transform: rotate(-45deg); }
.mobile-nav { display: grid; margin: auto 0; padding: 40px 0; }
.mobile-nav a { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; min-height: 82px; padding: 19px 0; border-top: 1px solid var(--line-subtle); }
.mobile-nav a:last-child { border-bottom: 1px solid var(--line-subtle); }
.mobile-nav a > span { color: var(--text-primary); font-family: var(--font-serif); font-size: 28px; letter-spacing: 0.12em; }
.mobile-nav small { color: var(--text-muted); font-size: 12px; }
.mobile-nav a { transition: padding-left 200ms var(--ease-out), color 200ms ease; }
.mobile-nav a:hover, .mobile-nav a:focus-visible { padding-left: 8px; }
.menu-footnote { color: var(--text-muted); font-size: 12px; }

/* 冒頭 */
.hero { position: relative; min-height: 100svh; min-height: 100dvh; overflow: hidden; isolation: isolate; background: var(--surface-page); }
.hero-media { position: absolute; z-index: -3; inset: -8% 0; transform: translate3d(0, var(--hero-y, 0%), 0); will-change: transform; }
.hero-media picture, .hero-media img { width: 100%; height: 100%; }
.hero-media img { object-fit: cover; object-position: 54% center; filter: var(--image-grade); animation: hero-drift 16s cubic-bezier(0.2, 0.6, 0, 1) both; }
@keyframes hero-drift { from { transform: scale(1.04); } to { transform: scale(1.13) translate3d(-1.5%, -1%, 0); } }
.hero-shade { position: absolute; z-index: -2; inset: 0; background: linear-gradient(180deg, oklch(0.08 0.008 28 / 0.46), oklch(0.08 0.008 28 / 0.06) 35%, oklch(0.08 0.008 28 / 0.88) 100%), linear-gradient(90deg, oklch(0.08 0.008 28 / 0.85), transparent 72%); }
.hero-frame { position: absolute; z-index: -1; inset: 96px 20px 20px; border: 1px solid oklch(0.51 0.08 27 / 0.25); pointer-events: none; }
.hero-location { position: absolute; top: calc(112px + env(safe-area-inset-top)); left: var(--page-pad); color: var(--text-muted); font-size: 12px; letter-spacing: 0.24em; }
.hero-wordmark { position: absolute; top: 18%; right: max(32px, 7vw); display: flex; align-items: flex-start; gap: 14px; color: var(--text-primary); writing-mode: vertical-rl; }
.wordmark-chars { display: flex; gap: 0.09em; font-size: clamp(58px, 14vw, 92px); line-height: 1; letter-spacing: 0.08em; }
.wordmark-chars i { display: block; font-style: normal; opacity: 0; animation: character-in 1100ms var(--ease-out) forwards; }
.wordmark-chars i:nth-child(1) { animation-delay: 120ms; }
.wordmark-chars i:nth-child(2) { animation-delay: 230ms; }
.wordmark-chars i:nth-child(3) { animation-delay: 340ms; }
.wordmark-chars i:nth-child(4) { animation-delay: 450ms; }
@keyframes character-in { from { opacity: 0; transform: translateY(-0.4em) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
.hero-wordmark small { padding-top: 4px; color: var(--text-muted); font-family: var(--font-sans); font-size: 12px; letter-spacing: 0.28em; }
.hero-copy { position: absolute; left: var(--page-pad); bottom: 19%; }
.hero-statement { color: var(--text-primary); font-family: var(--font-serif); font-size: clamp(34px, 7.8vw, 78px); line-height: 1.55; letter-spacing: 0.1em; text-shadow: 0 2px 30px var(--surface-page); }
.hero-note { display: none; color: var(--text-body); font-size: 14px; line-height: 2.1; }
.hero-bottom { position: absolute; right: var(--page-pad); bottom: calc(44px + env(safe-area-inset-bottom)); left: var(--page-pad); display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.hero-bottom > p { max-width: 22em; color: var(--text-muted); font-size: 12px; line-height: 1.8; }
.text-link { display: inline-flex; flex: none; align-items: center; gap: 14px; min-height: 44px; color: var(--text-primary); font-size: 13px; letter-spacing: 0.12em; }
.link-line { position: relative; display: block; width: 38px; height: 1px; overflow: hidden; background: var(--text-muted); }
.link-line::after { position: absolute; inset: 0; background: var(--text-primary); content: ""; transform: translateX(-105%); transition: transform 220ms var(--ease-out); }
.text-link:hover .link-line::after, .text-link:focus-visible .link-line::after { transform: translateX(0); }
.scroll-meter { position: absolute; right: 8px; bottom: 0; width: 1px; height: 24vh; background: var(--line-subtle); }
.scroll-meter span { display: block; width: 100%; height: 100%; background: var(--text-primary); transform: scaleY(0); transform-origin: top; }

/* 共通の本文構成 */
.section-space { padding: clamp(96px, 13vw, 184px) var(--page-pad); }
.section-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 48px 16px; width: 100%; max-width: 1440px; margin: 0 auto; }
.section-heading { grid-column: 1 / -1; position: relative; }
.section-heading h2 { color: var(--text-primary); font-size: clamp(30px, 6vw, 66px); letter-spacing: 0.075em; }
.vertical-label { margin-bottom: 24px; color: var(--text-muted); font-size: 12px; letter-spacing: 0.32em; }
.philosophy { background: var(--surface-page); }
.philosophy-lead { grid-column: 1 / -1; }
.philosophy-lead p { color: var(--text-primary); font-family: var(--font-serif); font-size: clamp(21px, 3.2vw, 31px); line-height: 1.9; letter-spacing: 0.07em; }
.philosophy-copy { grid-column: 1 / -1; display: grid; gap: 24px; }
.philosophy-copy p { line-height: 2; }

/* 全幅の写真 */
.image-break { position: relative; height: 82svh; min-height: 540px; overflow: hidden; background: var(--surface-raised); }
.image-break picture, .image-break img { width: 100%; height: 100%; }
.image-break img { object-fit: cover; object-position: 52% center; filter: saturate(0.68) contrast(1.12) brightness(0.58) sepia(0.08); transform: scale(1.12) translate3d(0, var(--parallax-y, 0%), 0); will-change: transform; }
.image-break-shade { position: absolute; inset: 0; background: linear-gradient(90deg, oklch(0.08 0.008 28 / 0.65), transparent 65%), linear-gradient(0deg, oklch(0.08 0.008 28 / 0.5), transparent 45%); }
.image-break figcaption { position: absolute; inset: 0; padding: 36px var(--page-pad); }
.vertical-caption { position: absolute; top: 12%; right: var(--page-pad); color: var(--text-primary); font-family: var(--font-serif); font-size: clamp(23px, 4vw, 42px); letter-spacing: 0.16em; writing-mode: vertical-rl; }
.image-index { position: absolute; bottom: 32px; left: var(--page-pad); color: var(--text-muted); font-size: 12px; letter-spacing: 0.2em; }

/* 領域 */
.domains { background: var(--surface-raised); }
.domains-intro { margin-bottom: clamp(64px, 8vw, 112px); }
.domains-note { grid-column: 1 / -1; color: var(--text-muted); font-size: 14px; line-height: 2; }
.domain-list { width: 100%; max-width: 1440px; margin: 0 auto; border-bottom: 1px solid var(--line-subtle); }
.domain-list article { position: relative; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; padding: 36px 0; overflow: hidden; border-top: 1px solid var(--line-subtle); }
.domain-list h3 { z-index: 1; grid-column: 1 / -1; color: var(--text-primary); font-size: clamp(24px, 4vw, 36px); letter-spacing: 0.1em; }
.domain-list p { z-index: 1; grid-column: 1 / 6; line-height: 2; }
.domain-list article > span { position: absolute; top: 50%; right: 0; color: var(--line-subtle); font-family: var(--font-serif); font-size: 100px; line-height: 1; transform: translateY(-50%); }

/* 間奏 */
.interlude { position: relative; display: flex; min-height: 100svh; align-items: center; justify-content: center; overflow: hidden; isolation: isolate; padding: 96px var(--page-pad); }
.interlude picture { position: absolute; z-index: -3; inset: -8% 0; }
.interlude img { width: 100%; height: 100%; object-fit: cover; object-position: 52% center; filter: saturate(0.55) contrast(1.12) brightness(0.54) sepia(0.12); transform: scale(1.12) translate3d(0, var(--parallax-y, 0%), 0); will-change: transform; }
.interlude-shade { position: absolute; z-index: -2; inset: 0; background: radial-gradient(circle at center, transparent, oklch(0.08 0.008 28 / 0.58) 75%), linear-gradient(180deg, oklch(0.08 0.008 28 / 0.48), transparent 25%, transparent 70%, oklch(0.08 0.008 28 / 0.7)); }
.interlude blockquote { color: var(--text-primary); font-family: var(--font-serif); font-size: clamp(29px, 6vw, 70px); line-height: 1.7; letter-spacing: 0.08em; text-align: center; text-shadow: 0 3px 32px var(--surface-page); }
.interlude > p { position: absolute; right: var(--page-pad); bottom: calc(32px + env(safe-area-inset-bottom)); color: var(--text-muted); font-size: 12px; }

/* 姿勢 */
.approach { background: var(--surface-page); }
.approach-copy { grid-column: 1 / -1; display: grid; gap: 24px; }
.approach-copy p { line-height: 2; }
.approach-aside { grid-column: 1 / -1; padding-top: 32px; border-top: 1px solid var(--line-subtle); color: var(--text-primary); font-family: var(--font-serif); font-size: clamp(24px, 4vw, 40px); line-height: 1.8; letter-spacing: 0.12em; }

/* 会社概要 */
.company { background: var(--surface-raised); border-top: 1px solid var(--line-subtle); }
.company-details { grid-column: 1 / -1; }
.company-details dl { border-bottom: 1px solid var(--line-subtle); }
.company-details dl > div { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 24px 0; border-top: 1px solid var(--line-subtle); }
.company-details dt { grid-column: 1; color: var(--text-muted); font-size: 13px; }
.company-details dd { grid-column: 1; color: var(--text-primary); line-height: 1.9; }
.contact-note { margin-top: 56px; }
.contact-note h3 { margin-bottom: 16px; color: var(--text-primary); font-size: 22px; letter-spacing: 0.08em; }
.contact-note p { color: var(--text-muted); font-size: 14px; line-height: 2; }

/* 末尾 */
.site-footer { padding: 64px var(--page-pad) calc(28px + env(safe-area-inset-bottom)); overflow: hidden; background: var(--surface-page); }
.footer-word { color: var(--p-brick-850); font-family: var(--font-serif); font-size: clamp(70px, 20vw, 290px); line-height: 1.05; letter-spacing: -0.03em; white-space: nowrap; }
.footer-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line-subtle); }
.footer-bottom p { color: var(--text-muted); font-size: 12px; }

@media (min-width: 768px) {
  .hero-frame { inset: 104px 32px 32px; }
  .hero-wordmark { top: 16%; }
  .hero-copy { bottom: 18%; display: grid; grid-template-columns: auto auto; align-items: end; gap: 6vw; }
  .hero-note { display: block; padding-bottom: 12px; }
  .hero-bottom > p { font-size: 13px; }
  .vertical-label { position: absolute; top: 8px; left: 0; margin: 0; writing-mode: vertical-rl; }
  .section-heading h2 { padding-left: 48px; }
  .philosophy-lead { grid-column: 2 / -1; }
  .philosophy-copy { grid-column: 2 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; }
  .domains-note { grid-column: 3 / -1; align-self: end; }
  .domain-list article { padding: 44px 0; }
  .domain-list h3 { grid-column: 1 / 3; }
  .domain-list p { grid-column: 3 / 6; }
  .domain-list article > span { font-size: 128px; }
  .approach-copy { grid-column: 2 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; }
  .approach-aside { grid-column: 3 / -1; margin-top: 24px; }
  .company-details { grid-column: 2 / -1; }
  .company-details dl > div { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
  .company-details dt { grid-column: 1 / 2; }
  .company-details dd { grid-column: 2 / -1; }
}

@media (min-width: 1024px) {
  .site-header { min-height: 88px; }
  .desktop-nav { display: flex; align-items: center; gap: clamp(24px, 3.5vw, 56px); }
  .desktop-nav a { position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; color: var(--text-body); font-size: 13px; letter-spacing: 0.16em; }
  .desktop-nav a::after { position: absolute; right: 0; bottom: 4px; left: 0; height: 1px; background: var(--text-primary); content: ""; transform: scaleX(0); transform-origin: left; transition: transform 200ms var(--ease-out); }
  .desktop-nav a:hover::after, .desktop-nav a:focus-visible::after { transform: scaleX(1); }
  .menu-toggle { display: none; }
  .section-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 64px 20px; }
  .section-heading { grid-column: 1 / 8; }
  .section-heading h2 { padding-left: 56px; }
  .philosophy-lead { grid-column: 4 / 12; }
  .philosophy-copy { grid-column: 4 / 12; gap: 56px; }
  .domains-intro .section-heading { grid-column: 1 / 9; }
  .domains-note { grid-column: 9 / 13; padding-bottom: 8px; }
  .domain-list article { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px; padding: 52px 0; }
  .domain-list h3 { grid-column: 2 / 6; }
  .domain-list p { grid-column: 7 / 12; }
  .domain-list article > span { right: 1%; font-size: 160px; }
  .approach .section-heading { grid-column: 1 / 10; }
  .approach-copy { grid-column: 4 / 12; gap: 64px; }
  .approach-aside { grid-column: 7 / 13; }
  .company-grid .section-heading { grid-column: 1 / 5; }
  .company-details { grid-column: 6 / 13; }
  .company-details dl > div { grid-template-columns: repeat(8, minmax(0, 1fr)); padding: 28px 0; }
  .company-details dt { grid-column: 1 / 3; }
  .company-details dd { grid-column: 3 / -1; }
  .contact-note { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 20px; }
  .contact-note h3 { grid-column: 1 / 4; }
  .contact-note p { grid-column: 4 / -1; }
}

@media (min-width: 1440px) {
  .hero-wordmark { right: 8vw; }
  .wordmark-chars { font-size: 116px; }
  .hero-copy { gap: 8vw; }
}

@media (max-width: 420px) {
  .brand-name small { display: none; }
  .hero-wordmark { top: 17%; right: 34px; }
  .hero-copy { bottom: 20%; }
  .hero-bottom > p { max-width: 15em; }
  .hero-bottom .text-link { gap: 8px; }
  .hero-bottom .link-line { width: 24px; }
  .interlude > p { right: auto; left: var(--page-pad); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .wordmark-chars i { opacity: 1; }
  .hero-media, .image-break img, .interlude img { transform: none !important; will-change: auto; }
}
