/* Liminal Iron — light and warm (design.md § Tone).
   Warm off-white, near-black ink, one muted rust accent. The photos carry the colour. */

:root {
  --bg: #f5f2ec;
  --surface: #fbfaf7;
  --well: #e8e3da;
  --ink: #1d1c1a;
  --muted: #6b665e;
  --line: #e0dacf;
  --accent: #8c4a2f;
  --accent-ink: #fbfaf7;
  --danger: #a3362a;
  --ok: #3f6a4a;
  --radius: 3px;
  --max: 1240px;
  --font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--font); text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3 { font-weight: 500; letter-spacing: -0.015em; line-height: 1.2; }
code { font-size: .9em; background: var(--well); padding: 1px 5px; border-radius: var(--radius); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 clamp(18px, 4vw, 44px); }

/* --- Header & footer ----------------------------------------------------- */

.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 76px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand img { width: 36px; height: 36px; }
.brand span { font-size: 13px; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; }
.brand em { font-style: normal; font-weight: 400; letter-spacing: .12em; color: var(--muted); margin-left: 8px; }
.nav { display: flex; gap: clamp(16px, 3vw, 32px); flex-wrap: wrap; }
.nav a { text-decoration: none; font-size: 15px; color: var(--muted); padding: 6px 0; border-bottom: 1px solid transparent; }
.nav a:hover, .nav a[aria-current] { color: var(--ink); border-bottom-color: var(--ink); }

.site-footer { border-top: 1px solid var(--line); margin-top: 48px; }
.site-footer .wrap { display: flex; align-items: center; gap: 14px; min-height: 72px; font-size: 14px; color: var(--muted); }
.site-footer img { width: 20px; height: 20px; opacity: .85; }
.site-footer a, .site-footer form { margin-left: auto; }

/* --- Home ---------------------------------------------------------------- */

.intro { padding: clamp(40px, 7vw, 88px) 0 clamp(24px, 3vw, 36px); }
.intro h1 { font-size: clamp(28px, 4.2vw, 48px); max-width: 20ch; margin: 0; letter-spacing: -0.025em; }
.intro p { color: var(--muted); max-width: 56ch; margin: 18px 0 0; font-size: 17px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 0 36px; }
.chip { display: inline-block; padding: 6px 15px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; text-decoration: none; color: var(--muted); }
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip[aria-current] { background: var(--ink); border-color: var(--ink); color: var(--bg); }

.grid { list-style: none; margin: 0; padding: 0 0 24px; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 44px clamp(18px, 2.4vw, 32px); }
.grid-small { grid-template-columns: repeat(auto-fill, minmax(min(46%, 220px), 1fr)); gap: 28px 20px; }
.card { display: block; text-decoration: none; }
.card:hover { color: var(--ink); }
.card .ph { aspect-ratio: 4 / 5; background: var(--well); overflow: hidden; }
.card .ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease, opacity .3s; }
.card:hover .ph img { transform: scale(1.025); }
.card h2, .card h3 { font-size: 16px; margin: 14px 0 2px; letter-spacing: 0; }
.card:hover h2, .card:hover h3 { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.meta { font-size: 14px; color: var(--muted); margin: 0; }

.status::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 6px; vertical-align: 2px; }
.status-available { color: var(--accent); }
.status-sold, .status-not-for-sale { color: var(--muted); }
.status-sold::before, .status-not-for-sale::before { background: transparent; border: 1px solid currentColor; }

.pager { display: flex; justify-content: space-between; align-items: center; padding: 24px 0; border-top: 1px solid var(--line); font-size: 15px; color: var(--muted); }
.pager a { color: var(--ink); text-decoration: none; }
.empty { color: var(--muted); padding: 32px 0 64px; }

/* --- Item ---------------------------------------------------------------- */

.crumbs { font-size: 14px; color: var(--muted); margin: 28px 0 0; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

.item { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); padding: 24px 0 56px; align-items: start; }
.gallery .main { display: block; background: var(--well); }
.gallery .main img { width: 100%; }
.thumbs { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 10px; }
.thumbs a { display: block; aspect-ratio: 1; background: var(--well); opacity: .62; transition: opacity .2s; }
.thumbs a:hover, .thumbs a[aria-current] { opacity: 1; }
.thumbs a[aria-current] { outline: 1px solid var(--ink); outline-offset: 2px; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }

.info { position: sticky; top: 28px; }
.info h1 { font-size: clamp(26px, 3vw, 38px); margin: 0 0 10px; }
.prose { margin-top: 22px; max-width: 60ch; }
.prose p { margin: 0 0 1em; }
.details { display: grid; grid-template-columns: max-content 1fr; gap: 10px 28px; margin: 28px 0; padding: 22px 0 0; border-top: 1px solid var(--line); }
.details dt { color: var(--muted); font-size: 14px; padding-top: 1px; }
.details dd { margin: 0; }
.tags { list-style: none; padding: 0; margin: 0 0 28px; display: flex; flex-wrap: wrap; gap: 8px; }
.tags a { font-size: 13px; color: var(--muted); text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px; }
.tags a:hover { color: var(--ink); border-color: var(--ink); }
.related { border-top: 1px solid var(--line); padding: 36px 0 0; }
.related h2 { font-size: 20px; margin: 0 0 24px; }

