/* ════════════════════════════════════════════════
   PhotoResize — style.css
   Aesthetic: Precision Dark Tool — Teal + Amber
   Fonts: Unbounded (display) + Epilogue (body)
════════════════════════════════════════════════ */

/* ── Variables ── */
:root {
  --bg-base:      #0b0c0f;
  --bg-surface:   #111318;
  --bg-card:      #181b22;
  --bg-input:     #1d2029;
  --border:       #252832;
  --border-hi:    #353a4a;
  --teal:         #00d4aa;
  --teal-dim:     rgba(0, 212, 170, 0.12);
  --teal-glow:    rgba(0, 212, 170, 0.28);
  --amber:        #f5a623;
  --amber-dim:    rgba(245, 166, 35, 0.12);
  --text:         #e8eaf2;
  --text-soft:    #9ca3b8;
  --text-muted:   #5a6070;
  --danger:       #ff5470;
  --radius:       16px;
  --radius-sm:    10px;
  --radius-xs:    6px;
  --shadow-card:  0 4px 32px rgba(0,0,0,0.45);
  --shadow-float: 0 16px 64px rgba(0,0,0,0.6);
  --font-display: 'Unbounded', sans-serif;
  --font-body:    'Epilogue', sans-serif;
  --transition:   0.2s cubic-bezier(0.4,0,0.2,1);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 15px; }
body {
  background: var(--bg-base);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--teal); text-decoration: none; transition: opacity var(--transition); }
a:hover { opacity: 0.8; }
button { cursor: pointer; font-family: var(--font-body); border: none; background: none; }
input { font-family: var(--font-body); }
.hidden { display: none !important; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 28px; }

/* ══════════════════════════════
   LOADER
══════════════════════════════ */
.loader-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(11,12,15,0.92);
  backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
.loader-overlay.active { opacity: 1; pointer-events: all; }

.loader-core {
  display: flex; flex-direction: column; align-items: center; gap: 20px;
}
.hex-loader {
  width: 120px; height: 120px;
}
.hex-loader svg { width: 100%; height: 100%; }

/* Outer hex dots */
.hex-dot {
  fill: var(--teal);
  opacity: 0.15;
  animation: hexPulse 1.4s ease-in-out infinite;
}
.h1 { animation-delay: 0s; }
.h2 { animation-delay: 0.23s; }
.h3 { animation-delay: 0.46s; }
.h4 { animation-delay: 0.69s; }
.h5 { animation-delay: 0.92s; }
.h6 { animation-delay: 1.15s; }

@keyframes hexPulse {
  0%, 100% { opacity: 0.1; fill: var(--teal); }
  50%       { opacity: 0.9; fill: var(--teal); filter: drop-shadow(0 0 6px var(--teal)); }
}

.hex-center {
  fill: var(--teal);
  opacity: 0.7;
  animation: centerPulse 1.4s ease-in-out infinite;
}
@keyframes centerPulse {
  0%, 100% { opacity: 0.4; transform-origin: 60px 56px; transform: scale(0.9); }
  50%       { opacity: 1;   transform-origin: 60px 56px; transform: scale(1.08); filter: drop-shadow(0 0 8px var(--teal)); }
}

.orbit-ring {
  stroke: var(--teal);
  stroke-width: 1;
  stroke-dasharray: 6 8;
  opacity: 0.3;
  animation: orbitSpin 3s linear infinite;
  transform-origin: 60px 60px;
}
@keyframes orbitSpin { to { transform: rotate(360deg); transform-origin: 60px 60px; } }

.scan-line {
  stroke: var(--amber);
  stroke-width: 1.5;
  stroke-linecap: round;
  opacity: 0;
  animation: scanMove 1.4s ease-in-out infinite;
}
@keyframes scanMove {
  0%   { opacity: 0; transform: translateY(-30px); transform-origin: 60px 60px; }
  30%  { opacity: 0.8; }
  70%  { opacity: 0.8; }
  100% { opacity: 0; transform: translateY(30px); transform-origin: 60px 60px; }
}

