@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Noto+Sans+JP:wght@400;500;700&family=Noto+Sans+KR:wght@400;500;700&display=swap');

.material-symbols-rounded {
  font-family: 'Material Symbols Rounded';
  font-weight: normal;
  font-style: normal;
  font-size: 1.2em;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  direction: ltr;
  vertical-align: middle;
  font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
  user-select: none;
}

:root {
  --bg-1: #f7fbff;
  --bg-2: #e7f5ff;
  --ink: #0f172a;
  --muted: #475569;
  --card: rgba(255, 255, 255, 0.86);
  --border: rgba(15, 23, 42, 0.12);
  --accent: #0f766e;
  --accent-2: #0ea5e9;
  --accent-3: #1d4ed8;
  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --shadow: 0 22px 46px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: 'Outfit', 'Noto Sans JP', 'Segoe UI', sans-serif;
  background:
    radial-gradient(1020px 600px at 12% -6%, rgba(14, 165, 233, 0.14) 0%, transparent 58%),
    radial-gradient(860px 520px at 95% -2%, rgba(29, 78, 216, 0.12) 0%, transparent 60%),
    linear-gradient(152deg, var(--bg-1) 0%, var(--bg-2) 100%);
}

.bg-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(540px 360px at 8% 12%, rgba(14, 165, 233, 0.14) 0%, transparent 72%),
    radial-gradient(460px 320px at 88% 18%, rgba(15, 118, 110, 0.14) 0%, transparent 72%),
    radial-gradient(380px 280px at 50% 96%, rgba(251, 191, 36, 0.11) 0%, transparent 78%);
  animation: ambient-shift 18s ease-in-out infinite alternate;
}

.landing-view {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  align-content: center;
  gap: 18px;
}

.hero-card {
  border: 1px solid var(--border);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(239, 246, 255, 0.9));
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: clamp(18px, 4vw, 34px);
  display: flex;
  gap: clamp(24px, 5vw, 52px);
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero-card::after {
  content: '';
  position: absolute;
  width: 280px;
  height: 280px;
  right: -120px;
  top: -120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.24) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  flex: 1;
  min-width: 0;
}

.hero-features {
  list-style: none;
  margin: 16px 0 14px;
  padding: 0;
  display: grid;
  gap: 8px;
}

.hero-features li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: #334155;
  font-weight: 500;
}

.hero-features li .material-symbols-rounded {
  font-size: 1.25rem;
  color: var(--accent);
  flex-shrink: 0;
}

.hero-visual {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  animation: float-card 5s ease-in-out infinite;
}

.hero-char-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  transform: rotate(-4deg);
}

.hero-char-grid span {
  font-family: 'Noto Sans JP', 'Noto Sans KR', sans-serif;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 700;
  line-height: 1;
  width: 2.8em;
  height: 2.8em;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.07) 0%, rgba(14, 165, 233, 0.07) 100%);
  border: 1.5px solid rgba(15, 118, 110, 0.16);
  border-radius: 18px;
  color: #1e293b;
}

.hero-char-grid span:nth-child(2),
.hero-char-grid span:nth-child(4) {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.07) 0%, rgba(99, 102, 241, 0.07) 100%);
  border-color: rgba(14, 165, 233, 0.18);
}

.hero-kicker {
  margin: 0;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  text-transform: uppercase;
  color: #0f766e;
  font-weight: 700;
}

.hero-title {
  margin: 8px 0;
  display: grid;
  gap: 4px;
  line-height: 1.04;
}

.hero-title-en {
  display: block;
  font-size: clamp(2rem, 5.1vw, 3.3rem);
  letter-spacing: -0.02em;
}

.hero-title-ja,
.hero-title-sub {
  display: block;
  font-size: clamp(1.1rem, 2.8vw, 1.8rem);
  letter-spacing: -0.01em;
  color: #172554;
  font-weight: 500;
}

.hero-subtitle {
  margin: 0;
  max-width: 62ch;
  color: #334155;
  line-height: 1.45;
}

.hero-tags {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-tags span {
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(204, 251, 241, 0.56);
  color: #115e59;
  font-size: 0.82rem;
  font-weight: 600;
}

.trust-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.trust-item {
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
  padding: 12px;
}

.trust-value {
  margin: 0;
  font-size: 1rem;
  color: #0b4a6f;
  font-weight: 800;
}

.trust-label {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: #475569;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.home-support-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid rgba(15, 118, 110, 0.28);
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(204, 251, 241, 0.6), rgba(186, 230, 253, 0.45));
  padding: clamp(14px, 3vw, 22px) clamp(16px, 3.5vw, 28px);
  box-shadow: var(--shadow);
}

