/*
Theme Name: Homodimes_Thema
Theme URI: https://homodimes.example/
Author: Homodimes Project
Author URI: https://homodimes.example/
Description: 多次元人類 Homodimes のトップページ用ワードプレステーマ。TOPページのみ対応。
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: homodimes-thema
*/

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400&family=Shippori+Mincho:wght@400;500;600;700;800&family=EB+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&display=swap');

:root {
  --bg: #fafaf8;
  --bg-alt: #f3f2ef;
  --bg-card: #f0efec;
  --text-primary: #1a1a1a;
  --text-secondary: #4a4a4a;
  --text-dim: #9a9a96;
  --accent: #2a5a7a;
  --accent-deep: #1e3a50;
  --accent-line: rgba(42, 90, 122, 0.18);
  --border: rgba(0, 0, 0, 0.06);
  --font-ja: 'Shippori Mincho', 'Yu Mincho', serif;
  --font-en: 'Cormorant Garamond', 'EB Garamond', serif;
  --font-mono: 'Courier New', monospace;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background: var(--bg);
}

body {
  font-family: var(--font-ja);
  color: var(--text-primary);
  background: var(--bg);
  line-height: 1.95;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url('images/noise.svg');
  pointer-events: none;
  z-index: 9999;
}

::-webkit-scrollbar {
  width: 3px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: #c8c8c2;
  border-radius: 2px;
}

#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.2;
}

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 24px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(to bottom, rgba(250, 250, 248, 0.98), rgba(250, 250, 248, 0));
  transition: all 0.5s ease;
}

nav.scrolled {
  padding: 16px 48px;
  background: rgba(250, 250, 248, 0.97);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-family: var(--font-en);
  font-size: 1.17rem;
  font-weight: 400;
  letter-spacing: 0.35em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.nav-logo a {
  color: inherit;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-en);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.3s;
}

.nav-links a:hover {
  color: var(--accent);
}

main {
  position: relative;
  z-index: 1;
}

/* HERO */
.hero {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
  padding: 0 24px;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 200px;
  background: linear-gradient(to bottom, transparent, var(--bg));
}

.hero-eyebrow {
  font-family: var(--font-en);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 36px;
  opacity: 0;
  animation: fadeUp 1.2s ease 0.3s forwards;
}

.hero-title {
  font-family: var(--font-en);
  font-size: clamp(3.5rem, 8vw, 8rem);
  font-weight: 300;
  letter-spacing: 0.12em;
  color: var(--text-primary);
  line-height: 1.05;
  margin-bottom: 28px;
  opacity: 0;
  animation: fadeUp 1.4s ease 0.5s forwards;
}

.hero-sub {
  font-family: var(--font-ja);
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: 0.2em;
  margin-bottom: 56px;
  opacity: 0;
  animation: fadeUp 1.4s ease 0.8s forwards;
}

.hero-line {
  width: 1px;
  height: 72px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  opacity: 0;
  animation: fadeIn 1.5s ease 1.2s forwards;
}

.hero-scroll {
  position: absolute;
  bottom: 48px;
  font-family: var(--font-en);
  font-size: 0.58rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-dim);
  writing-mode: vertical-rl;
  opacity: 0;
  animation: fadeIn 1.5s ease 1.5s forwards;
  z-index: 2;
}

/* SECTIONS */
section {
  padding: 120px 0;
}

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 40px;
}

.section-num {
  font-family: var(--font-en);
  font-size: 0.62rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 16px;
  display: block;
}

.section-title {
  font-family: var(--font-en);
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 300;
  letter-spacing: 0.06em;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 12px;
}

.section-title-ja {
  font-family: var(--font-ja);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: 0.2em;
  margin-bottom: 52px;
}

.divider-c {
  width: 40px;
  height: 1px;
  background: var(--accent-line);
  margin: 52px auto;
}

.body-text {
  font-size: 0.95rem;
  line-height: 2.2;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
}

.body-text p {
  margin-bottom: 24px;
}

.body-text p:last-child {
  margin-bottom: 0;
}

.body-text strong {
  color: var(--text-primary);
  font-weight: 500;
}

.emphasis {
  border-left: 2px solid var(--accent);
  padding-left: 28px;
  margin: 48px 0;
  font-style: italic;
  color: var(--accent-deep);
  font-size: 1rem;
  line-height: 2.1;
}

/* TIMELINE */
.timeline {
  display: flex;
  justify-content: center;
  gap: 0;
  margin: 56px 0;
  position: relative;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 12%;
  right: 12%;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--accent-line), var(--accent-line), transparent);
}

.tl-item {
  flex: 1;
  text-align: center;
  padding: 28px 12px;
  position: relative;
}

.tl-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-dim);
  margin: 0 auto 16px;
  position: relative;
  z-index: 1;
}

.tl-item.active .tl-dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(42, 90, 122, 0.2);
}

.tl-en {
  font-family: var(--font-en);
  font-size: 1.36rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.tl-ja {
  font-family: var(--font-ja);
  font-size: 0.85rem;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
}

.tl-item.active .tl-ja {
  color: var(--accent);
  font-weight: 600;
}

/* ATTRIBUTES */
.attr-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 24px 0 52px;
  border-top: 1px solid var(--border);
}