.loader-text {
  font-family: var(--font-display); font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--teal);
}
.loader-bar {
  width: 180px; height: 3px;
  background: var(--border); border-radius: 2px; overflow: hidden;
}
.loader-bar-fill {
  height: 100%; width: 0%; background: var(--teal);
  border-radius: 2px;
  transition: width 0.4s ease;
  box-shadow: 0 0 8px var(--teal-glow);
}

/* ══════════════════════════════
   HEADER
══════════════════════════════ */
.header {
  position: sticky; top: 0; z-index: 500;
  background: rgba(11,12,15,0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1120px; margin: 0 auto; padding: 0 28px;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
}
.logo {
  display: flex; align-items: center; gap: 11px;
  color: var(--text); flex-shrink: 0;
}
.logo-mark svg { width: 32px; height: 32px; }
.logo-wordmark {
  font-family: var(--font-display); font-size: 1rem; font-weight: 700;
  letter-spacing: -0.02em;
}
.logo-wordmark em { color: var(--teal); font-style: normal; }
.nav-links {
  display: flex; gap: 24px;
}
.nav-links a {
  color: var(--text-soft); font-size: 0.82rem; font-weight: 500;
  letter-spacing: 0.02em; transition: color var(--transition);
}
.nav-links a:hover { color: var(--text); opacity: 1; }
.header-tag {
  flex-shrink: 0;
  border: 1px solid var(--teal-glow);
  color: var(--teal); font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 4px 12px; border-radius: 100px;
  background: var(--teal-dim);
}
@media (max-width: 640px) {
  .nav-links { display: none; }
  .header-tag { display: none; }
}

/* ══════════════════════════════
   HERO
══════════════════════════════ */
.hero {
  position: relative;
  min-height: calc(100vh - 64px);
  display: flex; align-items: center;
  gap: 60px;
  max-width: 1120px; margin: 0 auto; padding: 80px 28px;
  overflow: hidden;
}
.hero-grid-bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(0,212,170,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,170,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black, transparent);
}
.hero-content { flex: 1; min-width: 0; }
.hero-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--teal-dim); border: 1px solid var(--teal-glow);
  color: var(--teal); padding: 6px 16px; border-radius: 100px;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em;
  margin-bottom: 28px;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  font-weight: 900; line-height: 1.05;
  letter-spacing: -0.04em;
  margin-bottom: 24px;
}
.hero-title-accent { color: var(--teal); }
.hero-desc {
  color: var(--text-soft); font-size: 1.05rem; font-weight: 300;
  max-width: 460px; line-height: 1.75; margin-bottom: 36px;
}
.hero-cta-row { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.btn-cta {
  display: inline-flex; align-items: center;
  background: var(--teal); color: #000;
  font-family: var(--font-display); font-size: 0.82rem; font-weight: 700;
  letter-spacing: 0.02em; padding: 14px 30px; border-radius: 100px;
  transition: transform var(--transition), box-shadow var(--transition);
}
.btn-cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px var(--teal-glow);
  opacity: 1;
}
.hero-stat-row { display: flex; align-items: center; gap: 14px; }
.hero-stat { text-align: center; }
.hero-stat span {
  display: block; font-family: var(--font-display); font-size: 1.2rem;
  font-weight: 900; color: var(--amber);
}
.hero-stat { font-size: 0.72rem; color: var(--text-muted); letter-spacing: 0.05em; }
.hero-stat-divider { width: 1px; height: 30px; background: var(--border); }

