/* ==========================================================================
   TerraPocket Modern Static Design System
   ========================================================================== */

:root {
  /* Brand Colors */
  --color-primary: #f26522;
  --color-primary-hover: #d9531e;
  --color-primary-light: #fff2eb;
  --color-primary-subtle: rgba(242, 101, 34, 0.08);
  --color-primary-border: rgba(242, 101, 34, 0.25);
  
  /* Neutral Colors */
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-surface-hover: #f1f5f9;
  --color-surface-active: #e2e8f0;
  --color-border: #e2e8f0;
  --color-border-subtle: #edf2f7;
  
  /* Text Colors */
  --color-heading: #0f172a;
  --color-text: #334155;
  --color-text-muted: #64748b;
  --color-text-subtle: #94a3b8;
  
  /* Accents */
  --color-link: #0284c7;
  --color-link-hover: #0369a1;
  --color-success: #16a34a;
  --color-quote-bg: #fff7ed;
  --color-quote-border: #f97316;

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;

  /* Layout */
  --header-height: 64px;
  --sidebar-width: 270px;
  --max-content-width: 1040px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 4px 20px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 0.975rem;
  line-height: 1.65;
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Links */
a {
  color: var(--color-link);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--color-link-hover);
  text-decoration: underline;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  color: var(--color-heading);
  font-weight: 700;
  line-height: 1.3;
  margin-top: 1.6rem;
  margin-bottom: 0.8rem;
  letter-spacing: -0.015em;
}

h1:first-child, h2:first-child, h3:first-child {
  margin-top: 0;
}

h1 {
  font-size: 1.85rem;
  border-bottom: 2px solid var(--color-primary-subtle);
  padding-bottom: 0.6rem;
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}

h1 img {
  max-height: 48px;
  width: auto;
  vertical-align: middle;
}

h2 {
  font-size: 1.45rem;
  color: var(--color-heading);
  margin-top: 1.8rem;
}

h3 {
  font-size: 1.2rem;
  color: #1e293b;
  margin-top: 1.4rem;
}

h4 {
  font-size: 1.05rem;
  color: var(--color-heading);
}

p {
  margin-bottom: 1rem;
}

ul, ol {
  margin-bottom: 1.2rem;
  padding-left: 1.6rem;
}

li {
  margin-bottom: 0.4rem;
}

img {
  max-width: 100%;
  height: auto;
  display: inline-block;
}

/* ==========================================================================
   Top Header Bar
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.03);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  height: 100%;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* Hamburger toggle for mobile */
.menu-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--color-heading);
}

.menu-toggle:hover {
  background-color: var(--color-surface-hover);
}

.hamburger-bar {
  display: block;
  width: 22px;
  height: 2px;
  background-color: currentColor;
  margin: 4px 0;
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Brand Link */
.brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--color-heading);
}

.brand-logo {
  height: 42px;
  width: auto;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.brand-link:hover .brand-logo {
  transform: scale(1.04);
}

.brand-name {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--color-primary);
  background: linear-gradient(135deg, #f26522 0%, #ea580c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Header Center Badge */
.header-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--color-primary-light);
  border: 1px solid var(--color-primary-border);
  border-radius: 20px;
  padding: 0.25rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-primary);
}

.product-header-badge img {
  width: 22px;
  height: 22px;
  border-radius: 4px;
}

/* Language Switcher */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  background: var(--color-surface-hover);
  border: 1px solid var(--color-border);
  border-radius: 24px;
  padding: 3px;
  gap: 2px;
}

.lang-btn {
  padding: 4px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  border-radius: 20px;
  text-decoration: none;
  transition: all 0.15s ease;
}

.lang-btn:hover {
  color: var(--color-heading);
  text-decoration: none;
}

.lang-btn.active {
  background: var(--color-primary);
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(242, 101, 34, 0.28);
}

.lang-divider {
  display: none;
}

/* ==========================================================================
   Main Layout Container
   ========================================================================== */
.site-container {
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex: 1;
  position: relative;
}

/* ==========================================================================
   Sidebar Navigation
   ========================================================================== */
.site-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  padding: 1.5rem 0.85rem 2.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.nav-section-title {
  font-size: 0.725rem;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--color-text-subtle);
  padding: 0 0.75rem;
  margin-bottom: 0.4rem;
}

.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  margin: 0;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  color: var(--color-text);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all 0.15s ease;
}

.nav-link:hover {
  background-color: var(--color-surface-hover);
  color: var(--color-heading);
  text-decoration: none;
}

.nav-link.active {
  background-color: var(--color-primary-light);
  color: var(--color-primary);
  font-weight: 700;
}

.nav-icon {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.nav-product-icon {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  object-fit: contain;
  flex-shrink: 0;
}

.nav-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Submenu */
.submenu {
  list-style: none;
  padding: 0.2rem 0 0.2rem 2rem;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.subnav-link {
  display: block;
  padding: 0.35rem 0.65rem;
  font-size: 0.825rem;
  color: var(--color-text-muted);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all 0.15s ease;
}

.subnav-link:hover {
  background-color: var(--color-surface-hover);
  color: var(--color-heading);
  text-decoration: none;
}

.subnav-link.active {
  color: var(--color-primary);
  font-weight: 700;
  background-color: var(--color-primary-light);
}

/* ==========================================================================
   Main Content Area
   ========================================================================== */
.site-main {
  flex: 1;
  min-width: 0;
  padding: 1.75rem 2rem 3rem;
  display: flex;
  flex-direction: column;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
}

.breadcrumb a {
  color: var(--color-text-muted);
  text-decoration: none;
}

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

.breadcrumb-sep {
  color: var(--color-text-subtle);
  font-size: 0.8rem;
}

.breadcrumb-current {
  color: var(--color-heading);
  font-weight: 600;
}

/* Content Card */
.content-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-card);
  padding: 2.25rem 2.5rem;
  margin-bottom: 2rem;
  flex: 1;
}

