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

html {
  font-family: var(--font-sans);
  background-color: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--paper);
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 16px;
  background: var(--ink);
  color: var(--ink-inverse);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  z-index: 1000;
  text-decoration: none;
  font-weight: 600;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 16px;
}

.container {
  width: 100%;
  max-width: var(--max-w-page);
  margin: 0 auto;
  padding: 0 24px;
}

.reading-container {
  width: 100%;
  max-width: var(--max-w-reading);
  margin: 0 auto;
  padding: 60px 24px 100px;
}

/* Header Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--paper-translucent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--hairline);
  transition: background-color 0.2s;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.nav-links a {
  text-decoration: none;
  color: var(--ink-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s;
  white-space: nowrap;
}

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

@media (max-width: 900px) {
  .nav-links {
    display: none;
  }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.locale-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.locale-select {
  appearance: none;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 6px 28px 6px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s;
}

.locale-select:hover {
  border-color: var(--hairline-strong);
}

.locale-chevron {
  position: absolute;
  right: 10px;
  font-size: 9px;
  color: var(--muted);
  pointer-events: none;
}

.theme-toggle-btn {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s;
}

.theme-toggle-btn:hover {
  background: var(--panel-hover);
  border-color: var(--hairline-strong);
}

.header-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  background: var(--accent-blue);
  color: #FFFFFF;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
}

.header-cta-btn:hover {
  background: var(--accent-blue-hover);
  transform: translateY(-1px);
}

/* Hero Section with 3D Graphic Integration */
.hero-section {
  padding: 60px 0 40px;
  text-align: center;
  position: relative;
}

.hero-badge-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 20px;
}

.hero-3d-graphic-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 12px;
}

.hero-3d-broom {
  width: 72px;
  height: 72px;
  object-fit: contain;
  animation: heroFloat 4s ease-in-out infinite alternate;
}

@keyframes heroFloat {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(-8px) rotate(3deg); }
}

.hero-title {
  font-size: clamp(34px, 5.5vw, 54px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--ink);
  max-width: 820px;
  margin: 0 auto 16px;
}

.hero-subtitle {
  font-size: clamp(16px, 2.2vw, 19px);
  line-height: 1.5;
  color: var(--ink-secondary);
  max-width: 660px;
  margin: 0 auto 36px;
}

/* Comparison Showcase with 3D Arrow */
.section-block {
  padding: 70px 0;
  border-top: 1px solid var(--hairline);
}

.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 44px;
}

.section-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-blue);
  margin-bottom: 8px;
}

.section-title {
  font-size: clamp(24px, 3.5vw, 36px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 12px;
}

.section-description {
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink-secondary);
}

.comparison-wrapper {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 20px;
  max-width: 980px;
  margin: 0 auto;
}

.comparison-card {
  flex: 1 1 0;
  width: 100%;
  min-height: 240px;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.comparison-card.highlighted {
  background: var(--paper);
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-md), 0 0 0 1px var(--accent-blue);
}

.comparison-text {
  flex: 1;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink);
  word-break: break-word;
}

.arrow-3d-separator {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  align-self: center;
  object-fit: contain;
}

@media (max-width: 768px) {
  .comparison-wrapper {
    flex-direction: column;
  }
  .arrow-3d-separator {
    transform: rotate(90deg);
    margin: 4px 0;
  }
}

/* Feature Showcase Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.feature-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--paper);
  border: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: var(--shadow-xs);
}

.feature-card-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.feature-card-desc {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-secondary);
}

/* 3D Case Converter Feature Showcase Banner */
.case-converter-banner {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-xl);
  padding: 40px;
  margin: 40px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  box-shadow: var(--shadow-md);
}

.case-banner-copy {
  max-width: 540px;
}

.case-banner-graphics {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.case-3d-img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.case-banner-graphics:hover .case-3d-img {
  transform: scale(1.06) rotate(-2deg);
}

@media (max-width: 768px) {
  .case-converter-banner {
    flex-direction: column;
    text-align: center;
    padding: 28px;
  }
}

/* Corruption Matrix Table */
.corruption-matrix {
  width: 100%;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.matrix-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  padding: 16px 20px;
  border-bottom: 1px solid var(--hairline);
  align-items: center;
  font-size: 14px;
}

.matrix-row:last-child {
  border-bottom: none;
}

.matrix-header {
  background: var(--panel);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.matrix-problem {
  font-weight: 600;
  color: var(--ink);
}

.matrix-bad {
  color: var(--tag-red-text);
  font-family: var(--font-mono);
  font-size: 13px;
}

.matrix-good {
  color: var(--tag-green-text);
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 13px;
}

@media (max-width: 640px) {
  .matrix-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .matrix-header {
    display: none;
  }
}

/* App Promo & iOS Screenshots */
.promo-split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 50px;
  align-items: center;
}

.promo-title {
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 12px 0 16px;
}

.promo-description {
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-secondary);
  margin-bottom: 24px;
}

