/*
Theme Name: Monaural Life
Version: 1.0.0
Author: monaural
Description: Izanami-inspired minimal portfolio theme — smooth scroll, GSAP animations, monotone design
Text Domain: monaural-life
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

/* ===========================
   CSS Variables
   =========================== */
:root {
  --ml-black: #111;
  --ml-dark: #1a1a1a;
  --ml-gray: #888;
  --ml-light: #e8e8e8;
  --ml-white: #fafafa;
  --ml-pure-white: #fff;
  --ml-font: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
  --ml-font-en: 'Inter', var(--ml-font);
  --ml-transition: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ml-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ===========================
   Reset & Base
   =========================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

html.lenis, html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

body {
  font-family: var(--ml-font);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.8;
  color: var(--ml-black);
  background: var(--ml-white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ===========================
   Utility: Reveal animations
   (Initial state set by GSAP — no CSS opacity:0 to avoid
    conflicts with lazy-load plugins)
   =========================== */
[data-reveal] {
  will-change: transform, opacity;
}

/* Split text lines */
.split-line {
  overflow: hidden;
  display: block;
}

.split-line__inner {
  display: block;
  transform: translateY(105%);
  transition: transform 1s var(--ml-ease-out);
}

.split-line__inner.is-revealed {
  transform: translateY(0);
}

/* ===========================
   Layout
   =========================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
}

.container--narrow {
  max-width: 800px;
}

/* ===========================
   Header
   =========================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 28px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  mix-blend-mode: difference;
}

.site-header__logo {
  font-family: var(--ml-font-en);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ml-pure-white);
}

.site-header__nav {
  display: flex;
  gap: 32px;
}

.site-header__nav a {
  font-family: var(--ml-font-en);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ml-pure-white);
  position: relative;
  transition: opacity 0.3s ease;
}

.site-header__nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--ml-pure-white);
  transition: width 0.4s var(--ml-ease-out);
}

.site-header__nav a:hover::after {
  width: 100%;
}

.site-header__nav a:hover {
  opacity: 0.7;
}

/* ===========================
   Hero
   =========================== */
.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--ml-black);
}

.hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
  transform: scale(1.1);
  transition: transform 1.5s var(--ml-ease-out), opacity 1.5s ease;
}

.hero.is-loaded .hero__bg {
  transform: scale(1);
  opacity: 0.85;
}

.hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: var(--ml-pure-white);
}

.hero__title {
  font-family: var(--ml-font-en);
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 300;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 16px;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1.2s ease 0.5s, transform 1.2s var(--ml-ease-out) 0.5s;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
}

.hero.is-loaded .hero__title {
  opacity: 1;
  transform: translateY(0);
}

.hero__subtitle {
  font-size: 0.8rem;
  font-weight: 300;
  letter-spacing: 0.15em;
  opacity: 0;
  transition: opacity 1.2s ease 0.9s;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.4);
}

.hero.is-loaded .hero__subtitle {
  opacity: 0.8;
}

.hero__scroll {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.5);
  font-family: var(--ml-font-en);
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  z-index: 2;
  opacity: 0;
  animation: fadeInScroll 1s ease 1.5s forwards;
}

.hero__scroll::after {
  content: '';
  display: block;
  width: 1px;
  height: 40px;
  background: rgba(255, 255, 255, 0.3);
  margin: 12px auto 0;
  animation: scrollLine 2s ease-in-out infinite;
}

@keyframes fadeInScroll {
  to { opacity: 1; }
}

