/* ITC Garamond Std Book Condensed (commercial font; add your licensed webfont files to assets/fonts/).
   local() picks it up if it is installed on the viewer's machine. Fraunces is the fallback. */
@font-face {
  font-family: "Passport Garamond";
  src: local("ITC Garamond Std Book Condensed"), local("ITCGaramondStd-BkCond");
  /* add url("../assets/fonts/ITCGaramondStd-BkCond.woff2") format("woff2") here once you have the licensed file */
  font-weight: 400; font-style: normal; font-display: swap;
}

/* =========================================================
   PASSPORT MATERIAL LAYER
   Real-passport look: cover, security paper, guilloche, page curl.
   Pure CSS + inline SVG data URIs (no image files, no libraries).
   Loaded after wireframe.css so it overrides the grey boxes.
   ========================================================= */

:root {
  --cover: #1c2a4f;          /* Indian passport navy */
  --cover-dark: #131d3a;
  --paper: #f5efe1;          /* cream security paper */
  --paper-2: #ece4d1;
  --ink-blue: #3c48a8;       /* header / stamp ink */
  --ink-text: #1d1b19;
  --ink-label: #6f6a62;
  --ink-red: #b2333f;

  /* fine paper grain */
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .35  0 0 0 0 .3  0 0 0 0 .22  0 0 0 .09 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");

  /* guilloche: interleaved sine waves, the security-print pattern */
  --guilloche: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='36' fill='none' stroke='%23b9ae97' stroke-width='.5' stroke-opacity='.55'><path d='M0 18 Q15 2 30 18 T60 18 T90 18 T120 18'/><path d='M0 18 Q15 34 30 18 T60 18 T90 18 T120 18'/><path d='M0 12 Q15 -4 30 12 T60 12 T90 12 T120 12'/><path d='M0 24 Q15 40 30 24 T60 24 T90 24 T120 24'/><path d='M-15 18 Q0 6 15 18 T45 18 T75 18 T105 18 T135 18' stroke='%23a9b6c9'/></svg>");

  /* concentric rosette watermark (stand-in for the world-map watermark) */
  --rosette: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200' fill='none' stroke='%23b6a98d' stroke-opacity='.35' stroke-width='.6'><g transform='translate(100 100)'><circle r='20'/><circle r='34'/><circle r='48'/><circle r='62'/><circle r='76'/><circle r='90'/><g stroke-opacity='.25'><ellipse rx='90' ry='30'/><ellipse rx='90' ry='30' transform='rotate(30)'/><ellipse rx='90' ry='30' transform='rotate(60)'/><ellipse rx='90' ry='30' transform='rotate(90)'/><ellipse rx='90' ry='30' transform='rotate(120)'/><ellipse rx='90' ry='30' transform='rotate(150)'/></g></g></svg>");
}

/* ---------- Cover (shows around the pages) ---------- */
.passport {
  border: 0;
  border-radius: 22px;
  padding: 10px;
  background:
    var(--grain),
    radial-gradient(120% 90% at 50% 0%, var(--cover) 0%, var(--cover-dark) 100%);
  box-shadow:
    0 1px 0 rgba(255,255,255,.15) inset,
    0 30px 60px -20px rgba(12, 20, 45, .45),
    0 12px 24px -12px rgba(0,0,0,.35);
  grid-template-columns: 1fr 0 1fr;
  gap: 0;
}

/* ---------- Pages (security paper) ---------- */
.pp-page {
  background-color: var(--paper);
  background-image:
    var(--grain),
    var(--guilloche);
  background-size: 180px 180px, 120px 36px;
  color: var(--ink-text);
  overflow: hidden; min-width: 0;
}
.pp-left  { border-radius: 14px 4px 4px 14px; }
.pp-right { border-radius: 4px 14px 14px 4px; }

/* page curvature toward the spine + stacked page edges */
.pp-left {
  box-shadow:
    inset -26px 0 30px -18px rgba(70, 50, 30, .28),
    inset -2px 0 0 rgba(70, 50, 30, .12),
    -2px 2px 0 var(--paper-2), -4px 4px 0 #e2d8c2, -6px 6px 0 #d8cdb4;
}
.pp-right {
  box-shadow:
    inset 26px 0 30px -18px rgba(70, 50, 30, .28),
    inset 2px 0 0 rgba(70, 50, 30, .12),
    2px 2px 0 var(--paper-2), 4px 4px 0 #e2d8c2, 6px 6px 0 #d8cdb4;
}
/* soft watermark rosette behind the data */
.pp-left::before, .pp-right::before {
  content: ""; position: absolute; pointer-events: none;
  width: 70%; aspect-ratio: 1; background: var(--rosette) center/contain no-repeat;
}
.pp-left::before  { right: -8%; top: 22%; }
.pp-right::before { left: -10%; bottom: -6%; }
.pp-page > * { position: relative; }   /* content above watermark */

