/* imghd.ai upscaler page: the workspace (stage + side panel), the how-to and a short footer.
   The kit gives the nav, buttons, tokens and type; everything here sits inside the tool. */

.up-page { background: var(--p-bg); }
.up { padding-top: var(--nav); }
.up__work { padding: var(--s-6) 0 var(--s-8); }
.up__grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s-6); align-items: stretch; }
.up :is(h1, h2) { font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: var(--display-tracking); }

/* the stage: one dark surface holding the drop zone, the result or the limit */
.up__stage { position: relative; isolation: isolate; display: flex; overflow: hidden;
  min-height: clamp(460px, calc(100svh - var(--nav) - 2 * var(--s-6)), 820px);
  border-radius: 28px; background: #141414; box-shadow: 0 0 0 1px rgb(255 255 255 / .08); }
.up__glow { position: absolute; z-index: -1; inset: -40% -10% auto; height: 80%; pointer-events: none;
  background: radial-gradient(50% 50% at 50% 50%, rgb(47 107 254 / .22), transparent 70%); }
.up__stage[data-state="result"] .up__glow { display: none; }
.up__stage > [hidden] { display: none; }

.up__drop { flex: 1; margin: var(--s-4); display: grid; place-content: center; justify-items: center; gap: var(--s-4);
  padding: var(--s-7) var(--s-5); text-align: center; border-radius: 20px; border: 1.5px dashed rgb(255 255 255 / .18);
  transition: border-color .15s ease, background-color .15s ease; }
.up__stage.is-drag .up__drop { border-color: var(--p-accent); background: rgb(47 107 254 / .08); }
.up__ic { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; color: #8fb0ff;
  background: rgb(47 107 254 / .16); box-shadow: inset 0 0 0 1px rgb(47 107 254 / .35); }
.up__drop-h { margin: var(--s-2) 0 0; font-size: clamp(30px, 2.6vw, 44px); line-height: 1.08; text-wrap: balance; }
.up__drop-p { margin: 0; color: color-mix(in oklab, var(--ink) 76%, var(--bg)); max-width: 46ch; }
.up__fmt { margin: 0; font-size: 14px; color: color-mix(in oklab, var(--ink) 64%, var(--bg)); }
.up__samples { margin-top: var(--s-6); display: grid; justify-items: center; gap: var(--s-3); }
.up__samples-h { margin: 0; font-size: 14px; color: color-mix(in oklab, var(--ink) 76%, var(--bg)); }
.up__samples-row { display: flex; gap: var(--s-3); flex-wrap: wrap; justify-content: center; }
.up__sample { width: 104px; height: 78px; padding: 0; border: 0; border-radius: 14px; overflow: hidden; cursor: pointer; background: #222;
  box-shadow: 0 0 0 1px rgb(255 255 255 / .14); transition: transform .2s ease, box-shadow .2s ease; }
.up__sample img { width: 100%; height: 100%; object-fit: cover; display: block; }
.up__sample:hover { transform: translateY(-2px); box-shadow: 0 0 0 2px var(--p-accent); }
.up__sample:focus-visible { outline: 2px solid var(--action); outline-offset: 3px; }

.up__result { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.up__bar { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-bottom: 1px solid rgb(255 255 255 / .08); flex-wrap: wrap; }
.up__bar [hidden] { display: none; }
.up__file { color: color-mix(in oklab, var(--ink) 72%, var(--bg)); font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up__file b { color: var(--ink); font-weight: 500; }
.up__sp { flex: 1; }
.up__cmp { flex: 1; min-height: 320px; background: #0b0b0b; }
.up__cmp .cmp__img { object-fit: contain; }
.cmp__tag { position: absolute; z-index: 1; top: 14px; padding: 6px 11px; border-radius: 99px; background: rgb(14 14 14 / .74); color: #fff; font: 500 13px/1 var(--font-text); pointer-events: none; }
.cmp__tag--l { left: 14px; }
.cmp__tag--r { right: 14px; background: var(--p-accent); }
.cmp[data-single] :is(.cmp__tag--r, .cmp__line) { display: none; }
.up__busy { position: absolute; inset: 0; z-index: 3; display: grid; place-content: center; justify-items: center; gap: var(--s-3); background: rgb(14 14 14 / .55); color: #fff; font-weight: 500; }
.up__busy[hidden] { display: none; }
.up__spin { width: 36px; height: 36px; border-radius: 50%; border: 3px solid rgb(255 255 255 / .2); border-top-color: var(--p-accent); animation: up-spin .8s linear infinite; }
@keyframes up-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .up__spin { animation: none; } }

.up__limit { flex: 1; display: grid; place-content: center; justify-items: center; gap: var(--s-4); padding: var(--s-7) var(--s-5); text-align: center; }

.up__status:not(:empty) { position: absolute; z-index: 4; left: 50%; bottom: var(--s-5); transform: translateX(-50%); max-width: calc(100% - 32px);
  margin: 0; padding: 10px 16px; border-radius: 99px; background: #0e0e0e; color: #fff; font: 500 14px/1.35 var(--font-text); text-align: center;
  box-shadow: 0 0 0 1px rgb(255 255 255 / .16), 0 10px 30px rgb(0 0 0 / .4); }
.up__status:empty { display: none; }
.up__status a { color: #8fb0ff; }

/* the side panel */
.up__side { display: flex; flex-direction: column; gap: var(--s-5); padding: var(--s-2) 0; }
.up__side h1 { margin: 0; font-size: clamp(32px, 2.6vw, 42px); line-height: 1.06; }
.up__lead { margin: 0; color: color-mix(in oklab, var(--ink) 76%, var(--bg)); }
.up__block { display: grid; gap: var(--s-2); }
.up__block .t-label { margin: 0; color: color-mix(in oklab, var(--ink) 64%, var(--bg)); }
.up__seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 99px; background: rgb(255 255 255 / .07); width: max-content; }
.up__seg span { padding: 6px 16px; border-radius: 99px; font-size: 14px; color: color-mix(in oklab, var(--ink) 64%, var(--bg)); }
.up__seg .is-on { background: #fff; color: #0e0e0e; }
.up__quota { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; max-width: 240px; }
.up__quota i { height: 8px; border-radius: 99px; background: var(--p-accent); }
.up__quota i.is-used { background: rgb(255 255 255 / .14); }
.up__note { margin: 0; font-size: 15px; }
.up__rules { list-style: none; margin: 0; padding: 0; display: grid; }
.up__rules li { padding: var(--s-3) 0; border-top: 1px solid var(--line); font-size: 15px; color: color-mix(in oklab, var(--ink) 82%, var(--bg)); }
.up__app { margin-top: auto; display: flex; align-items: center; gap: var(--s-3); padding: var(--s-4); border-radius: 18px; text-decoration: none; color: inherit;
  background: #151515; box-shadow: 0 0 0 1px rgb(255 255 255 / .08); transition: transform .2s ease, box-shadow .2s ease; }
.up__app:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px rgb(47 107 254 / .6); }
.up__app img { border-radius: 12px; flex: none; }
.up__app > span { display: grid; gap: 2px; } .up__app b { font-weight: 500; } .up__app > span > span { font-size: 14px; color: color-mix(in oklab, var(--ink) 68%, var(--bg)); }
.nav__quota { font-size: 14px; color: color-mix(in oklab, var(--ink) 72%, var(--bg)); white-space: nowrap; }

/* how-to */
.up__how { padding: var(--s-8) 0 var(--s-9); border-top: 1px solid var(--line); }
.up__how h2 { margin: 0 0 var(--s-6); font-size: clamp(28px, 2.4vw, 40px); line-height: 1.1; max-width: 22ch; }
.up__steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-5); counter-reset: s; }
.up__steps li { counter-increment: s; padding-top: var(--s-4); border-top: 1px solid var(--line); color: color-mix(in oklab, var(--ink) 80%, var(--bg)); }
.up__steps li::before { content: counter(s); display: block; margin-bottom: var(--s-3); font: 500 14px/1 var(--font-mono); color: #8fb0ff; }
.up__steps b { color: var(--ink); font-weight: 500; }

.up-foot { padding: var(--s-6) 0 var(--s-7); border-top: 1px solid var(--line); }
.up-foot__row { display: flex; align-items: center; gap: var(--s-6); flex-wrap: wrap; }
.up-foot__links { display: flex; gap: var(--s-5); flex-wrap: wrap; }
.up-foot__links a, .up-foot__legal { font-size: 14px; color: color-mix(in oklab, var(--ink) 72%, var(--bg)); text-decoration: none; }
.up-foot__links a:hover { color: var(--ink); }
.up-foot__legal { margin-left: auto; } .up-foot__legal a { color: inherit; }

/* a tablet and a phone: the stage first, the panel under it */
@media (max-width: 1023px) {
  .up__grid { grid-template-columns: minmax(0, 1fr); }
  .up__stage { min-height: clamp(440px, 72svh, 720px); }
  .up__app { margin-top: 0; }
  .up__steps { grid-template-columns: minmax(0, 1fr); }
  .nav__quota { display: none; }
}
@media (max-width: 639px) {
  .up__work { padding-top: var(--s-4); }
  .up__stage { border-radius: 22px; }
  .up__drop { margin: var(--s-3); padding: var(--s-6) var(--s-4); }
  .up__sample { width: 88px; height: 66px; }
  .up__bar .btn { flex: 1 1 auto; }
  .up-foot__legal { margin-left: 0; }
}
