/* ============================================================
   MAM design tokens and the card component itself.
   Loaded by every page — the portal preview, the member's card
   page and the print sheet all draw from this one definition,
   so the preview an officer approves is the card that ships.
   ============================================================ */
:root{
  --ink:#08090B; --card-black:#0C0F12; --graphite:#15191E;
  --slate:#20323C; --slate-2:#2C4A58;
  --gold-1:#F7E4AC; --gold-2:#DFB44E; --gold-3:#A97C1E; --gold-4:#6E4E0C;
  --paper:#EAEEF2; --surface:#FFFFFF; --line:#D9E0E8; --line-soft:#E9EDF2;
  --navy:#16387E; --red:#D62B3C; --yellow:#F3C336; --green:#1E7A4D;
  --text:#11161C; --muted:#5E6C7A;
  --display:'Archivo','Arial Narrow',Impact,sans-serif;
  --body:'Inter Tight','Segoe UI',system-ui,sans-serif;
  --mono:'JetBrains Mono',ui-monospace,Menlo,monospace;
  --script:'Pinyon Script','Snell Roundhand',cursive;
}
*{box-sizing:border-box}
html,body{margin:0}
body{font-family:var(--body);color:var(--text);-webkit-font-smoothing:antialiased}
button,input,select,textarea{font:inherit;color:inherit}
:focus-visible{outline:2px solid var(--navy);outline-offset:2px;border-radius:6px}

/* ------------------------------------------------------------
   The card. Every internal measurement is in cqw so the whole
   thing scales from a 320px phone to a 440px preview pane with
   no breakpoints and no drift between the two.
   ------------------------------------------------------------ */
.ecard{position:relative;width:100%;aspect-ratio:1.586;perspective:1500px;container-type:inline-size}
.ecard__tilt{position:absolute;inset:0;transform-style:preserve-3d;transition:transform .35s ease}
.ecard__inner{position:absolute;inset:0;transform-style:preserve-3d;transition:transform .75s cubic-bezier(.2,.8,.2,1)}
.ecard.is-flipped .ecard__inner{transform:rotateY(180deg)}

