/* ==========================================================================
   Services — "The situation board"
   An active bento grid: 7 situation tiles that filter (FLIP) and expand
   in place into a full case file. Loads after site.css + pages.css.
   ========================================================================== */

@property --beam { syntax: '<angle>'; inherits: false; initial-value: 0deg; }

/* ---- Hero -------------------------------------------------------------- */
.shero { position: relative; min-height: min(86svh, 800px); display: flex; flex-direction: column; justify-content: flex-end;
  padding: clamp(7rem, 11vw, 9rem) 0 clamp(3rem, 6vw, 4.5rem); overflow: hidden; isolation: isolate; }
.shero__fx { position: absolute; inset: 0; z-index: -2; }
.shero__fx canvas { display: block; width: 100%; height: 100%;
  -webkit-mask-image: radial-gradient(120% 90% at 70% 15%, #000 20%, transparent 72%); mask-image: radial-gradient(120% 90% at 70% 15%, #000 20%, transparent 72%); }
.shero::before { content: ''; position: absolute; z-index: -1; inset: 0;
  background: radial-gradient(70% 55% at 12% 88%, rgba(61,123,255,.16), transparent 70%); pointer-events: none; }

.shero__title { font-weight: 500; font-size: clamp(2.3rem, 1rem + 5.6vw, 5.6rem); line-height: .98; letter-spacing: -.055em; margin-top: clamp(1rem, 2vh, 1.75rem); }
.shero__line { display: block; overflow: hidden; padding-bottom: .1em; margin-bottom: -.06em; }
.shero__line > span { display: inline-block; }
/* the rotating situation gets its own slot so nothing reflows as it changes */
.rotor { display: block; min-height: 1.06em; color: var(--blue-2); font-family: var(--serif); font-style: italic; font-size: 1.1em; letter-spacing: -.03em; white-space: nowrap; }
.shero__lead { margin-top: clamp(1.5rem, 3vh, 2.25rem); max-width: 46ch; color: var(--ink-2); font-size: clamp(1rem, .96rem + .3vw, 1.15rem); }
.shero__actions { display: flex; align-items: center; flex-wrap: wrap; gap: .9rem 1.75rem; margin-top: clamp(1.5rem, 3vh, 2.25rem); }
@media (max-width: 720px) { .rotor { white-space: normal; font-size: 1em; } }

/* ---- Filter rail -------------------------------------------------------- */
.board__bar { position: sticky; top: 78px; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
  padding: 1rem 0; margin-bottom: 1.5rem; background: var(--bg); }
/* soft tail so tiles dissolve under the bar instead of hitting a hard edge */
.board__bar::after { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 26px; pointer-events: none;
  background: linear-gradient(var(--bg), transparent); }
.fchip { display: inline-flex; align-items: center; gap: .55rem; height: 42px; padding: 0 1.1rem; border-radius: 999px; cursor: pointer;
  font: 500 .8rem/1 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3);
  background: none; border: 1px solid var(--line); transition: color .35s, border-color .35s, background .35s; }
.fchip:hover { color: var(--ink); border-color: var(--line-2); }
.fchip.is-on { color: var(--bg); background: var(--ink); border-color: var(--ink); }
.fchip__n { font-variant-numeric: tabular-nums; opacity: .55; }
.board__count { margin-left: auto; font: 500 .72rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.board__count b { color: var(--blue-2); font-weight: 500; }

/* ---- The board ---------------------------------------------------------- */
.board__sec { padding-bottom: clamp(4rem, 8vw, 6rem); }
.board { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: minmax(196px, auto); grid-auto-flow: dense; gap: 14px; }
.tile { position: relative; margin: 0; border-radius: 22px; overflow: hidden; isolation: isolate; scroll-margin-top: 150px;
  background: linear-gradient(180deg, var(--bg-2), var(--bg)); border: 1px solid var(--line);
  transition: border-color .45s var(--ease); }
.tile--lg { grid-column: span 2; grid-row: span 2; }
.tile--wide { grid-column: span 2; }
.tile.is-hidden { display: none; }
.tile:hover { border-color: rgba(127,176,255,.3); }

/* cursor spotlight (Magic UI "Magic Card", ported) */
.tile::before { content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0; transition: opacity .45s;
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 50%), rgba(61,123,255,.17), transparent 68%); }
.tile:hover::before, .tile:focus-within::before { opacity: 1; }
/* travelling border (Magic UI "Border Beam", ported to pure CSS) */
.tile::after { content: ''; position: absolute; inset: 0; z-index: 3; border-radius: inherit; padding: 1px; pointer-events: none; opacity: 0; transition: opacity .45s;
  background: conic-gradient(from var(--beam), transparent 0 68%, rgba(127,176,255,.9) 84%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude; }
.tile:hover::after, .tile.is-open::after { opacity: 1; animation: beamspin 4s linear infinite; }
@keyframes beamspin { to { --beam: 360deg; } }

.tile__face { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; height: 100%;
  padding: clamp(1.4rem, 2.2vw, 2rem); }
.tile__top { display: flex; justify-content: space-between; align-items: flex-start; width: 100%; gap: 1rem; }
.tile__n { font: italic 400 clamp(2.6rem, 1.8rem + 2.2vw, 4.2rem)/.8 var(--serif); color: transparent; -webkit-text-stroke: 1px rgba(127,176,255,.5);
  font-variant-numeric: tabular-nums; transition: color .55s var(--ease), -webkit-text-stroke-color .55s; }
.tile:hover .tile__n, .tile.is-open .tile__n { color: var(--blue-2); -webkit-text-stroke-color: transparent; }
.tile__k { color: var(--ink-3); padding-top: .45rem; }
.tile__h { margin-top: auto; padding-top: clamp(1.75rem, 4vh, 3rem); font-size: clamp(1.35rem, 1.1rem + .9vw, 2.1rem); font-weight: 500; line-height: 1.04; letter-spacing: -.04em; }
.tile--lg .tile__h { font-size: clamp(1.8rem, 1.3rem + 1.8vw, 3rem); }
.tile__h em { color: var(--blue-2); }
.tile__hook { margin-top: .7rem; color: var(--ink-2); font-size: .95rem; max-width: 38ch; }
/* only the feature tile carries these — they fill its taller box with scent
   rather than decoration */
.tile__pts { display: none; width: 100%; margin-top: 1.5rem; }
.tile--lg .tile__pts { display: grid; }
.tile__pts li { display: flex; align-items: center; gap: .7rem; padding: .7rem 0; border-top: 1px solid var(--line);
  color: var(--ink-3); font: 500 .7rem/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; transition: color .4s; }
.tile__pts li::before { content: ''; flex: none; width: 4px; height: 4px; border-radius: 50%; background: var(--blue-2); }
.tile:hover .tile__pts li { color: var(--ink-2); }
/* the control is a real button; its ::after stretches over the face so the
   whole card is clickable while the accessible name stays short */
.tile__btn { display: inline-flex; align-items: center; gap: .5rem; margin-top: 1.25rem; padding: 0; cursor: pointer;
  background: none; border: 0; color: var(--ink-3); font: 500 .72rem/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase;
  transition: color .35s; }
.tile__btn::after { content: ''; position: absolute; inset: 0; z-index: 2; border-radius: inherit; }
.tile__btn i { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line-2); font-style: normal; font-size: .9rem; line-height: 1;
  transition: transform .5s var(--ease), background .35s, border-color .35s, color .35s; }
