/* ─────────────────────────────────────────────────────────────────────────────
   Standard Group — card surfaces (v53)

   A "liquid glass" treatment for the cards, built from the brand's own locked
   colours: teal #209C9C, deep teal #136464, orange #FC803C, rust #A9521F.
   The reference material for this look uses blue and pink; those are not this
   brand's colours, so the light that falls behind these cards is teal and
   orange instead.

   Nothing here changes a brand colour, a typeface, or any card's size or
   position. It adds a surface: a translucent pane, one light edge, layered
   depth, and a soft brand-coloured glow behind the card.

   Load AFTER site.css and theme.css:
       <link rel="stylesheet" href="assets/cards.css">

   Readability comes first. The pane stays mostly opaque, so body text keeps
   its contrast, and where the browser cannot blur, or the reader has asked
   for less transparency, the card falls back to a solid surface.
   ───────────────────────────────────────────────────────────────────────────── */

:root{
  /* The pane. High alpha on purpose: text sits on these. */
  --sg-glass-bg:        color-mix(in srgb, var(--sg-neutral-0) 82%, transparent);
  --sg-glass-bg-strong: color-mix(in srgb, var(--sg-neutral-0) 92%, transparent);
  --sg-glass-edge:      color-mix(in srgb, var(--sg-neutral-0) 85%, transparent);
  --sg-glass-line:      color-mix(in srgb, var(--sg-teal-500) 18%, var(--sg-neutral-200));
  --sg-glass-blur:      14px;

  /* Ambient light behind a card, in the brand's two hues. */
  --sg-glow-teal:   color-mix(in srgb, var(--sg-teal-500) 26%, transparent);
  --sg-glow-orange: color-mix(in srgb, var(--sg-orange-500) 22%, transparent);

  --sg-depth-1: 0 1px 2px rgba(0,43,45,.06), 0 4px 12px rgba(0,43,45,.07);
  --sg-depth-2: 0 2px 4px rgba(0,43,45,.07), 0 12px 32px rgba(0,43,45,.11);
  --sg-depth-3: 0 3px 6px rgba(0,43,45,.09), 0 22px 54px rgba(0,43,45,.15);
}

[data-theme="dark"]{
  --sg-glass-bg:        color-mix(in srgb, var(--sg-teal-900) 72%, transparent);
  --sg-glass-bg-strong: color-mix(in srgb, var(--sg-teal-900) 88%, transparent);
  --sg-glass-edge:      color-mix(in srgb, var(--sg-neutral-0) 16%, transparent);
  --sg-glass-line:      color-mix(in srgb, var(--sg-teal-400) 26%, transparent);
  --sg-glow-teal:   color-mix(in srgb, var(--sg-teal-400) 30%, transparent);
  --sg-glow-orange: color-mix(in srgb, var(--sg-orange-500) 24%, transparent);
  --sg-depth-1: 0 1px 2px rgba(0,0,0,.30), 0 4px 12px rgba(0,0,0,.34);
  --sg-depth-2: 0 2px 4px rgba(0,0,0,.34), 0 12px 32px rgba(0,0,0,.42);
  --sg-depth-3: 0 3px 6px rgba(0,0,0,.38), 0 22px 54px rgba(0,0,0,.50);
}


/* ── The pane ───────────────────────────────────────────────────────────────
   One rule for every card on the site and in the portal. */
.inst-card, .course-card, .pcard, .pil, .quick-item, .fcard,
.portal-home .p-card{
  position: relative;
  background: var(--sg-glass-bg-strong);
  border: 1px solid var(--sg-glass-line);
  box-shadow: var(--sg-depth-1);
}

@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)){
  .inst-card, .course-card, .pcard, .pil, .quick-item, .fcard,
  .portal-home .p-card{
    background: var(--sg-glass-bg);
    -webkit-backdrop-filter: blur(var(--sg-glass-blur)) saturate(135%);
    backdrop-filter: blur(var(--sg-glass-blur)) saturate(135%);
  }
}

/* The light edge. A hairline catching light along the top, the detail that
   makes a pane read as glass rather than as a flat tint. Drawn as a border on
   an overlay so it never changes the card's own box. */
