/* ==========================================================================
   Phototranslatorai — front page
   Hero grid, the translator card, step list, use cases, language marquee,
   tool links and local history. Only loaded on the translator landing page.
   ========================================================================== */

/* ----------------------------------------------------------- Hero grid --- */
.home-hero .hero-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 48px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 8px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: .85rem;
  font-weight: 600;
  color: var(--muted);
  box-shadow: var(--shadow);
}
.eyebrow b {
  background: var(--grad);
  color: #fff;
  font-size: .72rem;
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: .3px;
}

.home-hero h1 {
  font-size: clamp(2.3rem, 5vw, 3.9rem);
  letter-spacing: -2px;
  margin: 20px 0 18px;
}

.home-hero .lead { font-size: 1.12rem; max-width: 520px; }

.hero-ticks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 26px;
}
.hero-ticks li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: .94rem;
}
.hero-ticks svg { width: 20px; height: 20px; color: var(--ok); flex-shrink: 0; }

.stats {
  display: flex;
  gap: 28px;
  margin-top: 34px;
  padding-top: 26px;
  border-top: 1px dashed var(--line);
  flex-wrap: wrap;
}
.stat strong {
  display: block;
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}
.stat small { color: var(--muted); font-weight: 500; }

/* ------------------------------------------------------------ Trust row --- */
.trust { padding-top: 28px; }
.trust-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
.chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-weight: 600;
  font-size: .9rem;
}
.chip i { font-style: normal; font-size: 1.1rem; }

/* -------------------------------------------------------- Translator card - */
.tool {
  position: relative;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(20px);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 22px;
  box-shadow: var(--shadow);
}

@supports not (background: color-mix(in srgb, red 50%, transparent)) {
  .tool { background: var(--surface); }
}

/* Gradient hairline border drawn with a masked pseudo-element. */
.tool::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 28px;
  padding: 1px;
  background: var(--grad);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: .55;
  pointer-events: none;
}

.tool-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.tabs {
  display: flex;
  background: var(--surface-2);
  padding: 4px;
  border-radius: var(--radius-sm);
  gap: 2px;
}
.tab {
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 600;
  font-size: .86rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background .2s, color .2s;
}
.tab svg { width: 16px; height: 16px; }
.tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

.howlink { font-size: .85rem; font-weight: 600; color: var(--p1); white-space: nowrap; }
.howlink:hover { text-decoration: underline; }

/* Dropzone */
.drop {
  display: block;
  width: 100%;
  position: relative;
  border: 2px dashed color-mix(in srgb, var(--p1) 40%, var(--line));
  border-radius: 20px;
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .25s, background .25s, transform .25s;
  background: linear-gradient(180deg, color-mix(in srgb, var(--p1) 4%, transparent), transparent);
}
.drop:hover,
.drop.drag { border-color: var(--p1); background: color-mix(in srgb, var(--p1) 8%, transparent); }
.drop.drag { transform: scale(1.01); }
.drop:focus-within { border-color: var(--p1); }