.tile:hover .tile__btn { color: var(--ink); }
.tile.is-open .tile__btn i { transform: rotate(135deg); background: var(--blue); border-color: var(--blue); color: #fff; }
.tile__btn:focus-visible { outline: none; }
.tile__btn:focus-visible::after { outline: 2px solid var(--blue-2); outline-offset: -3px; }

/* ---- Expanded case file -------------------------------------------------- */
.tile.is-open { grid-column: 1 / -1; grid-row: span 1; border-color: rgba(127,176,255,.34); }
/* the face is height:100% while closed so the heading can sit at the bottom of
   the card; open, that would stretch past the detail and leave a dead gap */
.tile.is-open .tile__face { height: auto; }
.tile.is-open .tile__h { padding-top: 1.25rem; }
.tile__detail { position: relative; z-index: 1; display: none; padding: 0 clamp(1.4rem, 2.2vw, 2rem) clamp(1.6rem, 2.4vw, 2.25rem); }
.tile.is-open .tile__detail { display: block; }
.tile__inner { display: grid; grid-template-columns: 1.25fr .75fr .75fr; gap: clamp(1.5rem, 3vw, 3rem); padding-top: 1.5rem; border-top: 1px solid var(--line); }
.tile__inner > div > p { color: var(--ink-2); max-width: 54ch; }
.tile__inner > div > p + p { margin-top: .9rem; }
.tile__inner h3 { margin-bottom: .9rem; color: var(--ink-3); font: 500 .72rem/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.tile__inner ul { display: grid; gap: .6rem; }
.tile__inner li { position: relative; padding-left: 1.05rem; color: var(--ink-2); font-size: .93rem; }
.tile__inner li::before { content: ''; position: absolute; left: 0; top: .55em; width: 5px; height: 5px; border-radius: 50%; background: var(--blue-2); }
.tile__cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }

@media (max-width: 1080px) {
  .board { grid-template-columns: repeat(2, 1fr); }
  .tile--lg, .tile--wide { grid-column: span 2; }
  .tile--lg { grid-row: span 1; }
  .tile__inner { grid-template-columns: 1fr 1fr; }
  .tile__inner > div:first-child { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .board { grid-template-columns: 1fr; grid-auto-rows: auto; }
  .tile--lg, .tile--wide { grid-column: span 1; }
  .tile__inner { grid-template-columns: 1fr; }
  .tile__h { padding-top: 2.5rem; }
}

/* ---- Closing band ------------------------------------------------------- */
.band { padding: clamp(4rem, 8vw, 6.5rem) 0; border-top: 1px solid var(--line); }
.band__row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 1.5rem; }
.band__k { color: var(--ink-3); }
.band__list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 2.5rem; background: var(--line); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.band__item { padding: clamp(1.5rem, 2.5vw, 2rem); background: var(--bg); }
.band__item dt { color: var(--ink-3); font: 500 .72rem/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; margin-bottom: .75rem; }
.band__item dd { color: var(--ink-2); font-size: .95rem; }
@media (max-width: 860px) { .band__list { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  .tile:hover::after, .tile.is-open::after { animation: none; }
}