.home-support-banner-text {
  display: grid;
  gap: 4px;
}

.home-support-kicker {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #0f766e;
}

.home-support-body {
  margin: 0;
  font-size: 0.9rem;
  color: #334155;
  max-width: 54ch;
  line-height: 1.45;
}

.home-support-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #0f766e;
  color: #fff;
  border-radius: 999px;
  padding: 10px 22px;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 150ms;
  white-space: nowrap;
}

.home-support-btn:hover {
  background: #0d6b64;
}

.seo-content {
  border: 1px solid var(--border);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.95), rgba(239, 246, 255, 0.9));
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: clamp(16px, 3vw, 26px);
  display: grid;
  gap: 14px;
}

.seo-content h2,
.seo-content h3 {
  margin: 0;
  color: #0f172a;
}

.seo-content > p {
  margin: 0;
  color: #334155;
  line-height: 1.55;
  max-width: 78ch;
}

.seo-content-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.seo-card {
  border: 1px solid rgba(15, 118, 110, 0.2);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.72);
  display: grid;
  gap: 8px;
}

.seo-card p {
  margin: 0;
  color: #334155;
  line-height: 1.5;
  font-size: 0.92rem;
}

.seo-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.seo-links a {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.1);
  border: 1px solid rgba(15, 118, 110, 0.22);
  color: #0f766e;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
}

.seo-links a:hover {
  background: rgba(15, 118, 110, 0.16);
}

.seo-faq {
  border-top: 1px solid rgba(15, 23, 42, 0.1);
  padding-top: 8px;
}

.seo-faq dl {
  margin: 0;
  display: grid;
  gap: 8px;
}

.seo-faq dt {
  font-weight: 700;
  color: #0f172a;
}

.seo-faq dd {
  margin: 0;
  color: #334155;
  line-height: 1.45;
}

.multilingual-seo {
  border-top: 1px solid rgba(15, 23, 42, 0.1);
  padding-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.multilingual-card {
  border: 1px solid rgba(14, 116, 144, 0.2);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.75);
  padding: 12px;
  display: grid;
  gap: 8px;
}

.multilingual-card h3 {
  color: #0c4a6e;
}

.multilingual-card p {
  margin: 0;
  color: #334155;
  line-height: 1.6;
  font-size: 0.92rem;
}

.menu-card {
  position: relative;
  text-align: left;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(241, 245, 249, 0.88) 100%);
  padding: 16px;
  display: grid;
  gap: 8px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.menu-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.14);
  border-color: rgba(14, 165, 233, 0.42);
}

.menu-card.is-empty {
  border-style: dashed;
  opacity: 0.76;
}

.menu-progress {
  position: absolute;
  top: 12px;
  right: 12px;
  left: auto;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  border: 1px solid rgba(14, 165, 233, 0.25);
  background: rgba(224, 242, 254, 0.9);
  color: #075985;
  font-weight: 700;
}

.menu-progress::after {
  content: ' completed';
  font-weight: 600;
}

.menu-kicker {
  margin: 0;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0f766e;
  font-weight: 700;
}

.menu-card h2 {
  margin: 0;
  font-size: 1.2rem;
  padding-right: 126px;
}

.menu-card p {
  margin: 0;
  color: #334155;
}

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(294px, 352px) 1fr;
  gap: 16px;
}

.settings-panel,
.workspace-panel {
  border: 1px solid var(--border);
  background: var(--card);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.settings-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  max-height: calc(100vh - 32px);
  overflow: auto;
}

.workspace-panel {
  min-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
}

.brand-block h1 {
  margin: 4px 0;
  font-size: 1.48rem;
  letter-spacing: -0.01em;
}

.brand-block .muted {
  margin: 0;
  color: var(--muted);
}

.label {
  margin: 0;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
}

.settings-card {
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.92);
  border-radius: var(--radius-lg);
  padding: 12px;
}

.settings-card h2 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.toggle-list {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
}

.switch-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 8px 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  background: #fbfdff;
}

.setting-label {
  color: #1f2937;
  font-weight: 600;
}

.switch-row input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-ui {
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: #d1d5db;
  position: relative;
  flex-shrink: 0;
  transition: background 180ms ease;
}

.switch-ui::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.2);
  transition: transform 180ms ease;
}

