/* Shared site styling (Cursor-like dark palette + narrow "link-tree" layout) */

:root {
  --bg0: #0f0f10;
  --bg1: #0f0f10;
  --panel: rgba(255, 255, 255, 0.032);
  --panel2: rgba(255, 255, 255, 0.050);
  --border: rgba(255, 255, 255, 0.10);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.62);
  --faint: rgba(255, 255, 255, 0.40);
  --accent: #7c5cff;
  --accent2: #3bd3ff;
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.58);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background: radial-gradient(circle at 50% 0%, #161616 0%, var(--bg0) 70%);
  font-family: "Noto Sans JP", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial,
    "Apple Color Emoji", "Segoe UI Emoji";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

/* Subtle depth without a visible "template" gradient. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 10%, rgba(255, 255, 255, 0.04), transparent 60%);
}

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

.lead a {
  color: #c4b5ff;
  text-decoration: underline;
  text-decoration-color: rgba(196, 181, 255, 0.7);
  text-underline-offset: 3px;
  font-weight: 650;
}

.lead a:hover {
  color: #e0ccff;
  text-decoration-color: rgba(224, 204, 255, 0.85);
}

.lead a:focus-visible {
  outline: 2px solid rgba(167, 139, 250, 0.6);
  outline-offset: 3px;
  border-radius: 8px;
}

.wrap {
  max-width: 600px; /* slightly narrower compromise */
  margin: 0 auto;
  padding: 0 22px;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 96px;
  display: flex;
  align-items: center;
  background: rgba(15, 15, 16, 0.86);
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(10px);
}

.nav-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.brand-logo {
  width: 90px;
  height: 90px;
  object-fit: cover; /* crop to fill square (no extra black padding) */
  object-position: center;
  display: block;
}

.brand-text {
  display: inline-block;
}

.nav-links {
  display: flex;
  gap: 18px;
  align-items: center;
}

.nav-link {
  font-size: 13px;
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: 160ms ease;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.07);
}

.nav-link.is-active {
  color: var(--text);
  background: rgba(124, 92, 255, 0.12);
  border-color: rgba(124, 92, 255, 0.30);
}

.hero {
  padding: 34px 0 18px;
}

.hero-title {
  font-size: 2.2rem;
  line-height: 1.15;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
  font-weight: 650;
}

.hero-by {
  font-size: 0.55em;
  font-weight: 650;
  opacity: 0.78;
}

.hero-subtitle {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.hero-note {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 13.5px;
  line-height: 1.5;
}

.site-tagline-wrap {
  padding-top: 12px;
}

.site-tagline {
  font-size: 13px;
  color: #c4b5ff;
  line-height: 1.4;
  text-transform: lowercase;
  letter-spacing: 0.02em;
  font-weight: 500;
  opacity: 0.75;
}

.site-tagline-sub {
  margin-top: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.62);
  line-height: 1.5;
  font-weight: 500;
  opacity: 0.95;
}

.hero-actions {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.search-wrap {
  flex: 1;
  min-width: 220px;
}

.sentence-search {
  width: 100%;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.92);
  padding: 0 12px;
  font-size: 13.5px;
  outline: none;
}

.sentence-search::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.sentence-search:focus {
  border-color: rgba(167, 139, 250, 0.65);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.18);
}

.search-results {
  margin-top: 10px;
  min-height: 18px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.6);
}

.search-note {
  margin-top: 6px;
  margin-left: 8px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.5);
}

.filter-label {
  margin-top: 8px;
  min-height: 16px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.55);
}

.clickable {
  cursor: pointer;
  transition: 160ms ease;
}

.clickable:hover {
  filter: brightness(1.08);
}

.jp-search-hit {
  background: rgba(80, 200, 120, 0.16); /* muted emerald */
  border: 1px solid rgba(126, 226, 168, 0.35);
  padding: 0 6px;
  border-radius: 999px;
}

.jp-search-hit-inline {
  background: rgba(80, 200, 120, 0.18);
  border: 1px solid rgba(126, 226, 168, 0.32);
  padding: 0 3px;
  border-radius: 999px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.flow-row {
  margin-top: 14px;
}

.flow-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0.6rem 1.1rem;
  border-radius: 12px;
  border: 1px solid rgba(124, 92, 255, 0.35);
  background: rgba(124, 92, 255, 0.12);
  color: rgba(255, 255, 255, 0.95);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: 160ms ease;
}

.flow-btn:hover {
  background: rgba(124, 92, 255, 0.18);
  border-color: rgba(124, 92, 255, 0.55);
  transform: translateY(-1px);
}

.flow-btn:active {
  transform: translateY(0);
}

.flow-btn:focus-visible {
  outline: 2px solid rgba(124, 92, 255, 0.65);
  outline-offset: 2px;
}

.furigana-toggle-btn {
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.02);
  color: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
  user-select: none;
  transition: 160ms ease;
}

.furigana-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(124, 92, 255, 0.32);
  transform: translateY(-1px);
}

.furigana-toggle-btn:active {
  transform: translateY(0);
}

.furigana-toggle-btn:focus-visible {
  outline: 2px solid rgba(124, 92, 255, 0.55);
  outline-offset: 2px;
}

.panel {
  background: #161618;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.section {
  padding: 18px;
}

.section + .section {
  margin-top: 18px; /* soft spacing between sections */
}

.section-title {
  margin: 0 0 10px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.08em;
  opacity: 0.85;
  text-transform: uppercase;
}

.panel.section .section-title {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.lead {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.65;
  font-size: 14px;
}

.about-koi {
  margin-top: 10px;
  color: rgba(196, 181, 255, 0.85);
  font-size: 13.5px;
  line-height: 1.55;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  opacity: 0.95;
}

.tree {
  display: grid;
  gap: 10px;
}

.tree-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  background: rgba(255, 255, 255, 0.03);
  transition: 160ms ease;
}

