:root {
  --primary: #ef4f4f;
  --primary-dark: #d64040;
  --secondary: #129b9f;
  --text-main: #1d1d1f;
  --text-sub: #86868b;
  --bg-white: #ffffff;
  --bg-light: #f5f5f7;
  --border: #d2d2d7;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  --max-width: 1100px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

html {
  scroll-behavior: smooth;
}

body {
  color: var(--text-main);
  background-color: var(--bg-white);
  line-height: 1.6;
  overflow-x: hidden;
}

.rubytalk-wrap {
  background: var(--bg-white);
}

main.rubytalk-page,
.legal-modal {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* Legacy header */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  z-index: 1000;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
}

.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.topbar .logo {
  display: flex;
  align-items: center;
  gap: 0;
  text-decoration: none;
}

.topbar .logo img {
  height: 26px;
  width: auto;
  display: block;
}

.topbar nav {
  display: flex;
  gap: 20px;
}

.topbar nav a {
  text-decoration: none;
  color: var(--text-main);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.3s;
  white-space: nowrap;
}

.topbar nav a:hover {
  color: var(--primary);
}

.topbar .header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.topbar .btn-text {
  text-decoration: none;
  color: var(--text-sub);
  font-size: 14px;
}

.topbar .btn-sm {
  padding: 8px 16px;
  border-radius: 99px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s;
}

.topbar .btn-sm.primary {
  background: var(--primary);
  color: white;
}

/* Main Content */
main.rubytalk-page {
  padding-top: 96px;
}

.section {
  padding: 100px 0;
}

.quick-strip.section {
  padding: 28px 0 12px;
}

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

.quick-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 14px;
}

.quick-item strong {
  display: block;
  font-size: 16px;
  margin-bottom: 4px;
}

.quick-item span {
  font-size: 13px;
  color: var(--text-sub);
}

.bg-light {
  background-color: var(--bg-light);
}

.section-title {
  text-align: center;
  margin-bottom: 60px;
}

.section-title h2 {
  font-size: 42px;
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -1px;
}

.section-title p {
  font-size: 18px;
  color: var(--text-sub);
}

/* Hero */
.hero {
  padding: 80px 0 120px;
  background: radial-gradient(circle at 80% 20%, rgba(239, 79, 79, 0.05) 0%, transparent 40%);
}

.hero .container {
  display: flex;
  align-items: center;
  gap: 60px;
}

.hero-content {
  flex: 1.2;
}

.badge {
  display: inline-block;
  background: rgba(239, 79, 79, 0.1);
  color: var(--primary);
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: 64px;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 24px;
  letter-spacing: -2px;
  word-break: keep-all;
}

.hero p {
  font-size: 20px;
  color: var(--text-sub);
  margin-bottom: 18px;
}

.hero-rotator {
  display: inline-block;
  color: var(--primary-dark);
  transition: opacity 0.32s ease, transform 0.32s ease;
  word-break: keep-all;
}

.hero-rotator.fade {
  opacity: 0;
  transform: translateY(8px);
}

.hero-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
}

.hero-proof span {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #d9dce3;
  background: #fff;
  color: #4a4d53;
  font-size: 13px;
  font-weight: 700;
}

.cta-group {
  display: flex;
  gap: 16px;
}

.btn-store {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #000;
  color: white;
  padding: 12px 24px;
  border-radius: 12px;
  text-decoration: none;
  transition: transform 0.3s;
}

.btn-store:hover {
  transform: translateY(-5px);
}

.btn-store img {
  height: 24px;
}

.btn-store span {
  font-weight: 600;
}

.hero-image {
  flex: 0.8;
  position: relative;
}

.phone-mockup {
  position: relative;
  width: 320px;
  margin: 0 auto;
}

.phone-mockup-single img {
  width: 100%;
  display: block;
  border-radius: 36px;
  box-shadow: 0 32px 80px rgba(16, 24, 40, 0.18);
}

.phone-screen {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 19.5;
  border-radius: 42px;
  overflow: hidden;
  border: 9px solid #0e1014;
  box-shadow: 0 32px 80px rgba(16, 24, 40, 0.18);
  background: #12151b;
  z-index: 1;
}

.phone-screen::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 118px;
  height: 22px;
  background: #0c0f14;
  border-radius: 0 0 14px 14px;
  z-index: 3;
}

.hero-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.55s ease;
}