.attr {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}

.attr:hover {
  background: var(--bg-alt);
}

.attr-num {
  font-family: var(--font-en);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  flex-shrink: 0;
}

.attr strong {
  font-family: var(--font-ja);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 3px;
}

.attr p {
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.6;
  letter-spacing: 0.02em;
}

@media (max-width: 768px) {
  .attr-grid {
    grid-template-columns: 1fr;
  }
}

/* FORMULA */
.formula-box {
  text-align: center;
  padding: 56px 0;
  margin: 48px 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  position: relative;
}

.formula-box::before,
.formula-box::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: var(--accent-line);
  border-style: solid;
}

.formula-box::before {
  top: 10px;
  left: 10px;
  border-width: 1px 0 0 1px;
}

.formula-box::after {
  bottom: 10px;
  right: 10px;
  border-width: 0 1px 1px 0;
}

.formula-main {
  font-family: var(--font-en);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 300;
  color: var(--text-primary);
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.formula-main .op {
  color: var(--accent);
  font-weight: 500;
}

.formula-label {
  font-family: var(--font-en);
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* PULLQUOTE */
.pullquote {
  text-align: center;
  margin: 64px 0;
  padding: 48px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.pullquote p {
  font-family: var(--font-ja);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.15em;
}

.pullquote .sub {
  font-family: var(--font-en);
  font-size: 0.72rem;
  font-weight: 300;
  font-style: italic;
  color: var(--text-dim);
  margin-top: 10px;
  letter-spacing: 0.1em;
}

/* DECLARATION */
.decl-section {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.decl-text {
  font-family: var(--font-ja);
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 2.4;
  letter-spacing: 0.08em;
  text-align: center;
  max-width: 620px;
  margin: 0 auto;
}

.decl-text .hl {
  color: var(--accent);
  font-weight: 600;
}

.decl-desktop-text {
  display: inline;
}

.decl-mobile-text {
  display: none;
}

/* FOOTER */
footer {
  padding: 72px 0 40px;
  text-align: center;
  border-top: 1px solid var(--border);
}

.footer-logo {
  font-family: var(--font-en);
  font-size: 1.2rem;
  font-weight: 300;
  letter-spacing: 0.25em;
  color: var(--text-dim);
  margin-bottom: 20px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.footer-links a {
  font-family: var(--font-en);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.3s;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-copy {
  font-family: var(--font-en);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  opacity: 0.5;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Hide mobile menu on desktop */
.menu-toggle,
.mobile-menu {
  display: none;
}

@media (max-width: 768px) {
  #definition .container {
    padding-left: 10px;
    padding-right: 16px;
  }

  #definition .attr {
    padding-left: 12px;
    padding-right: 16px;
  }

  .nav-logo {
    font-size: 0.65rem;
    letter-spacing: 0.24em;
  }

  nav {
    padding: 12px 16px;
  }

  .hero::after {
    height: 160px;
  }

  .hero-sub {
    margin-bottom: 44px;
  }

  .nav-links {
    display: none;
  }

  .container {
    padding: 0 16px;
  }

  section {
    padding: 56px 0;
  }

  .hero {
    padding: 0 16px;
  }

  .timeline {
    margin: 32px 0;
  }

  .timeline {
    flex-direction: column;
  }

  .timeline::before {
    display: none;
  }

  .tl-item {
    padding: 16px 8px;
  }

  .menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 26px;
    height: 26px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 200;
    position: relative;
  }

  .menu-toggle span {
    display: block;
    width: 100%;
    height: 1px;
    background: var(--text-dim);
    transition: all 0.3s ease;
  }

  .menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
    background: var(--text-primary);
  }

  .menu-toggle.active span:nth-child(2) {
    transform: rotate(-45deg) translate(5px, -5px);
    background: var(--text-primary);
  }

  .mobile-menu {
    position: fixed;
    inset: 0;
    background: rgba(250, 250, 248, 0.98);
    backdrop-filter: blur(20px);
    z-index: 150;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
  }

  .mobile-menu.active {
    opacity: 1;
    pointer-events: all;
  }

  .mobile-menu a {
    font-family: var(--font-en);
    font-size: 0.475rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-primary);
    text-decoration: none;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
  }

  .mobile-menu.active a {
    opacity: 1;
    transform: translateY(0);
  }

  .mobile-menu.active a:nth-child(1) { transition-delay: 0.1s; }
  .mobile-menu.active a:nth-child(2) { transition-delay: 0.2s; }
  .mobile-menu.active a:nth-child(3) { transition-delay: 0.3s; }
  .mobile-menu.active a:nth-child(4) { transition-delay: 0.4s; }

  .decl-desktop-text {
    display: none;
  }

  .decl-mobile-text {
    display: inline;
  }

  .decl-text {
    font-size: 0.9rem;
    line-height: 2;
    letter-spacing: 0.03em;
  }
}
