:root {
  --ink: #101010;
  --muted: #5e6570;
  --line: #dde2e7;
  --paper: #ffffff;
  --page: #f6f7f9;
  --teal: #0f766e;
  --teal-dark: #0a4f49;
  --amber: #b7791f;
  --coral: #cf4b45;
  --blue: #315fd5;
  --shadow: 0 16px 42px rgba(16, 16, 16, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

img,
svg {
  display: block;
}

[hidden] {
  display: none !important;
}

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
}

textarea {
  resize: vertical;
}

.container {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 20;
  padding: 10px 14px;
  color: #fff;
  background: var(--ink);
  border-radius: 6px;
  text-decoration: none;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.header-inner,
.footer-grid,
.footer-bottom,
.section-heading,
.tool-layout,
.hero-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.header-inner {
  min-height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 900;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
}

.site-nav,
.site-footer nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.site-nav a,
.site-footer nav a {
  padding: 9px 11px;
  color: var(--muted);
  text-decoration: none;
  border-radius: 6px;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-footer nav a:hover,
.site-footer nav a:focus-visible {
  color: var(--ink);
  background: #eef1f4;
  outline: none;
}

.hero-section {
  padding: 72px 0 48px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.hero-grid {
  align-items: center;
}

.hero-copy {
  max-width: 720px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.08;
}

h1 {
  font-size: 3.75rem;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.14rem;
}

.hero-text,
.section-heading p,
.tool-intro,
.page-content p,
.page-content li {
  color: var(--muted);
}

.hero-text {
  max-width: 650px;
  margin: 18px 0 0;
  font-size: 1.1rem;
}

.hero-panel {
  width: min(100%, 360px);
  padding: 18px;
  color: #fff;
  background: var(--ink);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-panel strong,
.hero-panel span {
  display: block;
}

.hero-panel span {
  color: #cdd3d8;
}

.section {
  padding: 64px 0;
}

.section-heading {
  align-items: flex-end;
  margin-bottom: 22px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.tool-card {
  display: grid;
  gap: 14px;
  min-height: 220px;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(16, 16, 16, 0.04);
}

.tool-card:hover,
.tool-card:focus-visible {
  border-color: #b9c4ce;
  transform: translateY(-2px);
  outline: none;
}

.tool-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--teal);
  border-radius: 8px;
  font-weight: 900;
}

.tool-card p {
  margin: 0;
  color: var(--muted);
}

.mini-list {
  display: grid;
  gap: 7px;
  padding: 14px 0 0;
  margin: 0;
  color: var(--muted);
  border-top: 1px solid var(--line);
  list-style: none;
}

.mini-list li {
  position: relative;
  padding-left: 15px;
}

.mini-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 6px;
  height: 6px;
  background: var(--teal);
  border-radius: 50%;
}

.tool-section {
  padding: 42px 0 72px;
}

.tool-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 22px;
  align-items: start;
}

.workspace,
.side-panel,
.content-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(16, 16, 16, 0.04);
}

.workspace {
  padding: 18px;
}

.side-panel,
.content-panel {
  padding: 20px;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 900;
}

.text-input,
.result-input,
.small-input {
  width: 100%;
  color: var(--ink);
  background: #fff;
  border: 1px solid #cfd6dd;
  border-radius: 8px;
  outline: none;
}

.text-input {
  min-height: 280px;
  padding: 14px;
}

.result-input {
  min-height: 170px;
  padding: 14px;
}

.small-input {
  min-height: 42px;
  padding: 0 12px;
}

.text-input:focus,
.result-input:focus,
.small-input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.14);
}

.control-grid,
.stats-grid {
  display: grid;
  gap: 10px;
}

.control-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 14px 0;
}

.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
  text-decoration: none;
}

.button:hover,
.button:focus-visible {
  border-color: #aeb7c2;
  outline: none;
}

.button.primary {
  color: #fff;
  background: var(--teal);
  border-color: var(--teal);
}

.button.primary:hover,
.button.primary:focus-visible {
  background: var(--teal-dark);
}

.button.danger {
  color: #8b1d18;
  border-color: #efc7c4;
}

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

.stat {
  padding: 14px;
  background: #f8f9fb;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stat strong,
.stat span {
  display: block;
}

.stat strong {
  font-size: 1.55rem;
  line-height: 1.1;
}

.stat span {
  color: var(--muted);
  font-size: 0.9rem;
}

.option-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
  color: var(--muted);
  font-weight: 700;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.result-block {
  margin-top: 16px;
}

.helper-text {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.93rem;
}

.toast {
  min-height: 24px;
  margin-top: 10px;
  color: var(--teal);
  font-weight: 900;
}

.related-list {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 16px 0 0;
  list-style: none;
}

.related-list a {
  display: block;
  padding: 10px 12px;
  color: var(--muted);
  background: #f8f9fb;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 800;
}

.related-list a:hover,
.related-list a:focus-visible {
  color: var(--ink);
  border-color: #b9c4ce;
  outline: none;
}

.page-hero {
  padding: 58px 0 34px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.page-hero h1 {
  font-size: 3rem;
}

.page-content {
  padding: 54px 0 72px;
}

.content-panel {
  max-width: 840px;
}

.content-panel h2 {
  margin-top: 28px;
  font-size: 1.4rem;
}

.content-panel h2:first-child {
  margin-top: 0;
}

.site-footer {
  padding: 34px 0 24px;
  color: #fff;
  background: var(--ink);
}

.site-footer p {
  margin: 12px 0 0;
  color: #c7ccd1;
}

.footer-brand {
  color: #fff;
}

.site-footer nav a {
  color: #c7ccd1;
}

.site-footer nav a:hover,
.site-footer nav a:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.footer-bottom {
  margin-top: 28px;
  padding-top: 18px;
  color: #aeb6bd;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.92rem;
}

@media (max-width: 920px) {
  .hero-grid,
  .tool-shell {
    display: grid;
    grid-template-columns: 1fr;
  }

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

  .hero-panel {
    width: 100%;
  }
}

@media (max-width: 680px) {
  .header-inner,
  .section-heading,
  .footer-grid,
  .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-inner {
    padding: 14px 0;
  }

  .site-nav {
    width: 100%;
  }

  h1 {
    font-size: 2.65rem;
  }

  h2 {
    font-size: 1.7rem;
  }

  .page-hero h1 {
    font-size: 2.25rem;
  }

  .tool-grid,
  .stats-grid,
  .control-grid,
  .two-col {
    grid-template-columns: 1fr;
  }

  .section,
  .tool-section {
    padding-block: 48px;
  }
}
