/*
 * Befora hosted profile — befora.pro/{slug}
 *
 * This page IS branded: it wears the PRO's own colors (from the payload
 * `colors{primary,accent}`) and logo. Befora's own identity is limited to the
 * subtle "Powered by Befora" badge.
 *
 * Foundation is the app's INK register — always dark, whoever the pro is. The
 * PRO's colors ride on top as ACCENTS ONLY via --pro-primary / --pro-accent (set
 * at runtime); they never become the page or card background. A non-subscriber
 * falls back to Befora brass, so an unbranded portfolio reads as Befora's.
 * 20px/12px radii, Instrument Sans, letterspaced-caps tags.
 */

@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("assets/fonts/instrument-sans-var-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("assets/fonts/instrument-sans-var-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* The pro's colors — ACCENTS ONLY, set at runtime from the payload. A
     non-subscriber keeps these fallbacks (Befora branding). */
  --pro-primary: #2A2C30;   /* fallback: neutral raised (the logo block). Sub overrides. */
  --pro-accent:  #E9A13B;   /* fallback: Befora brass. Sub overrides with theirs. */

  /* Ink foundation — mirrors BeforaBrand in the app. */
  --bg:        #0E0F11;   /* ink — the page */
  --surface:   #16181B;   /* inkRaised — cards, chips, inputs */
  --surface-2: #1F2226;   /* a touch higher — image placeholders */
  --text:      #F5F6F7;   /* onInk — primary text */
  --muted:     #9BA0A8;   /* onInkMuted — secondary text */
  --faint:     #7C8189;   /* onInkDim — placeholders */
  --line:      #26282C;   /* inkLine — hairlines */

  --radius-card: 20px;
  --radius-ctrl: 12px;
  --maxw: 1040px;      /* wide canvas: featured hero + multi-up grid */
  --readw: 620px;      /* comfortable reading column for the header */
  --font: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.25rem 1.15rem 3rem;
}

/* ---- top bar: EN/ES toggle -------------------------------------------- */
.topbar {
  display: flex;
  justify-content: flex-end;
  padding-top: .25rem;
}
.lang-toggle {
  font: inherit;
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .3rem .9rem;
  transition: border-color .15s, color .15s;
}
.lang-toggle:hover { border-color: var(--pro-accent); color: var(--pro-accent); }

/* ---- profile header --------------------------------------------------- */
.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: .85rem;
  padding: 1.75rem 0 2rem;
  max-width: var(--readw);   /* stay a centered reading column on the wide canvas */
  margin: 0 auto;
}
/* Search + category filter also stay in the reading column, left-aligned to the grid. */
.filters { max-width: var(--readw); margin-left: auto; margin-right: auto; }
.logo {
  height: 98px;
  width: auto;             /* the chip HUGS the logo's real shape (wide → elongated) */
  max-width: 260px;
  border-radius: 22px;
  object-fit: contain;
  box-sizing: border-box;
  /* Pro logos are artwork made for a light ground; a white chip keeps them
     legible on the ink page (a dark logo on ink would vanish). */
  background: #fff;
  /* width:auto locks the chip aspect to the logo's, so object-fit:contain adds no
     letterbox slack — this padding is the ONLY margin. Keep it near the corner
     radius so trimmed artwork clears the rounded corners and never looks pinched. */
  padding: 18px;
}
.logo-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  font-weight: 600;
  color: #fff;
  background: var(--pro-primary);
}
.business-name {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -.02em;
  line-height: 1.15;
}
.bio {
  margin: 0;
  max-width: 46ch;
  color: var(--muted);
  font-size: 1rem;
}

/* ---- contact / social links ------------------------------------------ */
.links {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: center;
  margin-top: .35rem;
}
.link-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .85rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .45rem .95rem;
  transition: border-color .15s;
}
.link-chip:hover { border-color: var(--pro-accent); }
.link-chip .ico { font-size: .95em; line-height: 1; display: inline-flex; }
/* Official brand glyphs (Instagram/Facebook/TikTok/WhatsApp/X/YouTube) — matches the app. */
.brand-ico { width: 1.05em; height: 1.05em; display: block; }
/* Nostr: the app's mark is a template-rendered PNG, not an SVG. Same technique
   as SF Symbol template rendering — shape from the PNG's alpha via CSS mask,
   color from currentColor (inherited from .link-chip like every other chip). */
.mask-ico {
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-size: contain; mask-size: contain;
}

/* ---- search + category filter ------------------------------------------ */
.filters {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  margin-bottom: 1.1rem;
}
.search-input {
  font: inherit;
  font-size: .95rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-ctrl);
  padding: .6rem .9rem;
  width: 100%;
  outline: none;
  transition: border-color .15s;
  -webkit-appearance: none;
}
.search-input:focus { border-color: var(--pro-accent); }
.search-input::placeholder { color: var(--faint); }
.cat-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.cat-chip {
  font: inherit;
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .3rem .85rem;
  transition: border-color .15s, color .15s;
}
.cat-chip:hover { color: var(--text); }
.cat-chip.active { color: var(--pro-accent); border-color: var(--pro-accent); }

/* ---- job cards -------------------------------------------------------- */
.cards { gap: 1.25rem; }
/* Visitor-toggled density: 2-up grid (default) or single wide column. */
.cards.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.cards.grid-1 { display: flex; flex-direction: column; }
.feat-badge {
  margin: 0;
  align-self: flex-start;
  font-size: .6rem;
  letter-spacing: .12em;
  font-weight: 500;
  color: #fff;
  background: var(--pro-accent);
  padding: .35em .9em;
  border-radius: 6px;
}
.card {
  display: flex;
  flex-direction: column;
  gap: .7rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 1.4rem 1.4rem 1.5rem;
}
.eyebrow {
  margin: 0;
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--pro-accent);
}
.card-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.25;
  text-wrap: balance; /* no orphan word on its own line */
  color: var(--text);
}
.card-loc { font-weight: 400; color: var(--muted); }

