@charset "UTF-8";

/* Shrink bilingual flex/grid content without compressing controls or logos. */
.brand, .brand-text,
.hero-banner > div, .feature-cad > *, .simulator-layout > *,
.sim-metrics > *, .content-layout > *, .article-layout > *,
.footer-grid > *, .about-card > * {
  min-width: 0;
}
.brand-mark, .header-actions, .desktop-nav, .simulator-title svg {
  flex-shrink: 0;
}
.brand-text strong, .desktop-nav a { white-space: nowrap; }
.brand-text small {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.simulator-title .simulator-name { font: inherit; color: inherit; }
.page-title { font-size: 32px; line-height: 1.4; margin: 10px 0; }
.article-body figure img { height: auto; }

/* Switch navigation before the desktop header runs out of room. */
@media (max-width: 1100px) {
  .desktop-nav, .search-open kbd { display: none; }
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 44px;
  }
  .header-actions { gap: 8px; }
}

@media (max-width: 1024px) {
  .hero-banner, .feature-cad, .content-layout, .simulator-layout, .about-card {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero-specs { flex-wrap: wrap; gap: 6px 16px; }
  .cad-media img { height: auto; object-fit: contain; }
  .article-layout { display: flex; flex-direction: column-reverse; gap: 28px; }
  .toc { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  main { padding-bottom: 40px; }
  .header-inner { height: 68px; gap: 12px; }
  .brand-text small { max-width: 260px; font-size: 8px; letter-spacing: 1px; }
  .search-open, .theme-toggle { min-height: 44px; }
  .mobile-nav {
    max-height: calc(100dvh - 68px);
    overflow-y: auto;
    overscroll-behavior-y: contain;
  }

  .hero-banner { padding: 28px 0 24px; }
  .hero-tag {
    max-width: 100%;
    font-size: 9px;
    letter-spacing: 1px;
    overflow-wrap: anywhere;
  }
  .hero-title { font-size: 28px; line-height: 1.45; }
  .hero-title, .cad-title, .page-title, .article-heading h1, .about-card h1 {
    text-wrap: balance;
  }
  .hero-desc { font-size: 13px; margin: 0; }
  .hero-desc br, .cad-summary br { display: none; }
  .feature-cad { margin-top: 24px; border-radius: 10px; }
  .cad-info { padding: 24px; }
  .cad-badge-group { flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
  .cad-badge { white-space: nowrap; font-size: 9px; letter-spacing: 0.5px; }
  .cad-title { font-size: 26px; line-height: 1.45; }
  .cad-title br { display: none; }
  .cad-title em { display: block; text-wrap: balance; }
  .cad-summary { font-size: 13px; margin: 0 0 20px; }
  .cad-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .cad-actions .btn { min-height: 44px; padding: 10px 8px; font-size: 12px; }
  .cad-telemetry-overlay { font-size: 8px; bottom: 8px; right: 8px; }

  .simulator-box { margin: 30px 0; padding: 24px 18px 18px; }
  .simulator-box::before {
    left: 12px;
    max-width: calc(100% - 24px);
    font-size: 8px;
    letter-spacing: 0.4px;
  }
  .simulator-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 18px;
  }
  .simulator-title {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: center;
    gap: 4px 8px;
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
  }
  .simulator-subtitle { grid-column: 2; }
  .simulator-layout { gap: 18px; }
  .slider-group { gap: 8px; }
  .slider-label { gap: 12px; }
  .slider-val { white-space: nowrap; flex-shrink: 0; }
  .slider-range { min-width: 0; height: 44px; margin: 0; background: transparent; }
  .slider-range::-webkit-slider-runnable-track {
    height: 6px;
    background: var(--bg-elevated);
    border-radius: 3px;
  }
  .slider-range::-webkit-slider-thumb { width: 24px; height: 24px; margin-top: -9px; }
  .slider-range::-moz-range-track {
    height: 6px;
    background: var(--bg-elevated);
    border-radius: 3px;
  }
  .slider-range::-moz-range-thumb { width: 24px; height: 24px; }
  .sim-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .metric-card { padding: 10px; }
  .metric-label { overflow-wrap: anywhere; line-height: 1.6; }

  .content-layout { margin-top: 28px; gap: 28px; }
  .section-head, .section-head h2 { flex-wrap: wrap; gap: 6px 12px; }
  .section-head h2 { font-size: 18px; }
  .section-head h2 small { font-size: 9px; }
  .section-head a { white-space: nowrap; }
  .filters { gap: 6px; }
  .filter { min-height: 40px; padding: 7px 11px; }
  .post {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    padding: 16px;
  }
  .post-visual { aspect-ratio: 1; }
  .post-visual::after { font-size: 7px; letter-spacing: 0; left: 5px; }
  .post h3 { font-size: 16px; line-height: 1.6; }
  .post p {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 12px;
  }
  .post-category, .post-meta { flex-wrap: wrap; gap: 4px 8px; }
  .post-meta > span, .post-meta .dot, .avatar, .step-num { flex-shrink: 0; }
  .author-title > div, .learning-step > div { min-width: 0; }

  .page-heading { padding: 28px 0 22px; }
  .page-title, .article-heading h1 { font-size: 27px; line-height: 1.5; }
  .breadcrumbs, .article-byline { flex-wrap: wrap; gap: 6px 10px; }
  .article-byline > span { white-space: nowrap; }
  .article-deck { font-size: 14px; }
  .article-layout { padding: 22px 0 32px; gap: 24px; }
  .article-side { gap: 12px; }
  .toc button { min-height: 44px; align-items: baseline; padding: 8px; line-height: 1.7; }
  .toc button span { flex-shrink: 0; }
  .article-body { min-width: 0; overflow-wrap: anywhere; font-size: 15px; line-height: 1.9; }
  .article-body .lead { font-size: 16px; }
  .article-body h2 { font-size: 20px; line-height: 1.6; margin-top: 30px; }
  .article-body h2 span { flex-shrink: 0; }
  .article-body figure { margin: 24px 0; }
  .article-body figcaption { line-height: 1.7; }
  .article-body table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 12px;
    line-height: 1.8;
  }
  .article-body th, .article-body td {
    padding: 10px 8px;
    text-align: left;
    vertical-align: top;
    border: 1px solid var(--border-medium);
  }
  .article-body th { background: var(--bg-card); color: var(--text-primary); }
  .formula-card, .callout, .phil-callout { padding: 16px; overflow-wrap: anywhere; }
  .article-end { flex-direction: column; align-items: flex-start; gap: 18px; }
  .related-link { align-items: flex-start; font-size: 16px; }
  .related-link > span:last-child { flex-shrink: 0; }

  .about-page { padding: 28px 0 36px; }
  .about-card { padding: 28px; gap: 24px; }
  .about-monogram { font-size: 76px; }
  .about-card h1 { font-size: 26px; }
  .about-bottom, .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .footer-specs, .footer-links { overflow-wrap: anywhere; }

  dialog { width: calc(100% - 24px); max-height: 85vh; max-height: 85dvh; padding: 18px; }
  .search-dialog-top { gap: 12px; }
  .search-dialog-top h2 { font-size: 16px; line-height: 1.6; }
  .icon-button, .search-input-wrap svg { flex-shrink: 0; }
  .icon-button { min-width: 40px; min-height: 40px; }
  .search-input-wrap { gap: 8px; padding: 10px; }
  .search-input-wrap input { min-width: 0; font-size: 16px; }
  .search-results-list { max-height: 34vh; max-height: 34dvh; }
  .search-result { overflow-wrap: anywhere; }
  .search-dialog-footer { flex-wrap: wrap; gap: 8px; line-height: 1.7; }
  .back-top {
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
    min-height: 44px;
  }
}

@media (max-width: 600px) {
  .brand { gap: 8px; }
  .brand-mark { width: 32px; height: 32px; font-size: 20px; }
  .brand-text strong { font-size: 14px; letter-spacing: 0; }
  .brand-text small, .search-open > span, .theme-label { display: none; }
  .header-inner { height: 64px; gap: 8px; }
  .header-actions { gap: 6px; }
  .header-actions > button {
    width: 40px;
    min-width: 40px;
    height: 44px;
    padding: 0;
    justify-content: center;
  }
  .hero-title { font-size: 26px; }
  .cad-info { padding: 22px 18px; }
  .post { grid-template-columns: 70px minmax(0, 1fr); gap: 12px; padding: 14px; }
  .toc { grid-template-columns: minmax(0, 1fr); }
  .about-card { padding: 22px; }
  .mobile-nav { max-height: calc(100dvh - 64px); }
}

@media (max-width: 480px) {
  .shell { width: calc(100% - 24px); }
  .hero-specs { font-size: 10px; gap: 6px 12px; }
  .post { grid-template-columns: minmax(0, 1fr); }
  .post-visual { display: none; }
}

@media (max-width: 360px) {
  .brand { gap: 6px; }
  .brand-mark { width: 28px; height: 28px; }
  .brand-text strong { font-size: 13px; }
  .header-actions > button { width: 38px; min-width: 38px; }
  .hero-title { font-size: 22px; }
  .cad-title { font-size: 24px; }
  .cad-actions { grid-template-columns: minmax(0, 1fr); }
  .simulator-box { padding-left: 14px; padding-right: 14px; }
  .page-title, .article-heading h1 { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