/* Hero Deco */
.hero-deco { flex: 0 0 auto; display: none; }
@media (min-width: 860px) { .hero-deco { display: block; } }
.deco-frame {
  width: 320px; height: 320px;
  border: 1px solid var(--border-hi); border-radius: 20px;
  background: var(--bg-card);
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-float);
}
.deco-inner { width: 100%; height: 100%; position: relative; }
.deco-scanlines {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(0,212,170,0.015) 3px, rgba(0,212,170,0.015) 4px);
  pointer-events: none;
}
.deco-crosshair {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 60px; height: 60px;
}
.ch-h, .ch-v {
  position: absolute; background: rgba(0,212,170,0.4);
}
.ch-h { height: 1px; width: 100%; top: 50%; transform: translateY(-50%); }
.ch-v { width: 1px; height: 100%; left: 50%; transform: translateX(-50%); }
.deco-chip {
  position: absolute;
  background: var(--bg-surface);
  border: 1px solid var(--border-hi);
  padding: 8px 14px; border-radius: 8px;
  font-size: 0.78rem; font-weight: 600; color: var(--text-soft);
  animation: chipFloat 3.5s ease-in-out infinite;
}
.chip-a { top: 24px; left: 24px; color: var(--teal); animation-delay: 0s; }
.chip-b { top: 24px; right: 24px; color: var(--text-soft); animation-delay: 0.8s; }
.chip-c { bottom: 70px; left: 24px; color: var(--amber); animation-delay: 1.6s; }
.chip-d { bottom: 24px; right: 24px; color: var(--teal); animation-delay: 2.4s; }
@keyframes chipFloat {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

/* ══════════════════════════════
   TOOL SECTION
══════════════════════════════ */
.tool-section {
  padding: 60px 0 90px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
}

/* Progress Tracker */
.progress-tracker {
  display: flex; align-items: center; justify-content: center;
  gap: 0; margin-bottom: 48px;
}
.pt-step {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  position: relative;
}
.pt-dot {
  width: 38px; height: 38px; border-radius: 50%;
  border: 2px solid var(--border-hi);
  background: var(--bg-card);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 0.72rem; font-weight: 700;
  color: var(--text-muted);
  transition: all var(--transition);
}
.pt-label {
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-muted);
  transition: color var(--transition);
}
.pt-step.active .pt-dot {
  border-color: var(--teal); background: var(--teal-dim);
  color: var(--teal); box-shadow: 0 0 20px var(--teal-dim);
}
.pt-step.active .pt-label { color: var(--teal); }
.pt-step.done .pt-dot {
  border-color: var(--teal); background: var(--teal); color: #000;
}
.pt-step.done .pt-label { color: var(--text-soft); }
.pt-line {
  flex: 1; min-width: 40px; height: 2px;
  background: var(--border); margin: 0 6px; margin-bottom: 26px;
  transition: background var(--transition);
}
.pt-line.done { background: var(--teal); }
@media (max-width: 480px) {
  .pt-label { display: none; }
  .pt-line { min-width: 20px; }
}

/* Panel Base */
.tool-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
  animation: panelIn 0.35s ease forwards;
}
@keyframes panelIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.panel-header {
  display: flex; align-items: flex-start; gap: 20px;
  margin-bottom: 32px;
}
.panel-number {
  font-family: var(--font-display); font-size: 2.5rem; font-weight: 900;
  color: var(--border-hi); line-height: 1; flex-shrink: 0;
}
.panel-title {
  font-family: var(--font-display); font-size: 1.25rem; font-weight: 700;
  margin-bottom: 4px;
}
.panel-subtitle { color: var(--text-soft); font-size: 0.88rem; }

/* ── Upload Area ── */
.upload-area {
  border: 2px dashed var(--border-hi);
  border-radius: var(--radius);
  padding: 56px 28px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.upload-area.drag-active {
  border-color: var(--teal);
  background: var(--teal-dim);
}
.upload-svg { width: 64px; height: 64px; margin: 0 auto 20px; }
.upload-main {
  font-family: var(--font-display); font-size: 1.1rem; font-weight: 700;
  margin-bottom: 8px;
}
.upload-sub { color: var(--text-soft); font-size: 0.9rem; margin-bottom: 8px; }
.upload-formats { color: var(--text-muted); font-size: 0.78rem; }
.link-btn {
  color: var(--teal); font-size: inherit; font-weight: 600;
  text-decoration: underline; cursor: pointer;
}
.upload-divider {
  display: flex; align-items: center; gap: 14px;
  max-width: 280px; margin: 24px auto;
  color: var(--text-muted); font-size: 0.78rem;
}
.upload-divider::before, .upload-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border-hi);
}
.btn-camera {
  display: inline-flex; align-items: center; gap: 10px;
  border: 1px solid var(--border-hi);
  color: var(--text-soft); padding: 12px 24px; border-radius: 100px;
  font-size: 0.85rem; font-weight: 500;
  transition: border-color var(--transition), color var(--transition);
}
.btn-camera:hover { border-color: var(--teal); color: var(--teal); }