.hero-slide.is-active {
  opacity: 1;
  z-index: 1;
}

.floating-item {
  position: absolute;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  padding: 10px 16px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.09);
  border: 1px solid #d7dce5;
  white-space: nowrap;
  z-index: 12;
}

.floating-item img {
  width: 24px;
  height: 24px;
}

.floating-item span {
  font-weight: 700;
  font-size: 13px;
}

.f1 { top: 10%; left: -46%; animation: float 6s ease-in-out infinite; }
.f2 { top: 34%; right: -44%; animation: float 6s ease-in-out infinite 1.6s; }
.f3 { bottom: 24%; left: -44%; animation: float 6s ease-in-out infinite 2.8s; }
.f4 { bottom: 8%; right: -48%; animation: float 6s ease-in-out infinite 4.2s; }

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

/* Features */
.feature-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.feature-card {
  padding: 40px;
  background: white;
  border-radius: 24px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: all 0.3s;
}

.feature-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
  border-color: var(--primary);
}

.icon-box {
  width: 60px;
  height: 60px;
  background: var(--bg-light);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.icon-box img {
  width: 30px;
  height: 30px;
}

.feature-card h3 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
}

.feature-card p {
  color: var(--text-sub);
}

/* Detail Features */
.detail {
  border-top: 1px solid rgba(0, 0, 0, 0.04);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

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

.detail-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px 18px;
}

.detail-card h3 {
  font-size: 19px;
  margin-bottom: 12px;
}

.detail-list {
  list-style: none;
}

.detail-list li {
  position: relative;
  font-size: 14px;
  color: #4b4b4f;
  padding-left: 14px;
  margin-bottom: 8px;
}

.detail-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--primary);
}

/* Security Section */
.split {
  display: flex;
  align-items: center;
  gap: 80px;
}

.security-text { flex: 1; }
.security-image { flex: 1; }

.sub-title {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  color: var(--secondary);
  font-weight: 700;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.security-text h2 {
  font-size: 48px;
  font-weight: 800;
  margin-bottom: 24px;
  line-height: 1.2;
}

.check-list {
  list-style: none;
  margin-top: 32px;
}

.check-list li {
  position: relative;
  padding-left: 32px;
  margin-bottom: 12px;
  font-weight: 600;
}

.check-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: 900;
}

.secure-box {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 30px;
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.1);
}

.secure-box > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Use Cases */
.case-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.case-item {
  text-align: center;
}

.case-img {
  width: 100%;
  aspect-ratio: 16/10;
  background: var(--bg-light);
  border-radius: 20px;
  margin-bottom: 24px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.case-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.case-item:hover .case-img img {
  transform: scale(1.05);
}

.case-item h3 {
  font-size: 22px;
  margin-bottom: 8px;
}

.case-item p {
  color: var(--text-sub);
}

/* Compare Table */
.table-container {
  max-width: 860px;
  margin: 0 auto;
  background: white;
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.compare-table th, .compare-table td {
  padding: 18px 14px;
  text-align: center;
  vertical-align: middle;
  line-height: 1.45;
  border-bottom: 1px solid var(--bg-light);
}

.compare-table th {
  font-weight: 800;
  font-size: 19px;
}

.compare-table th:first-child,
.compare-table td:first-child {
  width: 24%;
}

.compare-table th:nth-child(2),
.compare-table td:nth-child(2),
.compare-table th:nth-child(3),
.compare-table td:nth-child(3) {
  width: 38%;
}

.compare-table th:first-child,
.compare-table td:first-child {
  text-align: center;
  font-weight: 600;
  color: var(--text-sub);
}

.compare-table tbody tr:last-child td {
  border-bottom: 0;
}

.highlight {
  color: var(--primary);
  font-weight: 800;
  background-color: transparent;
}

/* FAQ */
.faq-list-box {
  max-width: 920px;
  margin: 0 auto;
  display: grid;
  gap: 10px;
}

.faq-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 18px;
}

.faq-item summary {
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item p {
  margin-top: 10px;
  color: var(--text-sub);
}

/* Legal Pages */
.legal-main {
  padding-top: 90px;
}

.legal-card {
  max-width: 980px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px 34px;
  box-shadow: var(--shadow);
}

.legal-card h1 {
  font-size: 40px;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}

.legal-card h2 {
  font-size: 24px;
  line-height: 1.35;
  margin-top: 26px;
  margin-bottom: 10px;
}

.legal-card p,
.legal-card li {
  font-size: 15px;
  color: #4f545a;
  line-height: 1.78;
}

.legal-card ul {
  margin: 8px 0 0;
  padding-left: 22px;
}

.legal-card table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.legal-card th,
.legal-card td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
  line-height: 1.55;
  word-break: keep-all;
}

.legal-card th {
  background: #f6f7fa;
  color: #30343a;
  font-weight: 700;
}

.legal-card a {
  color: var(--primary);
}

/* Legal Modal */
.legal-modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: none;
}