.tree-link:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.045);
}

.tree-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.tree-name {
  font-weight: 650;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.92);
}

.tree-desc {
  font-size: 12.5px;
  color: var(--muted);
}

.tree-right {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.55);
}

.accent-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(124, 92, 255, 0.28);
  background: rgba(124, 92, 255, 0.10);
  color: rgba(255, 255, 255, 0.9);
  font-size: 12.5px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.14);
}

.grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.spaced {
  margin-top: 12px;
}

.jp-stack {
  display: grid;
  gap: 0;
  margin-top: 0;
  background: #161618;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-top: none;
  border-radius: 16px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.jp-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.jp-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.jp-num {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.42);
  text-transform: uppercase;
}

.audio-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.02);
  color: rgba(255, 255, 255, 0.90);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: 140ms ease;
  user-select: none;
}

.audio-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(124, 92, 255, 0.35);
  transform: scale(1.05);
}

.audio-btn:active {
  transform: translateY(1px) scale(1);
}

.audio-btn:focus-visible {
  outline: 2px solid rgba(124, 92, 255, 0.6);
  outline-offset: 2px;
}

.jp-sentence-card {
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  border-radius: 0;
  border: none;
  padding: 18px 16px 16px;
  box-shadow: none;
  font-family: "Noto Sans JP", system-ui, sans-serif;
  transition: all 0.25s ease;
  will-change: transform;
}

.jp-sentence-card:first-child,
.jp-sentence-card:last-child {
  border-radius: 0;
}

.jp-sentence-card:not(:first-child) {
  padding-top: 24px;
}

.jp-sentence-card:not(:last-child) {
  padding-bottom: 24px;
}

.jp-sentence-card:hover {
  background: rgba(255, 255, 255, 0.015);
  transform: translateY(-2px);
  z-index: 1;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.jp-sentence-card.is-playing {
  background: linear-gradient(180deg, rgba(124, 92, 255, 0.12), rgba(124, 92, 255, 0.05));
  box-shadow: inset 0 0 0 1px rgba(124, 92, 255, 0.22);
  transform: scale(1.01);
}

.jp-sentence-card.is-playing .audio-btn {
  box-shadow: 0 0 0 2px rgba(124, 92, 255, 0.36), 0 0 12px rgba(124, 92, 255, 0.30);
  border-color: rgba(124, 92, 255, 0.60);
  background: rgba(124, 92, 255, 0.10);
}

.jp-sentence-card.is-playing .jp-romaji {
  opacity: 1;
}

.jp-sentence-card.is-playing .jp-title {
  text-shadow: 0 0 6px rgba(167, 139, 250, 0.22);
}

.jp-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
  color: rgba(255, 255, 255, 0.95);
}

.jp-meta {
  display: grid;
  gap: 8px;
}

.jp-row {
  font-size: 13.5px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.78);
}

.jp-normal {
  line-height: 1.9;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.92);
}

.jp-hiragana {
  font-size: 14.5px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.96);
}

.jp-romaji {
  color: rgba(255, 255, 255, 0.65) !important;
}

.jp-romaji-pronounce {
  color: #c4b5ff !important; /* lighter lavender-purple */
  opacity: 0.95;
}

.jp-label {
  display: inline-block;
  vertical-align: middle;
  margin-right: 10px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.11);
  padding: 2px 8px;
  border-radius: 999px;
}

.jp-breakdown {
  margin: 12px 0 10px 18px;
  padding: 0;
}

.jp-breakdown li {
  margin: 6px 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.78);
}

.jp-breakdown-title {
  margin-top: 12px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.60);
}

/* Furigana (ruby) styling */
.jp-normal ruby {
  ruby-position: over;
}

.jp-normal ruby rt {
  font-size: 0.78em;
  opacity: 0.90;
  line-height: 1.03;
  font-family: "Noto Sans JP", system-ui, sans-serif;
  transition: opacity 180ms ease;
}

.jp-normal ruby rp {
  font-size: 0.72em;
  opacity: 0.25;
  transition: opacity 180ms ease;
}

.furigana-off .jp-normal ruby rt,
.furigana-off .jp-normal ruby rp {
  opacity: 0;
}

.jp-breakdown-lines {
  margin-top: 8px;
  display: grid;
  gap: 6px;
  padding-left: 2px;
}

.jp-word-line {
  font-size: 13.5px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.78);
}

.jp-word-line strong {
  color: rgba(255, 255, 255, 0.96);
  font-weight: 900;
}

.jp-breakdown strong {
  color: rgba(255, 255, 255, 0.94);
  font-weight: 850;
}

.jp-meaning {
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.72);
  margin-top: 8px;
}

.jp-meaning em {
  font-style: italic; /* highlight meaning */
}

.mini-card {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  background: var(--panel2);
}

.mini-title {
  margin: 0 0 6px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.82);
}

.mini-text {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
}

.footer {
  margin-top: 26px;
  padding: 26px 0 38px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.footer-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.footer-tagline {
  font-size: 13px;
  color: #c4b5ff;
  text-transform: lowercase;
  letter-spacing: 0.02em;
  font-weight: 500;
  opacity: 0.75;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer-logo {
  width: 48px;
  height: 48px;
  object-fit: cover;
  object-position: center;
  flex-shrink: 0;
}

.footer-links {
  display: flex;
  gap: 16px;
  align-items: center;
}

.footer-link {
  font-size: 13px;
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: 160ms ease;
}

.footer-link:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.03);
}

.back-to-top {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.arrow {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
}

@media (max-width: 420px) {
  .grid-two {
    grid-template-columns: 1fr;
  }
  .hero-title {
    font-size: 24px;
  }
}