/* ── Camera Modal ── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 800;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  width: 100%; max-width: 600px;
  box-shadow: var(--shadow-float);
  overflow: hidden;
  animation: panelIn 0.3s ease;
}
.modal-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-title {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-size: 0.85rem; font-weight: 700;
  letter-spacing: 0.04em;
}
.modal-close-btn {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-input); color: var(--text-soft);
  font-size: 1rem; display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), color var(--transition);
}
.modal-close-btn:hover { background: var(--danger); color: #fff; }
.camera-viewport {
  position: relative; background: #000;
}
#cameraStream { width: 100%; max-height: 360px; object-fit: cover; display: block; }
.camera-overlay-frame {
  position: absolute; inset: 16px;
  border: 2px solid rgba(0,212,170,0.5);
  border-radius: 8px; pointer-events: none;
}
.camera-overlay-frame::before, .camera-overlay-frame::after {
  content: ''; position: absolute;
  width: 20px; height: 20px; border-color: var(--teal); border-style: solid;
}
.camera-overlay-frame::before { top: -2px; left: -2px; border-width: 2px 0 0 2px; }
.camera-overlay-frame::after  { bottom: -2px; right: -2px; border-width: 0 2px 2px 0; }
.modal-footer {
  padding: 20px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.btn-snap {
  position: relative; width: 64px; height: 64px; border-radius: 50%;
  background: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.snap-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 3px solid var(--teal);
  animation: snapPing 2s ease-in-out infinite;
}
@keyframes snapPing {
  0%,100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.12); opacity: 0.7; }
}
.snap-core {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--teal);
  transition: transform var(--transition);
}
.btn-snap:hover .snap-core { transform: scale(0.9); background: #fff; }
.snap-hint { font-size: 0.78rem; color: var(--text-muted); }

/* ── Crop Layout ── */
.crop-layout {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 28px;
}
@media (max-width: 720px) { .crop-layout { grid-template-columns: 1fr; } }
.crop-canvas-wrap {
  max-height: 450px; overflow: hidden;
  border-radius: var(--radius-sm);
  background: #000;
}
.crop-canvas-wrap img { display: block; max-width: 100%; max-height: 450px; }
.crop-sidebar { display: flex; flex-direction: column; gap: 20px; }
.ctrl-block { display: flex; flex-direction: column; gap: 10px; }
.ctrl-label {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-muted);
  display: flex; align-items: center; justify-content: space-between;
}
.ratio-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.ratio-pill {
  background: var(--bg-input); border: 1px solid var(--border-hi);
  color: var(--text-soft); padding: 7px 13px;
  border-radius: 100px; font-size: 0.78rem; font-weight: 500;
  transition: all var(--transition);
}
.ratio-pill:hover, .ratio-pill.active {
  background: var(--teal-dim); border-color: var(--teal); color: var(--teal);
}
.crop-actions { display: flex; flex-direction: column; gap: 10px; }
.crop-hint { font-size: 0.78rem; color: var(--text-muted); }
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--teal); color: #000;
  font-weight: 700; font-size: 0.88rem; padding: 12px 22px;
  border-radius: var(--radius-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px var(--teal-glow); }
.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-hi); color: var(--text-soft);
  padding: 11px 22px; border-radius: var(--radius-sm);
  font-size: 0.85rem; transition: all var(--transition);
}
.btn-ghost:hover { border-color: var(--text-muted); color: var(--text); }