/* ==========================================================================
   Typography & Specific Component Styles
   ========================================================================== */

/* Slogan Styles */
.slogan_l {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ea580c;
  margin: 1.25rem 0 0.5rem;
}

h3.slogan_l {
  font-size: 1.25rem;
  color: #ea580c;
  margin-top: 1.5rem;
}

.slogan_box {
  margin: 1.5rem 0;
}

/* Quote Box */
.quoteBox {
  border-left: 4px solid var(--color-primary);
  background: linear-gradient(135deg, #fff7ed 0%, #ffffff 100%);
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.6rem;
  margin: 1.5rem 0 2rem;
  box-shadow: var(--shadow-sm);
  border-top: 1px solid #ffedd5;
  border-right: 1px solid #ffedd5;
  border-bottom: 1px solid #ffedd5;
}

blockquote {
  margin: 0;
}

.quote {
  font-size: 1.2rem;
  font-style: italic;
  font-weight: 600;
  color: #9a3412;
  line-height: 1.5;
  display: block;
}

.read_on {
  font-size: 0.8rem;
  font-style: normal;
  font-weight: 600;
  color: var(--color-primary);
  margin-left: 0.5rem;
}

.typewriter {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  background: #f1f5f9;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid #64748b;
  margin: 1.2rem 0;
  color: #334155;
}

/* Screenshots Gallery */
.screenshot, .screenshot_small, .screenshotimage {
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  margin: 0.6rem 0.6rem 1.2rem 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  vertical-align: top;
}

.screenshot:hover, .screenshot_small:hover, .screenshotimage:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.screenshot_small {
  max-height: 380px;
  width: auto;
}

.screenshot {
  max-height: 520px;
  width: auto;
}

/* Tables */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1.2rem 0 1.8rem;
}

table td, table th {
  padding: 0.75rem 0.85rem;
  vertical-align: middle;
}

/* Store Badge Links */
.store-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin: 1.2rem 0 1.8rem;
}

.store-badge-link img {
  border-radius: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  max-height: 50px;
  width: auto;
}

.store-badge-link:hover img {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Keypa feature tables */
.withbox {
  width: 90px;
  height: 90px;
  text-align: center;
  vertical-align: middle;
  background: var(--color-primary-light);
  border-radius: var(--radius-md);
  padding: 0.5rem;
}

.withbox img {
  max-width: 64px;
  max-height: 64px;
}

.finetext {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.ChecksumText {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--color-text-muted);
  background: #f1f5f9;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  word-break: break-all;
}

.linkImage {
  height: 22px;
  width: auto;
  vertical-align: middle;
}

.IconInText {
  height: 1.3em;
  width: auto;
  vertical-align: -0.2em;
  margin: 0 0.15em;
}

/* Language Gateway Page (root index.html) */
.gateway-container {
  max-width: 680px;
  margin: 4rem auto;
  padding: 2.5rem;
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-card);
  text-align: center;
}

.gateway-logo {
  height: 72px;
  width: auto;
  margin-bottom: 1.5rem;
}

.gateway-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: var(--color-heading);
}

.gateway-subtitle {
  color: var(--color-text-muted);
  margin-bottom: 2rem;
}

.gateway-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.gateway-card {
  padding: 1.5rem;
  border-radius: var(--radius-md);
  border: 2px solid var(--color-border);
  text-decoration: none;
  color: var(--color-heading);
  transition: all 0.2s ease;
  background: var(--color-surface);
}

.gateway-card:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.gateway-card h3 {
  color: var(--color-primary);
  margin-top: 0;
  margin-bottom: 0.4rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 1.5rem 0 0;
  margin-top: auto;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-separator {
  color: var(--color-border);
}

.print-button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.print-button:hover {
  background: var(--color-surface-hover);
  color: var(--color-heading);
  border-color: var(--color-text-subtle);
}

.print-button img {
  width: 14px;
  height: 14px;
}

/* Backdrop */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 140;
  opacity: 0;
  transition: opacity 0.25s ease;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 960px) {
  .menu-toggle {
    display: block;
  }

  .site-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100vh;
    z-index: 150;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-lg);
  }

  .site-sidebar.open {
    transform: translateX(0);
  }

  .sidebar-backdrop.active {
    display: block;
    opacity: 1;
  }

  .site-main {
    padding: 1.25rem 1rem 2rem;
  }

  .content-card {
    padding: 1.5rem;
  }
}

@media (max-width: 640px) {
  .header-inner {
    padding: 0 0.85rem;
  }

  .brand-name {
    font-size: 1.15rem;
  }

  .product-header-badge {
    display: none;
  }

  .gateway-cards {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
  .site-header, .site-sidebar, .breadcrumb, .print-button, .menu-toggle, .sidebar-backdrop {
    display: none !important;
  }

  body {
    background: #ffffff;
    color: #000000;
  }

  .site-container {
    display: block;
  }

  .site-main {
    padding: 0;
  }

  .content-card {
    border: none;
    box-shadow: none;
    padding: 0;
  }

  a {
    color: #000000;
    text-decoration: underline;
  }
}
