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

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

:root {
  --black: #0a0a0c;
  --black-warm: #12101a;
  --white: #e8e4df;
  --white-dim: #b8b2a8;
  --red: #8b2d3a;
  --red-light: #c44058;
  --red-glow: rgba(196, 64, 88, 0.25);
  --red-deep: #5a1a28;
  --cream: #d4cec4;
  --gold-dim: #8a7d5a;
  --gray: #5a5555;
  --gray-dark: #1e1c22;
  --gray-darker: #15131a;
  --serif: 'Cormorant Garamond', 'Georgia', serif;
  --sans: 'Raleway', 'Segoe UI', system-ui, sans-serif;
}

body {
  font-family: var(--sans);
  background: var(--black);
  color: var(--white);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--red-light); text-decoration: none; transition: all 0.3s; }
a:hover { color: var(--white); }

::selection { background: var(--red-deep); color: var(--white); }

/* === Animations === */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes drawLine {
  from { opacity: 0; width: 0; }
  to { opacity: 1; width: 90px; }
}

@keyframes drawLineSmall {
  from { opacity: 0; width: 0; }
  to { opacity: 1; width: 36px; }
}

@keyframes breathe {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  92% { opacity: 1; }
  93% { opacity: 0.2; }
  94% { opacity: 0.8; }
  96% { opacity: 0.3; }
  97% { opacity: 1; }
}

/* === Navigation === */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2.5rem;
  background: rgba(10, 10, 12, 0.92);
  border-bottom: 1px solid var(--red-deep);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.nav-brand {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--white);
  letter-spacing: 0.06em;
  font-style: italic;
}
.nav-brand:hover { color: var(--red-light); }

.nav-links {
  display: flex;
  list-style: none;
  gap: 2.5rem;
}

.nav-links a {
  color: var(--white-dim);
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--red);
  transition: width 0.3s;
}
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }
.nav-links a:hover,
.nav-links a.active { color: var(--white); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 1px;
  background: var(--white);
  transition: transform 0.2s;
}

/* === Hero === */
.hero {
  position: relative;
  text-align: center;
  padding: 0;
  min-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-image {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  opacity: 0.4;
  filter: saturate(0.3) contrast(1.1);
  transition: opacity 1.5s;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse at center, transparent 30%, var(--black) 80%),
    linear-gradient(to bottom, rgba(10, 10, 12, 0.3) 0%, rgba(10, 10, 12, 0.8) 70%, var(--black) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 4rem 2rem;
}

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.8rem, 7vw, 5rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
  animation: riseUp 1.2s ease-out;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.8);
}

.tagline {
  font-family: var(--serif);
  font-size: 1.3rem;
  color: var(--red-light);
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.08em;
  margin-bottom: 1.5rem;
  animation: riseUp 1.2s ease-out 0.2s both;
}

.subtitle {
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 300;
  color: var(--white-dim);
  max-width: 440px;
  margin: 0 auto;
  letter-spacing: 0.02em;
  animation: riseUp 1.2s ease-out 0.4s both;
}

.version-tag {
  display: inline-block;
  margin-top: 2rem;
  padding: 0.3rem 1.2rem;
  border: 1px solid var(--gray-dark);
  border-radius: 20px;
  font-size: 0.7rem;
  color: var(--gray);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  animation: riseUp 1.2s ease-out 0.6s both;
}

/* === Hexagram (乾 — six solid yang lines) === */
.hexagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 2.5rem;
}

.hexagram .line {
  width: 90px;
  height: 6px;
  background: var(--red);
  border-radius: 3px;
  box-shadow: 0 0 14px var(--red-glow);
  animation: drawLine 0.6s ease-out both;
  transition: transform 0.4s, box-shadow 0.4s;
  cursor: crosshair;
}
.hexagram .line:hover {
  transform: scaleX(1.4);
  box-shadow: 0 0 28px var(--red-glow), 0 0 56px var(--red-glow);
}

.hexagram .line:nth-child(1) { animation-delay: 0.1s; }
.hexagram .line:nth-child(2) { animation-delay: 0.2s; }
.hexagram .line:nth-child(3) { animation-delay: 0.3s; }
.hexagram .line:nth-child(4) { animation-delay: 0.4s; }
.hexagram .line:nth-child(5) { animation-delay: 0.5s; }
.hexagram .line:nth-child(6) { animation-delay: 0.6s; }