.switch-row input:checked + .switch-ui {
  background: linear-gradient(90deg, #10b981 0%, #0ea5e9 100%);
}

.switch-row input:checked + .switch-ui::after {
  transform: translateX(19px);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.stats-grid div {
  border: 1px solid rgba(14, 165, 233, 0.24);
  border-radius: 12px;
  background: rgba(224, 242, 254, 0.74);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stats-grid span {
  font-size: 0.82rem;
  color: #0c4a6e;
}

.stats-grid strong {
  font-size: 1rem;
}

.support-card .muted {
  margin: 0 0 10px;
}

.support-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  border: 1px solid rgba(15, 118, 110, 0.26);
  background: rgba(204, 251, 241, 0.52);
  color: #115e59;
  border-radius: 999px;
  padding: 7px 12px;
  font-weight: 700;
  text-decoration: none;
}

.support-link:hover {
  background: rgba(167, 243, 208, 0.7);
}

.status-pill {
  margin: 0;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(248, 250, 252, 0.95);
  padding: 10px 12px;
  border-radius: 12px;
  color: #334155;
}

#landingView:not(.hidden) ~ footer .footer-support-link,
#languageView:not(.hidden) ~ footer .footer-support-link {
  display: none;
}

.site-footer {
  position: relative;
  z-index: 1;
  padding: 0 16px 18px;
}

.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.1);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.footer-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: #0f172a;
}

.footer-note {
  margin: 4px 0 0;
  color: #475569;
  font-size: 0.88rem;
  line-height: 1.35;
}

.footer-links {
  margin-top: 8px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-links a {
  color: #0f766e;
  font-size: 0.82rem;
  text-decoration: none;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 999px;
  padding: 3px 9px;
  background: rgba(204, 251, 241, 0.38);
}

.footer-links a:hover {
  background: rgba(167, 243, 208, 0.56);
}

.footer-meta {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.footer-support-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(14, 165, 233, 0.3);
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(224, 242, 254, 0.8);
  color: #0369a1;
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
}

.footer-support-link:hover {
  background: rgba(186, 230, 253, 0.92);
}

.footer-legal {
  margin: 0;
  color: #64748b;
  font-size: 0.8rem;
}

.workspace-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.workspace-header-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.workspace-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 1;
  min-width: 400px;
}

.workspace-title h2 {
  margin: 4px 0 0;
  font-family: 'Noto Sans KR', 'Noto Sans JP', sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
  min-width: 1.3em;
}

.ghost-btn {
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: rgba(255, 255, 255, 0.94);
  color: #0f172a;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.letter-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 260px) auto auto auto;
  gap: 8px;
  align-items: center;
}

.letter-toolbar select {
  width: 100%;
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 12px;
  height: 42px;
  padding: 7px 10px;
  background: white;
  font: inherit;
}

.toolbar-btn {
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: #f8fafc;
  color: #0f172a;
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.toolbar-btn.primary {
  border-color: transparent;
  background: linear-gradient(92deg, var(--accent) 0%, var(--accent-2) 100%);
  color: white;
}

.trace-view,
.pronunciation-view {
  flex: 1;
  padding: 14px;
}

.trace-stage {
  position: relative;
  width: min(100%, 840px);
  margin: 0 auto;
}

.canvas-shell {
  width: min(100%, 840px);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  max-height: calc(100vh - 248px);
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  overflow: hidden;
}

#tracingCanvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.canvas-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: rgba(248, 250, 252, 0.92);
  color: #0f172a;
  border-radius: 12px;
  width: 44px;
  height: 44px;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.canvas-nav-btn .material-symbols-rounded {
  font-size: 1.6rem;
}

.canvas-nav-btn.left {
  left: 0;
}

.canvas-nav-btn.right {
  right: 0;
}

.pronunciation-head h3 {
  margin: 0;
  font-size: 1.42rem;
}

.pronunciation-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.pronunciation-rows {
  margin-top: 12px;
  display: grid;
  gap: 14px;
}

.pron-section {
  display: grid;
  gap: 8px;
}

.pron-section-head {
  margin: 2px 0;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0f766e;
}

.pron-row {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 10px;
  align-items: stretch;
}

.play-row-btn {
  border-radius: 14px;
  border: 1px solid rgba(14, 116, 144, 0.22);
  background: linear-gradient(180deg, #ecfeff, #dbeafe);
  color: #0f172a;
  font-size: 1rem;
  font-weight: 800;
}

.pron-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
}

.pron-card-btn {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  padding: 12px 10px;
  display: grid;
  justify-items: center;
  gap: 4px;
  min-height: 114px;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.pron-card-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
  border-color: rgba(14, 165, 233, 0.34);
}

.pron-char {
  font-family: 'Noto Sans KR', 'Noto Sans JP', sans-serif;
  font-size: 2rem;
  line-height: 1;
}

.pron-roman {
  font-size: 0.98rem;
  color: #334155;
}

.pron-play-hint {
  margin-top: 2px;
  font-size: 0.74rem;
  color: #0369a1;
  letter-spacing: 0.02em;
}

.transition-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.34);
  backdrop-filter: blur(3px);
}