.drop-icon {
  width: 72px; height: 72px;
  margin: 0 auto 14px;
  border-radius: 22px;
  background: var(--grad);
  display: grid;
  place-items: center;
  box-shadow: 0 14px 30px -10px rgba(109, 91, 255, .7);
  animation: ptai-float 3.5s ease-in-out infinite;
}
.drop-icon svg { width: 34px; height: 34px; color: #fff; }

@keyframes ptai-float {
  50% { transform: translateY(-6px); }
}

.drop-title { display: block; font-size: 1.2rem; font-weight: 700; }
.drop-sub { display: block; color: var(--muted); font-size: .92rem; margin: 4px 0 16px; }
.drop .btn { pointer-events: none; }
.drop .hint { display: block; font-size: .8rem; color: var(--muted); margin-top: 14px; }
.drop .kbd {
  display: inline-block;
  padding: 1px 7px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  font-size: .75rem;
  font-weight: 700;
  background: var(--surface);
}

/* Preview + scan animation */
.preview {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.preview img {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
}

.scan {
  position: absolute;
  left: 0; right: 0;
  height: 3px;
  background: var(--grad);
  box-shadow: 0 0 18px 4px rgba(155, 77, 255, .6);
  top: 0;
  display: none;
}
.scan.on { display: block; animation: ptai-scan 1.6s ease-in-out infinite; }

@keyframes ptai-scan {
  0%   { top: 0; }
  50%  { top: calc(100% - 3px); }
  100% { top: 0; }
}

.file-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  font-size: .85rem;
}
.file-meta span {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-meta button { color: var(--p3); font-weight: 700; }

/* Language pickers */
.langs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: end;
  margin: 16px 0;
}
.field label {
  display: block;
  font-size: .78rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .6px;
}

.select { position: relative; }
.select select {
  width: 100%;
  height: 50px;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 0 40px 0 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
}
.select select:focus {
  outline: none;
  border-color: var(--p1);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--p1) 18%, transparent);
}
.select::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 8px; height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.swap {
  width: 50px; height: 50px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  display: grid;
  place-items: center;
  transition: transform .3s, border-color .2s, color .2s;
}
.swap:hover { border-color: var(--p1); color: var(--p1); transform: rotate(180deg); }
.swap svg { width: 20px; height: 20px; }

.translate-btn { width: 100%; min-height: 56px; font-size: 1.05rem; border-radius: 16px; }

/* Progress */
.progress { margin-top: 14px; }
.bar {
  height: 8px;
  background: var(--surface-2);
  border-radius: 99px;
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--grad);
  border-radius: 99px;
  transition: width .2s;
}
.progress-row {
  display: flex;
  justify-content: space-between;
  font-size: .85rem;
  font-weight: 600;
  color: var(--muted);
  margin-top: 8px;
}

/* Result */
.result {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  animation: ptai-fade-up .5s ease;
}

@keyframes ptai-fade-up {
  from { opacity: 0; transform: translateY(10px); }
}

.result-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface-2);
  font-weight: 700;
  font-size: .9rem;
  flex-wrap: wrap;
}
.result-head .ok { display: flex; align-items: center; gap: 6px; color: var(--ok); }
.result-head .ok svg { width: 18px; height: 18px; stroke-width: 2.5; }

.result-cols { display: grid; grid-template-columns: 1fr 1fr; }
.result-col { padding: 16px; font-size: .93rem; }
.result-col + .result-col { border-left: 1px solid var(--line); }
.result-col small {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--muted);
  margin-bottom: 6px;
}
.result-col p { word-break: break-word; }

/* Right-to-left results keep their natural direction. */
.result-col[dir="rtl"] { text-align: right; }

.result-actions {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.result-actions .btn { min-height: 40px; padding: 0 14px; font-size: .88rem; border-radius: 12px; }

.privacy-note {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  font-size: .8rem;
  color: var(--muted);
  margin-top: 14px;
  flex-wrap: wrap;
}
.privacy-note svg { width: 15px; height: 15px; color: var(--ok); }
.privacy-note a { text-decoration: underline; }

.tool-admin-note {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--warn) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent);
  font-size: .83rem;
  color: var(--text);
}
.tool-admin-note a { color: var(--p1); text-decoration: underline; font-weight: 600; }

/* --------------------------------------------------------------- Steps --- */
.steps-wrap { background: var(--bg-2); border-block: 1px solid var(--line); }

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  position: relative;
}
/* Dotted connector behind the step circles. */
.steps::before {
  content: "";
  position: absolute;
  top: 36px;
  left: 16%; right: 16%;
  height: 2px;
  background: repeat-x linear-gradient(90deg, var(--p1) 0 8px, transparent 8px 16px);
  opacity: .4;
}

