:root {
  --bg: #ffffff;
  --surface: #f4f4f5;
  --line: #dbd7d2;
  --text: #161616;
  --muted: #6f6a64;
  --cta: #e9e9ea;
  --cta-text: #666;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.03);
  --accent: #dd7b28;
  --input-bg: #d6d1c9;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Outfit", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.page {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 64px 20px 42px;
}

.hero-header {
  text-align: center;
}

.hero-title-main {
  margin: 0;
  display: block;
  font-family: Outfit, "Outfit Fallback", Outfit, Helvetica, Arial, sans-serif;
  font-style: normal;
  font-weight: 500;
  font-size: clamp(2.2rem, 7vw, 4.5rem);
  line-height: 1.05;
  letter-spacing: normal;
  color: rgb(26, 25, 22);
}

.hero-title-accent {
  display: block;
  margin: 0.14em 0 0;
  font-family: Outfit, "Outfit Fallback", Outfit, Helvetica, Arial, sans-serif;
  font-weight: 500;
  font-style: normal;
  color: var(--accent);
  font-size: clamp(2.2rem, 7vw, 4.5rem);
  line-height: 1.05;
  letter-spacing: normal;
}

.hero-subtitle {
  margin: 30px 0 0;
  font-family: Outfit, "Outfit Fallback", Outfit, Helvetica, Arial, sans-serif;
  font-style: normal;
  font-weight: 400;
  font-size: clamp(0.95rem, 2.5vw, 1.25rem);
  line-height: 1.4;
  color: rgb(92, 88, 80);
}

.controls {
  width: min(588px, 100%);
  margin: 42px auto 0;
}

.controls-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #d0cbc3;
  padding: 8px 10px;
}

.search-icon {
  appearance: none;
  border: 0;
  background: transparent;
  width: 24px;
  height: 24px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  align-items: center;
  justify-content: center;
  color: #8e877f;
  cursor: pointer;
}

.search-icon svg,
.icon-clear {
  grid-area: 1 / 1;
}

.search-icon svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.icon-clear {
  display: none;
  font-size: 26px;
  line-height: 1;
  color: #8e877f;
}

.controls-row.has-value .icon-search {
  display: none;
}

.controls-row.has-value .icon-clear {
  display: block;
}

input {
  width: 100%;
  border: 0;
  border-radius: 0;
  padding: 8px 4px;
  font-family: Outfit, "Outfit Fallback", Outfit, Helvetica, Arial, sans-serif;
  font-style: normal;
  font-weight: 400;
  font-size: 16px;
  line-height: 24px;
  color: rgb(26, 25, 22);
  background: transparent;
  outline: none;
}

input::placeholder {
  font-family: Outfit, "Outfit Fallback", Outfit, Helvetica, Arial, sans-serif;
  font-style: normal;
  font-weight: 400;
  font-size: 16px;
  line-height: 24px;
  color: rgba(26, 25, 22, 0.6);
}

button {
  border: 1px solid #c9c3ba;
  border-radius: 999px;
  padding: 8px 14px;
  background: #ece8e1;
  color: #66615a;
  font-family: "Outfit", sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.status {
  display: none;
}

.tools-line {
  margin: 18px 0 0;
  text-align: center;
  font-family: Outfit, "Outfit Fallback", Outfit, Helvetica, Arial, sans-serif;
  font-style: normal;
  font-weight: 400;
  font-size: 14px;
  line-height: 20px;
  color: rgb(140, 135, 120);
}

.tools-line a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.result {
  margin-top: 32px;
  position: relative;
}

.result.loading {
  min-height: 320px;
}

.hidden {
  display: none !important;
}

.result-loader {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.86);
  border-radius: 14px;
  backdrop-filter: blur(2px);
}

.result-loader.hidden {
  display: none !important;
}

.result.loading .app-row,
.result.loading .image-grid {
  visibility: hidden;
}

.loader-circle {
  width: 74px;
  height: 74px;
  border: 5px solid #e4e0da;
  border-top-color: #dd7b28;
  border-radius: 999px;
  animation: spin 0.9s linear infinite;
}

.loader-status {
  margin: 0;
  font-family: Outfit, "Outfit Fallback", Outfit, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 24px;
  color: #5f5a54;
}

.alert {
  margin-top: 12px;
  border: 1px solid #efb2b2;
  background: #fff2f2;
  color: #8f1d1d;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 20px;
}

.alert.hidden {
  display: none !important;
}

.app-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.app-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-chip {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: #d8d3cb;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.app-icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

#app-name {
  margin: 0;
  font-size: 15px;
  line-height: 1.15;
  font-weight: 700;
}

#app-meta {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.store-link {
  text-decoration: none;
  background: var(--cta);
  color: var(--cta-text);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
  align-items: start;
}

.shot-card {
  width: min(268px, 100%);
}

.shot-link {
  display: block;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--surface);
}

.shot-link img {
  width: 100%;
  height: auto;
  aspect-ratio: 460 / 995;
  display: block;
  object-fit: cover;
}

.footer {
  border-top: 1px solid var(--line);
  margin-top: 28px;
  padding: 10px 20px 14px;
  color: #8c8c8d;
  font-size: 14px;
  text-align: center;
}

.seo-content {
  margin-top: 72px;
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.seo-content h3 {
  margin-top: 20px;
  margin-bottom: 6px;
  font-family: Outfit, "Outfit Fallback", Outfit, Helvetica, Arial, sans-serif;
  font-style: normal;
  font-weight: 400;
  font-size: clamp(0.95rem, 2.5vw, 1.25rem);
  line-height: 1.4;
  color: rgb(92, 88, 80);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 900px) {
  .page {
    padding-top: 44px;
  }

  .image-grid {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  }

  .shot-card {
    width: min(220px, 100%);
  }

}

@media (max-width: 680px) {
  .controls-row {
    grid-template-columns: 24px minmax(0, 1fr);
    row-gap: 8px;
  }

  .controls-row > #fetch-button {
    grid-column: 1 / -1;
    width: 100%;
    margin-top: 6px;
  }

  .app-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .app-actions {
    width: 100%;
  }

  .image-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shot-card {
    width: 100%;
  }

}
