/* ==========================================================================
   Emma Noblesala — portfolio
   Palette sampled from color vibes.jpg + emma_portfolio_branding.jpeg
   ========================================================================== */

:root {
  /* raw palette ------------------------------------------------------- */
  --navy:        #141937;
  --dark-purple: #592148;
  --olive:       #726D2C;
  --sage:        #92946F;
  --orchid:      #D7C0DE;
  --ice:         #BFD5EC;
  --wine:        #551336;
  --moss:        #4F5320;
  --espresso:    #351C13;
  --plum:        #2C1328;
  --linen:       #B1AA9A;

  /* semantic tokens --------------------------------------------------- */
  --bg:          #FCFCFD;
  --surface:     #FFFFFF;
  --surface-alt: #F1F2F5;
  --ink:         #141937;   /* 16.73:1 on --bg */
  --ink-muted:   #592148;   /* 11.80:1 on --bg */
  --rule:        #E3E4E9;
  --rule-strong: #C9CBD3;
  --accent:      #592148;
  --accent-2:    #726D2C;   /* 5.20:1 on --bg */
  --focus:       #141937;

  /* type -------------------------------------------------------------- */
  --display: "Lora", Georgia, "Times New Roman", serif;
  --utility: "Merriweather", Georgia, "Times New Roman", serif;
  --ui:      "Montserrat", "Helvetica Neue", Arial, sans-serif;

  /* spacing scale ------------------------------------------------------ */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;

  --sidebar-w:   300px;
  --detail-w:    min(55vw, 900px);   /* overlays the work column */
  --container:  1240px;   /* centred two-column measure */

  /* Baseline-to-button gap, minus the descender space that sits inside the
     heading's line box. Measured for Lora at the sizes used here. */
  --heading-gap: 9px;   /* 9 + 7px descender = 16px from the baseline */

  --z-detail: 40;
  --z-header: 20;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--accent); }

button { font: inherit; color: inherit; }

/* Universal focus treatment — never removed, only restyled. */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

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

/* ==========================================================================
   LAYOUT
   ========================================================================== */

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  align-items: start;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 56px);
}

/* The detail panel layers over the work column rather than compressing it,
   so the grid never changes shape when it opens. */

/* ==========================================================================
   SIDEBAR
   ========================================================================== */

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  max-height: 100vh;
  overflow-y: auto;
  /* 30px, not 24px: the heading's cap top sits 6px below its line-box top,
     so this lines the avatar's top edge up with the top of the "t" in
     "things i've done". Re-measure if the heading size changes. */
  padding: 30px var(--s6) var(--s8) 0;
  border-right: 1px solid var(--rule);
  background: var(--bg);
}

.avatar {
  width: 88px; height: 88px;
  border-radius: 50%;
  object-fit: cover;
  /* The source is near-square, so the circle shows its full width and 91%
     of its height. Top-aligned to keep every pixel of headroom it has. */
  object-position: center top;
  border: 1px solid var(--rule-strong);
}

/* Sized so the four icons span exactly the width of "hi, i'm":
   4 x 24px + 3 x 8px gaps = 120px. */
.socials {
  display: flex;
  gap: var(--s2);
  margin: var(--s4) 0 var(--s5);
}

.socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  color: var(--ink);
  border-radius: 4px;
  position: relative;
  transition: color 160ms ease, background 160ms ease;
}

/* Expands the target to 32px, which is the most the 8px gaps allow before
   neighbouring targets would overlap and cause mis-taps. Clears the WCAG 2.2
   web minimum of 24px; mobile gets the full 44px below. */
.socials a::after {
  content: "";
  position: absolute;
  inset: -4px;
}

.socials a:hover { color: var(--accent); background: var(--surface-alt); }
.socials svg { width: 16px; height: 16px; }

