/* FixMyPhotos — How to use guide and per-tool pages.
   Builds on style.css tokens (--bg, --grad, --surface...). */

:root {
  --gold: #ffc861;
  --ok: #7be0b0;
  --surface-2: rgba(255, 255, 255, 0.08);
}

.nav-links a[aria-current="page"] { color: var(--text); }

/* ---------- Page hero ---------- */
.page-hero {
  position: relative;
  padding: 64px 0 76px;
  background: var(--bg-2);
  overflow: hidden;
}
.page-hero::before,
.page-hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}
.page-hero::before {
  width: 540px; height: 540px; left: -170px; top: -270px;
  background: radial-gradient(circle, rgba(161, 45, 180, 0.5), transparent 65%);
}
.page-hero::after {
  width: 480px; height: 480px; right: -180px; top: -120px;
  background: radial-gradient(circle, rgba(255, 104, 87, 0.3), transparent 65%);
}
.page-hero > .container { position: relative; z-index: 1; }
.page-hero h1 { font-size: clamp(2.1rem, 4.4vw, 3.2rem); text-wrap: balance; }

.hero-split {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 52px;
  align-items: center;
}
.hero-split > * { min-width: 0; }

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 22px;
}
.crumbs a { color: var(--text-dim); }
.crumbs a:hover { color: var(--text); }

.facts {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 32px;
  margin-top: 4px;
}
.facts li { display: flex; flex-direction: column; line-height: 1.3; }
.facts b { font-size: 1.1rem; }
.facts span { color: var(--text-dim); font-size: 0.8rem; }

.model-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.model-nav a {
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 30px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  color: var(--text-dim);
  transition: color 0.2s, border-color 0.2s, transform 0.15s;
}
.model-nav a:hover { color: var(--text); border-color: rgba(255, 104, 87, 0.45); transform: translateY(-1px); }