.hexagram-small {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  margin-bottom: 1.5rem;
}
.hexagram-small .line {
  width: 36px;
  height: 2px;
  background: var(--red);
  border-radius: 1px;
  box-shadow: 0 0 8px var(--red-glow);
  animation: drawLineSmall 0.5s ease-out both;
}
.hexagram-small .line:nth-child(1) { animation-delay: 0.05s; }
.hexagram-small .line:nth-child(2) { animation-delay: 0.1s; }
.hexagram-small .line:nth-child(3) { animation-delay: 0.15s; }
.hexagram-small .line:nth-child(4) { animation-delay: 0.2s; }
.hexagram-small .line:nth-child(5) { animation-delay: 0.25s; }
.hexagram-small .line:nth-child(6) { animation-delay: 0.3s; }

/* === Divider === */
.divider {
  text-align: center;
  padding: 2rem;
  color: var(--gray);
  font-size: 0.8rem;
  letter-spacing: 0.3em;
}

/* === Apps Section === */
.apps {
  padding: 5rem 2rem;
  text-align: center;
  background: var(--black-warm);
}

.apps h2 {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  letter-spacing: 0.03em;
}

.apps .section-sub {
  font-family: var(--serif);
  color: var(--gray);
  font-size: 1rem;
  font-style: italic;
  margin-bottom: 3rem;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  max-width: 700px;
  margin: 0 auto;
}

.app-card {
  display: block;
  background: var(--gray-darker);
  border: 1px solid #2a2630;
  border-radius: 16px;
  padding: 2.5rem 2rem;
  text-align: center;
  transition: all 0.4s;
  color: var(--white);
  position: relative;
  overflow: hidden;
}
.app-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, var(--red-glow), transparent 70%);
  opacity: 0;
  transition: opacity 0.5s;
}
.app-card:hover::before { opacity: 1; }
.app-card:hover {
  transform: translateY(-6px);
  border-color: var(--red-deep);
  color: var(--white);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
}

.app-icon {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 700;
  font-style: italic;
  margin: 0 auto 1.25rem;
  position: relative;
  z-index: 1;
  transition: transform 0.4s;
}
.app-card:hover .app-icon { animation: float 2.5s ease-in-out infinite; }

.app-icon-nardo {
  background: linear-gradient(135deg, var(--red-deep), var(--red));
  color: var(--white);
  box-shadow: 0 4px 24px var(--red-glow);
}

.app-icon-lm {
  background: linear-gradient(135deg, #2a2630, #3a3540);
  color: var(--white-dim);
  border: 1px solid #3a3540;
}

.app-card h3 {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
}

.app-card p {
  font-size: 0.9rem;
  font-weight: 300;
  color: var(--white-dim);
  margin-bottom: 1.25rem;
  position: relative;
  z-index: 1;
  line-height: 1.7;
}

.app-status {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.35rem 1rem;
  border-radius: 20px;
  position: relative;
  z-index: 1;
}
.app-status.released {
  background: var(--red-deep);
  color: var(--white);
  box-shadow: 0 2px 12px var(--red-glow);
}
.app-status.coming-soon {
  background: transparent;
  border: 1px solid #3a3540;
  color: var(--gray);
  animation: breathe 4s ease-in-out infinite;
}

/* === Lore / Flavor Section === */
.lore {
  padding: 4rem 2rem;
  text-align: center;
  border-top: 1px solid var(--gray-dark);
  border-bottom: 1px solid var(--gray-dark);
  background: var(--black);
}

.lore .whisper {
  font-family: var(--sans);
  font-size: 0.7rem;
  color: var(--gray);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.lore blockquote {
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--cream);
  font-style: italic;
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.9;
}
.lore blockquote em {
  color: var(--white);
  font-style: normal;
  font-weight: 600;
}
.lore .attr {
  margin-top: 1.25rem;
  font-family: var(--sans);
  font-size: 0.75rem;
  color: var(--gray);
  font-style: normal;
  letter-spacing: 0.08em;
}

/* === Philosophy === */
.philosophy {
  text-align: center;
  padding: 4rem 2rem;
}

.philosophy blockquote {
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--gray);
  font-style: italic;
  max-width: 400px;
  margin: 0 auto;
  line-height: 1.9;
}
.philosophy blockquote em { color: var(--cream); font-style: normal; }

/* === Secret / Easter Egg === */
.secret-trigger {
  cursor: help;
  border-bottom: 1px dotted var(--gray-dark);
}
.secret-msg {
  display: none;
  margin-top: 0.75rem;
  font-family: var(--serif);
  font-size: 0.85rem;
  color: var(--red-light);
  font-style: italic;
  animation: flicker 5s infinite;
}
.secret-trigger:hover + .secret-msg { display: block; }