/* ---- pair: side-by-side (default view) -------------------------------- */
.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .6rem;
}
.pair figure { position: relative; margin: 0; }
.pair img {
  width: 100%;
  display: block;
  border-radius: var(--radius-ctrl);
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--surface-2);
}
/* Portrait photos get a taller 3:4 cell so the work is the feature; landscape
   stays 4:3. Set per pair from the image's real orientation (see profile.js). */
.pair.is-portrait img { aspect-ratio: 3 / 4; }
.tag {
  position: absolute;
  left: .6rem;
  top: .6rem;
  font-size: .6rem;
  letter-spacing: .1em;
  font-weight: 500;
  color: #F5F6F7;
  background: rgba(14, 15, 17, .58);
  padding: .3em .8em;
  border-radius: 6px;
}

/* ---- pair: clickable cover (opens the lightbox) ------------------------ */
.pair-btn {
  cursor: pointer;
  border-radius: var(--radius-ctrl);
}
.pair-btn:focus-visible { outline: 2px solid var(--pro-accent); outline-offset: 3px; }
.pair-btn img { transition: filter .15s; }
.pair-btn:hover img { filter: brightness(1.06); }
.pair-label { margin: .1rem 0 0; font-size: .78rem; color: var(--muted); }

.quote {
  margin: .3rem 0 0;
  padding: .1rem 0 .1rem 1rem;
  border-left: 3px solid var(--pro-accent);
  font-style: italic;
  color: var(--text);
}
.quote p { margin: 0; }
.quote cite { display: block; margin-top: .4rem; font-style: normal; font-size: .85rem; color: var(--muted); }

/* ---- powered-by badge + footer --------------------------------------- */
.powered {
  margin-top: 2.5rem;
  text-align: center;
}
.powered a {
  font-size: .8rem;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
}
.powered a:hover { color: #E9A13B; } /* the one Befora-brass moment on the page */
/* Finalist A wordmark inside the badge (decided 2026-07-03): letters ride the
   badge's muted color; the O's right half is brass-deep. Same geometry as
   landing.css § .wordmark — full-viewBox circle + cap-height overshoot. */
.powered .bf-wm { font-weight: 600; letter-spacing: .12em; }
/* The split-O is optically centered between F and R: F's open right side adds
   visual space, so the disc gets a slight negative left / larger right margin. */
.powered .bf-wm-o { display: inline-block; height: .76em; width: .76em; vertical-align: -0.02em; margin: 0 .14em 0 -.04em; }
.powered .bf-wm-ra { color: #E9A13B; }

/* ---- states ----------------------------------------------------------- */
.state {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: .6rem;
  color: var(--muted);
}
.state h1 { margin: 0; font-size: 1.35rem; font-weight: 600; color: var(--text); }
.state p { margin: 0; max-width: 38ch; }
.state .home { margin-top: 1rem; font-size: .85rem; color: var(--pro-accent); text-decoration: none; }
.spinner {
  width: 26px; height: 26px;
  border: 3px solid var(--line);
  border-top-color: var(--pro-accent);
  border-radius: 50%;
  animation: befora-spin .8s linear infinite;
}
@keyframes befora-spin { to { transform: rotate(360deg); } }

/* ---- featured hero: pro-color band, testimonial beside the pair -------- */
.hero {
  background: var(--pro-primary);
  border-radius: var(--radius-card);
  padding: 1.7rem 1.8rem;
  margin: .4rem 0 1.7rem;
  color: #fff;
}
.hero-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem; align-items: center; }
.hero-nofq .hero-inner { grid-template-columns: 1fr; }
.hero-badge {
  display: inline-block; font-size: .6rem; letter-spacing: .12em; font-weight: 500;
  text-transform: uppercase; background: rgba(0, 0, 0, .24); color: #fff;
  padding: .35em .9em; border-radius: 6px; margin-bottom: .8rem;
}
.hero-testimonial { margin: 0; font-size: 1.45rem; line-height: 1.35; font-style: italic; }
.hero-testimonial p { margin: 0; }
.hero-testimonial cite { display: block; margin-top: .8rem; font-size: .85rem; font-style: normal; opacity: .85; }
.hero-job { margin: .9rem 0 0; font-size: .8rem; opacity: .85; }
.hero-title { margin: 0 0 .7rem; font-size: 1.25rem; font-weight: 600; color: #fff; }

/* ---- visitor density toggle (2-up grid / single column) ---------------- */
.view-switch { display: flex; justify-content: flex-end; gap: .35rem; margin: 0 0 .8rem; }
.vs-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 30px; padding: 0; cursor: pointer;
  color: var(--muted); background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px;
  transition: color .15s, border-color .15s;
}
.vs-btn:hover { color: var(--text); }
.vs-btn.active { color: var(--pro-accent); border-color: var(--pro-accent); }

/* ---- responsive ------------------------------------------------------- */
/* Hero + grid collapse to one column; the density toggle is moot on mobile. */
@media (max-width: 720px) {
  .hero-inner, .hero-nofq .hero-inner { grid-template-columns: 1fr; }
  .cards.grid-2 { grid-template-columns: 1fr; }
  .view-switch { display: none; }
  .hero-testimonial { font-size: 1.25rem; }
}
@media (max-width: 440px) {
  .pair { grid-template-columns: 1fr; }
  .business-name { font-size: 1.45rem; }
  .card { padding: 1rem 1rem 1.1rem; }
}
