:root {
  --art: url("https://github.com/InfiniteProfile/SOLVANE/raw/refs/heads/main/IMG_20261010_144034.jpg");
  --ink: #0d0d0d;
  --graphite: #171717;
  --graphite-2: #202020;
  --line: #2f2f2f;
  --text: #e8e8e3;
  --muted: #a0a09a;
  --gold: #d6c38b;
  --gold-dim: #a99a65;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  background: var(--ink);
  color-scheme: dark;
  scroll-behavior: auto;
  overflow-anchor: none;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  background: transparent;
  color: var(--text);
  font: 400 1rem/1.55 var(--sans);
  overflow-x: hidden;
}
#feed { overflow-anchor: none; }

.sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- The landscape ---------- */
.sky {
  position: fixed; left: 0; top: 0; z-index: -1;
  width: 100%; height: 100vh; height: 100lvh;
  background: var(--ink) var(--art) 60% 30% / cover no-repeat;
  pointer-events: none;
}
.sky::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(13,13,13,.5), rgba(13,13,13,0) 38%);
}
/* Portrait tablets: keep valley, river and figure in frame. */
@media (min-aspect-ratio: 3/5) and (max-aspect-ratio: 9/10) {
  .sky { background-position: 50% 36%; }
}
/* Landscape and square screens: show the whole artwork uncropped, centred,
   its edges dissolving into charcoal. */