/* ── Resize Layout ── */
.resize-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 32px;
  align-items: start;
}
@media (max-width: 860px) { .resize-layout { grid-template-columns: 1fr; } }

.preview-col { display: flex; flex-direction: column; gap: 12px; }
.preview-label {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-muted);
}
.preview-frame {
  position: relative;
  border-radius: var(--radius-sm); overflow: hidden;
  background: #000; min-height: 180px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
}
.preview-frame img { width: 100%; height: auto; }
.preview-badge {
  position: absolute; bottom: 8px; right: 8px;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(4px);
  color: var(--teal); font-size: 0.68rem; font-weight: 700;
  padding: 4px 10px; border-radius: 100px;
  border: 1px solid var(--teal-glow);
}
.info-card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.info-row { display: flex; justify-content: space-between; align-items: center; }
.info-k { font-size: 0.75rem; color: var(--text-muted); }
.info-v { font-size: 0.8rem; font-weight: 600; color: var(--text); }

.controls-col { display: flex; flex-direction: column; gap: 24px; }

/* Dimensions */
.dim-inputs {
  display: flex; align-items: center; gap: 12px; margin-bottom: 14px;
}
.dim-field {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-input); border: 1px solid var(--border-hi);
  border-radius: var(--radius-sm); padding: 10px 14px; flex: 1;
  transition: border-color var(--transition);
}
.dim-field:focus-within { border-color: var(--teal); }
.dim-axis { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); letter-spacing: 0.08em; }
.dim-field input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-size: 0.92rem; font-weight: 500;
  width: 0; min-width: 0;
}
.dim-field input::placeholder { color: var(--text-muted); }
.dim-unit { font-size: 0.7rem; color: var(--text-muted); }
.lock-aspect-btn {
  flex-shrink: 0;
  width: 40px; height: 40px; border-radius: var(--radius-xs);
  background: var(--bg-input); border: 1px solid var(--border-hi);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.lock-aspect-btn.locked { border-color: var(--amber); color: var(--amber); background: var(--amber-dim); }
.presets-label {
  font-size: 0.7rem; font-weight: 600; color: var(--text-muted);
  letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 2px;
}
.presets-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
@media (max-width: 640px) { .presets-grid { grid-template-columns: repeat(3,1fr); } }
.preset {
  background: var(--bg-input); border: 1px solid var(--border);
  color: var(--text-soft); padding: 8px 4px;
  border-radius: var(--radius-xs); font-size: 0.72rem; font-weight: 500;
  transition: all var(--transition);
}
.preset:hover { border-color: var(--teal); color: var(--teal); background: var(--teal-dim); }

/* Quality Slider */
.quality-badge {
  font-family: var(--font-display); font-size: 0.78rem; font-weight: 700;
  color: var(--amber); background: var(--amber-dim);
  padding: 2px 10px; border-radius: 4px;
}
.slider-wrap { display: flex; flex-direction: column; gap: 6px; }
.quality-slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; border-radius: 3px; outline: none; cursor: pointer;
  background: linear-gradient(to right, var(--teal) var(--pct,85%), var(--bg-input) var(--pct,85%));
}
.quality-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; border: 3px solid var(--teal);
  box-shadow: 0 0 0 4px var(--teal-dim); cursor: pointer;
}
.quality-slider::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; border: 3px solid var(--teal); cursor: pointer;
}
.slider-ends {
  display: flex; justify-content: space-between;
  font-size: 0.72rem; color: var(--text-muted);
}

/* Format Tabs */
.format-tabs { display: flex; gap: 10px; }
.fmt-tab {
  flex: 1; position: relative;
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-xs); overflow: hidden;
  cursor: pointer; transition: all var(--transition);
}
.fmt-tab input { position: absolute; opacity: 0; width: 0; height: 0; }
.fmt-tab span {
  display: flex; align-items: center; justify-content: center;
  padding: 10px 8px;
  font-size: 0.82rem; font-weight: 700;
  letter-spacing: 0.04em; color: var(--text-soft);
  transition: all var(--transition);
}
.fmt-tab:has(input:checked) { border-color: var(--teal); background: var(--teal-dim); }
.fmt-tab:has(input:checked) span { color: var(--teal); }