.name {
  font-family: var(--display);
  font-weight: 500;
  /* nowrap means this can never wrap out of trouble, so the low end of the
     clamp is set to leave headroom at 320px rather than fit it exactly. */
  font-size: clamp(1.6rem, 7.5vw, 2.6rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  text-transform: lowercase;
  margin: 0 0 var(--s5);
  white-space: nowrap;   /* "hi, i'm emma" stays on one line */
}

.role-stack {
  font-family: var(--utility);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  line-height: 1.55;
  color: var(--ink);
  margin: 0 0 var(--s5);
}

.role-stack .role { display: block; }

.role-stack .plus {
  color: var(--accent-2);
  display: inline-block;
  width: 0.9em;
}

.role-stack .tail {
  display: block;
  margin-top: var(--s2);
  color: var(--ink-muted);
  font-style: italic;
  letter-spacing: 0.02em;
}

.sidebar hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: var(--s5) 0;
}

.bio-label {
  font-family: var(--utility);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin: 0 0 var(--s3);
}

.bio {
  font-family: var(--ui);
  font-weight: 400;
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--ink);
  margin: 0;
}

/* ==========================================================================
   MAIN / PROOF OF WORK
   ========================================================================== */

.main {
  min-width: 0;
  padding: var(--s5) 0 var(--s8) var(--s7);
}

.page-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.75rem, 2.7vw, 2.375rem);
  line-height: 1.1;
  text-transform: lowercase;
  letter-spacing: -0.01em;
  /* Gap below is measured from the baseline (bottom of the "t"), not the
     descender (bottom of the "g"), so the descender space is subtracted out.
     See --heading-descender-trim. */
  margin: 0 0 var(--heading-gap);
}

/* --- tab bar ------------------------------------------------------------ */

.tabbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s3);
  padding-bottom: var(--s5);
  border-bottom: 1px solid var(--rule);
  margin-bottom: var(--s6);
}

.tablist {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s3);
}

/* Rounded rectangles in Lora Regular, matching the reference's button
   treatment. Colours are deliberately ours, not the reference's. */
.tab {
  font-family: var(--display);
  font-weight: 400;
  font-size: 0.8125rem;
  letter-spacing: 0.01em;
  padding: 6px 12px;
  min-height: 32px;
  background: var(--surface-alt);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 8px;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.tab:hover { border-color: var(--rule-strong); background: #EDE7D8; }

.tab[aria-selected="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
}

/* The resume link is an action, not a tab. Separation is spacing rather than
   a rule: a rule element orphans at the end of the row whenever the bar wraps,
   and CSS cannot detect wrapping to hide it. */
.resume-link {
  margin-left: var(--s3);
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-family: var(--display);
  font-weight: 400;
  font-size: 0.8125rem;
  letter-spacing: 0.01em;
  padding: 6px 12px;
  min-height: 32px;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 8px;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease;
}

.resume-link:hover { background: var(--ink); color: var(--bg); }
.resume-link svg { width: 15px; height: 15px; }

/* --- company block ------------------------------------------------------ */

/* 48px + 48px read as a chapter break between jobs; 32/32 keeps them
   grouped as one history while still separating cleanly. */
.company {
  padding-bottom: var(--s6);
  margin-bottom: var(--s6);
  border-bottom: 1px solid var(--rule);
}

/* A bullets-only role has no tile row, so its bullets sit right on the rule. */
.company-bullets:last-child { margin-bottom: 0; }

.company:last-child { border-bottom: 0; margin-bottom: 0; }

.company-head {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin-bottom: var(--s3);
}

.company-logo {
  width: 34px; height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--rule);
  flex: none;
}

.company-logo--text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #FFFFFF;
  font-family: var(--ui);
  font-weight: 900;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  border-color: var(--accent);
}

.company-name {
  font-family: var(--ui);
  font-weight: 900;
  font-size: 1rem;
  letter-spacing: -0.005em;
  margin: 0;
}

.company-role {
  font-family: var(--utility);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin: 0 0 var(--s3);
}

.company-bullets {
  font-family: var(--ui);
  font-weight: 400;
  font-size: 0.9375rem;
  line-height: 1.7;
  max-width: 68ch;
  margin: 0 0 var(--s5);
  padding-left: 1.1em;
  list-style: none;
}

.company-bullets li {
  position: relative;
  margin-bottom: var(--s2);
}

.company-bullets li::before {
  content: "";
  position: absolute;
  left: -1.1em;
  top: 0.62em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-2);
}

.company-bullets li:last-child { margin-bottom: 0; }

