/* EncodeKit — static encoding tools. No external assets, no webfonts. */

:root {
  --paper: #eef0eb;
  --paper-deep: #e6e9e1;
  --surface: #ffffff;
  --ink: #131619;
  --ink-soft: #2c3138;
  --muted: #5c646e;
  --line: #c9cfc6;
  --signal: #dd3f00;
  --signal-dark: #b33300;
  --ok: #0e6b45;
  --ok-bg: #eef7f1;
  --err: #b42318;
  --err-bg: #fdf3f2;
  --font-ui: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-prose: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --font-mono: "Cascadia Mono", Consolas, "SF Mono", "Courier New", monospace;
  --shell: 940px;
  --radius: 3px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--signal);
  color: #fff;
}

.shell {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 28px;
}

a {
  color: var(--ink);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 20;
  background: var(--ink);
  color: #f5f6f2;
  padding: 10px 16px;
  text-decoration: none;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
}

/* Header */

.site-head {
  border-bottom: 1px solid var(--ink);
  background: var(--paper);
}

.site-head-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-prose);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand::before {
  content: "";
  width: 12px;
  height: 12px;
  background: var(--signal);
  display: inline-block;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 22px;
  font-size: 14px;
}

.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover {
  color: var(--ink);
  border-color: var(--signal);
}

.site-nav a[aria-current="page"] {
  color: var(--ink);
  border-color: var(--ink);
}

/* Breadcrumbs and hero */

.crumbs {
  padding-top: 18px;
  font-size: 13px;
  color: var(--muted);
}

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.crumbs li + li::before {
  content: "/";
  margin-right: 8px;
  color: var(--line);
}

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

.crumbs a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hero {
  max-width: 780px;
  padding: 34px 0 22px;
}

.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(2.05rem, 4.6vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-weight: 700;
}

.lede {
  max-width: 68ch;
  margin: 0 0 14px;
  font-family: var(--font-prose);
  font-size: 1.15rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.byline {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.byline time {
  color: var(--ink-soft);
}

.byline a {
  color: var(--ink-soft);
  text-decoration: underline;
  text-decoration-color: var(--rule, var(--line));
  text-underline-offset: 3px;
}

.byline a:hover {
  color: var(--signal-dark);
}

/* Tool */

.tool {
  margin: 4px 0 10px;
  background: var(--surface);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
}

.tool-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 24px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
}

.tool-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.tool-note {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.tool-note strong {
  color: var(--ok);
  font-weight: 650;
}

.panel {
  padding: 12px 20px 2px;
}

.panel-out {
  border-top: 1px dashed var(--line);
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.panel-label {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
}

.count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
}

.panel-head .btn {
  margin-left: 4px;
}

.editor {
  display: block;
  width: 100%;
  height: 106px;
  min-height: 84px;
  max-height: 300px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fafbf8;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.55;
  resize: vertical;
}

.editor:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 2px rgba(221, 63, 0, 0.2);
}

.editor::placeholder {
  color: #8b9298;
}

.editor[readonly] {
  background: #f3f5f0;
}

.tool-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
}

.btn {
  display: inline-block;
  margin: 0;
  padding: 11px 16px;
  border: 1px solid transparent;
  border-radius: 2px;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.btn-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #f5f6f2;
}

.btn-primary:hover {
  background: var(--signal);
  border-color: var(--signal);
}

.btn-outline {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}

.btn-outline:hover {
  background: var(--ink);
  color: #f5f6f2;
}

.btn-quiet {
  padding: 9px 12px;
  border-color: var(--line);
  background: transparent;
  color: var(--muted);
  font-weight: 500;
}

.btn-quiet:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.btn-small {
  padding: 6px 10px;
  font-size: 12.5px;
}

.btn:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

.tool-foot {
  padding: 0 20px 16px;
}

.status {
  margin: 0;
  padding: 8px 0 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
}

.status-ok {
  color: var(--ok);
}

.status-error {
  margin-top: 2px;
  padding: 9px 12px;
  border-left: 3px solid var(--err);
  background: var(--err-bg);
  color: var(--err);
  font-weight: 600;
}

.noscript-note {
  margin: 10px 0 0;
  padding: 10px 14px;
  background: #fff6e8;
  border-left: 3px solid #b25d00;
  font-size: 14px;
  color: #5a3a00;
}

/* Content */

.content {
  padding: 6px 0;
}

.content > section {
  border-top: 1px solid var(--line);
  padding: 34px 0 8px;
}