/* --- Buttons, forms, notices --------------------------------------------- */

.button { display: inline-block; background: var(--ink); color: var(--bg); padding: 12px 22px; text-decoration: none; border: 1px solid var(--ink); border-radius: var(--radius); font: inherit; font-size: 15px; line-height: 1.2; cursor: pointer; }
.button:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.button-quiet { background: transparent; color: var(--ink); }
.button.danger { background: var(--danger); border-color: var(--danger); }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.inline { display: inline; margin: 0; }

.form { display: grid; gap: 18px; max-width: 640px; }
.form label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.form label.check { display: flex; gap: 10px; align-items: center; color: var(--ink); }
.form small { font-size: 13px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
input, select, textarea { font: inherit; font-size: 16px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; width: 100%; }
input[type=checkbox], input[type=radio] { width: auto; margin: 0; accent-color: var(--accent); }
input[type=file] { padding: 10px; background: transparent; border-style: dashed; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); }
textarea { resize: vertical; }
.form .button { justify-self: start; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.notice { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--ink); padding: 14px 18px; margin: 16px 0; }
.notice-ok { border-left-color: var(--ok); }
.notice-error { border-left-color: var(--danger); }
.notice h2 { margin: 0 0 8px; font-size: 20px; }
.notice p:last-child { margin-bottom: 0; }
.message { padding: 72px 0; max-width: 56ch; }
.message h1 { font-size: clamp(26px, 3vw, 36px); margin: 0 0 12px; }
.message p { color: var(--muted); }

/* --- Contact ------------------------------------------------------------- */

.contact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: clamp(28px, 6vw, 96px); padding-bottom: 32px; }
.contact h2 { font-size: 14px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; }
.email { font-size: clamp(18px, 2vw, 22px); }
.about { margin: 0; font-size: 15px; }

/* --- Owner --------------------------------------------------------------- */

.signin { max-width: 420px; padding: 56px 0 24px; }
.signin h1 { font-size: 30px; margin: 0 0 24px; }
.owner-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 28px 0 8px; }
.owner-head h1 { font-size: clamp(24px, 3vw, 32px); margin: 0; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.badge { display: inline-block; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; background: var(--well); color: var(--ink); padding: 2px 8px; border-radius: var(--radius); }
.list { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 15px; }
.list th { text-align: left; font-weight: 500; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); padding: 8px 10px; }
.list td { border-bottom: 1px solid var(--line); padding: 8px 10px; vertical-align: middle; }
.list .thumb { width: 64px; padding-left: 0; }
.list .thumb img { width: 56px; height: 56px; object-fit: cover; background: var(--well); }
.form-item { margin: 24px 0 40px; }
.owner-photos, .danger-zone { border-top: 1px solid var(--line); padding: 28px 0; }
.owner-photos h2, .danger-zone h2 { font-size: 20px; margin: 0 0 18px; }
.photo-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 22px; }
.photo-list img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--well); }
.photo-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
button.small { font: inherit; font-size: 13px; padding: 4px 10px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; }
button.small:hover { border-color: var(--ink); }
button.small.danger { color: var(--danger); }
.cat-list { list-style: none; padding: 0; margin: 20px 0 32px; max-width: 760px; }
.cat-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cat-row input { width: auto; flex: 1 1 200px; }
.cat-add { grid-template-columns: 1fr auto; align-items: end; }
.messages { list-style: none; padding: 0; margin: 20px 0; max-width: 760px; }
.messages li { border-bottom: 1px solid var(--line); padding: 20px 0; }
.messages li.unread { border-left: 3px solid var(--accent); padding-left: 16px; }
.msg-head { display: flex; gap: 14px; flex-wrap: wrap; align-items: baseline; }
.form label .check { display: flex; gap: 8px; align-items: center; color: var(--ink); font-size: 13px; }

/* --- Get an email (following) ------------------------------------------------ */

.follow { border-top: 1px solid var(--line); margin: 36px 0 8px; padding-top: 22px; }
.follow h2 { font-size: 14px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.follow p { margin: 0; }
.follow-form { gap: 14px; }
.follow-form fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.follow-form label.check { font-size: 15px; }
.follow-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.follow-row .button { align-self: end; }
.follow small { color: var(--muted); }
main > .follow { max-width: 640px; margin-top: 56px; }

/* --- Small screens --------------------------------------------------------- */

@media (max-width: 860px) {
  .item { grid-template-columns: 1fr; }
  .info { position: static; }
  .contact { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .form .row { grid-template-columns: 1fr; }
  .list th:nth-child(3), .list td:nth-child(3) { display: none; }
  .brand span { letter-spacing: .18em; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
