:root {
  --paper: #F1EFEA;
  --paper-2: #F7F6F2;
  --frame: #E4E1DA;
  --sil: #D6D2CA;
  --ink: #1A1A1A;
  --muted: #6E6B65;
  --soft: #8F8B84;
  --rule: #CFCBC3;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --sans: 'Inter Tight', system-ui, sans-serif;
  --gutter: clamp(20px, 4vw, 32px);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--paper); color: var(--ink); }
body { font-family: var(--sans); -webkit-font-smoothing: antialiased; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
a { color: var(--ink); }
a:hover { color: var(--muted); }
button { font: inherit; color: inherit; }
img { display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; line-height: 1.7; }
.muted { color: var(--muted); }
.soft { color: var(--soft); }
.link { background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; color: var(--ink); font: inherit; letter-spacing: inherit; text-transform: inherit; }
.link.mono { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
:focus-visible { outline: 1.5px solid var(--ink); outline-offset: 3px; }

/* ---------- header ---------- */
.bar { max-width: 1200px; width: 100%; margin: 0 auto; padding: 40px var(--gutter) 0; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.logo { display: flex; color: var(--ink); }
.reg { display: none; flex: 1; flex-wrap: wrap; gap: 20px 48px; }
.reg-col { flex: 1 1 200px; display: flex; flex-direction: column; }
.ruled { border-top: 1px solid var(--rule); padding-top: 12px; }
.tabs { flex-direction: row; flex-wrap: wrap; gap: 4px 20px; align-content: flex-start; }
.tabs a { text-decoration: none; color: var(--muted); min-height: 24px; }
.tabs a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-underline-offset: 5px; }
.pill { min-height: 44px; display: inline-flex; align-items: center; gap: 10px; padding: 0 20px; border-radius: 22px; border: 0; background: var(--ink); color: var(--paper); font-size: 14px; cursor: pointer; text-decoration: none; }
.pill:hover { color: var(--paper); opacity: .88; }
body:not(.is-home) .logo, body:not(.is-home) #menuBtn { display: none; }
body:not(.is-home) .reg { display: flex; }
body:not(.is-home) .bar { align-items: flex-start; padding-top: 56px; }

.menu { position: fixed; inset: 0; z-index: 20; background: var(--paper); display: flex; align-items: center; justify-content: center; }
.menu nav { display: flex; flex-direction: column; gap: 8px; text-align: center; }
.menu a { font-size: clamp(40px, 9vw, 72px); letter-spacing: -0.04em; text-decoration: none; line-height: 1.1; }
.menu a:nth-child(even) { color: var(--soft); }

main { flex: 1; width: 100%; }
.view { display: none; max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter) 96px; }
.view.on { display: block; }

/* ---------- home ---------- */
.home.on { display: flex; flex-direction: column; min-height: calc(100dvh - 90px); padding-bottom: 32px; }
.orbit { position: relative; width: min(620px, 100%, 70dvh); aspect-ratio: 1; margin: auto; }
.tile { position: absolute; width: 21%; aspect-ratio: 1; border-radius: 26%; overflow: hidden; background: var(--frame); display: flex; align-items: flex-end; justify-content: center; transition: transform .4s ease; }
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile svg { width: 72%; }
.orbit-center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 32%; display: flex; flex-direction: column; align-items: center; gap: 12px; cursor: pointer; text-align: center; }
.drop-tile { width: 64%; aspect-ratio: 1; border: 1px solid var(--rule); border-radius: 22%; background: var(--paper-2); display: flex; align-items: center; justify-content: center; color: var(--ink); transition: transform .2s ease; }
.orbit-center:hover .drop-tile, .drag .drop-tile { transform: scale(1.04); }
.orbit-text { font-size: 13px; }
.home-foot { display: flex; justify-content: space-between; }

