/* Photo Search — Toolforge. Dark-first, single accent (amber). */
:root {
  --bg: #0b0d10;
  --bg-2: #121519;
  --line: #232a31;
  --ink: #eef1f4;
  --ink-2: #aab3bd;
  --ink-3: #7c8792;
  --accent: #e8b06b;
  --accent-ink: #17130b;
  --radius: 12px;
  --maxw: 1200px;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Masthead */
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 20px;
}
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand-mark {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2.5px solid var(--accent);
  align-self: center;
  position: relative;
}
.brand-mark::after {
  content: ""; position: absolute; right: -5px; bottom: -5px;
  width: 8px; height: 2.5px; background: var(--accent);
  transform: rotate(45deg); transform-origin: left; border-radius: 2px;
}
.brand-name { font-weight: 650; letter-spacing: -0.01em; }
.brand-sub { color: var(--ink-3); font-size: 0.85rem; }
.contact { color: var(--ink-2); font-size: 0.9rem; }

/* Main + intro */
main { max-width: var(--maxw); margin: 0 auto; padding: 0 20px 64px; }
.intro { padding: 28px 0 8px; max-width: 720px; }
.intro h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 12px;
  text-wrap: balance;
}
.lede { color: var(--ink-2); margin: 0 0 22px; font-size: 1.02rem; text-wrap: pretty; }

/* Search */
.search { display: flex; gap: 10px; max-width: 620px; }
.search input {
  flex: 1; min-width: 0;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--ink);
  border-radius: var(--radius); padding: 13px 15px; font-size: 1rem;
  outline: none; transition: border-color .15s ease;
}
.search input:focus { border-color: var(--accent); }
.search input::placeholder { color: var(--ink-3); }
.search button {
  background: var(--accent); color: var(--accent-ink);
  border: none; border-radius: var(--radius);
  padding: 0 22px; font-size: 1rem; font-weight: 640; cursor: pointer;
  transition: filter .15s ease;
}
.search button:hover { filter: brightness(1.06); }
.search button:disabled { opacity: .55; cursor: default; }

.status { color: var(--ink-3); min-height: 1.4em; margin: 20px 0 6px; font-size: .92rem; }

/* Results grid — masonry-ish via columns */
.grid { columns: 4 240px; column-gap: 16px; }
.card {
  break-inside: avoid; margin: 0 0 16px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}
.photo-link { display: block; line-height: 0; background: #1a1e23; }
.photo { width: 100%; height: auto; display: block; }

.credit {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 11px; font-size: .82rem; color: var(--ink-2);
}
.credit-text { min-width: 0; }
.credit a { color: var(--ink); }
.credit a:hover { color: var(--accent); }
.dl {
  flex: none;
  background: transparent; color: var(--ink-2);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 5px 10px; font-size: .78rem; cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
}
.dl:hover { color: var(--accent); border-color: var(--accent); }
.dl:disabled { opacity: .5; cursor: default; }

.more-wrap { display: flex; justify-content: center; padding: 8px 0 0; }
.more-btn {
  background: var(--bg-2); color: var(--ink); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 11px 24px; font-size: .95rem; cursor: pointer;
}
.more-btn:hover { border-color: var(--accent); color: var(--accent); }

.site-foot {
  max-width: var(--maxw); margin: 0 auto; padding: 28px 20px 48px;
  border-top: 1px solid var(--line); color: var(--ink-3); font-size: .85rem;
}
.site-foot a { color: var(--ink-2); }

@media (max-width: 560px) {
  .search { flex-wrap: wrap; }
  .search button { padding: 12px 22px; }
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f8fa; --bg-2: #ffffff; --line: #e3e7ec;
    --ink: #12161a; --ink-2: #46515b; --ink-3: #7c8792;
    --accent: #b9772a; --accent-ink: #ffffff;
  }
  .photo-link { background: #eceef1; }
}
