/* A member's profile: the art drawn for them, the profile as a reader sees it, and the editor's own controls. The page
   links it after account.css. Tokens only and no hue: the art's classes map each role in a drawing (a wire, a gate box, a
   label) to the system's tokens, so every banner is right in both themes. DESIGN.md records the page. */

/* ---------- The art (profile-art.js) ---------- */

.art { display: block; width: 100%; height: 100%; }
.art * { vector-effect: non-scaling-stroke; fill: none; stroke: none; stroke-width: 1; }
.art .art-wire { stroke: var(--wire); }
.art .art-strong { stroke: var(--border-strong); }
.art .art-ink { stroke: var(--text-primary); }
.art .art-dash { stroke-dasharray: 3 4; }
.art .art-heavy { stroke-width: 1.5; }
.art .art-dot { fill: var(--text-primary); }
.art .art-node { fill: var(--bg-canvas); stroke: var(--border-strong); }
.art .art-ring { fill: var(--bg-canvas); stroke: var(--text-primary); }
.art .art-gate { fill: var(--bg-canvas); stroke: var(--border-strong); }
.art .art-plaq { stroke: var(--border-hairline); }
.art .art-tone { fill: var(--surface-accent-subtle); }
.art .art-bar { fill: var(--surface-accent-subtle); stroke: var(--border-strong); }
.art .art-bar-high { fill: var(--text-primary); stroke: var(--text-primary); }
.art .art-label { fill: var(--text-primary); font: 400 14px var(--font-data); }
.art .art-note { fill: var(--text-secondary); font: 400 13px var(--font-data); }
.art .art-ground { fill: var(--bg-canvas); }
.art .art-cell { fill: var(--text-primary); }
/* A banner is drawn twice, wide and compact, and one is shown: a wide drawing scaled to a phone would be unreadable. */
.art-compact { display: none; }

/* ---------- The member page's head and its three panels ---------- */

.member-head { padding-bottom: var(--space-8); }
.member-tabs { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); margin-top: var(--space-4); }
.member-tabs a { color: var(--text-secondary); border-bottom-color: transparent; }
.member-tabs a:hover, .member-tabs a[aria-current="page"] { color: var(--text-primary); }
.member-tabs a[aria-current="page"] { border-bottom-color: var(--text-primary); }
.member-private { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2) var(--space-5); margin: 0 0 var(--space-4); }
.member-private a { color: var(--text-primary); text-decoration: underline; text-decoration-thickness: var(--line-thin); text-underline-offset: 3px; }
.share-address { margin: 0; overflow-wrap: anywhere; }
.share-address a { font: var(--type-mono-sm); color: var(--text-primary); text-decoration: underline; text-decoration-thickness: var(--line-thin); text-underline-offset: 3px; }
.member-form > .opt-in { margin-top: var(--space-6); }
.member-form > .opt-in + .field-hint { margin-top: var(--space-2); }
.member-message:empty { display: none; }
.member-message { margin: 0 0 var(--space-4); }
/* The profile keeps a reading width on a wide screen, where a banner the page's full width would be half a screen tall. */
.profile { max-width: 1040px; }
.profile-handle { margin: calc(-1 * var(--space-2)) 0 0; overflow-wrap: anywhere; }
.profile-foot { margin: var(--space-10) 0 0; padding-top: var(--space-6); border-top: var(--line-thin) solid var(--border-hairline); }
.profile-foot a { color: var(--text-secondary); text-decoration: underline; text-decoration-thickness: var(--line-thin); text-underline-offset: 3px; }
.profile-foot a:hover { color: var(--text-primary); }

/* ---------- The profile as a reader sees it ---------- */

.profile-banner { aspect-ratio: 3 / 1; border: var(--line-thin) solid var(--border-hairline); overflow: hidden; background: var(--bg-canvas); }
.profile-banner-image, .profile-avatar-image { display: block; width: 100%; height: 100%; object-fit: cover; }
.profile-head { display: grid; gap: var(--space-4); padding: 0 var(--space-5) var(--space-10); }
.profile-avatar { width: 96px; height: 96px; margin-top: -48px; border: var(--line-thin) solid var(--border-strong); border-radius: var(--radius-xs); background: var(--bg-canvas); overflow: hidden; }
.profile-card { display: grid; gap: var(--space-4); }
.profile-card > * { margin: 0; }
.profile-name { font: var(--weight-light) clamp(26px, 3vw, 36px)/1.15 var(--font-display); color: var(--text-primary); overflow-wrap: anywhere; }
.profile-headline { font: var(--type-body-lg); color: var(--text-body); max-width: 34em; text-wrap: pretty; overflow-wrap: anywhere; }
.profile-meta { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-5); padding: 0; list-style: none; font: var(--type-body-sm); color: var(--text-secondary); }
.profile-now { display: flex; gap: var(--space-3); align-items: baseline; padding: var(--space-3) 0; border-top: var(--line-thin) solid var(--border-hairline); border-bottom: var(--line-thin) solid var(--border-hairline); font: var(--type-body-sm); color: var(--text-primary); overflow-wrap: anywhere; }
.profile-now .mono { flex: none; }
.profile-tags { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.profile-tags .badge { justify-self: auto; }
.profile-links { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); padding: 0; list-style: none; font: var(--type-mono-sm); }
.profile-links a { color: var(--text-primary); text-decoration: underline; text-decoration-thickness: var(--line-thin); text-underline-offset: 3px; overflow-wrap: anywhere; }
.profile-links a:hover { color: var(--text-link-hover); }