/* Transform */
.transform-row { display: flex; align-items: center; gap: 12px; }
.transform-btn {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-input); border: 1px solid var(--border-hi);
  color: var(--text-soft); padding: 10px 18px;
  border-radius: var(--radius-xs); font-size: 0.8rem; font-weight: 500;
  transition: all var(--transition);
}
.transform-btn:hover { border-color: var(--teal); color: var(--teal); }
.rot-display {
  flex: 1; text-align: center;
  font-family: var(--font-display); font-size: 1.1rem; font-weight: 900;
  color: var(--text-muted);
}

/* Toggle Grid */
.toggles-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
@media (max-width: 480px) { .toggles-grid { grid-template-columns: 1fr; } }
.toggle-row {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
}
.tgl { display: none; }
.tgl-track {
  width: 38px; height: 22px; border-radius: 11px;
  background: var(--bg-input); border: 1px solid var(--border-hi);
  position: relative; flex-shrink: 0;
  transition: background var(--transition), border-color var(--transition);
}
.tgl-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--text-muted);
  transition: transform var(--transition), background var(--transition);
}
.tgl:checked ~ .tgl-track { background: var(--teal-dim); border-color: var(--teal); }
.tgl:checked ~ .tgl-track .tgl-thumb { transform: translateX(16px); background: var(--teal); }
.tgl-lbl { font-size: 0.82rem; color: var(--text-soft); }

/* Adjustments */
.adj-row {
  display: flex; align-items: center; gap: 12px;
}
.adj-label { font-size: 0.78rem; color: var(--text-soft); min-width: 76px; }
.adj-slider {
  flex: 1; -webkit-appearance: none; appearance: none;
  height: 4px; border-radius: 2px; outline: none; cursor: pointer;
  background: linear-gradient(to right, var(--amber) 50%, var(--bg-input) 50%);
}
.adj-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--amber); border: 2px solid #fff; cursor: pointer;
}
.adj-slider::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--amber); border: 2px solid #fff;
}
.adj-val { font-size: 0.78rem; font-weight: 700; color: var(--amber); min-width: 30px; text-align: right; }

/* Process Button */
.btn-process {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; background: var(--teal);
  color: #000; font-family: var(--font-display);
  font-size: 0.9rem; font-weight: 700; letter-spacing: 0.04em;
  padding: 16px; border-radius: var(--radius-sm);
  transition: transform var(--transition), box-shadow var(--transition);
  margin-top: 4px;
}
.btn-process:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 40px var(--teal-glow);
}
.btn-process:active { transform: translateY(-1px); }

/* ── Download ── */
.download-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 36px;
  align-items: start;
}
@media (max-width: 720px) { .download-layout { grid-template-columns: 1fr; } }
.result-frame-wrap { position: relative; }
.result-frame {
  border-radius: var(--radius-sm); overflow: hidden;
  background: #000; border: 1px solid var(--border);
  box-shadow: var(--shadow-float);
}
.result-frame img { width: 100%; height: auto; }
.result-overlay-tag {
  position: absolute; top: 14px; right: 14px;
  background: var(--teal); color: #000;
  font-family: var(--font-display); font-size: 0.72rem; font-weight: 900;
  letter-spacing: 0.08em; padding: 5px 14px; border-radius: 100px;
}
.download-info-col { display: flex; flex-direction: column; gap: 16px; }
.dl-stat-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.dl-stat {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-xs); padding: 12px 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.dl-stat-wide { grid-column: 1 / -1; }
.dl-stat-k { font-size: 0.68rem; color: var(--text-muted); letter-spacing: 0.06em; text-transform: uppercase; }
.dl-stat-v { font-family: var(--font-display); font-size: 0.9rem; font-weight: 700; color: var(--teal); }
.btn-download {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--teal); color: #000;
  font-family: var(--font-display); font-size: 0.88rem; font-weight: 900;
  letter-spacing: 0.04em; padding: 16px;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 32px var(--teal-glow);
  transition: transform var(--transition), box-shadow var(--transition);
}
.btn-download:hover {
  transform: translateY(-3px); box-shadow: 0 16px 48px var(--teal-glow);
  opacity: 1;
}
.btn-back-edit {
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-hi); color: var(--text-soft);
  padding: 13px; border-radius: var(--radius-sm);
  font-size: 0.85rem; transition: all var(--transition);
}
.btn-back-edit:hover { border-color: var(--amber); color: var(--amber); }
.btn-restart {
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 0.82rem;
  padding: 8px; text-decoration: underline;
  transition: color var(--transition);
}
.btn-restart:hover { color: var(--danger); }