/* --- project thumbnail row ---------------------------------------------- */

.project-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: var(--s3);
  max-width: 660px;
}

.thumb {
  display: block;
  position: relative;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 3px;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  transition: transform 180ms cubic-bezier(0.16, 1, 0.3, 1),
              border-color 180ms ease,
              box-shadow 180ms ease;
}

.thumb:hover {
  transform: scale(1.02);
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(20, 25, 55, 0.10);
}

.thumb[aria-current="true"] {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.thumb-img {
  width: 100%;
  height: auto;                /* let aspect-ratio win over the height attr */
  aspect-ratio: 16 / 9;        /* reserved — no layout shift on load */
  object-fit: cover;
  object-position: center;     /* centred crop; see README for per-image focus */
  background: var(--surface-alt);
}

.thumb-cap {
  display: block;              /* inline spans drop vertical padding from the
                                  box height, so a caption that wraps to two
                                  lines spills past the card border */
  padding: var(--s2) var(--s3) var(--s3);
  font-family: var(--ui);
  font-weight: 900;
  font-size: 0.6875rem;
  line-height: 1.35;
  letter-spacing: 0.01em;
}

.thumb-flag {
  position: absolute;
  top: var(--s2); left: var(--s2);
  font-family: var(--utility);
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: rgba(252, 252, 253, 0.94);
  color: var(--ink-muted);
  padding: 3px 6px;
  border-radius: 2px;
}

/* --- empty state -------------------------------------------------------- */

.empty {
  border: 1px dashed var(--rule-strong);
  border-radius: 4px;
  padding: var(--s5);
  background: var(--surface-alt);
  max-width: 60ch;
}

.empty p {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--ink);
}

/* ==========================================================================
   DETAIL PANEL
   ========================================================================== */

.detail {
  background: var(--surface);
  border-left: 1px solid var(--rule);
  z-index: var(--z-detail);
}

.detail[hidden] { display: none; }

/* Always an overlay, anchored right, a little over half the viewport.
   At 1440 that is ~790px, which clears the 300px sidebar entirely. */
.detail {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: var(--detail-w);
  min-width: min(420px, 100vw);
  overflow-y: auto;
  padding: var(--s5) var(--s6) var(--s8);
  box-shadow: -8px 0 32px rgba(20, 25, 55, 0.14);
}

/* Below the desktop layout a 55% panel drops to ~50 characters per line,
   which is too tight for long case studies, and the space behind it is
   already single-column. Widen it there. */
@media (max-width: 1023px) {
  .detail { width: min(620px, 92vw); }
}

@media (max-width: 767px) {
  .detail { width: 100vw; min-width: 0; padding: var(--s5) var(--s5) var(--s8); }
}

.detail-enter { animation: slideIn 240ms cubic-bezier(0.16, 1, 0.3, 1); }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(18px); }
  to   { opacity: 1; transform: translateX(0); }
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  min-height: 44px;
  padding: var(--s2) var(--s3) var(--s2) var(--s2);
  margin: 0 0 var(--s5) calc(var(--s2) * -1);
  background: transparent;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--utility);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  transition: background 160ms ease, color 160ms ease;
}

.back-btn:hover { background: var(--surface-alt); color: var(--ink); }
.back-btn svg { width: 17px; height: 17px; }

/* --- header row: title left, tags right, one baseline ------------------- */

.detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s3);
  padding-bottom: var(--s4);
  border-bottom: 1px solid var(--rule);
  margin-bottom: var(--s5);
}

/* The panel heading receives programmatic focus so screen readers land in
   the new content. It is not interactive, so it takes no visible ring —
   role="dialog" + aria-labelledby carries the announcement instead. */
.detail-title:focus,
.detail-title:focus-visible { outline: none; }

.detail-title {
  font-family: var(--ui);
  font-weight: 900;
  font-size: 1.125rem;
  line-height: 1.3;
  letter-spacing: -0.005em;
  margin: 0;
  flex: 1 1 150px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  flex: 0 1 auto;
}

.tag {
  font-family: var(--ui);
  font-weight: 700;
  font-size: 0.625rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 3px;
  white-space: nowrap;
}

