/*
Theme Name: Superliminal
Theme URI: https://superliminal.jp/
Author: Emerald Inc.
Description: Superliminal — Give Ideas Gravity. Independent creative company site theme.
Version: 1.2.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: superliminal
*/

:root {
	--paper: #f5f5f2;
	--ink: #101010;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: Arial, 'Helvetica Neue', 'Noto Sans JP', sans-serif;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }

.screen-reader-text {
	border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
	height: 1px; margin: -1px; overflow: hidden; padding: 0;
	position: absolute; width: 1px; word-wrap: normal !important;
}

/* Header */
.site-header {
	height: 82px;
	position: fixed;
	z-index: 20;
	top: 0; left: 0; right: 0;
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0 5%;
	mix-blend-mode: difference;
	color: #fff;
}
.admin-bar .site-header { top: 32px; }
.site-header .brand { font-size: 17px; font-weight: 900; letter-spacing: -.07em; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 30px; }
.site-nav { font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.site-nav a:hover { opacity: .55; }

/* Hero */
.hero {
	min-height: 100vh;
	min-height: 100svh;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	padding: 120px 7% 55px;
	position: relative;
}
/* ロゴはビューポートの上下左右中央に固定（hero-foot の高さに影響されない） */
.hero-visual {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
}
/* .hero-mask は登場アニメーション用の窓（clip-path は iOS Safari で再描画されないことがあるため使わない） */
.hero-mask {
	width: min(80%, 824px);
	overflow: hidden;
}
.hero-logo {
	display: block;
	width: 100%;
	height: auto;
}
.hero-foot {
	display: flex;
	justify-content: space-between;
	align-items: end;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .07em;
}
.hero-foot span:last-child { text-align: right; }
.orbit {
	position: absolute;
	width: 120px; height: 120px;
	border: 1px solid #aaa;
	border-radius: 50%;
	right: 7%; bottom: 17%;
	animation: spin 12s linear infinite;
}
.orbit:after {
	content: '';
	position: absolute;
	top: 8px; left: 12px;
	width: 14px; height: 14px;
	background: #111;
	border-radius: 50%;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Statement */
.dark { background: #0a0a0a; color: #f7f7f3; }
.statement {
	min-height: 100vh;
	min-height: 100svh;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 15vh 7%;
}
.eyebrow { font-size: 12px; letter-spacing: .22em; font-weight: 700; }
.statement h1 {
	font-size: clamp(65px, 12vw, 190px);
	letter-spacing: -.095em;
	line-height: .88;
	margin: 50px 0 55px;
	font-weight: 900;
}
.statement p { font-size: clamp(15px, 1.7vw, 21px); line-height: 2.1; max-width: 650px; margin: 0; }
.statement .jp { margin-top: 35px; color: #a5a5a5; }

/* Sections */
.section { padding: 145px 7%; }
.section-head {
	display: flex;
	justify-content: space-between;
	gap: 20px;
	align-items: baseline;
	border-bottom: 1px solid #aaa;
	padding-bottom: 25px;
}
.section-head h2 { font-size: clamp(40px, 7vw, 100px); letter-spacing: -.08em; margin: 0; line-height: 1; }
.section-head > span { font-size: 12px; }
.works-intro { max-width: 680px; font-size: 16px; line-height: 1.9; margin: 34px 0 55px; }
.works-note { font-size: 12px; line-height: 1.8; color: #666; margin-top: 22px; }

/* Services */
.services { margin-top: 50px; }
.service {
	display: grid;
	grid-template-columns: 70px 1fr 1fr;
	align-items: start;
	gap: 25px;
	padding: 36px 0;
	border-bottom: 1px solid #bbb;
}
.service > div { min-width: 0; }
.service b { font-size: clamp(25px, 4vw, 55px); letter-spacing: -.065em; overflow-wrap: anywhere; }
.service p { font-size: 14px; line-height: 1.9; max-width: 400px; margin: 7px 0; }
.service-sub { font-size: 15px; font-weight: 700; margin-top: 13px; letter-spacing: .01em; }
.service-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; }
.service-tags span { border: 1px solid #aaa; padding: 9px 13px; font-size: 12px; font-weight: 700; }
.service-logos { display: flex; gap: 26px; align-items: center; flex-wrap: wrap; margin-top: 22px; }
.service-logos img { display: block; width: auto; height: 46px; opacity: .85; }
.service-logos a:hover img, .service-logos a:focus-visible img { opacity: 1; }
.service-logos a:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }

/* Works */
.work-filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 30px; }
.work-filters button {
	border: 1px solid #aaa;
	background: transparent;
	color: inherit;
	padding: 12px 19px;
	font: 700 11px Arial, sans-serif;
	letter-spacing: .11em;
	cursor: pointer;
	transition: .2s;
}
.work-filters button:hover,
.work-filters button.active { background: #111; color: #fff; border-color: #111; }
.work-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.work-card {
	display: block;
	border: 1px solid #c8c8c4;
	overflow: hidden;
	transition: transform .3s, border-color .3s;
}
.work-card:hover { transform: translateY(-6px); border-color: #111; }
.work-card[hidden] { display: none !important; }
.work-visual {
	height: clamp(210px, 27vw, 390px);
	display: flex;
	align-items: flex-end;
	position: relative;
	padding: 28px;
	overflow: hidden;
	background: #161616;
	color: #fff;
}
.work-visual strong {
	font-size: clamp(34px, 5vw, 76px);
	line-height: .95;
	letter-spacing: -.08em;
	max-width: 90%;
	position: relative;
	z-index: 1;
}
.work-visual small { position: absolute; top: 25px; left: 28px; letter-spacing: .18em; font-size: 11px; z-index: 1; }
.work-visual.music-one { background: radial-gradient(circle at 75% 20%, #f65d3c, transparent 35%), #141414; }
.work-visual.music-two { background: radial-gradient(circle at 70% 35%, #6e64ff, transparent 42%), #151515; }
.work-visual.gaming { background: radial-gradient(circle at 80% 10%, #e6ff55, transparent 34%), #101010; }
.work-visual.dpf { background: radial-gradient(circle at 76% 30%, #e9ff43, transparent 36%), #111; color: #fff; }
.work-visual.f1 { background: radial-gradient(circle at 78% 28%, #d82727, transparent 40%), #111; }
.work-visual.f1 strong { font-size: clamp(28px, 4.2vw, 65px); }
.work-visual.custom { background: radial-gradient(circle at 76% 28%, var(--accent, #888), transparent 38%), #111; }
.work-visual.has-image { background: #e9e9e9; }
.work-visual.has-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.work-visual.is-logo { background: #fff; }
.work-visual.is-logo img { inset: 14% 16%; width: 68%; height: 72%; object-fit: contain; }
.work-visual.has-image:not(.is-logo):after {
	content: '';
	position: absolute;
	inset: 45% 0 0;
	background: linear-gradient(transparent, rgba(0, 0, 0, .45));
}
.work-meta { display: flex; justify-content: space-between; align-items: start; gap: 18px; padding: 22px 24px 25px; }
.work-meta h3 { font-size: clamp(19px, 2vw, 28px); letter-spacing: -.045em; margin: 0 0 9px; }
.work-meta p { font-size: 11px; letter-spacing: .1em; margin: 0; color: #555; }
.work-arrow { font-size: 23px; }
.work-soon { border-style: dashed; }
.work-soon .work-visual { background: #e9e9e6; color: #9a9a96; }
.work-soon .work-meta p { letter-spacing: .18em; }
.empty-works {
	font-size: clamp(22px, 4vw, 48px);
	font-weight: 800;
	letter-spacing: -.05em;
	padding: 65px 0;
	border-top: 1px solid #bbb;
}

/* Partners */
.partner-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	border-top: 1px solid #aaa;
	border-left: 1px solid #aaa;
	margin-top: 42px;
}
.partner-grid > * {
	min-height: 155px;
	border-right: 1px solid #aaa;
	border-bottom: 1px solid #aaa;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	font-size: clamp(21px, 2.6vw, 38px);
	font-weight: 900;
	letter-spacing: -.05em;
	padding: 15px;
}
.partner-grid sup { font-size: 12px; margin-left: 3px; align-self: center; }
.partner-grid img { display: block; max-width: 70%; max-height: 64px; width: auto; height: auto; object-fit: contain; transition: filter .4s; }

/* Manifesto (unused in front page, kept for reuse) */
.manifesto { min-height: 75vh; display: flex; justify-content: center; flex-direction: column; }
.manifesto h2 { font-size: clamp(45px, 9vw, 130px); line-height: 1; letter-spacing: -.09em; max-width: 1150px; margin: 35px 0; }
.manifesto p { font-size: 16px; line-height: 2; }

/* Contact / Footer */
.contact { padding: 130px 7% 80px; }
.contact h2 { font-size: clamp(65px, 12vw, 180px); letter-spacing: -.09em; line-height: .9; margin: 55px 0; }
.contact .contact-link { font-size: clamp(20px, 3vw, 38px); border-bottom: 1px solid; padding-bottom: 10px; display: inline-block; }
.contact-form { max-width: 760px; margin-top: 50px; display: grid; gap: 30px; }
.contact-field { display: grid; gap: 10px; margin: 0; padding: 0; border: 0; min-width: 0; }
.contact-field > span, .contact-field legend { font-size: 11px; font-weight: 700; letter-spacing: .18em; padding: 0; }
.contact-field input, .contact-field textarea {
	width: 100%;
	border: 0;
	border-bottom: 1px solid #777;
	background: transparent;
	color: inherit;
	font: 16px/1.7 Arial, 'Helvetica Neue', 'Noto Sans JP', sans-serif;
	padding: 8px 0;
	border-radius: 0;
}
.contact-field textarea { resize: vertical; }
.contact-field input:focus, .contact-field textarea:focus { outline: none; border-bottom-color: var(--ink); }
.contact-categories { display: flex; flex-wrap: wrap; gap: 8px; }
.contact-categories legend { margin-bottom: 12px; }
.contact-categories label { cursor: pointer; }
.contact-categories input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.contact-categories span { display: inline-block; border: 1px solid #aaa; padding: 11px 16px; font-size: 11px; line-height: 1.2; font-weight: 700; letter-spacing: .1em; transition: .2s; }
.contact-categories input:checked + span { background: #111; color: #fff; border-color: #111; }
.contact-categories input:focus-visible + span { outline: 2px solid #111; outline-offset: 2px; }
.contact-form button.contact-link { justify-self: start; background: none; border: 0; border-bottom: 1px solid; color: inherit; font-family: inherit; font-weight: 700; cursor: pointer; padding: 0 0 10px; }
.contact-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.contact-status { font-size: 14px; font-weight: 700; border-left: 3px solid; padding: 4px 0 4px 14px; margin: 40px 0 0; }
.contact-status.is-invalid, .contact-status.is-error { color: #c0271d; }
.footer {
	display: flex;
	justify-content: space-between;
	gap: 25px;
	flex-wrap: wrap;
	margin-top: 150px;
	padding-top: 25px;
	border-top: 1px solid #777;
	font-size: 11px;
	letter-spacing: .07em;
}
.footer-address { font-style: normal; line-height: 1.7; }
.footer-end { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 18px; text-align: right; }
.footer-sns { display: inline-flex; }
.footer-sns:hover { opacity: .55; }
.site-footer { padding: 0 7% 80px; }
.site-footer .footer { margin-top: 0; }

/* Reveal (JS が有効なときだけ隠す) */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s, transform .8s; }
.js .reveal.visible { opacity: 1; transform: translateY(0); }

/* Generic pages (index.php) */
.page-main { padding: 160px 7% 120px; }
.entry { max-width: 820px; margin: 0 0 90px; }
.entry-title { font-size: clamp(36px, 6vw, 80px); letter-spacing: -.07em; line-height: 1; margin: 0 0 30px; }
.entry-meta { font-size: 11px; letter-spacing: .1em; color: #666; margin-bottom: 30px; }
.entry-content { font-size: 16px; line-height: 2; }
.entry-content a { border-bottom: 1px solid; }
.pagination { font-size: 12px; font-weight: 700; letter-spacing: .1em; }
.pagination .nav-links { display: flex; gap: 14px; }

@media (max-width: 782px) {
	.admin-bar .site-header { top: 46px; }
}

@media (max-width: 700px) {
	.site-header { height: 65px; }
	.site-nav ul { gap: 9px; }
	.site-nav { font-size: 8px; }
	.hero { padding: 110px 6% 40px; }
	.hero-mask { width: 88%; }
	.orbit { width: 65px; height: 65px; bottom: 21%; }
	.hero-foot { font-size: 9px; }
	.statement, .section, .contact, .page-main, .site-footer { padding-left: 6%; padding-right: 6%; }
	.statement h1 { font-size: 18vw; }
	.service { grid-template-columns: 32px 1fr; gap: 10px; }
	.service > div, .service p { grid-column: 2; }
	.service b { font-size: 30px; }
	.service-sub { font-size: 13px; }
	.section { padding-top: 95px; padding-bottom: 95px; }
	.footer { margin-top: 100px; }
	.work-grid { grid-template-columns: 1fr; gap: 16px; }
	.work-visual { height: 270px; }
	.work-visual strong { font-size: 49px; }
	.work-meta { padding: 18px; }
	.work-filters button { padding: 11px 13px; font-size: 10px; }
	.partner-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.partner-grid > * { min-height: 115px; }
	.service-logos img { height: 36px; }
	.footer-end { align-items: flex-start; text-align: left; }
}

/* =========================================================
   Motion / Interaction（assets/js/main.js と対応）
   ========================================================= */

/* JS 起動前のチラつき防止。main.js が html に .motion-ready を付けたら解除 */
.js:not(.motion-ready):not(.motion-fallback) .hero-mask,
.js:not(.motion-ready):not(.motion-fallback) .hero-foot,
.js:not(.motion-ready):not(.motion-fallback) .orbit { opacity: 0; }
.motion-fallback .reveal { opacity: 1; transform: none; }

/* smooth のままだと ScrollTrigger の位置計測がずれるため、GSAP 動作時は JS 側でスムーススクロールする */
html.gsap { scroll-behavior: auto; }

/* GSAP 管理下では CSS トランジションと競合させない */
.gsap .reveal { transition: none; }
.gsap .work-card { transition: border-color .3s; }
.gsap .work-card:hover { transform: none; }

/* Scroll progress */
.scroll-progress {
	position: fixed;
	z-index: 30;
	top: 0; left: 0; right: 0;
	height: 2px;
	background: #fff;
	mix-blend-mode: difference;
	transform-origin: 0 50%;
	transform: scaleX(0);
	pointer-events: none;
}
.admin-bar .scroll-progress { top: 32px; }

/* Custom cursor（hover 可能なデバイスのみ JS が生成） */
.has-cursor, .has-cursor a, .has-cursor button { cursor: none; }
.has-cursor #wpadminbar, .has-cursor #wpadminbar a { cursor: auto; }
.cursor {
	position: fixed;
	z-index: 100000;
	top: 0; left: 0;
	pointer-events: none;
	mix-blend-mode: difference;
}
.cursor-dot,
.cursor-ring {
	position: fixed;
	top: 0; left: 0;
	border-radius: 50%;
	transform: translate(-50%, -50%);
}
.cursor-dot { width: 6px; height: 6px; background: #fff; }
.cursor-ring {
	width: 38px; height: 38px;
	border: 1px solid #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: width .35s cubic-bezier(.2, .8, .2, 1), height .35s cubic-bezier(.2, .8, .2, 1), background-color .35s, border-color .35s;
}
.cursor-label {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .12em;
	color: #000;
	opacity: 0;
	white-space: nowrap;
	transition: opacity .2s;
}
.cursor.is-link .cursor-ring { width: 64px; height: 64px; }
.cursor.is-label .cursor-ring { width: 96px; height: 96px; background: #fff; }
.cursor.is-label .cursor-label { opacity: 1; }
.cursor.is-label .cursor-dot,
.cursor.is-hidden { opacity: 0; }

/* Split text */
.split-word { display: inline-block; white-space: nowrap; }
[data-split="rise"] .split-word { overflow: hidden; padding: .08em .02em; margin: -.08em -.02em; vertical-align: top; }
.split-char { display: inline-block; will-change: transform; }
.split-line { display: block; overflow: hidden; padding: .08em 0; margin: -.08em 0; }
.split-line-inner { display: block; will-change: transform; }

/* Hero */
.hero { overflow: hidden; }
.hero-visual { will-change: transform, opacity; }
.gsap .orbit { animation: none; }

/* Statement */
.statement { overflow: hidden; }

/* Services: hover で行を反転 */
.service { position: relative; isolation: isolate; transition: color .45s; }
.service:before {
	content: '';
	position: absolute;
	inset: 0 -3.5vw;
	z-index: -1;
	background: #111;
	transform: scaleY(0);
	transform-origin: 50% 100%;
	transition: transform .55s cubic-bezier(.7, 0, .2, 1);
}
.service b { display: inline-block; transition: transform .55s cubic-bezier(.7, 0, .2, 1); }
.service-tags span { transition: border-color .45s; }
.service-logos img { transition: filter .45s, opacity .3s; }
@media (hover: hover) {
	.service:hover { color: #f7f7f3; }
	.service:hover:before { transform: scaleY(1); }
	.service:hover b { transform: translateX(18px); }
	.service:hover .service-tags span { border-color: #555; }
	.service:hover .service-logos img { filter: invert(1); }
}

/* Works: tilt + spotlight */
.work-card { will-change: transform; }
.work-visual:before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 1;
	background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .22), transparent 42%);
	opacity: 0;
	transition: opacity .4s;
	pointer-events: none;
}
.work-card:hover .work-visual:before { opacity: 1; }
.work-visual strong { transition: transform .6s cubic-bezier(.2, .8, .2, 1); }
.work-card:hover .work-visual strong { transform: translateY(-8px); }
.work-visual.has-image img { transition: transform 1s cubic-bezier(.2, .8, .2, 1); }
.work-card:hover .work-visual.has-image img { transform: scale(1.06); }
.work-arrow { display: inline-block; transition: transform .45s cubic-bezier(.2, .8, .2, 1); }
.work-card:hover .work-arrow { transform: translate(4px, -4px) rotate(45deg); }

/* Partners: hover で下から塗り */
.partner-grid > * { position: relative; overflow: hidden; isolation: isolate; transition: color .4s; }
.partner-grid > *:before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: -1;
	background: #111;
	transform: translateY(101%);
	transition: transform .5s cubic-bezier(.7, 0, .2, 1);
}
@media (hover: hover) {
	.partner-grid > *:hover { color: #f7f7f3; }
	.partner-grid > *:hover:before { transform: translateY(0); }
	.partner-grid > *:hover img { filter: invert(1); }
}

/* Contact */
.contact-link { will-change: transform; }

@media (max-width: 782px) {
	.admin-bar .scroll-progress { top: 46px; }
}

@media (prefers-reduced-motion: reduce) {
	.orbit { animation: none; }
	.js .reveal { opacity: 1; transform: none; transition: none; }
	.service:before, .partner-grid > *:before, .work-visual strong,
	.work-visual.has-image img, .service b { transition: none; }
}