/* === Footer === */
footer {
  border-top: 1px solid var(--gray-dark);
  padding: 2.5rem 2rem;
  text-align: center;
  color: var(--gray);
  font-size: 0.8rem;
}
footer .studio-mark {
  font-family: var(--serif);
  font-size: 0.75rem;
  font-style: italic;
  letter-spacing: 0.1em;
  margin-bottom: 0.3rem;
  color: #3a3540;
}

.footer-links {
  margin-top: 0.75rem;
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}
.footer-links a {
  color: var(--gray);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}
.footer-links a:hover { color: var(--red-light); }

/* === App Detail Pages === */
.app-hero {
  text-align: center;
  padding: 5rem 2rem 3rem;
  position: relative;
}
.app-hero h1 {
  font-family: var(--serif);
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: 0.03em;
}
.app-hero .app-tagline {
  font-family: var(--serif);
  color: var(--red-light);
  font-size: 1.1rem;
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.06em;
  margin-bottom: 2rem;
}
.app-hero .app-description {
  color: var(--white-dim);
  max-width: 520px;
  margin: 0 auto 1.5rem;
  font-size: 0.95rem;
  font-weight: 300;
  line-height: 1.8;
}

.app-store-badge {
  display: inline-block;
  padding: 0.85rem 2.5rem;
  background: var(--white);
  color: var(--black);
  font-weight: 600;
  border-radius: 10px;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  transition: all 0.4s;
}
.app-store-badge:hover {
  background: var(--red);
  color: var(--white);
  box-shadow: 0 4px 28px var(--red-glow);
  transform: scale(1.04);
}

.app-features {
  max-width: 520px;
  margin: 0 auto;
  padding: 3rem 2rem;
}
.app-features h2 {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  text-align: center;
}
.feature-list {
  list-style: none;
  display: grid;
  gap: 1rem;
}
.feature-list li {
  padding: 1.25rem 1.5rem;
  background: var(--gray-darker);
  border-radius: 10px;
  border-left: 2px solid var(--red-deep);
  font-size: 0.9rem;
  font-weight: 300;
  color: var(--white-dim);
  transition: all 0.4s;
}
.feature-list li:hover {
  border-left-color: var(--red);
  transform: translateX(8px);
  color: var(--white);
  box-shadow: -4px 0 16px var(--red-glow);
}

/* === Policy Pages === */
.policy {
  max-width: 660px;
  margin: 0 auto;
  padding: 3rem 2rem;
}
.policy h1 {
  font-family: var(--serif);
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.policy .policy-date { color: var(--gray); margin-bottom: 2rem; font-size: 0.85rem; letter-spacing: 0.03em; }
.policy h2 {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 600;
  margin: 2.5rem 0 0.75rem;
  color: var(--white);
}
.policy p { color: var(--white-dim); margin-bottom: 1rem; line-height: 1.8; font-weight: 300; }
.policy a { color: var(--red-light); }

/* === Support Page === */
.support {
  max-width: 480px;
  margin: 0 auto;
  padding: 5rem 2rem;
  text-align: center;
}
.support h1 {
  font-family: var(--serif);
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
}
.support .support-sub {
  font-family: var(--serif);
  color: var(--gray);
  font-size: 1rem;
  font-style: italic;
  margin-bottom: 2.5rem;
}
.support .email-link {
  display: inline-block;
  padding: 0.85rem 2.5rem;
  background: var(--red-deep);
  color: var(--white);
  font-weight: 600;
  border-radius: 10px;
  font-size: 0.95rem;
  transition: all 0.4s;
  box-shadow: 0 4px 20px var(--red-glow);
}
.support .email-link:hover {
  background: var(--red);
  color: var(--white);
  transform: scale(1.04);
  box-shadow: 0 6px 28px var(--red-glow);
}

.support-apps {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--gray-dark);
  color: var(--gray);
}
.support-apps h2 {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
.support-apps p { margin-bottom: 0.5rem; font-weight: 300; }

/* === Error Page === */
.error-hex .line {
  background: var(--gray) !important;
  box-shadow: none !important;
}

/* === Mobile === */
@media (max-width: 640px) {
  .nav { padding: 1rem 1.5rem; }
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--black);
    border-bottom: 1px solid var(--red-deep);
    padding: 1.5rem 2rem;
    gap: 1.25rem;
  }
  .nav.open .nav-links { display: flex; }
  .hero { min-height: 80vh; }
  .hero h1 { font-size: 2.4rem; }
  .app-grid { grid-template-columns: 1fr; }
  .app-hero h1 { font-size: 2.2rem; }
  .apps { padding: 3rem 1.5rem; }
}