.content h2 {
  margin: 0 0 14px;
  font-size: 1.55rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.content h3 {
  margin: 24px 0 8px;
  font-size: 1.06rem;
  letter-spacing: -0.01em;
  font-weight: 650;
}

.content p {
  max-width: 70ch;
  margin: 0 0 16px;
  font-family: var(--font-prose);
  font-size: 1.06rem;
  line-height: 1.7;
  color: var(--ink-soft);
}

.content li {
  font-family: var(--font-prose);
  font-size: 1.04rem;
  line-height: 1.65;
  color: var(--ink-soft);
}

.content ul,
.content ol {
  max-width: 70ch;
  margin: 0 0 18px;
  padding-left: 22px;
}

.content li {
  margin-bottom: 8px;
}

.content li:last-child {
  margin-bottom: 0;
}

.content a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--signal);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.content a:hover {
  color: var(--signal-dark);
}

.content code {
  padding: 1px 5px;
  border-radius: 2px;
  background: #e5e8e0;
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--ink);
  word-break: break-word;
}

.steps {
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  margin: 0 0 10px;
  padding: 13px 16px 13px 52px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 2px;
  font-family: var(--font-prose);
  font-size: 1.03rem;
  line-height: 1.6;
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 15px;
  top: 13px;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: var(--ink);
  color: #f5f6f2;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  line-height: 23px;
  text-align: center;
}

.content .steps {
  max-width: none;
}

.table-wrap {
  margin: 4px 0 20px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
}

th,
td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  border-bottom: 1px solid var(--ink);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}

tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.55);
}

td code {
  white-space: nowrap;
}

/* FAQ */

.faq-list {
  margin: 2px 0 12px;
}

.faq-item {
  border-top: 1px solid var(--line);
  padding: 17px 0;
}

.faq-item:first-child {
  border-top: 0;
  padding-top: 6px;
}

.faq-item h3 {
  margin: 0 0 7px;
  font-size: 1.02rem;
  font-weight: 650;
  letter-spacing: -0.005em;
}

.faq-item p {
  margin: 0;
}

/* Related tools */

.related {
  border-top: 1px solid var(--ink);
  margin-top: 22px;
  padding: 26px 0 48px;
}

.related h2 {
  margin: 0 0 14px;
  font-size: 1.1rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.related ul {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.related li {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.related a {
  display: block;
  height: 100%;
  padding: 15px 17px;
  text-decoration: none;
  color: var(--ink);
}

.related a:hover {
  background: var(--surface);
}

.related a:hover .rel-title {
  color: var(--signal-dark);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.rel-title {
  display: block;
  margin-bottom: 4px;
  font-size: 14.5px;
  font-weight: 650;
}

.rel-desc {
  display: block;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

/* Footer */

.site-foot {
  background: var(--ink);
  color: #d9dcd4;
}

.site-foot .shell {
  padding-top: 38px;
  padding-bottom: 24px;
}

.foot-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 28px;
}

.foot-brand {
  margin: 0 0 9px;
  font-family: var(--font-prose);
  font-size: 20px;
  font-weight: 700;
  color: #f5f6f2;
}

.site-foot p {
  max-width: 42ch;
  margin: 0 0 8px;
  font-size: 13.5px;
  line-height: 1.6;
  color: #aeb4ab;
}

.site-foot h2 {
  margin: 0 0 10px;
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: #8f978e;
}

.site-foot ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-foot li {
  margin-bottom: 7px;
}

.site-foot a {
  color: #e4e7e0;
  font-size: 13.5px;
  text-decoration: none;
}

.site-foot a:hover {
  color: #ffffff;
  text-decoration: underline;
  text-decoration-color: var(--signal);
  text-underline-offset: 3px;
}

.foot-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 18px;
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid #343a34;
  font-size: 12.5px;
  color: #8f978e;
}

.foot-base p {
  margin: 0;
  max-width: none;
  font-size: 12.5px;
  color: inherit;
}

/* Responsive */

@media (max-width: 760px) {
  .shell {
    padding: 0 18px;
  }

  .hero {
    padding-top: 26px;
  }

  .hero h1 {
    font-size: clamp(1.9rem, 8vw, 2.5rem);
  }

  .lede {
    font-size: 1.07rem;
  }

  .site-head-inner {
    min-height: 58px;
  }

  .site-nav {
    gap: 2px 16px;
    font-size: 13px;
  }

  .related ul {
    grid-template-columns: 1fr 1fr;
  }

  .foot-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .site-head-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 12px 18px;
  }

  .site-nav {
    width: 100%;
    gap: 0 16px;
  }

  .crumbs {
    padding-top: 12px;
  }

  .hero {
    padding: 20px 0 16px;
  }

  .tool-top,
  .panel,
  .tool-actions,
  .tool-foot {
    padding-left: 14px;
    padding-right: 14px;
  }

  .tool-top {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .editor {
    height: 92px;
    min-height: 76px;
  }

  .tool-actions {
    gap: 7px;
  }

  .btn {
    padding: 10px 13px;
    font-size: 13.5px;
  }

  .related ul {
    grid-template-columns: 1fr;
  }

  .foot-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .content > section {
    padding-top: 26px;
  }

  .content h2 {
    font-size: 1.35rem;
  }
}

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