.step { text-align: center; position: relative; padding: 0 10px; }
.step-num {
  width: 72px; height: 72px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  font-weight: 800;
  position: relative;
  z-index: 1;
}
.step-num::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: var(--grad);
  z-index: -1;
}
.step-num span { color: #fff; }
.step h3 { margin-bottom: 8px; }
.step p { color: var(--muted); font-size: .95rem; }

/* ----------------------------------------------------------- Use cases --- */
.uses { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }

.use {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  transition: border-color .3s, box-shadow .3s;
}
.use:hover { border-color: var(--p1); box-shadow: var(--shadow); }

.use-emoji {
  flex-shrink: 0;
  width: 64px; height: 64px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 1.9rem;
  background: var(--surface-2);
}
.use h3 { margin-bottom: 6px; }
.use p { color: var(--muted); font-size: .94rem; }

/* ------------------------------------------------------------- Marquee --- */
.marquee {
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.track {
  display: flex;
  gap: 12px;
  width: max-content;
  animation: ptai-marquee 46s linear infinite;
}
.track.rev { animation-direction: reverse; margin-top: 12px; }
.marquee:hover .track,
.marquee:focus-within .track { animation-play-state: paused; }

@keyframes ptai-marquee {
  to { transform: translateX(-50%); }
}

.lang-chip {
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  font-weight: 600;
  white-space: nowrap;
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: .94rem;
}
.lang-chip em { font-style: normal; color: var(--muted); font-weight: 500; }

/* --------------------------------------------------------- Tool links --- */
.tools-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

.tool-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  font-weight: 700;
  transition: border-color .25s, transform .25s;
}
.tool-link:hover { border-color: var(--p1); transform: translateY(-3px); }

.tool-link .ti {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: var(--grad);
  display: grid;
  place-items: center;
  color: #fff;
  flex-shrink: 0;
  margin: 0;
}
.tool-link .ti svg { width: 20px; height: 20px; }
.tool-link .tl-text { min-width: 0; }
.tool-link small {
  display: block;
  font-weight: 500;
  color: var(--muted);
  font-size: .8rem;
}

/* --------------------------------------------------------------- History -- */
.history {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.history-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.history-head h2 { font-size: 1.15rem; letter-spacing: -.3px; }

.history-list { display: grid; gap: 10px; }

.h-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.h-item img {
  width: 48px; height: 48px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}
.h-item .h-text { flex: 1; min-width: 0; }
.h-item strong {
  display: block;
  font-size: .92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.h-item small { color: var(--muted); font-size: .8rem; }

.history-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-size: .8rem;
  color: var(--muted);
}
.history-note svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ----------------------------------------------------------------- FAQ --- */
.faq-grid {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: 48px;
  align-items: start;
}
.faq-side { position: sticky; top: calc(var(--head) + 28px); }

/* ---------------------------------------------------------- Responsive --- */
@media (max-width: 1024px) {
  .home-hero .hero-grid { grid-template-columns: 1fr; }
  .hero-copy { text-align: center; }
  .home-hero .lead { margin-inline: auto; }
  .hero-ticks, .stats { justify-content: center; }
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
  .faq-grid { grid-template-columns: 1fr; }
  .faq-side { position: static; }
}

@media (max-width: 820px) {
  .steps { grid-template-columns: 1fr; gap: 36px; }
  .steps::before { display: none; }
  .uses { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .tool { padding: 16px; border-radius: 22px; }
  .drop { padding: 28px 16px; }
  .drop-icon { width: 62px; height: 62px; border-radius: 18px; }
  .drop .btn { width: 100%; max-width: 260px; }

  .tabs .tab span { display: none; }
  .tabs .tab { padding: 8px 12px; }

  .langs { grid-template-columns: 1fr; }
  .swap { margin: 0 auto; transform: rotate(90deg); }
  .swap:hover { transform: rotate(270deg); }

  .result-cols { grid-template-columns: 1fr; }
  .result-col + .result-col { border-left: none; border-top: 1px solid var(--line); }
  .result-actions .btn { flex: 1; }

  .stats { gap: 18px; }
  .stat strong { font-size: 1.35rem; }

  .use { flex-direction: column; }
  .tools-grid { grid-template-columns: 1fr; }
  .trust-row { gap: 8px; }
  .chip { padding: 8px 14px; font-size: .85rem; }
}

/* Paste hints only make sense with a physical keyboard. */
@media (hover: none) {
  .paste-hint { display: none; }
}
