/* =========================================================
   HeifToJpg.net — design tokens
   ========================================================= */
:root {
  --paper: #FAF9F6;
  --paper-dim: #F1EFE9;
  --ink: #1D2321;
  --ink-soft: #4B534F;
  --cobalt: #26436B;
  --cobalt-dark: #1A2F4D;
  --amber: #E2963B;
  --amber-dark: #C97C22;
  --line: #DBD7CB;
  --success: #3F7A54;
  --danger: #B4432F;
  --radius-tool: 14px;
  --radius-soft: 10px;
  --font-head: "Newsreader", Georgia, serif;
  --font-body: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --max: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

a { color: var(--cobalt); }
h1, h2, h3 { font-family: var(--font-head); color: var(--ink); font-weight: 600; margin: 0 0 0.5em; }
p { margin: 0 0 1em; color: var(--ink-soft); max-width: 62ch; }

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

/* =========================================================
   Header
   ========================================================= */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 20;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.logo-mark { color: var(--cobalt); display: inline-flex; }
.logo-text { font-family: var(--font-head); font-size: 1.2rem; font-weight: 600; }
.logo-dot { color: var(--amber-dark); }

.main-nav { display: flex; gap: 28px; }
.main-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.95rem;
}
.main-nav a:hover { color: var(--cobalt); }

@media (max-width: 720px) {
  .main-nav { display: none; }
}

/* =========================================================
   Hero + tool
   ========================================================= */
.hero { padding: 56px 0 48px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
}

.eyebrow {
  color: var(--cobalt);
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  margin-bottom: 12px;
}
.hero-copy h1 {
  font-size: clamp(2rem, 3.6vw, 2.7rem);
  line-height: 1.15;
  max-width: 16ch;
}
.hero-lede { max-width: 46ch; }
.hero-points {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hero-points li {
  padding-left: 26px;
  position: relative;
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.hero-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--amber);
  border-radius: 2px;
}

/* Tool panel */
.tool-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-tool);
  box-shadow: 0 1px 0 var(--line);
  overflow: hidden;
}
.tool-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  background: var(--paper-dim);
}
.tool-tab {
  flex: 1;
  padding: 14px 12px;
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--ink-soft);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.tool-tab.is-active {
  color: var(--cobalt-dark);
  background: #fff;
  border-bottom-color: var(--amber);
}
.tool-panel-body { padding: 22px; }

.notice {
  background: #FBF3E8;
  border: 1px solid #EFD8B4;
  border-radius: var(--radius-soft);
  padding: 14px 16px;
  font-size: 0.88rem;
  color: #6B4B1E;
  margin-bottom: 18px;
}
.notice strong { color: #5A3B10; }

.dropzone {
  border: 2px dashed var(--line);
  border-radius: var(--radius-soft);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.dropzone:hover,
.dropzone:focus-visible {
  border-color: var(--cobalt);
  background: #F6F8FA;
}
.dropzone.is-dragover {
  border-color: var(--amber);
  background: #FBF3E8;
}
.dropzone-icon { color: var(--cobalt); margin-bottom: 8px; }
.dropzone p { margin: 0 0 4px; color: var(--ink); }
.dropzone-note { color: var(--ink-soft); font-size: 0.82rem; margin: 4px 0 0; }

.tool-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.quality-control {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--ink-soft);
  flex: 1;
  min-width: 200px;
}
.quality-control input[type="range"] {
  width: 100%;
  accent-color: var(--cobalt);
}
.tool-buttons { display: flex; gap: 10px; }

.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--cobalt); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--cobalt-dark); }
.btn-secondary { background: var(--amber); color: #3A2500; }
.btn-secondary:hover:not(:disabled) { background: var(--amber-dark); }
.btn-ghost { background: transparent; color: var(--ink-soft); border-color: var(--line); }
.btn-ghost:hover:not(:disabled) { border-color: var(--ink-soft); color: var(--ink); }

.file-list {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-soft);
  background: var(--paper-dim);
}
.file-thumb {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  background: #E4E1D6;
  flex-shrink: 0;
}
.file-thumb.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  font-size: 0.7rem;
}
.file-meta { flex: 1; min-width: 0; }
.file-name {
  font-size: 0.85rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-status { font-size: 0.78rem; color: var(--ink-soft); }
.file-status.is-done { color: var(--success); }
.file-status.is-error { color: var(--danger); }
.file-download {
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--cobalt);
  flex-shrink: 0;
}
.file-remove {
  background: none;
  border: none;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 4px;
  flex-shrink: 0;
}
.file-remove:hover { color: var(--danger); }

.tool-footer { margin-top: 16px; }

/* =========================================================
   Sprocket divider (film-strip motif)
   ========================================================= */
.sprocket {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 28px 0;
}
.sprocket::before,
.sprocket::after,
.sprocket {
  background-image: repeating-linear-gradient(
    to right,
    var(--line) 0,
    var(--line) 6px,
    transparent 6px,
    transparent 18px
  );
  height: 6px;
}
.sprocket { max-width: var(--max); margin: 0 auto; width: 100%; padding: 0; height: 6px; }

/* =========================================================
   Generic sections
   ========================================================= */
.section { padding: 48px 0; }
.section h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
.section-lede { max-width: 68ch; }

.steps {
  list-style: none;
  padding: 0;
  margin: 32px 0 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
@media (max-width: 780px) {
  .steps { grid-template-columns: 1fr; }
}
.step { display: flex; gap: 14px; align-items: flex-start; }
.step-frame {
  font-family: var(--font-head);
  font-size: 1.4rem;
  color: var(--cobalt);
  border: 1px solid var(--line);
  border-radius: 6px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.step h3 { font-size: 1.05rem; margin-bottom: 6px; }
.step p { font-size: 0.92rem; }

.format-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 28px;
}
@media (max-width: 780px) {
  .format-grid { grid-template-columns: 1fr; }
}
.format-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-soft);
  padding: 20px;
  background: #fff;
}
.format-card h3 { font-size: 1.1rem; color: var(--cobalt-dark); }
.format-card p { font-size: 0.9rem; margin: 0; }
.format-footnote { margin-top: 24px; font-size: 0.88rem; color: var(--ink-soft); max-width: 76ch; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px 28px;
  margin-top: 28px;
}
@media (max-width: 780px) {
  .feature-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .feature-grid { grid-template-columns: 1fr; }
}
.feature h3 { font-size: 1rem; color: var(--ink); margin-bottom: 6px; }
.feature p { font-size: 0.88rem; margin: 0; }

.faq-list {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 76ch;
}
.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-soft);
  padding: 14px 18px;
  background: #fff;
}
.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before {
  content: "+";
  display: inline-block;
  width: 1em;
  color: var(--cobalt);
  font-weight: 700;
}
.faq-item[open] summary::before { content: "\2212"; }
.faq-item p { margin: 10px 0 0; font-size: 0.92rem; }

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px 0 20px;
  background: var(--paper-dim);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 20px;
}
.footer-tagline { font-size: 0.85rem; margin-top: 6px; }
.footer-nav { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-nav a { color: var(--ink-soft); text-decoration: none; font-size: 0.88rem; }
.footer-nav a:hover { color: var(--cobalt); }
.footer-copy {
  max-width: var(--max);
  margin: 24px auto 0;
  padding: 0 24px;
  font-size: 0.78rem;
  color: var(--ink-soft);
}
