/* Ortho Morph — matches thedanielyeh.com (iPortfolio palette & type) */

:root {
  --ink: #272829;
  --ink-soft: #55585c;
  --bg: #fff;
  --panel: #f7f8f9;
  --line: #e2e5e8;
  --accent: #b8a07e;
  --accent-deep: #826f54;
  --link-hover: #37b3ed;
  --dark: #040b14;
  --error: #b3372f;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8eaec;
    --ink-soft: #a9adb2;
    --bg: #0b1119;
    --panel: #101825;
    --line: #223047;
    --error: #ff8a80;
  }
}

* {
  box-sizing: border-box;
}

/* the hidden attribute must beat any display set by component classes */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: "Open Sans", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}

h1,
h2,
h3 {
  font-family: Raleway, sans-serif;
}

a {
  color: var(--accent-deep);
}

a:hover {
  color: var(--link-hover);
}

@media (prefers-color-scheme: dark) {
  a {
    color: var(--accent);
  }
}

/* top bar */
.topbar {
  background: var(--dark);
  color: #cfd6dd;
  padding: 14px 20px;
  font-family: Poppins, sans-serif;
  font-size: 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.topbar .back {
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.topbar .back:hover {
  color: var(--accent);
}

.topbar .crumb {
  opacity: 0.75;
}

.topbar .crumb.current {
  opacity: 1;
  color: var(--accent);
}

main {
  max-width: 860px;
  margin: 0 auto;
  padding: 8px 20px 60px;
}

/* hero */
.hero {
  padding: 34px 0 8px;
}

.hero h1 {
  font-size: 40px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--ink);
}

.hero .tagline {
  font-size: 19px;
  color: var(--ink-soft);
  margin: 0 0 14px;
}

.hero .privacy {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 16px;
  margin: 0;
  font-size: 15px;
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--accent-deep);
}

@media (prefers-color-scheme: dark) {
  .icon {
    color: var(--accent);
  }
}

.hero .privacy .icon {
  width: 30px;
  height: 30px;
  padding: 8px;
  border-radius: 9px;
  background: rgb(184 160 126 / 16%);
}

.icon.big {
  width: 30px;
  height: 30px;
  margin: 0;
}

/* panels */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 24px;
  margin-top: 22px;
}

.panel h2 {
  font-size: 22px;
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-family: Poppins, sans-serif;
  flex: 0 0 auto;
}

.hint {
  color: var(--ink-soft);
  font-size: 14.5px;
  margin: 4px 0 14px;
}

.demo-video {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  background: #000;
  cursor: pointer;
}

/* dropzone */
.dropzone {
  border: 2px dashed var(--accent);
  border-radius: var(--radius);
  background: var(--bg);
  min-height: 110px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 22px;
  cursor: pointer;
  text-align: center;
  color: var(--ink-soft);
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--link-hover);
  color: var(--ink);
}

.dropzone strong {
  color: var(--accent-deep);
}

@media (prefers-color-scheme: dark) {
  .dropzone strong {
    color: var(--accent);
  }
}

/* keyboard focus (before more-specific control selectors, per house lint) */
.dropzone:focus-visible,
select:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--link-hover);
  outline-offset: 2px;
}

/* thumbnails */
.thumbs {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 0;
  margin: 16px 0 0;
}

.thumbs li {
  position: relative;
  width: 132px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  padding: 6px 6px 4px;
  cursor: grab;
  touch-action: pan-y; /* vertical swipes keep scrolling; sideways starts a drag */
  user-select: none;
}

.thumbs img {
  width: 120px;
  height: 84px;
  object-fit: cover;
  border-radius: 5px;
  display: block;
}

.thumbs .ord {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--dark);
  color: #fff;
  font-size: 12px;
  font-family: Poppins, sans-serif;
  border-radius: 999px;
  padding: 1px 8px;
  opacity: 0.92;
}

.thumbs .row {
  display: flex;
  justify-content: space-between;
  margin-top: 2px;
}

.thumbs button {
  border: 0;
  background: none;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 16px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 6px;
}

.thumbs button:hover {
  background: var(--panel);
  color: var(--ink);
}

.thumbs button:disabled {
  opacity: 0.3;
  cursor: default;
}

.thumbs .rm:hover {
  color: var(--error);
}

.thumbs li.drag-src {
  opacity: 0.35;
}

.thumbs li.thumb-ghost {
  position: fixed;
  z-index: 999;
  margin: 0;
  pointer-events: none;
  opacity: 0.95;
  box-shadow: 0 12px 28px rgb(0 0 0 / 35%);
}

body.dragging-thumb {
  cursor: grabbing;
  user-select: none;
}

/* options: equal-height columns so the 44px control rows center-align */
.options {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  align-items: stretch;
}

.opt {
  display: flex;
  flex-direction: column;
}

.opt.checkbox {
  justify-content: flex-end;
}

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

legend,
.opt > label {
  font-size: 14px;
  font-weight: 600;
  display: block;
  margin-bottom: 8px;
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
}

.segmented label {
  display: inline-flex;
}

.segmented input {
  position: absolute;
  opacity: 0;
}

.segmented span {
  padding: 10px 18px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  font-size: 14.5px;
  border-right: 1px solid var(--line);
}

.segmented label:last-child span {
  border-right: 0;
}

.segmented input:checked + span {
  background: var(--accent);
  color: #fff;
}

.segmented input:focus-visible + span {
  outline: 3px solid var(--link-hover);
  outline-offset: -3px;
}

/* native popup, custom closed control: the chevron is two small gradient
   squares in currentColor, so it tracks the theme with no image assets */
.opt select {
  font: inherit;
  padding: 9px 42px 9px 12px;
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background-color: var(--bg);
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    right 21px center,
    right 15px center;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  color: var(--ink);
  appearance: none;
}

.opt.checkbox label {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  font-weight: 600;
  font-size: 14.5px;
  min-height: 44px;
  cursor: pointer;
}

.opt.checkbox input {
  width: 19px;
  height: 19px;
  margin: 0;
  accent-color: var(--accent);
}

/* actions / progress */
.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  font: 600 15px/1 Poppins, sans-serif;
  padding: 0 22px;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
}

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

.btn:hover {
  border-color: var(--accent);
  color: var(--accent-deep);
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn.primary:hover {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  color: #fff;
}

.btn:disabled {
  opacity: 0.45;
  cursor: default;
}

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

.btn.primary:disabled:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.progress-wrap {
  margin-top: 18px;
}

.progress-track {
  height: 10px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: inherit;
  transition: width 0.25s linear;
}

@media (prefers-reduced-motion: reduce) {
  .progress-bar {
    transition: none;
  }
}

.progress-label {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 8px 0 0;
}

.error {
  color: var(--error);
  font-size: 14.5px;
}

/* result */
.result {
  margin-top: 20px;
}

.result video {
  width: 100%;
  max-height: 70vh;
  border-radius: var(--radius);
  background: #000;
  display: block;
}

.result-actions {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.about-tool p {
  font-size: 15px;
  color: var(--ink-soft);
}

.about-tool p:last-child {
  margin-bottom: 0;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 18px 20px 30px;
  text-align: center;
  font-size: 14px;
  color: var(--ink-soft);
}

.site-footer .version {
  margin: 6px 0 0;
  font-size: 12px;
  letter-spacing: 0.02em;
  opacity: 0.7;
}

@media (max-width: 560px) {
  .hero h1 {
    font-size: 30px;
  }

  .panel {
    padding: 16px 14px 18px;
  }

  .thumbs li {
    width: calc(50% - 6px);
  }

  .thumbs img {
    width: 100%;
    height: 100px;
  }
}