.promo-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 30px;
}

.promo-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 15px;
  color: var(--ink);
}

.promo-feature-icon {
  width: 20px;
  height: 20px;
  color: var(--accent-blue);
  flex-shrink: 0;
  margin-top: 1px;
}

.screenshot-frame {
  max-width: 360px;
  margin: 0 auto;
  border-radius: 40px;
  overflow: hidden;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.25), 0 0 0 1px var(--hairline);
  background: var(--panel);
}

.screenshot-frame img {
  width: 100%;
  height: auto;
  display: block;
}

@media (max-width: 768px) {
  .promo-split {
    grid-template-columns: 1fr;
    gap: 36px;
    text-align: center;
  }
  .promo-feature-item {
    text-align: left;
  }
}

/* Reading Container & Article / Legal / Support Typography */
.article-header {
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--hairline);
}

.article-title {
  font-size: clamp(28px, 4.5vw, 42px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: 12px;
}

.article-meta {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.article-content {
  font-family: var(--font-sans);
  color: var(--ink);
  line-height: 1.7;
}

.article-content h2 {
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 36px 0 14px;
}

.article-content h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  margin: 24px 0 10px;
}

.article-content p {
  font-size: 15px;
  color: var(--ink-secondary);
  margin-bottom: 18px;
}

.article-content ul,
.article-content ol {
  margin: 12px 0 20px 24px;
  padding: 0;
  color: var(--ink-secondary);
  font-size: 15px;
  line-height: 1.8;
}

.article-content li {
  margin-bottom: 6px;
}

.article-content code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--panel);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-xs);
  padding: 2px 6px;
  color: var(--accent-blue);
}

/* Beautiful Data Table / Chart Table */
.chart-table,
.article-content table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 28px 0;
  box-shadow: var(--shadow-sm);
}

.chart-table thead th,
.article-content table thead th {
  background: var(--paper);
  padding: 14px 18px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-align: left;
  border-bottom: 1px solid var(--hairline-strong);
}

.chart-table tbody tr,
.article-content table tbody tr {
  transition: background-color 0.15s ease;
}

.chart-table tbody tr:hover,
.article-content table tbody tr:hover {
  background: var(--panel-hover);
}

.chart-table th[scope="row"],
.article-content table th[scope="row"] {
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  text-align: left;
  border-bottom: 1px solid var(--hairline-subtle);
}

.chart-table td,
.article-content table td {
  padding: 12px 18px;
  font-size: 14px;
  color: var(--ink-secondary);
  border-bottom: 1px solid var(--hairline-subtle);
  vertical-align: middle;
}

.chart-table tbody tr:last-child th,
.chart-table tbody tr:last-child td,
.article-content table tbody tr:last-child th,
.article-content table tbody tr:last-child td {
  border-bottom: none;
}

@media (max-width: 640px) {
  .chart-table,
  .article-content table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* FAQ Accordion / List */
.faq-list {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.faq-item {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 20px 24px;
}

.faq-question {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}

.faq-answer {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-secondary);
}

/* Footer */
.site-footer {
  margin-top: auto;
  background: var(--panel);
  border-top: 1px solid var(--hairline);
  padding: 60px 0 30px;
  font-size: 13px;
  color: var(--muted);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 1fr 1.4fr;
  gap: 32px;
  margin-bottom: 40px;
}

.footer-brand-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  margin-bottom: 8px;
}

.footer-col-title {
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink);
  margin-bottom: 14px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links a {
  text-decoration: none;
  color: var(--ink-secondary);
  font-size: 13px;
  transition: color 0.15s;
}

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

.locale-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.locale-chip {
  padding: 4px 10px;
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 12px;
  color: var(--ink-secondary);
  transition: all 0.15s;
}

.locale-chip:hover, .locale-chip.active {
  background: var(--panel-hover);
  border-color: var(--hairline-strong);
  color: var(--ink);
  font-weight: 600;
}

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--hairline);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 28px;
  }
}

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