@keyframes scrollLine {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  51% { transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ===========================
   Section Base
   =========================== */
.section {
  padding: 160px 0;
  position: relative;
}

.section--dark {
  background: #2a2a2a;
  color: var(--ml-pure-white);
}

.section--light {
  background: var(--ml-pure-white);
  color: var(--ml-black);
}

.section__label {
  font-family: var(--ml-font-en);
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  opacity: 0.4;
  margin-bottom: 24px;
}

.section__heading {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 300;
  letter-spacing: 0.05em;
  line-height: 1.6;
  margin-bottom: 32px;
}

.section__heading--en {
  font-family: var(--ml-font-en);
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  font-weight: 200;
  letter-spacing: 0.08em;
}

.section__text {
  font-size: 0.9rem;
  line-height: 2.4;
  color: var(--ml-gray);
  max-width: 560px;
  letter-spacing: 0.03em;
}

.section--dark .section__text {
  color: rgba(255, 255, 255, 0.5);
}

/* ===========================
   Concept Section
   =========================== */
.concept {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.concept__tagline {
  font-family: var(--ml-font-en);
  font-size: clamp(1.2rem, 2.5vw, 2rem);
  font-weight: 200;
  letter-spacing: 0.1em;
  line-height: 2;
  margin-bottom: 40px;
}

.concept__body {
  font-size: 0.85rem;
  line-height: 2.6;
  color: var(--ml-gray);
  max-width: 520px;
  letter-spacing: 0.04em;
}

/* ===========================
   Gallery Section
   =========================== */
.gallery {
  padding: 120px 0;
}

.gallery__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
}

.gallery__item {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  cursor: pointer;
}

.gallery__item--tall {
  aspect-ratio: 3 / 4;
  grid-row: span 2;
}

.gallery__item--wide {
  aspect-ratio: 16 / 9;
  grid-column: span 2;
}

.gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s var(--ml-ease-out);
}

.gallery__item:hover img {
  transform: scale(1.05);
}

.gallery__item__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background 0.4s ease;
}

.gallery__item:hover .gallery__item__overlay {
  background: rgba(0, 0, 0, 0.1);
}

/* Parallax image (fullwidth between gallery rows) */
.gallery__parallax {
  position: relative;
  width: 100%;
  height: 60vh;
  overflow: hidden;
  margin: 4px 0;
}

.gallery__parallax img {
  position: absolute;
  top: -15%;
  left: 0;
  width: 100%;
  height: 130%;
  object-fit: cover;
  will-change: transform;
}

/* ===========================
   Blog Section
   =========================== */
.blog-section {
  background: var(--ml-pure-white);
}

.blog__list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  margin-top: 60px;
}

.blog__item {
  display: block;
  transition: opacity 0.3s ease;
}

.blog__item:hover {
  opacity: 0.7;
}

.blog__item__thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 2px;
  margin-bottom: 16px;
  background: var(--ml-light);
}

.blog__item__title {
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.8;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.blog__item__date {
  font-family: var(--ml-font-en);
  font-size: 0.7rem;
  color: var(--ml-gray);
  letter-spacing: 0.05em;
}

.blog__more {
  display: inline-block;
  margin-top: 60px;
  font-family: var(--ml-font-en);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ml-black);
  position: relative;
  padding-bottom: 4px;
}

.blog__more::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--ml-black);
  transform: scaleX(0.3);
  transform-origin: left;
  transition: transform 0.5s var(--ml-ease-out);
}

.blog__more:hover::after {
  transform: scaleX(1);
}

/* ===========================
   Footer
   =========================== */
.site-footer {
  background: var(--ml-dark);
  color: rgba(255, 255, 255, 0.6);
  padding: 80px 40px;
  text-align: center;
}

.site-footer__logo {
  font-family: var(--ml-font-en);
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--ml-pure-white);
  margin-bottom: 24px;
}

.site-footer__tagline {
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  margin-bottom: 32px;
  opacity: 0.5;
}

.site-footer__sns {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 32px;
}

.site-footer__sns a {
  color: rgba(255, 255, 255, 0.4);
  transition: color 0.3s ease;
}

.site-footer__sns a:hover {
  color: var(--ml-pure-white);
}

.site-footer__copy {
  font-family: var(--ml-font-en);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  opacity: 0.3;
}

/* ===========================
   Lightbox
   =========================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.lightbox.is-active {
  opacity: 1;
  visibility: visible;
}

.lightbox__img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
}

.lightbox__close {
  position: absolute;
  top: 24px;
  right: 32px;
  color: var(--ml-pure-white);
  font-size: 1.5rem;
  opacity: 0.5;
  transition: opacity 0.3s ease;
}

.lightbox__close:hover {
  opacity: 1;
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ml-pure-white);
  font-size: 1.5rem;
  opacity: 0.4;
  transition: opacity 0.3s ease;
  padding: 20px;
}

.lightbox__nav:hover {
  opacity: 1;
}

.lightbox__nav--prev {
  left: 20px;
}

.lightbox__nav--next {
  right: 20px;
}

/* ===========================
   Responsive: Tablet
   =========================== */
