/* TinyPic — shared styles */
:root {
  --blue: #3d3cf9;
  --ink: #12143a;
  --snow: #eff5ff;
  --mist: #dde6ff;
  --line: #cfd9fb;
  --sun: #ffc21a;
  --sun-deep: #fd8b02;
  --muted: #4b5180;
  --peak-h: clamp(120px, 8.4vw, 240px);
  --font-head: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Instrument Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  color-scheme: light;
  font: 400 1.0625rem/1.6 var(--font-body);
}
img, svg { max-width: 100%; }
body { overflow-x: clip; }
button, a, label, select, summary { touch-action: manipulation; }
[hidden] { display: none !important; }
a { color: var(--blue); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

.wrap { width: min(1080px, 100% - 40px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: #fff; color: var(--ink); padding: 8px 14px; border-radius: 10px; }
.skip:focus { left: 12px; }

/* ---------- Header band ---------- */
.band { position: relative; background: linear-gradient(180deg, #e4ecff 0%, #f4f8ff 65%, #fff 100%); color: var(--ink); overflow: hidden; isolation: isolate; }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; padding-top: 18px; flex-wrap: wrap; position: relative; z-index: 4; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font: 700 1.5rem/1 var(--font-head); letter-spacing: -0.01em; }
.brand img { width: 42px; height: 42px; border-radius: 12px; }
.nav-links { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; max-width: 100%; }
.nav-links a { display: block; color: var(--ink); text-decoration: none; padding: 9px 14px; border-radius: 999px; font-weight: 500; font-size: 0.98rem; white-space: nowrap; }
.nav-links a:hover { background: rgba(61, 60, 249, 0.09); }
.nav-links a[aria-current='page'] { background: var(--blue); color: #fff; font-weight: 600; }
.menu-btn { display: none; }
.mobile-only { display: none; }
.menu-btn .bars, .menu-btn .bars::before, .menu-btn .bars::after { display: block; width: 20px; height: 2px; border-radius: 2px; background: currentColor; transition: transform 0.2s, background 0.2s; }
.menu-btn .bars { position: relative; }
.menu-btn .bars::before, .menu-btn .bars::after { content: ''; position: absolute; left: 0; }
.menu-btn .bars::before { top: -6px; }
.menu-btn .bars::after { top: 6px; }
.menu-btn[aria-expanded='true'] .bars { background: transparent; }
.menu-btn[aria-expanded='true'] .bars::before { top: 0; transform: rotate(45deg); }
.menu-btn[aria-expanded='true'] .bars::after { top: 0; transform: rotate(-45deg); }
@media (max-width: 760px) {
  .nav { position: relative; flex-wrap: nowrap; }
  .menu-btn { display: inline-grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
  .mobile-only { display: block; }
  .nav-links { position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 6; display: grid; gap: 2px; padding: 8px; overflow: visible; background: #fff; border: 1.5px solid var(--line); border-radius: 18px; box-shadow: 0 14px 34px rgba(18, 20, 58, 0.16); }
  .nav-links a { padding: 14px 16px; border-radius: 12px; font-size: 1.05rem; text-align: left; }
  .js .nav-links { display: none; }
  .js .nav.is-open .nav-links { display: grid; }
}

.band-copy { position: relative; z-index: 2; padding: clamp(36px, 6vw, 72px) 0 calc(var(--peak-h) + 12px); max-width: 640px; }
.band h1 { font: 700 clamp(1.9rem, 5.2vw, 3.6rem)/1.08 var(--font-head); letter-spacing: -0.025em; margin: 0 0 16px; text-wrap: balance; }
.lede { font-size: clamp(1.05rem, 2vw, 1.2rem); color: var(--muted); margin: 0; max-width: 34em; }

.sun {
  position: absolute; z-index: 1;
  right: max(6vw, calc(50% - 470px));
  bottom: calc(var(--peak-h) * 0.4);
  width: clamp(84px, 12vw, 150px); aspect-ratio: 1; border-radius: 50%;
  background: linear-gradient(150deg, #fff122, #fd8b02);
  box-shadow: 0 0 70px rgba(255, 194, 26, 0.5);
  animation: rise 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
@keyframes rise { from { transform: translateY(80px); opacity: 0; } to { transform: none; opacity: 1; } }
.peaks { position: absolute; z-index: 3; left: 0; bottom: -1px; width: 100%; height: var(--peak-h); display: block; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 1rem/1.2 var(--font-body); min-height: 44px; padding: 13px 22px; border-radius: 14px; border: 2px solid transparent; cursor: pointer; text-decoration: none; transition: background 0.15s, border-color 0.15s; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #2f2ee0; }
.btn-sun { background: var(--sun); color: var(--ink); }
.btn-sun:hover { background: #ffb300; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--blue); }
.btn-small { padding: 10px 16px; font-size: 0.95rem; border-radius: 12px; }
.btn-large { padding: 16px 26px; font-size: 1.05rem; }

/* ---------- Workspace ---------- */
.workspace { background: #fff; border: 1px solid var(--line); border-radius: 28px; padding: clamp(16px, 3vw, 32px); margin-top: 12px; }
.drop { border: 2px dashed #aebcf3; border-radius: 22px; background: var(--snow); padding: clamp(32px, 6vw, 60px) 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; transition: background 0.15s, border-color 0.15s; }
.drop.compact { padding: 22px 20px; flex-direction: row; justify-content: center; flex-wrap: wrap; gap: 8px 18px; }
.is-over .drop { background: #e3e9ff; border-color: var(--blue); }
.drop-icon { color: var(--blue); line-height: 0; }
.drop.compact .drop-icon { display: none; }
.drop-title { font: 700 1.5rem/1.2 var(--font-head); margin: 4px 0 0; }
.drop-sub { margin: 0 0 12px; color: var(--muted); max-width: 32em; }
.drop.compact .drop-sub { display: none; }
.drop.compact .drop-title { font-size: 1.15rem; margin: 0; }
.drop.compact .btn { padding: 11px 18px; }

.status { margin: 14px 0 0; min-height: 1.4em; font-weight: 500; }
.status.error { color: #b3261e; }
.status.ok { color: #14653a; }

.tool { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, 1fr); gap: clamp(20px, 3vw, 36px); align-items: start; margin-top: 8px; }
@media (max-width: 880px) { .tool { grid-template-columns: minmax(0, 1fr); } }
.checker { background: conic-gradient(#e6ecff 25%, #fff 0 50%, #e6ecff 0 75%, #fff 0) 0 0 / 20px 20px; border-radius: 18px; }
.preview { padding: 12px; display: grid; place-items: center; }
.preview img { max-width: 100%; max-height: 440px; display: block; border-radius: 6px; }
.file-info { margin: 10px 0 0; color: var(--muted); font-size: 0.95rem; overflow-wrap: anywhere; }

.controls { display: grid; gap: 18px; min-width: 0; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { font-weight: 600; font-size: 0.95rem; padding: 0; margin-bottom: 6px; }
.field { display: grid; gap: 6px; font-weight: 600; font-size: 0.95rem; min-width: 0; }
.field input[type='number'], .field select { font: inherit; font-weight: 400; padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); width: 100%; }
.field input[type='number']:focus, .field select:focus { border-color: var(--blue); }
.field input[type='color'] { width: 100%; height: 44px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; padding: 3px; cursor: pointer; }
.field input[type='range'] { width: 100%; height: 28px; accent-color: var(--blue); }
.field output { font-weight: 500; color: var(--muted); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.check input { width: 20px; height: 20px; accent-color: var(--blue); }
.hint { margin: 0; color: var(--muted); font-size: 0.95rem; }
.size-line { margin: 0; font-weight: 600; }

.seg { display: inline-flex; background: var(--snow); border: 1.5px solid var(--line); border-radius: 14px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: block; padding: 11px 16px; border-radius: 10px; font-weight: 600; font-size: 0.95rem; }
.seg input:checked + span { background: var(--blue); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chips-label { font-size: 0.92rem; color: var(--muted); margin-right: 2px; }
.chip { font: 600 0.9rem var(--font-body); padding: 9px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
.chip:hover { border-color: var(--blue); }
.chip[aria-pressed='true'] { background: var(--blue); border-color: var(--blue); color: #fff; }

.result { border-radius: 18px; background: #fff7de; border: 1.5px solid #ffd978; padding: 16px; display: grid; gap: 12px; }
.result p { margin: 0; font-weight: 500; }

/* ---------- Crop ---------- */
.crop-main { display: grid; justify-items: center; padding: 18px; min-width: 0; }
.stage { position: relative; line-height: 0; user-select: none; -webkit-user-select: none; }
.stage img { display: block; max-width: none; pointer-events: none; border-radius: 2px; }
.dim { position: absolute; inset: 0; background: rgba(18, 20, 58, 0.6); pointer-events: none; }
.cbox {
  position: absolute; border: 2px solid #fff; cursor: move; touch-action: none;
  background:
    linear-gradient(#fff6, #fff6) 33.333% 0 / 1px 100% no-repeat,
    linear-gradient(#fff6, #fff6) 66.666% 0 / 1px 100% no-repeat,
    linear-gradient(#fff6, #fff6) 0 33.333% / 100% 1px no-repeat,
    linear-gradient(#fff6, #fff6) 0 66.666% / 100% 1px no-repeat;
}
.hd { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; background: #fff; border: 3px solid var(--blue); border-radius: 50%; touch-action: none; }
.hd::after { content: ''; position: absolute; inset: -10px; }
.hd[data-h='nw'] { left: 0; top: 0; cursor: nwse-resize; }
.hd[data-h='n'] { left: 50%; top: 0; cursor: ns-resize; }
.hd[data-h='ne'] { left: 100%; top: 0; cursor: nesw-resize; }
.hd[data-h='e'] { left: 100%; top: 50%; cursor: ew-resize; }
.hd[data-h='se'] { left: 100%; top: 100%; cursor: nwse-resize; }
.hd[data-h='s'] { left: 50%; top: 100%; cursor: ns-resize; }
.hd[data-h='sw'] { left: 0; top: 100%; cursor: nesw-resize; }
.hd[data-h='w'] { left: 0; top: 50%; cursor: ew-resize; }
.field-row-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 480px) { .field-row-4 { grid-template-columns: 1fr 1fr; } }

/* ---------- Batch rows ---------- */
.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; align-items: end; margin-top: 20px; padding: 18px; background: var(--snow); border-radius: 18px; }
.rows { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 10px; }
.row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 16px; }
.thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; background: var(--mist); }
.row-main { display: grid; min-width: 0; }
.row-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta { color: var(--muted); font-size: 0.92rem; }
.badge { font-weight: 700; font-size: 0.85rem; padding: 5px 10px; border-radius: 999px; background: var(--mist); color: var(--ink); white-space: nowrap; }
.badge.good { background: #d8f5e3; color: #0e5b32; }
.badge.warn { background: #ffe9c2; color: #7a4300; }
.row.is-error { border-color: #e9a7a2; }
.row.is-error .row-meta { color: #b3261e; }
@media (max-width: 620px) {
  .row { grid-template-columns: 48px minmax(0, 1fr); }
  .thumb { width: 48px; height: 48px; }
  .row .badge, .row .btn { grid-column: 2; justify-self: start; }
}
.summary { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-top: 20px; padding: 14px 16px; border-radius: 16px; background: #fff7de; border: 1.5px solid #ffd978; }
.summary p { margin: 0; font-weight: 600; }
.summary .actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Home ---------- */
.tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding-top: 12px; }
@media (max-width: 720px) { .tools { grid-template-columns: minmax(0, 1fr); } }
.tool-link { display: grid; grid-template-columns: auto 1fr; gap: 4px 18px; align-content: center; padding: 24px; border-radius: 26px; background: #fff; border: 1.5px solid var(--line); text-decoration: none; color: var(--ink); transition: border-color 0.15s; }
.tool-link:hover { border-color: var(--blue); }
.tool-link .ico { grid-row: span 2; width: 58px; height: 58px; border-radius: 19px; display: grid; place-items: center; background: var(--blue); color: #fff; }
.tool-link:nth-child(2) .ico { background: var(--sun); color: var(--ink); }
.tool-link:nth-child(3) .ico { background: var(--ink); color: #fff; }
.tool-link:nth-child(4) .ico { background: #86adfc; color: var(--ink); }
.tool-link h2 { margin: 0; font: 700 1.4rem/1.2 var(--font-head); }
.tool-link p { margin: 0; color: var(--muted); }
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px; }
@media (max-width: 760px) { .trio { grid-template-columns: minmax(0, 1fr); gap: 20px; } }
.trio h3 { font: 700 1.25rem/1.25 var(--font-head); margin: 0 0 6px; }
.trio p { margin: 0; color: var(--muted); }

/* ---------- Content ---------- */
.content { padding: clamp(40px, 6vw, 80px) 0 20px; }
.content h2 { font: 700 clamp(1.5rem, 3vw, 2rem)/1.15 var(--font-head); letter-spacing: -0.015em; margin: 2.2em 0 0.6em; }
.content > .wrap > h2:first-child, .content h2.first { margin-top: 0; }
.prose { max-width: 44rem; }
.prose p { margin: 0 0 1em; }
.steps { padding-left: 1.3em; margin: 0; }
.steps li { margin: 0.55em 0; padding-left: 0.2em; }
details { border-bottom: 1px solid var(--line); padding: 14px 0; }
details:first-of-type { border-top: 1px solid var(--line); }
summary { font-weight: 600; cursor: pointer; }
details p { margin: 10px 0 0; color: var(--muted); }
.more { display: flex; flex-wrap: wrap; gap: 10px; }

footer { background: #fff; border-top: 1px solid var(--line); color: var(--muted); padding: 26px 0 18px; margin-top: 40px; }
.foot { display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; align-items: center; }
.foot .brand { font-size: 1.15rem; gap: 10px; }
.foot .brand img { width: 32px; height: 32px; border-radius: 10px; }
.foot p { margin: 0; font-size: 0.92rem; }
.foot-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 0.9rem; }
.foot-bottom p { margin: 0; }
.heart { color: #e5484d; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sun { animation: none; }
  * { transition: none !important; }
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Responsive: phones, tablets, touch ---------- */
@media (max-width: 880px) {
  .controls > .btn, .result .btn { width: 100%; }
}
@media (max-width: 600px) {
  .band-copy { padding-bottom: calc(var(--peak-h) + 44px); }
  .nav { padding-top: 14px; }
  .brand { font-size: 1.35rem; }
}
@media (max-width: 480px) {
  .workspace { border-radius: 20px; padding: 14px; }
  .crop-main { padding: 10px; }
  .drop { border-radius: 16px; }
  .tool-link { padding: 18px; gap: 4px 14px; border-radius: 20px; }
  .tool-link .ico { width: 50px; height: 50px; border-radius: 16px; }
  .options { padding: 14px; }
  .summary .actions { width: 100%; }
  .summary .actions .btn { flex: 1; }
  .foot { gap: 24px; }
}
@media (pointer: coarse) {
  .hide-coarse { display: none; }
  .chip { min-height: 44px; }
  .field input[type='number'], .field select { min-height: 46px; }
}
@media (hover: none) {
  .btn-primary:hover:not(:disabled) { background: var(--blue); }
  .btn-sun:hover { background: var(--sun); }
  .btn-ghost:hover, .tool-link:hover { border-color: var(--line); }
  .chip:not([aria-pressed='true']):hover { border-color: var(--line); }
  .nav-links a:not([aria-current]):hover { background: transparent; }
}

/* ---------- Compressor: file size target ---------- */
.span-all { grid-column: 1 / -1; }
.size-custom { display: flex; gap: 8px; max-width: 280px; }
.size-custom input { flex: 1; min-width: 0; }
.size-custom select { width: 92px; flex: none; }
.options .hint { font-weight: 400; }

/* ---------- Home: feature cards ---------- */
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
@media (max-width: 880px) { .features { grid-template-columns: minmax(0, 1fr); } }
.feature { padding: 26px 26px 28px; border-radius: 26px; background: #f4f8ff; border: 1.5px solid #e3ebff; }
.feature svg { color: var(--blue); display: block; margin-bottom: 18px; }
.feature h2 { margin: 0 0 6px; font: 700 1.25rem/1.25 var(--font-head); }
.feature p { margin: 0; color: var(--muted); }
@media (max-width: 480px) { .feature { padding: 20px; border-radius: 20px; } }
