/* sibox static site. System fonts only. No remote assets. */

:root {
  --bg: #f3efe8;
  --surface: #fffcf8;
  --ink: #1c1916;
  --muted: #4e4943;
  --line: #ddd4c8;
  --seal: #9d3222;
  --seal-dark: #7c2619;
  --seal-soft: #f6e4df;
  --sans: "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Noto Sans SC", "Microsoft YaHei", "Source Han Sans SC", "WenQuanYi Micro Hei", system-ui, sans-serif;
  --max: 70rem;
  --measure: 40rem;
}

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

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  border-top: 4px solid var(--seal);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.75;
}

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

h1,
h2,
h3 {
  line-height: 1.35;
  font-weight: 700;
}

p {
  margin: 0.6rem 0;
}

a {
  color: var(--seal-dark);
  text-underline-offset: 0.18em;
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: 0.4rem;
  z-index: 3;
  transform: translateY(-200%);
  background: #fff;
  color: var(--ink);
  padding: 0.4rem 0.7rem;
}

.skip:focus {
  transform: none;
}

.wrap {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

main {
  padding-top: 0.25rem;
  padding-bottom: 3.5rem;
}

main:focus {
  outline: none;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-block: 1rem 0.85rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: inherit;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.brand-mark {
  display: block;
  color: var(--ink);
}

.brand-mark .lid {
  fill: var(--seal);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 1.05rem;
}

.site-nav a,
.site-footer a,
.card,
.entry-list a {
  color: inherit;
}

.site-nav a {
  display: inline-block;
  padding: 0.35rem 0;
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover,
.site-footer a:hover {
  color: var(--ink);
}

.site-nav a[aria-current="page"] {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--seal);
}

.hero {
  padding: 1.35rem 0 0.25rem;
}

.hero h1 {
  margin: 0.2rem 0 0.35rem;
  max-width: 18em;
  font-size: clamp(1.55rem, 1.15rem + 1.7vw, 2.15rem);
  letter-spacing: -0.01em;
}

.lede {
  max-width: 38rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.section-title {
  margin: 2.4rem 0 0.8rem;
  font-size: 0.95rem;
  letter-spacing: 0.16em;
}

.kicker {
  margin: 1.2rem 0 0.2rem;
  color: var(--seal);
  font-size: 0.82rem;
  letter-spacing: 0.14em;
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

.card {
  display: block;
  padding: 1.05rem 1.1rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--ink);
  text-decoration: none;
}

.card:hover {
  border-top-color: var(--seal);
}

.card h3 {
  margin: 0.4rem 0 0.3rem;
  font-size: 1.2rem;
}

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

.badge {
  display: inline-block;
  margin: 0;
  padding: 0.08rem 0.42rem;
  background: var(--seal-soft);
  color: var(--seal-dark);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  line-height: 1.5;
}

.entry-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.entry-list a {
  display: block;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.entry-list h2,
.entry-list h3 {
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
}

.entry-list p {
  margin: 0;
  color: var(--muted);
}

.entry-list a:hover h2,
.entry-list a:hover h3 {
  color: var(--seal-dark);
}

.prose {
  max-width: var(--measure);
}

.prose h1 {
  margin: 0.2rem 0 0.4rem;
  font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2rem);
}

.prose h2 {
  margin: 1.8rem 0 0.45rem;
  font-size: 1.22rem;
}

.prose ol,
.prose ul {
  margin: 0.4rem 0 0;
  padding-left: 1.25rem;
}

.prose li + li {
  margin-top: 0.65rem;
}

.updated,
.hint,
.fine,
.file-name {
  color: var(--muted);
  font-size: 0.92rem;
}

.file-name {
  overflow-wrap: anywhere;
}

.updated {
  margin-top: 0;
}

.tool-layout {
  display: grid;
  gap: 1rem;
  margin-top: 1.15rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 1rem 1rem 1.15rem;
}

.panel.is-dragover {
  border-color: var(--seal);
  background: var(--seal-soft);
}

fieldset {
  border: 0;
  margin: 0 0 1rem;
  padding: 0;
}

legend {
  margin-bottom: 0.55rem;
  padding: 0;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
}

.field {
  margin-bottom: 0.85rem;
}

.field-label,
label {
  display: block;
  margin-bottom: 0.3rem;
}

input[type="text"],
input[type="number"],
select,
textarea {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line);
  background: #fff;
  color: inherit;
  font: inherit;
  font-size: 1rem;
}

textarea {
  min-height: 10rem;
  padding: 0.7rem 0.75rem;
  line-height: 1.65;
  resize: vertical;
}

input[type="file"] {
  width: 100%;
  font: inherit;
  font-size: 1rem;
}

input[type="range"] {
  width: 100%;
  min-height: 2.75rem;
  accent-color: var(--seal);
}

.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.45rem;
}

.presets button,
.button {
  min-height: 2.75rem;
  font: inherit;
  cursor: pointer;
}

.presets button {
  padding: 0.2rem 0.7rem;
  border: 1px solid var(--line);
  background: transparent;
  color: inherit;
}

.presets button[aria-pressed="true"] {
  border-color: var(--seal);
  color: var(--seal-dark);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.45rem 1rem;
  border: 1px solid var(--seal);
  background: var(--seal);
  color: #fff;
}

.button:hover:not(:disabled) {
  background: var(--seal-dark);
  border-color: var(--seal-dark);
}

.button:disabled {
  border-color: #e4ddd3;
  background: #e4ddd3;
  color: #4e4943;
  cursor: not-allowed;
}

@media (min-width: 720px) {
  .prose .button {
    width: auto;
    min-width: 12rem;
  }
}

.preview-frame {
  display: grid;
  place-items: center;
  min-height: 16rem;
  padding: 0.75rem;
  background: #e7e1d6;
}

.preview-frame img {
  max-height: 32rem;
  background: #fff;
}

.preview-empty {
  margin: 0;
  color: var(--muted);
  text-align: center;
}

.size-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  margin: 0.9rem 0 0;
}

.size-grid div {
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
}

.size-grid dt {
  color: var(--muted);
  font-size: 0.8rem;
}

.size-grid dd {
  margin: 0.1rem 0 0;
  font-size: 1.12rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.meter {
  height: 0.4rem;
  margin-top: 0.75rem;
  background: #e6dfd4;
}

.meter span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--seal);
}

.status {
  min-height: 1.4em;
}

p.hint:empty,
p.status:empty {
  margin: 0;
}

.status:empty {
  min-height: 0;
}

.soon-box {
  min-height: 8rem;
  padding: 0.85rem 0.9rem;
  border: 1px dashed var(--seal);
  background: var(--seal-soft);
}

.soon-box p:first-child {
  margin-top: 0;
}

.soon-box p:last-child {
  margin-bottom: 0;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.4rem 0 2.4rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.footer-inner {
  display: grid;
  gap: 0.35rem;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
}

.site-footer a {
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

::selection {
  background: #f0d2cb;
}

@media (min-width: 720px) {
  .card-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 900px) {
  .tool-layout {
    grid-template-columns: minmax(18rem, 24rem) minmax(0, 1fr);
    align-items: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

.summary { border-left: 3px solid currentColor; padding: .5em 1em; margin: 1em 0; background: rgba(0,0,0,.04); }