@media (max-width: 1024px) {
  .container {
    padding: 0 32px;
  }

  .site-header {
    padding: 24px 32px;
  }

  .section {
    padding: 120px 0;
  }

  .gallery__grid {
    gap: 3px;
  }

  .blog__list {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
  }
}

/* ===========================
   Responsive: Mobile
   =========================== */
@media (max-width: 768px) {
  .container {
    padding: 0 20px;
  }

  .site-header {
    padding: 20px;
  }

  .site-header__nav {
    gap: 20px;
  }

  .site-header__nav a {
    font-size: 0.6rem;
  }

  .section {
    padding: 100px 0;
  }

  .hero__scroll {
    bottom: 30px;
  }

  .concept__tagline {
    font-size: 1.1rem;
    line-height: 2.2;
  }

  .gallery__grid {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .gallery__item--wide {
    grid-column: span 1;
  }

  .gallery__item--tall {
    grid-row: span 1;
    aspect-ratio: 4 / 3;
  }

  .gallery__parallax {
    height: 40vh;
  }

  .blog__list {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .site-footer {
    padding: 60px 20px;
  }

  .lightbox__nav--prev {
    left: 10px;
  }

  .lightbox__nav--next {
    right: 10px;
  }
}

@media (max-width: 480px) {
  .site-header__logo {
    font-size: 0.7rem;
  }

  .section {
    padding: 80px 0;
  }

  .concept__body {
    font-size: 0.8rem;
    line-height: 2.4;
  }

  .blog__item__title {
    font-size: 0.75rem;
  }
}

/* ===========================
   WordPress: Admin bar
   =========================== */
.admin-bar .site-header {
  top: 32px;
}

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



/* ===========================
   Single Post
   =========================== */
.single-post__hero {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.single-post__hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.single-post__hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  padding: 40px;
  text-align: center;
}

.single-post__hero-date {
  font-family: var(--ml-font-en);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 16px;
}

.single-post__hero-title {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  font-weight: 300;
  letter-spacing: 0.05em;
  line-height: 1.8;
  color: #fff;
  max-width: 700px;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
}

.single-post__date {
  display: block;
  font-family: var(--ml-font-en);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--ml-gray);
  margin-bottom: 12px;
}

.single-post__title {
  font-size: 1.4rem;
  font-weight: 400;
  letter-spacing: 0.03em;
  line-height: 1.8;
  margin-bottom: 40px;
}

.single-post__content {
  font-size: 0.9rem;
  line-height: 2.4;
  color: var(--ml-black);
}

.single-post__content p {
  margin-bottom: 1.8em;
}

.single-post__content img {
  border-radius: 2px;
  margin: 2em 0;
}

.single-post__content h2,
.single-post__content h3 {
  margin-top: 2.5em;
  margin-bottom: 0.8em;
  font-weight: 400;
}

/* ===========================
   Blog Pagination
   =========================== */
.blog__pagination {
  margin-top: 80px;
  text-align: center;
}

.blog__pagination .nav-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.blog__pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  font-family: var(--ml-font-en);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: var(--ml-gray);
  border-radius: 50%;
  transition: all 0.3s ease;
}

.blog__pagination .page-numbers:hover {
  color: var(--ml-black);
  background: var(--ml-light);
}

.blog__pagination .page-numbers.current {
  color: var(--ml-pure-white);
  background: var(--ml-black);
}

.blog__pagination .prev,
.blog__pagination .next {
  width: auto;
  padding: 0 16px;
  font-size: 0.75rem;
}

@media (max-width: 768px) {
  .single-post__hero {
    height: 70vh;
  }

  .single-post__hero-title {
    font-size: 1.1rem;
    padding: 0 16px;
  }

  .single-post__title {
    font-size: 1.2rem;
  }
}