.face{
  position:absolute;inset:0;backface-visibility:hidden;-webkit-backface-visibility:hidden;
  border-radius:3.6cqw;overflow:hidden;isolation:isolate;
  background:radial-gradient(140% 120% at 78% 8%, #1B242B 0%, #10161B 42%, #080A0C 100%);
  box-shadow:0 2cqw 5cqw -1.5cqw rgba(0,0,0,.7), 0 0 0 1px rgba(223,180,78,.22) inset;
}
.face--back{transform:rotateY(180deg)}

/* chevron slashes lifted from the printed card */
.face::before{
  content:"";position:absolute;inset:0;
  background:repeating-linear-gradient(112deg,
    rgba(44,74,88,.62) 0 7.5cqw, rgba(0,0,0,0) 7.5cqw 17cqw);
  -webkit-mask-image:linear-gradient(160deg, rgba(0,0,0,.95) 0%, rgba(0,0,0,.25) 55%, transparent 85%);
  mask-image:linear-gradient(160deg, rgba(0,0,0,.95) 0%, rgba(0,0,0,.25) 55%, transparent 85%);
  z-index:0;
}
/* the one flourish: a foil sheen sweeping the laminate */
.face::after{
  content:"";position:absolute;inset:-20%;z-index:4;pointer-events:none;
  background:linear-gradient(104deg,transparent 34%,rgba(255,255,255,.09) 45%,
    rgba(255,255,255,.20) 50%,rgba(255,255,255,.06) 56%,transparent 66%);
  transform:translateX(-115%);
}
.ecard.is-lit .face::after{animation:sheen 1.4s cubic-bezier(.4,0,.2,1) both}
.ecard:hover .face::after{animation:sheen 1.1s cubic-bezier(.4,0,.2,1) both}
@keyframes sheen{from{transform:translateX(-115%)}to{transform:translateX(115%)}}
.face > *{position:relative;z-index:2}

/* gold ribbed edge, right side */
.edge{position:absolute;z-index:3;right:0;top:0;bottom:0;width:4.6cqw;
  background:repeating-linear-gradient(180deg,#F2D07E 0 .55cqw,#B98A24 .55cqw 1.1cqw);
  box-shadow:-.4cqw 0 1.2cqw rgba(0,0,0,.55) inset}

/* A gold wireframe globe filling the space the portrait used to take. Same asset and same
   placement as the canvas renderer, so the card and the saved image agree. */
.ecard__ghost{position:absolute;z-index:1;left:27cqw;top:2cqw;width:56cqw;height:56cqw;
  background:url("/img/mam-watermark.svg") center/contain no-repeat;opacity:.16;pointer-events:none}

/* --- front --- */
/* The 1.2cqw row gap is tighter than it looks arbitrary: every cqw between the header and the
   body is a cqw the QR column can spend on the partner panel, and that column is already
   carrying an 18cqw QR tile. */
.face--front{padding:4.6cqw 8cqw 4.6cqw 5.4cqw;display:grid;grid-template-rows:auto 1fr;gap:0.2cqw}
.ecard__head{display:grid;grid-template-columns:auto 1fr;gap:2.6cqw;align-items:center}
/* The logo is raster artwork of unknown proportions, so every place it appears gives it a box
   and lets object-fit keep its own shape inside. */
.mam-crest{object-fit:contain}
/* Load-bearing: the crest, its 2.6cqw gap and the 5.4/8cqw padding are what leave room for the
   association name, and .ecard__org is sized to fit that on one line. 15cqw leaves 69cqw.
   Changing this width means re-measuring the title and moving the canvas renderer to match. */
.mam-mark{width:17cqw;height:17cqw;display:block;
  filter:drop-shadow(0 .3cqw .6cqw rgba(0,0,0,.55))}
/* Measured, not guessed: with the crest at 17cqw the name has 67cqw to sit on one line, which
   it needs 3.10cqw to do. 3.05cqw leaves a hair of margin for font fallbacks. Enlarging the
   crest again means shrinking this to match, or the name wraps onto two lines. */
.ecard__org{
  margin:0;font-family:var(--display);font-weight:800;font-size:3.05cqw;line-height:1.1;
  letter-spacing:.02em;text-transform:uppercase;
  background:linear-gradient(180deg,#FBEDC4 0%,#E0B44E 46%,#A2711A 62%,#F3DBA0 100%);
  -webkit-background-clip:text;background-clip:text;color:transparent;
  filter:drop-shadow(0 .12cqw 0 rgba(0,0,0,.6));
}
.ecard__script{margin:.2cqw 0 0;font-family:var(--script);font-size:6.4cqw;line-height:1;color:#F4E7C4;
  text-shadow:0 .2cqw .4cqw rgba(0,0,0,.6)}
/* Name block and QR only. With the portrait gone the name column runs the full width of the
   card, which is why the sizes below are larger than a card with a photo would carry. */
.ecard__body{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:2.8cqw;align-items:end}
.ecard__id{min-width:0;padding-bottom:.4cqw}

/* foil type: a gold gradient clipped to the glyphs, with a hard shadow for the emboss */
.emboss{
  font-family:var(--display);text-transform:uppercase;
  background:linear-gradient(178deg,#FBEDC4 0%,#DEB253 40%,#8C6114 58%,#F0D48C 100%);
  -webkit-background-clip:text;background-clip:text;color:transparent;
  filter:drop-shadow(0 .18cqw 0 rgba(0,0,0,.85)) drop-shadow(0 -.1cqw 0 rgba(255,255,255,.22));
}
/* Three steps rather than a fluid fit, so a card always lands on one of three known sizes and
   a batch of them looks like a set. The thresholds are measured against the wider name column
   and are mirrored in CardFace.NameSizeClass, portal.js and the canvas renderer. */
.ecard__name{margin:0;font-size:6.4cqw;font-weight:700;letter-spacing:.09em;line-height:1.08;
  overflow-wrap:anywhere;
  /* The field holds 200 characters; the card cannot. Clamping to three lines keeps an
     over-long entry from growing up into the crest instead of being clipped mid-air. */
  display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden}
.ecard__name.is-long{font-size:5.2cqw;letter-spacing:.06em}
.ecard__name.is-xlong{font-size:4.2cqw;letter-spacing:.04em}
.ecard__name.is-xxlong{font-size:3.2cqw;letter-spacing:.02em}
/* Sits under the name at 2.6cqw, against the name's 6.4 and the expiry's 3.1 — the quietest
   line on the card, which suits a rank. Card gold and italic, so it still reads as part of
   the set. 2.6cqw is about 2.2mm on a printed card; much below this and the rank stops being
   readable at arm's length. :empty keeps the gap from appearing when no title is set. */
/* Switch 2 of 3 for the title's placement — see _Card.cshtml and mam-card.js.
   Above the name it was:  margin:0 0 .6cqw
   Under the name it is:   margin:.6cqw 0 0 */
.ecard__title{margin:.55cqw 0 0;font-family:var(--display);font-size:2.6cqw;line-height:1.15;
  /* No text-transform: capitalize here. It rewrote what the office typed — "Charge d’ Affaires"
     came out as "Charge D’ Affaires" — and the canvas renderer applies no such rule, so the
     page and the saved image disagreed. Titles are shown exactly as entered. */
  /* Italic sets the rank apart from the name above it without another colour or size step.
     The real Archivo italic is requested in the layouts rather than left to the browser
     to fake — a synthesised slant would not match what the canvas draws. */
  font-weight:600;font-style:italic;letter-spacing:.05em;color:var(--gold-2);
  text-shadow:0 .15cqw .3cqw rgba(0,0,0,.7);overflow-wrap:anywhere;
  /* Same reasoning as the name: 100 characters is what the record allows, two lines is what
     the card has room for above it. */
  display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
.ecard__title:empty{display:none}
.ecard__line{margin:1cqw 0 0;font-size:3.1cqw;font-weight:600;letter-spacing:.1em}
/* The QR column, bottom-aligned and growing upward: caption, partner panel, tile, caption.
   Everything in it is centred on one axis, which is what keeps the partner mark squared up
   with the QR tile instead of drifting. Mirrored measurement-for-measurement in the canvas
   renderer, and the whole column has to clear the 15cqw crest above it. */
/* The gaps and the panel height are budgeted, not chosen: the column has 37.65cqw between the
   crest and the bottom padding, and the 18cqw QR tile plus its two-line caption already claim
   24 of it. Grow the panel and the caption pushes past the card's bottom margin. */
.ecard__qr{display:grid;justify-items:center;gap:.8cqw;text-align:center}

/* The caption lives inside the plate rather than in gold above it. Kept outside, its own row
   plus a gap cost 3.5cqw of a column that has none to spare, and the plate had to shrink to
   8.6cqw to compensate. Inside, the plate keeps its full height and the logo grows with it. */
/* Back on the laminate in gold, now that the white plate has gone. */
.partner-caption{margin:0;font-family:var(--display);font-size:1.7cqw;line-height:1.2;
  font-weight:600;letter-spacing:.12em;text-transform:uppercase;color:#B79A63;white-space:nowrap}
/* No plate: the artwork sits straight on the card, so its box is only as wide as the QR tile
   and its height follows the logo's own proportions. The wordmark is pre-lightened for the
   dark ground by tools/reverse-mtm-logo.py — untreated, it measures 1.03:1 here. */
.ecard__partner{width:19cqw}
.ecard__partner img{width:100%;height:auto;display:block;
  filter:drop-shadow(0 .3cqw .6cqw rgba(0,0,0,.55))}
/* Sized by what the MTM mark leaves behind. At 19cqw that artwork is 16.4cqw tall, and the
   column only has 36.65cqw once the captions and gaps are paid for — so the tile gets 9.9.
   Padding is trimmed to .6cqw because the generated QR already carries its own four-module
   quiet zone; this tile's inset is decoration, and at this size it is area the code needs. */
.qr-tile{width:9.9cqw;height:9.9cqw;background:#fff;border-radius:1.1cqw;padding:.6cqw;
  display:grid;place-items:center;box-shadow:0 .8cqw 2cqw rgba(0,0,0,.55)}
.qr-tile img{width:100%;height:100%;display:block;image-rendering:pixelated}
.qr-tile .qr-placeholder{font:600 2.2cqw/1.3 var(--display);letter-spacing:.1em;color:#7A828A;
  text-align:center;text-transform:uppercase}
.qr-caption{margin:0;font-family:var(--display);font-size:2.35cqw;line-height:1.25;font-weight:600;
  letter-spacing:.09em;text-transform:uppercase;color:#CBB27A}

/* --- back ---
   The vertical budget here is tight: at a 1.586 aspect ratio the whole back has 63cqw of
   height, and the four return-address rows plus the band and footer fill nearly all of it.
   The margins below are sized so the footer lands inside the card with the longest real
   content (the Yangon embassy address wrapping to three lines).
   Right padding clears the 4.6cqw gold edge rather than running underneath it. */
.face--back{display:grid;grid-template-rows:auto 1fr auto;padding:0 0 3.4cqw}
.band{margin-top:4.5cqw;padding:1.4cqw 6.5cqw 1.4cqw 5cqw;text-align:center;
  background:linear-gradient(180deg,#F6D989 0%,#E0B44E 40%,#C9982F 60%,#F3D68A 100%);
  box-shadow:0 .6cqw 1.6cqw rgba(0,0,0,.45)}
.band small{display:block;font-family:var(--display);font-size:2.6cqw;letter-spacing:.05em;color:#4A3608}
.band strong{display:block;font-family:var(--display);font-weight:800;font-size:3.8cqw;letter-spacing:.02em;
  text-transform:uppercase;color:#231903;margin-top:.4cqw}
/* The freed space from the removed intro line is spent on the padding and the row gap rather
   than left as a hole above the footer. */
.return{padding:4.2cqw 6.5cqw 0 5.4cqw;color:#D8DEE4}
.return dl{margin:0;display:grid;grid-template-columns:1fr 1fr;gap:3.6cqw 3.4cqw}
.return .row{display:grid;grid-template-columns:4cqw 1fr;gap:1.8cqw;align-items:start}
.return .row svg{width:4cqw;height:4cqw;fill:none;stroke:#DFB44E;stroke-width:1.7;margin-top:.2cqw}
.return dt{font-family:var(--display);font-size:2.9cqw;font-weight:700;letter-spacing:.04em;
  text-transform:uppercase;color:#F0E4C6;line-height:1.15}
/* The association's own email is one 36-character token — without this it sails straight
   through the gold edge instead of wrapping. */
.return dd{margin:.4cqw 0 0;font-size:2.5cqw;line-height:1.26;color:#A0ABB5;overflow-wrap:anywhere}
/* The member's number, then the terms. The supporting company is credited on the front. */
.back-foot{padding:1.8cqw 6.5cqw 0 5.4cqw}
.member-no{margin:0 0 1cqw;font-family:var(--display);font-size:2.6cqw;line-height:1.25;
  font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:#9FAAB4}
.member-no b{color:#DFB44E;font-weight:700;letter-spacing:.1em}
.terms{margin:0;font-size:2.35cqw;line-height:1.4;color:#6E7A84}

@media (prefers-reduced-motion:reduce){
  .ecard__inner,.ecard__tilt{transition:none}
  .face::after{display:none}
}

/* ------------------------------------------------------------
   Status pills — the same four states everywhere
   ------------------------------------------------------------ */
.tag{display:inline-flex;align-items:center;gap:6px;padding:4px 9px;border-radius:999px;
  font-size:12px;font-weight:600;white-space:nowrap}
.tag::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor}
.tag--ok{color:#15703F;background:#E4F5EB}
.tag--soon{color:#8A6205;background:#FCF2D8}
.tag--dead{color:#A8202F;background:#FBE6E8}
.tag--off{color:#5A6673;background:#EDF0F4}