.transition-card {
  width: min(90vw, 360px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.2);
  padding: 14px;
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
}

.loader-ring {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(14, 165, 233, 0.22);
  border-top-color: #0ea5e9;
  animation: spin 900ms linear infinite;
}

.ad-slot {
  width: 100%;
  min-height: 52px;
  border: 1px dashed rgba(15, 23, 42, 0.22);
  border-radius: 10px;
  background: #f8fafc;
  color: #475569;
  font-size: 0.8rem;
  display: grid;
  place-items: center;
  padding: 8px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes ambient-shift {
  0% {
    transform: translateY(0px);
  }
  100% {
    transform: translateY(-10px);
  }
}

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

.support-nudge {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #0f172a;
  color: #f1f5f9;
  border-radius: 12px;
  padding: 12px 16px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.35);
  max-width: min(90vw, 460px);
  animation: nudge-in 300ms ease;
}

.support-nudge.hidden {
  display: none;
}

.support-nudge-text {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.4;
  flex: 1;
}

.support-nudge-btn {
  flex-shrink: 0;
  background: #0ea5e9;
  color: #fff;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 150ms;
}

.support-nudge-btn:hover {
  background: #0284c7;
}

.support-nudge-dismiss {
  flex-shrink: 0;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
  padding: 2px 4px;
}

.support-nudge-dismiss:hover {
  color: #f1f5f9;
}

@keyframes nudge-in {
  from { opacity: 0; transform: translateX(-50%) translateY(16px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@media (max-width: 1100px) {
  .site-footer {
    padding: 0 12px 14px;
  }
}

@media (max-width: 720px) {
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-meta {
    justify-items: start;
  }
}

[hidden],
.hidden {
  display: none !important;
}

html.trace-scroll-lock,
html.trace-scroll-lock body {
  overflow: hidden;
  touch-action: none;
  overscroll-behavior: none;
}

button:disabled,
.toolbar-btn:disabled,
.ghost-btn:disabled,
.canvas-nav-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

@media (max-width: 600px) {
  .home-support-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .home-support-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 1100px) {
  .landing-view {
    padding: 12px;
  }

  .trust-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .seo-content-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .menu-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .workspace-panel {
    order: 1;
  }

  .settings-panel {
    order: 2;
  }

  .settings-panel {
    max-height: none;
  }

  .workspace-panel {
    min-height: 68vh;
  }

  .workspace-header-actions {
    min-width: 0;
  }

  .canvas-shell {
    max-height: min(70vh, 620px);
  }

  .canvas-nav-btn.left {
    left: 8px;
  }

  .canvas-nav-btn.right {
    right: 8px;
  }
}

@media (max-width: 860px) {
  .seo-content-grid {
    grid-template-columns: 1fr;
  }

  .multilingual-seo {
    grid-template-columns: 1fr;
  }

  .workspace-header-top {
    align-items: stretch;
    flex-direction: column;
  }

  .workspace-header-actions {
    width: 100%;
    min-width: 0;
    flex-direction: column;
    align-items: stretch;
  }

  .ghost-btn {
    width: 100%;
    text-align: center;
  }

  .letter-toolbar {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .letter-toolbar select {
    grid-column: 1 / -1;
  }

  .canvas-nav-btn {
    width: 40px;
    height: 40px;
    font-size: 1.3rem;
  }
}

/* ─── Language Selector ─────────────────────────────────── */
.lang-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.lang-card {
  position: relative;
  text-align: left;
  border: 2px solid rgba(15, 23, 42, 0.1);
  border-radius: var(--radius-xl);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.97) 0%, rgba(204, 251, 241, 0.28) 100%);
  padding: clamp(18px, 3vw, 28px);
  display: grid;
  gap: 10px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
}

.lang-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.16);
  border-color: rgba(14, 165, 233, 0.52);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.99) 0%, rgba(186, 230, 253, 0.32) 100%);
}

.lang-card--ko {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.97) 0%, rgba(219, 234, 254, 0.28) 100%);
}

.lang-card--ko:hover {
  border-color: rgba(99, 102, 241, 0.52);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.99) 0%, rgba(199, 210, 254, 0.36) 100%);
}