/* --- sections ----------------------------------------------------------- */

.section { margin-bottom: var(--s6); }

.section-label {
  font-family: var(--utility);
  font-weight: 700;
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin: 0 0 var(--s2);
}

.section p {
  font-family: var(--ui);
  font-weight: 400;
  font-size: 0.9375rem;
  line-height: 1.75;
  margin: 0;
  max-width: 68ch;
  overflow-wrap: anywhere;
}

/* THE RESULT gets the inspiration's metric callout bar */
.section--result p {
  border-left: 3px solid var(--accent-2);
  padding-left: var(--s3);
  font-family: var(--utility);
  font-size: 0.875rem;
  line-height: 1.7;
  font-variant-numeric: tabular-nums;
}

.section--reflect p {
  font-style: italic;
  color: var(--ink-muted);
}

.placeholder-text { color: #6B6459; }

/* --- embeds (facade pattern) -------------------------------------------- */

.embeds {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: var(--s3);
}

.embed {
  position: relative;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 3px;
  overflow: hidden;
  background: var(--surface-alt);
  cursor: pointer;
  transition: border-color 180ms ease, transform 180ms cubic-bezier(0.16,1,0.3,1);
}

.embed:hover { border-color: var(--accent); transform: scale(1.02); }
.embed:disabled { cursor: default; opacity: 0.75; }
.embed:disabled:hover { border-color: var(--rule); transform: none; }

.embed-poster {
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  background: var(--surface-alt);
}

.embed-badge {
  position: absolute;
  top: var(--s2); left: var(--s2);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--utility);
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(252, 252, 253, 0.94);
  color: var(--ink);
  padding: 3px 6px;
  border-radius: 2px;
}

.embed-play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(252, 252, 253, 0.92);
  display: grid;
  place-items: center;
  pointer-events: none;
}

.embed-play svg { width: 16px; height: 16px; color: var(--ink); }

.embed iframe { width: 100%; aspect-ratio: 9 / 16; border: 0; display: block; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 1023px) {
  .layout { grid-template-columns: 1fr; }

  .sidebar {
    position: static;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
    padding: var(--s6) 0 var(--s6);
  }

  .main { padding: var(--s6) 0 var(--s8); }
}

@media (max-width: 640px) {
  .resume-link { margin-left: 0; margin-top: var(--s1); }
}

/* Compact sizing above is fine for a mouse (WCAG 2.2 AA asks 24px on web),
   but these become finger targets on touch screens, so give them their room
   back there. */
@media (max-width: 767px) {
  .tab, .resume-link { min-height: 44px; padding: var(--s2) var(--s4); }
  .socials { gap: var(--s3); }
  .socials a { width: 32px; height: 32px; }
  .socials a::after { inset: -6px; }
  .socials svg { width: 18px; height: 18px; }
}

@media (max-width: 767px) {
  .project-row { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }
  .main { padding: var(--s5) 0 var(--s8); }
  .sidebar { padding: var(--s5) 0 var(--s6); }
}

/* Overlay mode only: lock the page behind the sheet so scrolling acts on
   the panel, not the list underneath. Never applied in third-column mode. */
body.detail-locked { overflow: hidden; }

/* Scrim behind the overlay panel */
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(20, 25, 55, 0.32);
  z-index: calc(var(--z-detail) - 1);
  animation: fadeIn 200ms ease;
}

.scrim[hidden] { display: none; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }



/* ==========================================================================
   REDUCED MOTION — transitions degrade to opacity only
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .thumb:hover, .embed:hover { transform: none; }
}

/* ==========================================================================
   PRINT
   ========================================================================== */

@media print {
  .tabbar, .socials, .scrim, .back-btn { display: none; }
  .layout { display: block; }
  .detail { position: static; border: 0; }
}

/* ==========================================================================
   ADDITIONS — filter tab, result lists, work groups, outbound tiles
   ========================================================================== */

/* --- detail: company attribution line ------------------------------------ */

.detail-company {
  font-family: var(--utility);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin: calc(var(--s5) * -1 + 4px) 0 var(--s5);
}

/* --- detail: THE RESULT as a sourced list -------------------------------- */