/* ---------- search ---------- */
.hero { max-width: 720px; margin: 0 auto; padding: clamp(56px, 12vh, 120px) 0 clamp(48px, 9vh, 96px); display: flex; flex-direction: column; align-items: center; gap: 48px; text-align: center; }
.display { margin: 0; font-size: clamp(36px, 6vw, 56px); font-weight: 400; letter-spacing: -0.035em; line-height: 1.02; }
.query { width: 100%; display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--ink); padding-bottom: 12px; }
.field input[type="text"], .field input[type="url"] { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 18px; color: var(--ink); }
.field input::placeholder { color: var(--soft); }
.clip-btn { width: 44px; height: 44px; flex: none; border: 1px solid var(--rule); border-radius: 12px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.ref-chip { position: relative; flex: none; width: 36px; height: 45px; }
.ref-chip img { width: 100%; height: 100%; object-fit: cover; }
.ref-chip button { position: absolute; top: -8px; right: -8px; width: 20px; height: 20px; border-radius: 10px; border: 0; background: var(--ink); color: var(--paper); font-size: 12px; line-height: 1; cursor: pointer; }
.go { background: none; border: 0; cursor: pointer; min-height: 44px; padding: 0 4px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; text-align: left; }
.actions { display: flex; gap: 20px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 42vw), 1fr)); gap: 56px clamp(16px, 3vw, 40px); }
.card { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: var(--ink); position: relative; }
.card .frame { aspect-ratio: 4 / 5; background: var(--frame); overflow: hidden; position: relative; }
.card .frame img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card:hover .frame img { transform: scale(1.03); }
.card .meta { display: flex; justify-content: space-between; gap: 8px; margin-top: -4px; }
.card .meta span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .sub { margin-top: -6px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.star { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: 17px; border: 0; background: var(--paper); cursor: pointer; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .2s; }
.card:hover .star, .star.on, .star:focus-visible { opacity: 1; }
@media (hover: none) { .star { opacity: 1; } }
.star svg { width: 15px; height: 15px; }
.star.on svg { fill: var(--ink); }
.card.gone .frame { opacity: .35; }
.empty { text-align: center; color: var(--muted); font-size: 14px; max-width: 480px; margin: 40px auto; line-height: 1.6; }

/* ---------- compare ---------- */
.compare { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: clamp(24px, 5vw, 56px); padding: clamp(48px, 10vh, 120px) 0 clamp(48px, 8vh, 96px); }
.slot { margin: 0; flex: 0 1 260px; display: flex; flex-direction: column; gap: 10px; }
.frame.dropzone { aspect-ratio: 4 / 5; border: 1px solid var(--rule); display: flex; align-items: center; justify-content: center; cursor: pointer; overflow: hidden; position: relative; background: transparent; }
.frame.dropzone.filled { border-color: transparent; background: var(--frame); }
.frame.dropzone img { width: 100%; height: 100%; object-fit: cover; }
.frame.dropzone.drag { border-color: var(--ink); }
.dz-inner { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px; text-align: center; }
.drop-tile.small { width: 64px; border-radius: 16px; }
.hint { font-size: 13px; color: var(--muted); }
.score { display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 120px; }
.big { font-size: clamp(76px, 10vw, 120px); font-weight: 300; letter-spacing: -0.05em; line-height: .9; }
.features { max-width: 560px; margin: 0 auto; }
.feat { display: grid; grid-template-columns: 32px 1fr 2fr 32px; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid var(--rule); }
.feat .bar-track { height: 1px; background: var(--rule); }
.feat .bar-fill { height: 1px; background: var(--ink); transition: width .5s ease; }
.feat :last-child { text-align: right; }
.features .note { text-transform: none; letter-spacing: 0; font-family: var(--sans); font-size: 12px; color: var(--muted); padding-top: 14px; border-top: 1px solid var(--rule); }
.tray { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-top: 56px; }
.tray button { border: 0; padding: 0; background: none; cursor: pointer; width: 72px; display: flex; flex-direction: column; gap: 6px; font-family: var(--mono); font-size: 11px; }
.tray img { width: 72px; height: 90px; object-fit: cover; opacity: .55; }
.tray button.on img, .tray button:hover img { opacity: 1; }

/* ---------- agencies ---------- */
.list { max-width: 720px; margin: 0 auto; }
.agency { display: grid; grid-template-columns: 32px 1fr auto; gap: 8px 16px; padding: 16px 0; border-top: 1px solid var(--rule); align-items: baseline; }
.agency .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agency .ops { grid-column: 2 / -1; display: flex; gap: 20px; flex-wrap: wrap; }
.agency .err { grid-column: 2 / -1; text-transform: none; letter-spacing: 0; font-family: var(--sans); font-size: 13px; color: #9A3412; }
.progress { grid-column: 2 / -1; height: 1px; background: var(--rule); }
.progress div { height: 1px; background: var(--ink); transition: width .3s; }
.pill.dark { padding: 0 18px; }

/* ---------- saved ---------- */
.register { padding-top: clamp(56px, 10vh, 120px); display: flex; flex-direction: column; gap: 40px; }
.register-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px; }
.register h2 { margin: 0; font-size: clamp(24px, 3vw, 32px); font-weight: 400; letter-spacing: -0.03em; line-height: 1.1; }
.register .grid { grid-template-columns: repeat(auto-fill, minmax(min(170px, 40vw), 1fr)); gap: 48px clamp(16px, 2.5vw, 32px); }

.seg { display: flex; gap: 4px 18px; flex-wrap: wrap; justify-content: center; }
.seg button { background: none; border: 0; padding: 0; min-height: 32px; cursor: pointer; color: var(--muted); font: inherit; letter-spacing: inherit; text-transform: inherit; }
.seg button[aria-pressed="true"] { color: var(--ink); text-decoration: underline; text-underline-offset: 5px; }

/* ---------- model page ---------- */
.back { display: inline-flex; min-height: 44px; align-items: center; margin-top: 24px; text-decoration: none; color: var(--muted); }
.model-compare { padding-top: 32px; }
.model-actions { display: flex; justify-content: center; gap: 28px; flex-wrap: wrap; margin-bottom: 64px; }
.section-h { margin: 0 0 10px; font-weight: 400; color: var(--muted); }
.features { margin-bottom: 56px; }
.feat.subrow { padding: 8px 0; border-top-style: dotted; }
.feat.subrow span:nth-child(2) { color: var(--muted); padding-left: 12px; }
.feat.dim .bar-track { opacity: .4; }
.feat .verdict { justify-self: start; }
.notes { max-width: 560px; margin: 0 auto 56px; }
.notes ul, .note-list { margin: 0; padding: 14px 0 0; list-style: none; border-top: 1px solid var(--rule); display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 1.5; }
.note-list { font-family: var(--sans); text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--muted); }
.notes li::before, .note-list li::before { content: '— '; color: var(--soft); }
.photos { max-width: 1000px; margin: 0 auto 56px; }
.ph-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 20px; border-top: 1px solid var(--rule); padding-top: 16px; }
.ph { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.ph img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: var(--frame); }
.ph figcaption { display: flex; justify-content: space-between; }
.how { max-width: 560px; margin: 0 auto; border-top: 1px solid var(--rule); padding-top: 14px; font-size: 14px; line-height: 1.6; color: var(--muted); }
.how summary { cursor: pointer; color: var(--ink); min-height: 32px; }
.how b { color: var(--ink); font-weight: 500; }
.banner { max-width: 720px; margin: 0 auto 32px; display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; border: 1px solid var(--rule); padding: 16px 20px; font-size: 14px; }
.banner p { margin: 0; flex: 1 1 280px; }

/* ---------- misc ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 22px; z-index: 30; max-width: calc(100% - 32px); text-align: center; }
.dropveil { position: fixed; inset: 0; z-index: 25; background: rgba(241, 239, 234, .92); display: flex; align-items: center; justify-content: center; border: 1px dashed var(--ink); pointer-events: none; }

@media (max-width: 640px) {
  .bar { padding-top: 48px; }
  body:not(.is-home) .bar { padding-top: 40px; }
  .reg { gap: 16px; }
  .reg-title { display: none; }
  .reg-col { flex: 1 1 100%; }
  .field input[type="text"], .field input[type="url"] { font-size: 16px; }
  .grid { gap: 32px 16px; }
  .mono { font-size: 10px; }
  .slot { flex: 1 1 40%; }
  .compare { gap: 20px; }
  .score { order: 3; flex: 1 1 100%; flex-direction: row; justify-content: space-between; align-items: baseline; }
}