.lang-card-kicker {
  margin: 0;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0f766e;
  font-weight: 700;
}

.lang-card--ko .lang-card-kicker {
  color: #4f46e5;
}

.lang-card-name {
  margin: 0;
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.lang-card-native {
  font-size: 0.62em;
  color: #475569;
  font-weight: 500;
  letter-spacing: 0;
  font-family: 'Noto Sans KR', 'Noto Sans JP', sans-serif;
}

.lang-card-desc {
  margin: 0;
  color: #334155;
  line-height: 1.5;
}

.lang-card-cta {
  font-weight: 700;
  color: #0f766e;
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.lang-card--ko .lang-card-cta {
  color: #4f46e5;
}

/* ─── Back Navigation ────────────────────────────────────── */
.back-nav {
  display: flex;
  align-items: center;
}

.back-btn {
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: rgba(255, 255, 255, 0.9);
  color: #334155;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 150ms, color 150ms;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.back-btn:hover {
  background: rgba(255, 255, 255, 1);
  color: #0f172a;
}

/* ─── Footer: hide support link on root language view ───── */
#languageView:not(.hidden) ~ footer .footer-support-link {
  display: none;
}

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

  .trust-strip {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    display: none;
  }

  .hero-card {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 640px) {
  .app-shell,
  .landing-view {
    padding: 10px;
    gap: 10px;
  }

  .settings-panel,
  .workspace-panel,
  .hero-card,
  .menu-card {
    border-radius: 16px;
  }

  .menu-card h2 {
    padding-right: 110px;
  }

  .menu-progress {
    top: 10px;
    right: 10px;
  }

  .canvas-shell {
    max-height: min(62vh, 520px);
  }

  .canvas-nav-btn.left {
    left: 6px;
  }

  .canvas-nav-btn.right {
    right: 6px;
  }

  .pron-row {
    grid-template-columns: 44px 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bg-layer,
  .hero-visual {
    animation: none;
  }
}

/* ── Coming Soon badge on lang / menu cards ──────────────────────────────── */
.lang-card-coming-soon {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 100px;
  background: rgba(245, 158, 11, 0.13);
  color: #92400e;
  border: 1px solid rgba(245, 158, 11, 0.32);
  pointer-events: none;
}

.menu-card-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 100px;
  background: rgba(245, 158, 11, 0.13);
  color: #92400e;
  border: 1px solid rgba(245, 158, 11, 0.32);
  pointer-events: none;
}

/* ── Toast notifications ─────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 1.75rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
  width: max-content;
  max-width: calc(100vw - 2rem);
}

.toast {
  pointer-events: all;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 20rem;
  max-width: 26rem;
  padding: 0.9rem 1rem 0.9rem 1.1rem;
  background: #1a2236;
  color: #f1f5f9;
  border-radius: 14px;
  box-shadow: 0 10px 32px rgba(15, 23, 42, 0.38), 0 0 0 1px rgba(255, 255, 255, 0.07);
  position: relative;
  overflow: hidden;
  animation: toast-in 0.38s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.toast.is-leaving {
  animation: toast-out 0.22s ease-in both;
}

.toast--construction {
  border-left: 3px solid #f59e0b;
}

.toast--support {
  border-left: 3px solid #0ea5e9;
}

.toast-icon {
  font-size: 1.3rem;
  line-height: 1.1;
  flex-shrink: 0;
  user-select: none;
}

.toast-body {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-weight: 700;
  font-size: 0.875rem;
  line-height: 1.3;
  margin: 0 0 0.2rem;
  color: #f1f5f9;
}

.toast-msg {
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.45;
  margin: 0;
}

.toast-close {
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 2px 4px;
  font-size: 0.85rem;
  line-height: 1;
  flex-shrink: 0;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.toast-close:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.08);
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  transform-origin: left;
  animation: toast-shrink var(--toast-duration, 4000ms) linear both;
}

.toast--construction .toast-progress {
  background: #f59e0b;
  opacity: 0.5;
}

.toast--support .toast-progress {
  background: #0ea5e9;
  opacity: 0.5;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(14px) scale(0.94); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateY(0)   scale(1);    }
  to   { opacity: 0; transform: translateY(8px) scale(0.96); }
}

@keyframes toast-shrink {
  from { width: 100%; }
  to   { width: 0%;   }
}

@media (max-width: 600px) {
  .toast {
    min-width: calc(100vw - 2rem);
    max-width: calc(100vw - 2rem);
  }

  .toast-container {
    bottom: 1rem;
  }
}