@media (min-aspect-ratio: 9/10) {
  .sky { background: var(--ink); }
  .sky::before {
    content: ""; position: absolute; top: 0; bottom: 0; left: 50%;
    width: calc(100vh * .4623); width: calc(100lvh * .4623);
    transform: translateX(-50%);
    background: var(--art) center / cover no-repeat;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 16%, #000 84%, transparent);
            mask-image: linear-gradient(to right, transparent, #000 16%, #000 84%, transparent);
  }
}

/* ---------- Hero ---------- */
.hero {
  min-height: 92vh; min-height: 92svh;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 7vh) max(20px, env(safe-area-inset-right)) 28px max(20px, env(safe-area-inset-left));
  text-align: center;
  text-shadow: 0 1px 14px rgba(0,0,0,.65);
}
.mark {
  margin: 0;
  padding-left: .55em; /* balances the trailing letter-space */
  font: 400 clamp(1.7rem, 6.4vw, 2.6rem)/1.1 var(--serif);
  letter-spacing: .55em;
  color: #f1f1ec;
}
.rule {
  width: 64px; height: 1px; margin: 20px auto 16px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.tagline {
  margin: 0;
  font: 500 clamp(.72rem, 2.7vw, .88rem)/1.4 var(--sans);
  letter-spacing: .3em;
  color: var(--gold);
}
.sub {
  margin: 10px 0 0;
  font: italic 400 clamp(.95rem, 3.6vw, 1.1rem)/1.5 var(--serif);
  color: #d4d4cf;
}
.hero-bottom { width: 100%; max-width: 560px; margin: 0 auto; }

#search { display: flex; gap: 10px; }
#search input {
  flex: 1; min-width: 0; height: 50px; padding: 0 16px;
  border: 1px solid #3a3a3a; border-radius: 12px;
  background: rgba(20,20,20,.94); color: var(--text);
  font: inherit; font-size: 1rem; text-shadow: none;
}
#search input::placeholder { color: #8a8a85; }
#search input[aria-invalid="true"] { border-color: #b98f5b; }
.msg { min-height: 1.5em; margin: 8px 4px 0; font-size: .9rem; color: var(--gold); text-align: left; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0 18px;
  border: 1px solid #3c3c3c; border-radius: 12px;
  background: var(--graphite-2); color: var(--text);
  font: 500 .95rem/1 var(--sans); text-decoration: none; text-shadow: none;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.btn:hover { border-color: var(--gold-dim); }
.btn.primary { border-color: var(--gold-dim); color: var(--gold); }
.btn:disabled { opacity: .4; cursor: default; border-color: #3c3c3c; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- Feed ---------- */
main {
  background: linear-gradient(to bottom, rgba(13,13,13,0), rgba(13,13,13,.76) 200px);
  padding: 8px max(16px, env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 72px) max(16px, env(safe-area-inset-left));
  min-height: 60vh;
}
.boot { max-width: 520px; margin: 40px auto; text-align: center; color: var(--muted); }
.feed {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  max-width: 1120px; margin: 0 auto;
}
.sentinel { height: 1px; }
.sentinel.end { height: 80px; display: flex; align-items: center; justify-content: center; }
.sentinel.end span { width: 1px; height: 48px; background: linear-gradient(var(--gold-dim), transparent); }

.card {
  display: flex; align-items: center; gap: 14px;
  min-height: 92px; padding: 14px 16px;
  background: rgba(23,23,23,.92); color: inherit; text-decoration: none;
  border: 1px solid var(--line); border-radius: 14px;
  -webkit-tap-highlight-color: transparent;
}
.card:hover { border-color: var(--gold-dim); }
.meta { flex: 1; min-width: 0; display: block; }
.meta > span { display: block; }
.cname { font: 400 1.08rem/1.3 var(--serif); color: #f0f0eb; overflow-wrap: anywhere; }
.cid {
  margin-top: 2px; font: .76rem/1.4 var(--mono); color: var(--gold-dim);
  overflow-wrap: anywhere; word-break: break-all;
}
.cdesc {
  margin-top: 4px; font-size: .88rem; line-height: 1.4; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.go { color: var(--gold-dim); font-size: 1.5rem; line-height: 1; flex: none; }

.avatar {
  flex: none; width: 56px; height: 56px; overflow: hidden;
  border-radius: 12px; border: 1px solid #343434; background: #111;
}
.avatar svg { display: block; width: 100%; height: 100%; }
.avatar.big { width: 96px; height: 96px; border-radius: 16px; }

.to-start {
  position: fixed; z-index: 20; right: max(16px, env(safe-area-inset-right));
  bottom: calc(env(safe-area-inset-bottom) + 16px);
  width: 48px; padding: 0; background: rgba(23,23,23,.95); color: var(--gold); font-size: 1.2rem;
}

/* ---------- Profile dialog ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  display: flex; overflow-y: auto; overscroll-behavior: contain;
  padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  background: rgba(10,10,10,.84);
}
.dialog {
  position: relative; width: min(640px, 100%); margin: auto;
  padding: 24px 22px 22px;
  background: #151515; border: 1px solid #343434; border-radius: 18px;
}
.icon-btn {
  position: absolute; top: 8px; right: 8px; width: 46px; height: 46px;
  border: 0; border-radius: 12px; background: transparent; color: var(--text);
  font-size: 1.7rem; line-height: 1; cursor: pointer;
}
.icon-btn:hover { color: var(--gold); }
.p-head { display: flex; align-items: center; gap: 16px; padding-right: 40px; }
.p-title { min-width: 0; }
.sigil { margin: 0; font: .8rem/1.4 var(--mono); color: var(--gold-dim); }
.dialog h2 { margin: 2px 0 2px; font: 400 clamp(1.4rem, 5vw, 1.8rem)/1.2 var(--serif); overflow-wrap: anywhere; }
.role { margin: 0; color: var(--muted); }
.label { margin: 22px 0 2px; font-size: .85rem; color: var(--muted); }
.pid {
  margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #101010; color: var(--gold);
  font: .95rem/1.5 var(--mono); overflow-wrap: anywhere; word-break: break-all; user-select: all;
}
.facts { margin: 8px 0 0; }
.facts > div { padding: 14px 0; border-bottom: 1px solid #262626; }
.facts > div:last-child { border-bottom: 0; }
.facts dt { margin: 0 0 4px; font-size: .85rem; color: var(--gold-dim); }
.facts dd { margin: 0; max-width: 62ch; font-family: var(--serif); font-size: 1.02rem; line-height: 1.65; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { padding: 4px 12px; border: 1px solid #3a3a3a; border-radius: 999px; font: .9rem/1.4 var(--sans); color: #d6d6d1; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.actions .btn { flex: 1 1 140px; }
.actions.pn { margin-top: 10px; }

.toast {
  position: fixed; z-index: 60; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 24px);
  transform: translateX(-50%); max-width: calc(100% - 32px);
  padding: 12px 18px; border: 1px solid var(--gold-dim); border-radius: 12px;
  background: #181818; color: var(--text); font-size: .92rem; text-align: center;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.toast.show { opacity: 1; }

@media (min-width: 700px) {
  .hero { padding-top: 9vh; }
  .dialog { padding: 30px 30px 26px; }
}

@media (prefers-reduced-motion: no-preference) {
  .hero-top { animation: dawn 1.4s ease-out both; }
  @keyframes dawn { from { opacity: 0; } to { opacity: 1; } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