.profile-section { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.4fr); gap: var(--space-8); padding: var(--space-10) 0; border-top: var(--line-thin) solid var(--border-hairline); }
.profile-section > div > :is(h2, h3) { margin: 0; font: var(--weight-medium) var(--text-md)/var(--leading-snug) var(--font-body); color: var(--text-primary); }
.profile-section > div > .mono { display: block; margin-top: var(--space-1); }
.profile-body { display: grid; gap: var(--space-6); max-width: 40em; font: var(--type-body); color: var(--text-secondary); }
.profile-text { margin: 0; text-wrap: pretty; overflow-wrap: anywhere; white-space: pre-line; }
.entry { display: grid; gap: var(--space-1); min-width: 0; }
.entry :is(h3, h4), .entry-title { margin: 0; font: var(--weight-medium) var(--text-md)/var(--leading-snug) var(--font-body); color: var(--text-primary); overflow-wrap: anywhere; }
.entry-org { font: var(--type-body-sm); color: var(--text-body); overflow-wrap: anywhere; }
.entry .profile-text { margin-top: var(--space-2); font: var(--type-body-sm); }
.profile-body > .entry + .entry { padding-top: var(--space-6); border-top: var(--line-thin) solid var(--border-hairline); }
.profile-edit { margin: var(--space-10) 0 0; padding-top: var(--space-8); border-top: var(--line-thin) solid var(--border-hairline); }
a.capture-button { display: inline-flex; align-items: center; text-decoration: none; }
a.capture-button:hover { text-decoration: none; }

/* The register: eight cells, the set ones in ink, and the next step beside them. */
.meter { display: grid; gap: var(--space-3); padding: var(--space-6) 0; border-top: var(--line-thin) solid var(--border-hairline); }
.meter[hidden] { display: none; }
.meter-track { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; max-width: 320px; }
.meter-track i { height: 8px; border: var(--line-thin) solid var(--border-strong); }
.meter-track i.on { background: var(--text-primary); border-color: var(--text-primary); }
.meter-next { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); align-items: baseline; margin: 0; font: var(--type-body-sm); color: var(--text-primary); }

/* ---------- The editor ---------- */

#profile-editor .legal-section > div > .mono { display: block; margin-top: var(--space-1); }
.art-preview { max-width: 26em; }
.art-preview .profile-avatar { width: 64px; height: 64px; margin: -32px 0 0 var(--space-4); position: relative; }
.art-actions, .crop-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-5); }
.member-form .capture-interest[hidden], .crop[hidden], .entry-form[hidden], .entry-list[hidden], .link-label[hidden] { display: none; }
/* A theme's button carries a small drawing of the theme above its name. */
fieldset[data-field="theme"] .capture-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
fieldset[data-field="theme"] .capture-choice { display: grid; gap: var(--space-2); width: 100%; height: auto; padding: var(--space-2); text-align: left; }
.theme-art { display: block; aspect-ratio: 8 / 3; border: var(--line-thin) solid var(--border-hairline); background: var(--bg-canvas); overflow: hidden; }
.theme-art .art-compact { display: block; }
/* Inside a pressed button the canvas is ink, so the drawing keeps its own ground and stays readable. */

.crop { display: grid; gap: var(--space-4); padding: var(--space-4); border: var(--line-thin) solid var(--border-strong); border-radius: var(--radius-xs); }
.crop-canvas { display: block; width: 100%; height: auto; border: var(--line-thin) solid var(--border-hairline); }
.crop-canvas[data-kind="avatar"] { max-width: 240px; }
.crop-move { display: grid; gap: var(--space-2); margin: 0; }
.crop-move[hidden] { display: none; }
.crop-at { width: 100%; margin: 0; accent-color: var(--accent); }
.crop-at:focus-visible { outline: none; box-shadow: var(--shadow-focus); border-radius: var(--radius-xs); }

.member-form .entry-list { display: grid; margin: 0; padding: 0; list-style: none; border-top: var(--line-thin) solid var(--border-hairline); }
.member-form .entry-list li { margin: 0; }
.entry-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-2) var(--space-5); padding: var(--space-4) 0; border-bottom: var(--line-thin) solid var(--border-hairline); }
.entry-row .mono { overflow-wrap: anywhere; }
.entry-actions { display: flex; gap: var(--space-5); }
.entry-form { display: grid; gap: var(--space-5); padding: var(--space-5); border: var(--line-thin) solid var(--border-strong); border-radius: var(--radius-xs); }
.entry-form > * { margin: 0; }
.entry-form > .capture-label { margin-bottom: calc(-1 * var(--space-3)); }
.entry-form > div > * + * { margin-top: var(--space-2); }

@media (max-width: 720px) {
  .art-wide { display: none; }
  .art-compact { display: block; }
  .profile-banner { aspect-ratio: 8 / 3; }
  .profile .profile-banner { margin: 0 calc(-1 * var(--space-5)); border-left: 0; border-right: 0; }
  .profile-head { padding-inline: 0; }
  .profile-avatar { width: 80px; height: 80px; margin-top: -40px; }
  .profile-section { grid-template-columns: 1fr; gap: var(--space-4); padding: var(--space-8) 0; }
}