/* the spine crease */
.pp-spine {
  border: 0; width: 0; position: relative; z-index: 2;
  background: none;
  box-shadow: 0 0 0 1px rgba(60, 40, 25, .18), 0 0 14px 3px rgba(60, 40, 25, .18);
}

/* ---------- Typography on the page ---------- */
.pp-head {
  border-bottom: 0; padding-bottom: 0; margin-bottom: 22px;
  flex-direction: column; align-items: center; gap: 2px;
  color: var(--ink-blue); text-align: center;
}
.pp-head span:first-child {
  font: 800 clamp(15px, 1.6vw, 19px)/1.1 ui-sans-serif, system-ui, sans-serif; letter-spacing: .06em;
}
.pp-head span:last-child { font-size: 10px; letter-spacing: .14em; color: #6a73b8; }

.pp-field dt, .pp-k {
  font: 500 12px/1.2 ui-sans-serif, system-ui, sans-serif;
  text-transform: none; letter-spacing: 0; color: var(--ink-label);
}
.pp-field dd { font-weight: 800; font-size: 17px; letter-spacing: -.005em; }
.pp-name { font-weight: 800; }
.pp-what { color: #34302b; }
.wf-chip { border-color: #cbbfa6; color: #4b463f; background: rgba(255,255,255,.35); }
.pp-flow { color: #34302b; }

/* machine-readable zone */
.pp-mrz {
  border-top: 0; margin-top: 26px; padding: 10px 0 0;
  font: 600 13px/1.55 "OCR-B", "OCR B Std", ui-monospace, Menlo, monospace;
  letter-spacing: .16em; color: #2e2a26;
}

/* ---------- Photo, signature, stamp ---------- */
.pp-photo .wf-img {
  border: 0; border-radius: 14px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.06);
  background-color: #e4e0d8;
}
.pp-sign {
  font: italic 22px "Snell Roundhand", "Segoe Script", "Brush Script MT", cursive;
  color: #2a3a8a; border-bottom-color: #b7ab92;
}
.pp-stamp {
  border: 2.5px double var(--ink-red); color: var(--ink-red);
  background: none; font-weight: 700; letter-spacing: .06em;
  mix-blend-mode: multiply; opacity: .85;
  right: 5%; bottom: 4%; top: auto;
  /* uneven ink */
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence baseFrequency='.08' numOctaves='3'/><feComponentTransfer><feFuncA type='table' tableValues='0 1 1 1'/></feComponentTransfer><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 3 -.4'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
          mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence baseFrequency='.08' numOctaves='3'/><feComponentTransfer><feFuncA type='table' tableValues='0 1 1 1'/></feComponentTransfer><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 3 -.4'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------- Mobile: single page with cover edge ---------- */
@media (max-width: 760px) {
  .passport { grid-template-columns: minmax(0, 1fr); padding: 8px; border-radius: 18px; }
  .pp-left, .pp-right { border-radius: 12px; box-shadow: inset 0 0 0 1px rgba(70,50,30,.08); }
  .pp-right { border-radius: 12px 12px 4px 4px; box-shadow: inset 0 -22px 26px -18px rgba(70,50,30,.25); }
  .pp-left  { border-radius: 4px 4px 12px 12px; box-shadow: inset 0 22px 26px -18px rgba(70,50,30,.25); }
  .pp-spine { height: 0; width: auto; }
}

/* ---------- Left page: tighter after trimming ---------- */
.pp-left { padding-top: clamp(24px, 3.2vw, 40px); }
.pp-what { margin-top: 18px; font-size: 16px; }

/* ---------- Photo: application-form print with white border ---------- */
.pp-photo { position: relative; }
.pp-portrait {
  display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover;
  background: #fff;
  padding: clamp(6px, 2.4%, 10px);           /* the white gutter */
  border-radius: 2px;
  box-shadow:
    0 1px 1px rgba(40, 30, 20, .12),
    0 4px 10px -2px rgba(40, 30, 20, .22);    /* sits on the page, slightly lifted */
  transform: rotate(-1.2deg);
  animation: photo-jolt .45s ease-out .97s both;
}
/* the photo takes the hit: pushed down, knocked off-angle, wobbles back */
@keyframes photo-jolt {
  0%   { transform: rotate(-1.2deg); }
  14%  { transform: translate(1px, 6px) rotate(-2.8deg) scale(.975); }
  38%  { transform: translate(-2px, -2px) rotate(-0.2deg) scale(1.005); }
  62%  { transform: translate(1px, 1px) rotate(-1.7deg); }
  82%  { transform: rotate(-1deg); }
  100% { transform: rotate(-1.2deg); }
}

/* ---------- APPROVED seal ---------- */
.pp-seal {
  --seal-ink: #161412;
  position: absolute; right: -24%; bottom: -8%;
  width: 74%; aspect-ratio: 1;
  color: var(--seal-ink);
  transform: rotate(-14deg);
  animation: seal-stamp .5s linear .7s both;
}
.pp-seal__ink { position: absolute; inset: 0; mix-blend-mode: multiply; opacity: .92; }
.pp-seal svg { width: 100%; height: 100%; display: block; }
.pp-seal svg text { font-family: "Passport Garamond", "Fraunces", Georgia, serif; font-variation-settings: "opsz" 72; letter-spacing: .04em; }

/* clean white disc in the centre carrying the company logo (not inked) */
.pp-seal__logo {
  position: absolute; inset: 23%;
  border-radius: 50%; background: #fff;
  display: grid; place-items: center;
  box-shadow: 0 0 0 1px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.15);
}
.pp-seal__logo img { width: 74%; height: auto; display: block; }
.pp-seal__logo img + .pp-seal__word { display: none; }
.pp-seal__word { font: 800 clamp(14px, 1.7vw, 22px)/1 ui-sans-serif, system-ui, sans-serif; letter-spacing: -.03em; color: #111; }

/* the stamp is slammed down: starts big and high, accelerates, squashes on impact, rebounds */
@keyframes seal-stamp {
  0%   { opacity: 0;   transform: translateY(-46px) scale(2.5) rotate(-3deg); animation-timing-function: cubic-bezier(.55, 0, .9, .45); }
  25%  { opacity: .85; }
  55%  { opacity: 1;   transform: translateY(2px) scale(.86) rotate(-15.5deg); animation-timing-function: cubic-bezier(.2, .8, .3, 1); }
  75%  { transform: scale(1.04) rotate(-13.6deg); }
  100% { opacity: 1;   transform: scale(1) rotate(-14deg); }
}

@media (max-width: 760px) {
  .pp-photo { max-width: 150px; }
  .pp-seal { right: -50%; bottom: -14%; width: 78%; }
}
@media (prefers-reduced-motion: reduce) {
  .pp-seal, .pp-portrait { animation: none; }
}

/* ---------- Typeface: Fraunces across the passport (code strip stays monospace) ---------- */
.passport, .passport .pp-field dt, .passport .pp-k, .passport .pp-field dd,
.passport .pp-name, .passport .pp-what, .passport .wf-chip {
  font-family: "Passport Garamond", "Fraunces", Georgia, "Times New Roman", serif;
}
.passport .pp-name { font-weight: 700; font-variation-settings: "opsz" 96; letter-spacing: -.015em; }
.passport .pp-field dd { font-weight: 650; font-variation-settings: "opsz" 24; letter-spacing: 0; }
.passport .pp-field dt, .passport .pp-k { font-weight: 400; font-style: italic; font-variation-settings: "opsz" 12; }
.passport .pp-what { font-weight: 400; font-variation-settings: "opsz" 18; }
.passport .wf-chip { font-weight: 500; }

/* ---------- Tool badges: overlapping circles printed on the page ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.passport .pp-tools { display: flex; flex-wrap: nowrap; gap: 0; padding: 2px 0 0; }
.pp-tool {
  --d: 42px;
  position: relative; flex: none;
  width: var(--d); height: var(--d); border-radius: 50%;
  margin-left: calc(var(--d) * -.3);          /* 30% overlap */
  display: grid; place-items: center; overflow: hidden;
  /* each badge is a lightly inked disc in the tool's colour, ringed in page paper */
  background:
    radial-gradient(circle at 35% 30%, rgba(255,255,255,.55), transparent 60%),
    color-mix(in srgb, var(--c) 16%, var(--paper));
  box-shadow: 0 0 0 2.5px var(--paper), 0 0 0 3.5px rgba(70, 50, 30, .22);
  color: var(--c);
  font: 700 13px/1 "Passport Garamond", "Fraunces", Georgia, serif; letter-spacing: -.02em;
  transition: transform .2s ease, z-index 0s;
}
.pp-tool:first-child { margin-left: 0; }
.pp-tool img { width: 58%; height: 58%; object-fit: contain; mix-blend-mode: multiply; filter: saturate(.85) contrast(.95); }
.pp-tool img ~ span[aria-hidden] { display: none; }
/* printed texture over the badge: paper grain + slight ink fade */
.pp-tool::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: var(--grain); background-size: 120px 120px; mix-blend-mode: multiply; opacity: .9;
}
.pp-tool span[aria-hidden] { mix-blend-mode: multiply; opacity: .9; }
.pp-tool:hover { transform: translateY(-3px); z-index: 2; }
@media (prefers-reduced-motion: reduce) { .pp-tool { transition: none; } }

/* ---------- Right page: code strip on top, smaller photo ---------- */
.pp-right { justify-content: flex-start; gap: 18px; }
.pp-mrz--top { margin: 0; padding: 0 0 12px; align-self: stretch; text-align: left; font-size: 12px; letter-spacing: .14em;
  border-bottom: 1px dashed rgba(70, 50, 30, .25); }
.pp-photo { max-width: 240px; margin-top: 4px; }
@media (max-width: 760px) { .pp-mrz--top { font-size: 10px; } .pp-photo { max-width: 140px; } }

/* ---------- Tools: unstacked row + "how I use it" note ---------- */
.passport .pp-tools { gap: 10px; flex-wrap: wrap; list-style: none; padding: 2px 0 0; margin: 0; }
.passport .pp-tools li { display: contents; }
.pp-tool { margin-left: 0 !important; border: 0; padding: 0; cursor: pointer; }
.pp-tool .pp-tool__mono { mix-blend-mode: multiply; opacity: .9; }
.pp-tool img ~ .pp-tool__mono { display: none; }
.pp-tool:focus-visible { outline: 2px solid #2a3a8a; outline-offset: 4px; }
.pp-tool.is-active { transform: translateY(-3px); box-shadow: 0 0 0 2.5px var(--paper), 0 0 0 4px rgba(42, 58, 138, .55); }

.pp-tool-note {
  margin-top: 10px; min-height: 2.9em;           /* reserve two lines so the page never jumps */
  font: 400 14px/1.45 "Passport Garamond", "Fraunces", Georgia, serif; font-variation-settings: "opsz" 14;
  color: #3a352f; max-width: 46ch;
}
.pp-tool-note.is-on { animation: note-in .45s ease-out; }
@keyframes note-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
.passport .pp-tools { margin-top: 22px; }
@media (prefers-reduced-motion: reduce) { .pp-tool-note.is-on { animation: none; } }

/* ---------- Tools: stacked again, 20% overlap ---------- */
.passport .pp-tools { gap: 0; flex-wrap: nowrap; }
.passport .pp-tool { margin-left: calc(var(--d) * -.2) !important; }
.passport .pp-tools li:first-child .pp-tool { margin-left: 0 !important; }
.passport .pp-tool.is-active, .passport .pp-tool:hover, .passport .pp-tool:focus-visible { z-index: 2; }

/* ---------- Usage line above, logos pinned to the bottom ----------
   The line always reserves three lines and its text sits on the bottom edge,
   so a longer or shorter description never moves the logo row. */
.pp-tool-note {
  margin: 0 0 12px; min-height: calc(1.45em * 3);
  display: flex; align-items: flex-end;
}
.passport .pp-tools { margin-top: 0; }
.passport .pp-tool.is-active,
.passport .pp-tool:hover { transform: none; }          /* highlight with the ring only, no vertical hop */

/* ---------- Code strip at the bottom of the right page ---------- */
.pp-mrz--bottom {
  margin: 0; padding: 12px 0 0; align-self: stretch; text-align: left;
  font-size: 12px; letter-spacing: .14em;
  border-top: 1px dashed rgba(70, 50, 30, .25);
}
@media (max-width: 760px) { .pp-mrz--bottom { font-size: 10px; } }
