:root {
  --ink: #101827;
  --muted: #657589;
  --line: #dce8f0;
  --panel: #ffffff;
  --cyan: #24d6c8;
  --blue: #2f7df6;
  --brand-primary: linear-gradient(135deg, #28e0d4 0%, #20c6c4 42%, #2f7df6 100%);
  --brand-primary-shadow: 0 18px 42px rgba(36, 214, 200, .28);
  --shadow: 0 24px 70px rgba(28, 42, 67, .12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  padding-top: 94px;
  color: var(--ink);
  font-family: Manrope, Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background:
    radial-gradient(circle at 14% 8%, rgba(36, 214, 200, .18), transparent 30rem),
    radial-gradient(circle at 86% 12%, rgba(47, 125, 246, .15), transparent 32rem),
    linear-gradient(180deg, #effbfc 0%, #f8fbff 46%, #edf7fb 100%);
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.page-shell,
.site-header,
.tool-header,
.tool-page {
  width: min(1380px, calc(100% - 44px));
  margin-inline: auto;
}

.site-header,
.tool-header {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 10;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 0 22px;
  transform: translateX(-50%);
  border: 1px solid rgba(18, 20, 23, .08);
  border-radius: 16px;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(18px);
  box-shadow: 0 20px 60px rgba(31, 45, 61, .08);
}

.brand {
  min-height: 56px;
  display: inline-flex;
  align-items: center;
  gap: 28px;
  font-weight: 850;
}

.h5-logo-mark {
  width: 205px;
  height: 52px;
  flex: 0 0 205px;
  display: inline-grid;
  place-items: center;
  overflow: visible;
}

.brand .h5-logo-mark > .brand-logo-image {
  width: 205px !important;
  height: 52px !important;
  max-width: 205px !important;
  max-height: 52px !important;
  object-fit: contain;
  display: block;
  position: static !important;
}

.brand-logo-image { filter: none; }

.brand-tool,
.tool-status {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  white-space: nowrap;
}

.brand-tool {
  color: #253141;
  font-size: 18px;
  font-weight: 780;
}

.brand-tool::before,
.tool-header .brand-tool::before,
.site-header .brand-tool::before {
  content: none !important;
  display: none !important;
}

.tool-status {
  flex: 1;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.site-nav {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 2vw, 28px);
}

.site-nav a {
  color: #27364a;
  font-size: 14px;
  font-weight: 820;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  border: 1px solid rgba(16, 23, 38, .12);
  border-radius: 12px;
  font-weight: 780;
  letter-spacing: -.02em;
  transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}

.button:hover { transform: translateY(-1px); }

.button.dark {
  color: #04111d;
  border-color: rgba(32, 198, 196, .9);
  background: var(--brand-primary);
  box-shadow: var(--brand-primary-shadow), inset 0 0 0 1px rgba(255, 255, 255, .2);
}

.button.light {
  color: #142033;
  background: #fff;
  border: 1px solid rgba(148, 166, 190, .32);
}

.button.small {
  min-height: 40px;
  padding: 0 16px;
  font-size: 14px;
}

.language-switcher {
  position: relative;
  z-index: 20;
  margin-left: auto;
}

.language-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid rgba(16, 23, 38, .1);
  border-radius: 12px;
  color: #253141;
  background: #fff;
  cursor: pointer;
  font-weight: 750;
}

.language-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.language-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 132px;
  padding: 8px;
  border: 1px solid rgba(16, 23, 38, .1);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity .16s ease, transform .16s ease;
}

.language-switcher.open .language-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.language-menu button {
  width: 100%;
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-weight: 700;
}

.language-menu button.active,
.language-menu button:hover { background: #eef7ff; }

.hero {
  position: relative;
  min-height: 760px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 72px 0 42px;
  text-align: center;
}

.hero-copy { width: 100%; min-width: 0; }

.eyebrow {
  margin: 0 0 16px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 860;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.hero-copy h1 {
  max-width: 980px;
  margin: 0 auto 22px;
  color: #07111f;
  font-size: clamp(46px, 6vw, 88px);
  line-height: 1.12;
  letter-spacing: -.05em;
}

.hero-copy p {
  max-width: 780px;
  margin: 0 auto;
  color: #56677b;
  font-size: 19px;
  line-height: 1.75;
}

.hero-actions,
.tool-actions,
.charset-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}

.metrics {
  width: min(760px, 100%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 28px auto 30px;
}

.metrics div,
.workflow-grid article,
.case-card,
.seo-grid article,
.panel {
  border: 1px solid rgba(124, 148, 173, .22);
  background: rgba(255, 255, 255, .78);
  box-shadow: var(--shadow);
}

.metrics div {
  padding: 16px;
  border-radius: 18px;
}

.metrics strong {
  display: block;
  color: #07111f;
  font-size: 28px;
  font-weight: 950;
}

.metrics span {
  color: #667587;
  font-size: 13px;
  line-height: 1.45;
}

.hero-uploader,
.mini-workbench {
  border: 1px solid rgba(16, 23, 38, .08);
  border-radius: 18px;
  background: rgba(255, 255, 255, .84);
  box-shadow: 0 20px 60px rgba(31, 45, 61, .08);
}

.hero-uploader {
  width: min(780px, 100%);
  min-height: 240px;
  display: grid;
  place-items: center;
  gap: 18px;
  padding: 28px;
  margin: 0 auto;
  overflow: hidden;
  text-align: center;
  border: 2px dashed rgba(36, 214, 200, .42);
  background:
    radial-gradient(circle at 50% 0%, rgba(36, 214, 200, .2), transparent 42%),
    linear-gradient(135deg, rgba(244, 253, 255, .92), rgba(249, 255, 246, .88));
}

.subset-stack {
  display: grid;
  grid-template-columns: repeat(4, 58px);
  gap: 10px;
}

.subset-stack i {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #07111f;
  font-style: normal;
  font-size: 20px;
  font-weight: 950;
  background: var(--brand-primary);
  box-shadow: 0 12px 24px rgba(25, 126, 184, .18);
}

.hero-uploader strong {
  display: block;
  font-size: 22px;
  letter-spacing: -.04em;
}

.hero-uploader small {
  color: #637386;
  font-size: 15px;
  line-height: 1.7;
}

.mini-workbench {
  width: min(1120px, 100%);
  margin-top: 18px;
  padding: 16px;
  border-radius: 28px;
  text-align: left;
}

.mini-toolbar,
.card-title,
.preview-foot,
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.mini-toolbar { margin-bottom: 14px; }

.tab,
.chip {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 0 14px;
  border-radius: 10px;
  background: #f1f7fb;
  color: #344256;
  font-size: 13px;
  font-weight: 760;
}

.tab.active,
.chip.selected {
  color: #fff;
  background: #0f172a;
}

.route {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
}

.ad-slot {
  min-height: 62px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(70, 106, 132, .28);
  border-radius: 18px;
  color: #789;
  background: rgba(255, 255, 255, .64);
  font-size: 13px;
  font-weight: 760;
}

.ad-slot.large { min-height: 96px; }

.mini-grid {
  display: grid;
  grid-template-columns: minmax(230px, 280px) minmax(0, 1fr) minmax(230px, 280px);
  gap: 14px;
  margin-top: 14px;
}

.queue-card,
.subset-card,
.settings-card {
  min-height: 300px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.card-title span,
.settings-card b,
.panel-head h2 {
  color: #111827;
  font-weight: 950;
}

.card-title small,
.preview-foot span,
.panel-head span {
  color: #69798d;
  font-size: 13px;
  font-weight: 760;
}

.source-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 12px;
  border-radius: 16px;
  color: #25344a;
  background: #f3f8fb;
  font-weight: 840;
}

.source-row.active {
  outline: 2px solid rgba(36, 214, 200, .42);
  background: #edfffd;
}

.source-row em {
  color: #2f7df6;
  font-style: normal;
}

.subset-card {
  display: grid;
  gap: 14px;
}

.subset-bars {
  min-height: 220px;
  display: grid;
  align-content: center;
  gap: 14px;
  padding: 24px;
  border-radius: 18px;
  background:
    linear-gradient(rgba(36, 214, 200, .1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(36, 214, 200, .1) 1px, transparent 1px),
    #07111f;
  background-size: 22px 22px;
}

.subset-bars span {
  position: relative;
  min-height: 34px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
}

.subset-bars span::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--w);
  border-radius: inherit;
  background: var(--brand-primary);
}

.subset-bars b {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding-left: 14px;
  color: #eaffff;
  font-size: 13px;
}

.settings-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.section { padding: 72px 0; }

.section-head {
  max-width: 780px;
  margin-bottom: 28px;
}

.section-head h2 {
  margin: 0;
  color: #07111f;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.12;
  letter-spacing: -.06em;
}

.section-head p {
  margin: 18px 0 0;
  color: #607085;
  font-size: 18px;
  line-height: 1.75;
}

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

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

.workflow-grid article,
.case-card,
.seo-grid article {
  border-radius: 28px;
  padding: 26px;
}

.workflow-grid span {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  color: #03121d;
  background: var(--brand-primary);
  font-weight: 950;
}

.workflow-grid h3,
.case-card h3,
.seo-grid h3 {
  margin: 18px 0 0;
  color: #111827;
  font-size: 22px;
  letter-spacing: -.04em;
}

.workflow-grid p,
.case-card p,
.seo-grid p {
  color: #617184;
  line-height: 1.75;
}

.case-image {
  min-height: 120px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  color: #f8fbff;
  background:
    linear-gradient(rgba(36, 214, 200, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(36, 214, 200, .08) 1px, transparent 1px),
    linear-gradient(135deg, #07111f, #13223a);
  background-size: 20px 20px, 20px 20px, auto;
  font-size: clamp(24px, 3vw, 38px);
  font-weight: 950;
  letter-spacing: -.04em;
  text-shadow: 3px 3px 0 #07111f;
}

.case-card strong { color: #138f96; }

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 36px 0 48px;
  color: #69798d;
  font-weight: 760;
}

body[data-tool-page="true"] {
  background:
    radial-gradient(circle at 12% 0%, rgba(36, 214, 200, .16), transparent 24rem),
    linear-gradient(180deg, #effbfc 0%, #f8fbff 100%);
}

.tool-page { padding: 24px 0 52px; }
.tool-ad { margin-bottom: 18px; }

.drop-zone {
  position: relative;
  min-height: 148px;
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 18px;
  padding: 28px;
  border: 1px dashed rgba(32, 198, 196, .42);
  border-radius: 28px;
  background:
    radial-gradient(circle at 18% 24%, rgba(36, 214, 200, .16), transparent 18rem),
    linear-gradient(135deg, rgba(255, 255, 255, .92), rgba(239, 250, 252, .88));
  box-shadow: var(--shadow);
}

.font-start-icon {
  width: 84px;
  height: 84px;
  flex: 0 0 84px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  color: #07111f;
  background: var(--brand-primary);
  box-shadow: var(--brand-primary-shadow);
  font-size: 30px;
  font-weight: 950;
  letter-spacing: -.08em;
}

.subset-start div { display: grid; gap: 8px; }

.subset-start strong {
  color: #111827;
  font-size: clamp(24px, 3vw, 38px);
  font-weight: 950;
  letter-spacing: -.055em;
}

.subset-start small {
  max-width: 760px;
  color: #64748b;
  font-size: 15px;
  line-height: 1.65;
}

.tool-layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(460px, 1fr) minmax(280px, 340px);
  gap: 18px;
  align-items: start;
}

.panel {
  border-radius: 28px;
  padding: 20px;
}

.panel-head { margin-bottom: 16px; }
.panel-head.compact { margin: 0 0 10px; }
.panel-head h2 { margin: 0; font-size: 22px; letter-spacing: -.04em; }

.preset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.preset-grid button {
  border: 1px solid rgba(125, 147, 169, .24);
  border-radius: 15px;
  padding: 12px 10px;
  color: #223047;
  background: #f3f8fb;
  font-weight: 880;
}

.preset-grid button:hover,
.preset-grid button.active {
  color: #03121d;
  background: var(--brand-primary);
  border-color: rgba(32, 198, 196, .8);
}

.preset-grid button.wide {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  color: #263548;
  font-size: 14px;
  font-weight: 880;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(125, 147, 169, .32);
  border-radius: 16px;
  padding: 12px 14px;
  color: #111827;
  background: #f8fbff;
  outline: none;
}

input[type="file"] {
  padding: 10px;
}

.font-file-meta {
  margin: -2px 0 12px;
  padding: 10px 12px;
  border-radius: 14px;
  color: #64748b;
  background: #f4f9fb;
  font-size: 12px;
  line-height: 1.45;
}

textarea {
  resize: vertical;
  min-height: 310px;
  line-height: 1.55;
  font-family: "Cascadia Mono", Consolas, monospace;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.check-row input { width: 18px; height: 18px; }

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

.result-grid div {
  padding: 14px;
  border-radius: 18px;
  background: #f4f9fb;
}

.result-grid span {
  display: block;
  color: #68788b;
  font-size: 12px;
  font-weight: 820;
}

.result-grid strong {
  display: block;
  margin-top: 4px;
  color: #111827;
  font-size: 20px;
  font-weight: 950;
}

.range-panel,
.code-panel {
  margin-top: 18px;
  padding: 16px;
  border-radius: 22px;
}

.range-panel { background: #f4f9fb; }

.range-list {
  display: grid;
  gap: 10px;
}

.range-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 16px;
  background: #fff;
}

.range-item header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #223047;
  font-weight: 880;
}

.range-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6eef5;
}

.range-bar span {
  display: block;
  height: 100%;
  width: var(--w);
  border-radius: inherit;
  background: var(--brand-primary);
}

.glyph-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 132px;
  overflow: auto;
  margin-top: 18px;
  padding: 12px;
  border-radius: 18px;
  background: #f4f9fb;
}

.glyph-cloud span {
  min-width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #07111f;
  background: #fff;
  border: 1px solid rgba(125, 147, 169, .22);
  font-weight: 900;
}

.subset-glyph-preview {
  min-height: 168px;
  max-height: 220px;
  align-content: flex-start;
}

.subset-glyph-preview span {
  min-width: 40px;
  height: 40px;
  font-size: 22px;
}

.subset-export-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(36, 214, 200, .28);
  border-radius: 22px;
  background:
    radial-gradient(circle at 0% 0%, rgba(36, 214, 200, .18), transparent 18rem),
    #f8fbff;
}

.subset-export-card strong {
  display: block;
  color: #111827;
  font-size: 18px;
  font-weight: 950;
}

.subset-export-card small {
  display: block;
  margin-top: 6px;
  color: #64748b;
  line-height: 1.55;
}

.subset-export-card .button:disabled {
  cursor: not-allowed;
  color: #748195;
  border-color: rgba(125, 147, 169, .24);
  background: #e8eef5;
  box-shadow: none;
  opacity: .75;
  transform: none;
}

.code-panel {
  background: #07111f;
  color: #dff8ff;
}

pre {
  max-height: 260px;
  overflow: auto;
  margin: 0;
  white-space: pre-wrap;
  color: #dff8ff;
  font-size: 12px;
  line-height: 1.65;
}

.note-box {
  margin-top: 16px;
  padding: 16px;
  border-radius: 20px;
  color: #324258;
  background: linear-gradient(135deg, rgba(36, 214, 200, .13), rgba(47, 125, 246, .1));
}

.note-box p {
  margin: 8px 0 0;
  color: #5c6d80;
  line-height: 1.65;
}

.reveal { animation: reveal .56s ease both; }

@keyframes reveal {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1080px) {
  .site-nav { display: none; }
  .hero,
  .tool-layout,
  .mini-grid,
  .workflow-grid,
  .case-grid,
  .seo-grid { grid-template-columns: 1fr; }
  .tool-status { display: none; }
}

@media (max-width: 720px) {
  body { padding-top: 78px; }
  .site-header,
  .tool-header {
    min-height: 68px;
    padding: 0 16px;
  }
  .h5-logo-mark,
  .brand-logo-image {
    width: 156px !important;
    height: auto !important;
  }
  .brand-tool,
  .button.small { display: none; }
  .page-shell,
  .tool-page { width: min(100% - 24px, 1180px); }
  .hero { padding-top: 28px; }
  .metrics,
  .result-grid { grid-template-columns: 1fr; }
  .subset-export-card { align-items: stretch; flex-direction: column; }
  .subset-stack { grid-template-columns: repeat(4, 1fr); }
  .subset-stack i { width: auto; }
  .drop-zone {
    align-items: flex-start;
    padding: 20px;
  }
  .font-start-icon {
    width: 62px;
    height: 62px;
    flex-basis: 62px;
    border-radius: 18px;
    font-size: 24px;
  }
}