.result-list {
  margin: 0;
  padding: 0 0 0 var(--s3);
  list-style: none;
  border-left: 3px solid var(--accent-2);
}

.result-list li {
  font-family: var(--utility);
  font-size: 0.875rem;
  line-height: 1.7;
  font-variant-numeric: tabular-nums;
  margin-bottom: var(--s2);
  max-width: 68ch;
}

.result-list li:last-child { margin-bottom: 0; }

.result-closing {
  font-family: var(--ui);
  font-weight: 900;
  font-size: 0.9375rem;
  line-height: 1.55;
  margin: var(--s4) 0 0;
  max-width: 60ch;
}

/* --- detail: THE WORK groups --------------------------------------------- */

.work-group { margin-bottom: var(--s5); }
.work-group:last-child { margin-bottom: 0; }

.work-group-label {
  font-family: var(--ui);
  font-weight: 700;
  font-size: 0.8125rem;
  line-height: 1.5;
  margin: 0 0 var(--s3);
  color: var(--ink);
}

.embed-figure { margin: 0; }

.embed-figure figcaption {
  font-family: var(--ui);
  font-weight: 400;
  font-size: 0.75rem;
  line-height: 1.55;
  color: var(--ink);
  margin-top: var(--s2);
}

/* --- outbound link card (X has no iframe embed) -------------------------- */

.work-link {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3);
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--surface);
  text-decoration: none;
  color: var(--ink);
  min-height: 44px;
  transition: border-color 160ms ease, background 160ms ease;
}

.work-link:hover { border-color: var(--accent); background: var(--surface-alt); }

.work-link .embed-badge { position: static; flex: none; }

.work-link-cap {
  font-family: var(--ui);
  font-size: 0.8125rem;
  line-height: 1.5;
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.work-link-icon { flex: none; color: var(--ink-muted); display: inline-flex; }
.work-link-icon svg { width: 15px; height: 15px; }

/* --- link-only tiles (open the post, no panel) --------------------------- */

.thumb--link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.thumb-out {
  position: absolute;
  top: var(--s2); right: var(--s2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  border-radius: 3px;
  background: rgba(252, 252, 253, 0.94);
  color: var(--ink);
}

.thumb-out svg { width: 13px; height: 13px; }

/* ==========================================================================
   FILTER TAB
   ========================================================================== */

.filter-bar {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s3);
  margin-bottom: var(--s6);
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  min-height: 44px;
  padding: var(--s2) var(--s4);
  background: var(--surface);
  border: 1px solid var(--ink);
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--ui);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  transition: background 160ms ease, color 160ms ease;
}

.filter-btn:hover { background: var(--surface-alt); }

.filter-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
}

.filter-btn svg { width: 15px; height: 15px; }

.filter-caret { transition: transform 160ms ease; }
.filter-btn[aria-expanded="true"] .filter-caret { transform: rotate(180deg); }

.filter-menu {
  position: absolute;
  top: calc(100% + var(--s2));
  left: 0;
  z-index: 30;
  min-width: 240px;
  padding: var(--s3);
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  box-shadow: 0 8px 28px rgba(20, 25, 55, 0.14);
}

.filter-menu[hidden] { display: none; }

.filter-option {
  display: flex;
  align-items: center;
  gap: var(--s2);
  min-height: 40px;
  padding: 0 var(--s2);
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--ui);
  font-size: 0.8125rem;
}

.filter-option:hover { background: var(--surface-alt); }

.filter-option input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

.filter-swatch {
  width: 12px; height: 12px;
  border-radius: 3px;
  flex: none;
}

.filter-clear {
  width: 100%;
  margin-top: var(--s2);
  padding: var(--s2);
  background: transparent;
  border: 0;
  border-top: 1px solid var(--rule);
  border-radius: 0;
  cursor: pointer;
  font-family: var(--utility);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.filter-clear:hover { color: var(--ink); }

.filter-count {
  font-family: var(--utility);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin: 0;
}

.filter-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: var(--s4);
}

.filter-results .thumb { display: block; }

.fc-company {
  display: block;
  font-family: var(--utility);
  font-weight: 400;
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: 3px;
}

.fc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0 var(--s3) var(--s3);
}