.inst-card::after, .course-card::after, .pcard::after,
.pil::after, .quick-item::after, .fcard::after,
.portal-home .p-card::after{
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  border-top: 1px solid var(--sg-glass-edge);
  border-left: 1px solid color-mix(in srgb, var(--sg-glass-edge) 55%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 62%);
  mask-image: linear-gradient(to bottom, #000 0%, transparent 62%);
}


/* ── The light behind ───────────────────────────────────────────────────────
   Two soft brand-coloured pools of light under the card, revealed as it is
   raised. Drawn as coloured shadows rather than as a layer behind the card:
   several of these cards clip their own contents (overflow:hidden), which
   would have cut a backdrop layer off at the edge, but a shadow is painted
   outside the box and is never clipped. Teal falls to the left, orange to
   the right — the brand's two hues, the way the reference uses two. */
.inst-card, .course-card, .pcard, .quick-item, .portal-home .p-card{
  transition: box-shadow .34s cubic-bezier(.2,.7,.2,1),
              transform .25s cubic-bezier(.2,.7,.2,1),
              border-color .25s;
}

@media (hover: hover) and (pointer: fine){
  .inst-card:hover, .course-card:hover, .pcard:hover,
  .quick-item:hover, .portal-home .p-card:hover{
    box-shadow:
      var(--sg-depth-2),
      -12px 16px 40px -10px var(--sg-glow-teal),
       16px 12px 40px -10px var(--sg-glow-orange);
  }
}

/* Keyboard users get the same light, so focus reads as clearly as hover. */
.inst-card:focus-within, .course-card:focus-within, .pcard:focus-visible,
.quick-item:focus-visible, .portal-home .p-card:focus-visible{
  box-shadow:
    var(--sg-depth-2),
    -12px 16px 40px -10px var(--sg-glow-teal),
     16px 12px 40px -10px var(--sg-glow-orange);
}


/* ── Fallbacks ──────────────────────────────────────────────────────────────
   A reader who has asked their system for less transparency gets a solid
   card: the glass is decoration, the content is not. */
@media (prefers-reduced-transparency: reduce){
  .inst-card, .course-card, .pcard, .pil, .quick-item, .fcard,
  .portal-home .p-card{
    background: var(--surface);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .inst-card:hover, .course-card:hover, .pcard:hover,
  .quick-item:hover, .portal-home .p-card:hover{ box-shadow: var(--sg-depth-2); }
}

@media (prefers-reduced-motion: reduce){
  .inst-card, .course-card, .pcard, .quick-item, .portal-home .p-card{ transition: none; }
}

/* Printing: no glass, no glow, no shadow. */
@media print{
  .inst-card, .course-card, .pcard, .pil, .quick-item, .fcard,
  .portal-home .p-card{
    background: #fff; box-shadow: none;
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .inst-card::after, .course-card::after, .pcard::after,
  .quick-item::after, .pil::after, .fcard::after,
  .portal-home .p-card::after{ display: none; }
}


/* ── The room the glass sits in ─────────────────────────────────────────────
   Glass only reads as glass when there is something behind it to refract. On
   a near-white page a translucent pane just looks white, so the page carries
   a very soft wash of the brand's own two hues — teal low-left, orange high-
   right, the same arrangement as the cards' hover light. It is laid over the
   page colour as a background image, so it composites under every element
   and changes no layout. Fixed, so it behaves like light in the room rather
   than scrolling wallpaper. */
body{
  background-image:
    radial-gradient(58% 44% at 12% 18%,
      color-mix(in srgb, var(--sg-teal-500) 13%, transparent) 0%, transparent 68%),
    radial-gradient(52% 42% at 92% 8%,
      color-mix(in srgb, var(--sg-orange-500) 10%, transparent) 0%, transparent 66%),
    radial-gradient(60% 40% at 78% 92%,
      color-mix(in srgb, var(--sg-teal-500) 9%, transparent) 0%, transparent 70%);
  background-attachment: fixed;
  background-repeat: no-repeat;
}

[data-theme="dark"] body{
  background-image:
    radial-gradient(58% 44% at 12% 18%,
      color-mix(in srgb, var(--sg-teal-400) 15%, transparent) 0%, transparent 68%),
    radial-gradient(52% 42% at 92% 8%,
      color-mix(in srgb, var(--sg-orange-500) 11%, transparent) 0%, transparent 66%),
    radial-gradient(60% 40% at 78% 92%,
      color-mix(in srgb, var(--sg-teal-400) 10%, transparent) 0%, transparent 70%);
}

/* With light behind them the panes can be a little more transparent, which is
   what lets the colour through the card rather than only around it. */
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)){
  .inst-card, .course-card, .pcard, .quick-item, .portal-home .p-card{
    background: color-mix(in srgb, var(--sg-neutral-0) 74%, transparent);
  }
  [data-theme="dark"] .inst-card, [data-theme="dark"] .course-card,
  [data-theme="dark"] .pcard, [data-theme="dark"] .quick-item,
  [data-theme="dark"] .portal-home .p-card{
    background: color-mix(in srgb, var(--sg-teal-900) 66%, transparent);
  }
}

@media (prefers-reduced-transparency: reduce){
  body{ background-image: none; }
}
@media print{
  body{ background-image: none; }
}


/* ── Update bar ─────────────────────────────────────────────────────────────
   The bar had no way to close it. It does now. */
.sg-update-close{
  appearance:none;-webkit-appearance:none;
  width:36px;height:36px;min-width:36px;padding:0;margin-left:2px;
  display:grid;place-items:center;
  font:inherit;font-size:1.5rem;line-height:1;cursor:pointer;
  color:var(--sg-neutral-0);background:transparent;
  border:1px solid rgba(255,255,255,.3);border-radius:50%;
  transition:background .18s,border-color .18s}
.sg-update-close:hover{background:rgba(255,255,255,.16);border-color:rgba(255,255,255,.55)}
.sg-update-close:focus-visible{outline:3px solid #ffd166;outline-offset:2px}
@media print{.sg-update-bar{display:none}}