/* ---------- Sections ---------- */
.g-section { padding: 80px 0; }
.g-section.g-tight { padding: 52px 0 12px; }
.g-alt { background: var(--bg-2); }
.g-title {
  font-size: clamp(1.6rem, 3.2vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 10px;
  text-wrap: balance;
}
.g-sub { color: var(--text-dim); max-width: 42em; margin-bottom: 8px; }
.g-more { margin-top: 26px; }
.g-more a { color: var(--grad-b); font-weight: 600; text-decoration: none; }
.g-more a:hover { text-decoration: underline; }

a:focus-visible, button:focus-visible, .compare-range:focus-visible + * {
  outline: 2px solid var(--grad-b);
  outline-offset: 3px;
}

/* ---------- Guide steps ---------- */
.g-steps { list-style: none; display: grid; gap: 22px; margin-top: 38px; }
.g-step {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 40px;
  align-items: center;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
}
.g-step:nth-child(even) { grid-template-columns: 1fr 230px; }
.g-step:nth-child(even) .g-step-visual { order: 2; }
.g-step-body { min-width: 0; }
.g-step-body .step-num { margin: 0 0 12px; width: 40px; height: 40px; font-size: 1rem; }
.g-step-body h3 { font-size: 1.3rem; }
.g-step-body p { color: var(--text-dim); margin-top: 8px; max-width: 40em; }
.g-step-body ul { color: var(--text-dim); margin: 12px 0 0 18px; display: grid; gap: 4px; font-size: 0.93rem; }

/* Phone illustration built from real example photos */
.phone {
  width: 210px;
  max-width: 100%;
  aspect-ratio: 9 / 19;
  margin-inline: auto;
  border-radius: 32px;
  border: 7px solid #2b2238;
  background: #0d0716;
  overflow: hidden;
  position: relative;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.5);
  padding: 24px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.phone::before {
  content: "";
  position: absolute;
  top: 7px; left: 50%;
  transform: translateX(-50%);
  width: 52px; height: 6px;
  border-radius: 6px;
  background: #2b2238;
}
.ph-title { font-size: 0.64rem; font-weight: 700; text-align: center; }
.ph-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ph-tile { border-radius: 8px; overflow: hidden; position: relative; }
.ph-tile img { aspect-ratio: 1; object-fit: cover; width: 100%; }
.ph-tile span { position: absolute; left: 5px; bottom: 3px; font-size: 0.52rem; font-weight: 700; text-shadow: 0 1px 3px #000; }
.ph-tile.hl { outline: 2px solid var(--grad-b); outline-offset: -2px; }
.ph-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.ph-gallery img { aspect-ratio: 1; object-fit: cover; width: 100%; border-radius: 3px; }
.ph-gallery img.hl { outline: 2px solid var(--grad-b); outline-offset: -2px; }
.ph-img { border-radius: 10px; overflow: hidden; }
.ph-img img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.ph-dim { filter: blur(1.5px) saturate(0.6); }
.ph-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.ph-chip { font-size: 0.52rem; padding: 3px 8px; border-radius: 20px; background: var(--surface-2); border: 1px solid var(--surface-border); }
.ph-chip.on { background: var(--grad); border-color: transparent; }
.ph-btn { margin-top: auto; text-align: center; font-size: 0.62rem; font-weight: 700; padding: 7px; border-radius: 20px; background: var(--grad); }
.ph-btn.alt { background: var(--surface-2); }
.ph-row { display: flex; gap: 6px; margin-top: auto; }
.ph-row .ph-btn { flex: 1; margin-top: 0; }
.ph-center { margin: auto 0; display: grid; gap: 10px; text-align: center; font-size: 0.62rem; color: var(--text-dim); }
.ph-bar { height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.ph-bar i { display: block; height: 100%; width: 64%; background: var(--grad); animation: phFill 3s ease-in-out infinite alternate; }
@keyframes phFill { from { width: 20%; } to { width: 88%; } }
.compare.ph-compare { aspect-ratio: 3 / 4; border-radius: 10px; }
.ph-compare .compare-handle span { width: 22px; height: 22px; font-size: 0.42rem; }
.ph-compare .compare-label { font-size: 0.48rem; padding: 2px 7px; top: 6px; }

/* ---------- Tool finder ---------- */
.finder {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 30px;
}
.find {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  text-decoration: none;
  transition: border-color 0.2s, transform 0.15s, background 0.2s;
}
.find:hover { border-color: rgba(255, 104, 87, 0.45); transform: translateY(-2px); background: var(--surface-2); }
.find img { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; flex: none; }
.find span { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.find b { font-size: 0.97rem; }
.find small { color: var(--text-dim); font-size: 0.83rem; }
.find em { font-style: normal; color: var(--grad-b); font-weight: 600; }

/* ---------- Tool catalog ---------- */
.group-title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 44px 0 16px;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.group-title::after { content: ""; flex: 1; height: 1px; background: var(--surface-border); }
.tool-grid { display: grid; grid-template-columns: repeat(var(--cols, 4), 1fr); gap: 18px; }
.tool-grid-3 { grid-template-columns: repeat(3, 1fr); margin-top: 26px; }
.tool-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.tool-card:hover { transform: translateY(-4px); border-color: rgba(255, 104, 87, 0.4); box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35); }
.tool-pair { display: grid; grid-template-columns: 1fr 1fr; }
.tool-pair img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.tool-pair img:first-child { filter: saturate(0.85) brightness(0.92); }
.tool-card-body { padding: 14px 16px 18px; display: grid; gap: 6px; }
.tool-card-body h3 { font-size: 1.05rem; }
.tool-card-body p { color: var(--text-dim); font-size: 0.88rem; }
.tool-card-body .tool-meta { font-size: 0.76rem; }

.pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 20px;
  border: 1px solid var(--surface-border);
  background: var(--surface-2);
  white-space: nowrap;
  vertical-align: middle;
}
.pill.free { color: var(--ok); border-color: rgba(123, 224, 176, 0.35); }
.pill.pro { color: var(--gold); border-color: rgba(255, 200, 97, 0.4); }
.pill.new { background: var(--grad); border-color: transparent; color: #fff; }

/* ---------- Free vs Premium ---------- */
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 30px; }
.plan { padding: 28px; border-radius: var(--radius); border: 1px solid var(--surface-border); background: var(--surface); }
.plan-pro { background: linear-gradient(160deg, rgba(161, 45, 180, 0.24), rgba(255, 104, 87, 0.1)); border-color: rgba(255, 104, 87, 0.35); }
.plan ul { list-style: none; margin-top: 14px; display: grid; gap: 8px; color: var(--text-dim); }
.plan li::before { content: "\2713"; color: var(--grad-b); font-weight: 800; margin-right: 10px; }

/* ---------- Tool page ---------- */
.how-mini { list-style: none; counter-reset: s; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 24px; }
.how-mini li {
  counter-increment: s;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 14px;
  padding: 16px 18px;
  color: var(--text-dim);
  font-size: 0.93rem;
}
.how-mini li::before {
  content: counter(s);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  font-weight: 800;
  font-size: 0.78rem;
}
/* Upscale: By size strip (2K / 4K / 8K) */
.sizes-title { margin-top: 28px; font-size: 1.05rem; letter-spacing: 0.02em; }
.sizes { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 12px; }
.size {
  display: grid;
  gap: 4px;
  align-content: start;
  justify-items: start;
  padding: 18px 18px 16px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.size:hover { border-color: rgba(255, 104, 87, 0.45); transform: translateY(-2px); }
.size-label {
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.size-px { font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 6px; }
.size-px small { color: var(--text-dim); font-weight: 400; }
.size-mp { color: var(--text-dim); font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.size-use { font-size: 0.9rem; margin: 6px 0 8px; }
.sizes-note { margin-top: 12px; font-size: 0.88rem; color: var(--text-dim); max-width: 60em; }
@media (prefers-reduced-motion: reduce) { .size, .size:hover { transition: none; transform: none; } }

.options-note {
  margin-top: 16px;
  font-size: 0.9rem;
  color: var(--text-dim);
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
}
.options-note b { color: var(--text); }

.model { padding: 44px 0 8px; border-top: 1px solid var(--surface-border); margin-top: 28px; scroll-margin-top: 84px; }
.model-head { margin-bottom: 22px; }
.model-head h3 { font-size: 1.5rem; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 6px; }
.model-head p { color: var(--text-dim); max-width: 46em; }
.best-for { font-size: 0.88rem; margin-top: 4px; }
.best-for b { color: var(--text); font-weight: 600; }

.examples { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.ex { min-width: 0; }
.ex .compare { border-radius: 14px; }
.ex figcaption { margin-top: 10px; font-size: 0.88rem; color: var(--text-dim); }
.ex figcaption b { color: var(--text); font-weight: 600; }
.ex-note { font-size: 0.72rem; color: var(--gold); margin-left: 6px; }
.ex-missing {
  aspect-ratio: 3 / 2;
  border-radius: 14px;
  border: 1.5px dashed var(--surface-border);
  display: grid;
  place-content: center;
  color: var(--text-dim);
  font-size: 0.85rem;
}
.ex-pair {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  aspect-ratio: 3 / 2;
  max-width: 100%;
}
.ex-pair > img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 12px; }
.ex-arrow { color: var(--grad-b); font-weight: 800; }
.ex-after { border-radius: 12px; aspect-ratio: 3 / 4; display: grid; place-items: center; overflow: hidden; }
.ex-after img { max-height: 100%; object-fit: contain; }

/* Checkerboard behind transparent cut-outs */
.compare.transparent,
.ex-after.transparent {
  background-color: #2a2236;
  background-image:
    linear-gradient(45deg, #3a3048 25%, transparent 25%),
    linear-gradient(-45deg, #3a3048 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #3a3048 75%),
    linear-gradient(-45deg, transparent 75%, #3a3048 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}
.compare.transparent .compare-after { object-fit: contain; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .tool-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 960px) {
  .hero-split { grid-template-columns: 1fr; gap: 40px; }
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .g-section { padding: 56px 0; }
  .g-step, .g-step:nth-child(even) { grid-template-columns: 1fr; gap: 22px; padding: 22px; }
  .g-step:nth-child(even) .g-step-visual { order: 0; }
  .examples, .how-mini, .plans, .tool-grid-3, .sizes { grid-template-columns: 1fr; }
  .size { grid-template-columns: auto 1fr; column-gap: 18px; padding: 14px 16px; }
  .size-label { grid-row: 1 / span 4; align-self: center; font-size: 2.2rem; }
  .size-px { margin-top: 0; }
  .size-use { margin: 2px 0 4px; }
}
@media (max-width: 900px) {
  /* style.css hides the nav on phones; keep the guide links reachable */
  .nav-links { display: flex; gap: 16px; }
  .nav-links a:first-child, .nav-links a:last-child { display: none; }
}
@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .tool-grid { grid-template-columns: 1fr; }
  .site-header .btn-primary { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ph-bar i { animation: none; }
}