/* ══════════════════════════════
   FEATURES
══════════════════════════════ */
.features-section {
  padding: 100px 0;
  border-top: 1px solid var(--border);
}
.section-heading { text-align: center; margin-bottom: 56px; }
.section-tag {
  display: inline-block;
  color: var(--teal); font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  margin-bottom: 14px;
}
.section-title {
  font-family: var(--font-display); font-size: clamp(1.5rem, 3.5vw, 2.5rem);
  font-weight: 900; letter-spacing: -0.03em;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.feat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px 28px;
  transition: border-color var(--transition), transform var(--transition);
}
.feat-card:hover { border-color: var(--border-hi); transform: translateY(-4px); }
.feat-icon {
  width: 52px; height: 52px; border-radius: 12px;
  background: var(--teal-dim); border: 1px solid var(--teal-glow);
  color: var(--teal);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
}
.feat-card h3 {
  font-family: var(--font-display); font-size: 0.95rem; font-weight: 700;
  margin-bottom: 10px;
}
.feat-card p { color: var(--text-soft); font-size: 0.86rem; line-height: 1.75; }

/* ══════════════════════════════
   HOW TO
══════════════════════════════ */
.howto-section {
  padding: 100px 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
}
.howto-steps {
  display: flex; align-items: center; gap: 0; flex-wrap: wrap; justify-content: center;
}
.ht-step {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px 24px;
  flex: 1; min-width: 160px; max-width: 220px;
  text-align: center;
  transition: border-color var(--transition);
}
.ht-step:hover { border-color: var(--border-hi); }
.ht-num {
  font-family: var(--font-display); font-size: 1.8rem; font-weight: 900;
  color: var(--teal-dim);
  -webkit-text-stroke: 1px var(--teal);
  margin-bottom: 14px;
}
.ht-step h4 {
  font-family: var(--font-display); font-size: 0.82rem; font-weight: 700;
  margin-bottom: 8px;
}
.ht-step p { color: var(--text-muted); font-size: 0.78rem; line-height: 1.65; }
.ht-connector {
  display: flex; flex-direction: column; align-items: center;
  padding: 0 12px;
}
.ht-line { width: 30px; height: 2px; background: var(--border-hi); }
.ht-arrow { color: var(--teal); font-size: 1.6rem; line-height: 1; margin-top: 2px; }
@media (max-width: 700px) { .ht-connector { display: none; } .ht-step { max-width: 100%; } }

/* ══════════════════════════════
   FOOTER
══════════════════════════════ */
.footer {
  background: var(--bg-base);
  border-top: 1px solid var(--border);
  padding: 48px 28px;
}
.footer-inner {
  max-width: 700px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  text-align: center;
}
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-logo-mark svg { width: 28px; height: 28px; }
.footer-divider { width: 60px; height: 1px; background: var(--border-hi); }
.footer-credit { color: var(--text-soft); font-size: 0.85rem; }
.footer-credit strong { color: var(--text); }
.footer-contact { font-size: 0.82rem; color: var(--text-muted); }
.footer-contact a { color: var(--teal); }
.footer-note { font-size: 0.75rem; color: var(--text-muted); }

/* ══════════════════════════════
   SCROLLBAR
══════════════════════════════ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