.legal-modal.open {
  display: block;
}

.legal-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 24, 32, 0.58);
}

.legal-modal-dialog {
  position: relative;
  width: min(1000px, calc(100% - 40px));
  height: min(86vh, 820px);
  margin: 6vh auto 0;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
}

.legal-modal-head {
  height: 58px;
  padding: 0 16px 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e8eaf0;
}

.legal-modal-head strong {
  font-size: 16px;
}

.legal-modal-close {
  appearance: none;
  border: 1px solid #d9dce5;
  background: #fff;
  color: #1d1d1f;
  border-radius: 10px;
  padding: 7px 11px;
  font-size: 13px;
  cursor: pointer;
}

.legal-modal iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

body.modal-open {
  overflow: hidden;
}

/* Download CTA */
.cta-card {
  background: var(--text-main);
  border-radius: 40px;
  padding: 80px;
  text-align: center;
  color: white;
}

.cta-card h2 {
  font-size: 48px;
  font-weight: 800;
  margin-bottom: 16px;
  color: #fff;
}

.cta-card p {
  font-size: 20px;
  color: rgba(255, 255, 255, 0.82);
  opacity: 1;
  margin-bottom: 40px;
}

.cta-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.btn {
  padding: 16px 40px;
  border-radius: 99px;
  text-decoration: none;
  font-weight: 700;
  font-size: 18px;
  transition: all 0.3s;
}

.btn.primary {
  background: var(--primary);
  color: white;
}

.btn.primary:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 20px rgba(239, 79, 79, 0.3);
}

/* Legacy footer */
.rubytalk-custom-footer {
  padding: 80px 0;
  border-top: 1px solid var(--bg-light);
  color: var(--text-sub);
}

.rubytalk-legal-links {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 24px;
}

.rubytalk-legal-links a {
  color: rgba(255, 255, 255, 0.76);
  text-decoration: none;
  font-size: 14px;
}

.rubytalk-custom-footer .footer-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 40px;
}

.rubytalk-custom-footer .footer-brand {
  display: flex;
  align-items: center;
  gap: 0;
}

.rubytalk-custom-footer .footer-brand img {
  height: 22px;
  width: auto;
  display: block;
}

.rubytalk-custom-footer .footer-nav a {
  text-decoration: none;
  color: var(--text-sub);
  margin-left: 24px;
  font-size: 14px;
}

.rubytalk-custom-footer .footer-info p {
  font-size: 13px;
  line-height: 2;
}

.rubytalk-custom-footer .copyright {
  margin-top: 24px;
}

/* Animations */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
}

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

/* Responsive */
@media (max-width: 968px) {
  .hero .container, .split {
    flex-direction: column;
    text-align: center;
  }
  
  .hero h1 { font-size: 48px; }
  .section-title h2 { font-size: 32px; }
  .hero-proof { justify-content: center; }
  
  .quick-grid,
  .feature-cards,
  .case-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }
  
  .topbar nav { display: none; }
  
  .cta-group { justify-content: center; }
  
  .phone-mockup { width: 280px; }
  
  .f1, .f2, .f3, .f4 { position: static; margin: 10px auto; animation: none; }

  .table-container {
    overflow-x: auto;
    padding: 20px;
  }

  .compare-table {
    min-width: 620px;
  }

  .legal-main {
    padding-top: 72px;
  }

  main.rubytalk-page {
    padding-top: 64px;
  }

  .legal-card {
    padding: 24px 18px;
  }

  .legal-card h1 {
    font-size: 30px;
  }

  .legal-card h2 {
    font-size: 20px;
  }

  .legal-modal-dialog {
    width: calc(100% - 16px);
    height: 90vh;
    margin-top: 4vh;
  }

  .rubytalk-legal-links {
    flex-direction: column;
    gap: 10px;
  }
}
