/* ===========================================================================
   profile.css — styling for the public /our-profile/ company-profile document.
   Scoped under body.profile-doc so it never touches the rest of the site.
   Reuses the design tokens defined in :root by style.css (loaded first).

   Model: visible A4 "sheets" (WYSIWYG) that map 1:1 to printed PDF pages.
   Content is grouped into sheets at sensible boundaries; each sheet's footer
   sits at the page bottom, so trailing space reads like a normal page.
   =========================================================================== */

:root {
  --pad: 15mm;
}

/* Shreetuvis Blue (the navy of the logo, header and footer) replaces the
   site's orange accent throughout this document (owner, 2026-10-29). */
body.profile-doc {
  --accent:    #0a1929;
  --accent-h:  #1c3654;
  --accent-10: rgba(10, 25, 41, 0.08);
  --on-dark:   #b9c9db;   /* accent role inside the navy cover band and toolbar */
}

/* ---- screen shell -------------------------------------------------------- */
body.profile-doc {
  background: #dfe3ea;
  color: var(--ink);
  font-family: var(--sans);
  margin: 0; padding: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.doc-toolbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 16px;
  padding: 10px clamp(16px, 4vw, 40px);
  background: var(--bg-deep); color: #fff;
}
.doc-toolbar svg { width: 16px; height: 16px; flex: 0 0 auto; }
.doc-home {
  display: inline-flex; align-items: center; gap: 4px;
  color: #cdd7e3; text-decoration: none; font: 600 13px/1 var(--sans);
}
.doc-home:hover { color: #fff; }
.doc-toolbar .doc-label {
  font: 600 11px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: #9fb0c4;
  padding-left: 16px; border-left: 1px solid rgba(255, 255, 255, 0.18);
}
.doc-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.doc-actions .act {
  appearance: none; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 7px;
  background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, 0.28);
  font: 600 13px/1 var(--sans); letter-spacing: 0.02em;
  padding: 9px 14px; border-radius: 6px; white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.doc-actions .act:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.5); }
.doc-actions .act[hidden] { display: none; }
.doc-actions .act-primary { background: #fff; border-color: #fff; color: var(--bg-deep); }
.doc-actions .act-primary:hover { background: #dfe6ee; border-color: #dfe6ee; }
.doc-actions .act-wa { background: #1f9d55; border-color: #1f9d55; }
.doc-actions .act-wa:hover { background: #198a4a; border-color: #198a4a; }

.doc-toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 20;
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  background: var(--bg-deep); color: #fff; font: 600 13px/1 var(--sans);
  padding: 12px 18px; border-radius: 6px; box-shadow: 0 8px 24px rgba(10, 25, 41, 0.3);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.doc-toast.on { opacity: 1; transform: translate(-50%, 0); }

.doc { display: flex; flex-direction: column; align-items: center; gap: 24px; padding: 28px 16px 64px; }

/* ---- the A4 sheet -------------------------------------------------------- */
.sheet {
  width: 210mm; min-height: 297mm; box-sizing: border-box;
  padding: var(--pad);
  background: #fff; color: var(--ink);
  box-shadow: 0 10px 40px rgba(10, 25, 41, 0.20);
  position: relative; display: flex; flex-direction: column;
}

.sheet-foot {
  margin-top: auto; padding-top: 9mm;
  display: flex; justify-content: space-between; align-items: center;
  font: 600 9px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
  border-top: 1px solid var(--rule);
}
.sheet-foot .legal { color: var(--bg-deep); }

/* ---- base typography ----------------------------------------------------- */
.sheet h1, .sheet h2, .sheet h3, .sheet h4 { margin: 0; line-height: 1.12; }
.sheet p { margin: 0 0 8px; }
.lead-copy { font-size: 11px; line-height: 1.6; color: var(--ink-soft); }
.lead-copy b { color: var(--ink); }

.chapter-head {
  display: flex; align-items: baseline; gap: 11px;
  padding-bottom: 8px; margin: 16px 0 11px;
  border-bottom: 2px solid var(--bg-deep);
}
.chapter-head .n {
  font: 700 12px/1 var(--mono); color: #fff; background: var(--accent);
  padding: 5px 8px; border-radius: 5px; letter-spacing: 0.06em;
}
.chapter-head h2 { font-size: 18px; font-weight: 700; letter-spacing: 0.01em; color: var(--bg-deep); }
.chapter-head .sub {
  margin-left: auto; align-self: center;
  font: 500 9.5px/1.3 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); text-align: right;
}

/* ===========================================================================
   COVER
   =========================================================================== */
.cover-band {
  position: relative;
  margin: calc(-1 * var(--pad)) calc(-1 * var(--pad)) 15px;
  height: 92mm; overflow: hidden; background: var(--bg-deep);
}
/* no photo on the cover (owner, 2026-10-29): a plain navy band with a faint
   engineering grid and a blue edge */
.cover-band {
  background-color: var(--bg-deep);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(115deg, #07121f 0%, #0a1929 55%, #10263d 100%);
  background-size: 8mm 8mm, 8mm 8mm, 100% 100%;
  border-bottom: 3px solid #1c3654;
}
.cover-top {
  position: absolute; left: var(--pad); right: var(--pad); top: 12mm;
  display: flex; align-items: center; justify-content: space-between;
}
.cover-mark { width: 40mm; height: auto; display: block; }
.cover-top .eyebrow {
  font: 600 11px/1 var(--mono); letter-spacing: 0.32em; text-transform: uppercase; color: var(--on-dark);
  padding: 8px 12px; border: 1px solid rgba(185, 201, 219, 0.45); border-radius: 4px;
}
.cover-head { position: absolute; left: var(--pad); right: var(--pad); bottom: 12mm; color: #fff; }
.cover-head h1 {
  color: #fff; font-size: 33px; font-weight: 700; line-height: 1.12; letter-spacing: 0.005em;
  padding-left: 14px; border-left: 4px solid var(--on-dark);
}
.cover-head .desc { margin-top: 10px; max-width: 150mm; font-size: 12px; color: #cdd7e3; }

.stat-row {
  display: grid; grid-template-columns: repeat(4, 1fr);
  margin: 0 0 16px; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden;
}
.stat { display: flex; flex-direction: column; gap: 4px; padding: 10px 14px; border-right: 1px solid var(--rule); }
.stat:last-child { border-right: 0; }
.stat .v { font: 700 22px/1 var(--sans); color: var(--bg-deep); }
.stat .l { font: 500 8.5px/1.3 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

.verticals { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0 2px; }
.vert { border: 1px solid var(--rule); border-top: 3px solid var(--bg-deep); border-radius: 6px; padding: 10px 13px; break-inside: avoid; }
.vert .vh {
  display: flex; align-items: center; gap: 8px; margin-bottom: 5px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--bg-deep);
}
.vert .vh svg { width: 16px; height: 16px; }
.vert p { margin: 0; font-size: 10px; line-height: 1.5; color: var(--ink-soft); }

.block-label {
  display: flex; align-items: center; gap: 9px;
  font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--bg-deep);
  margin: 14px 0 8px; padding-bottom: 6px; border-bottom: 2px solid var(--accent);
}
.block-label .n { font: 700 10px/1 var(--mono); color: var(--accent); }

.bio {
  background: var(--bg-alt); border: 1px solid var(--rule); border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0; padding: 13px 17px;
  font-size: 10.5px; line-height: 1.58; color: var(--ink-soft);
}
.bio p:last-child { margin-bottom: 0; }
.bio b { color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 11px 0 0; }
.chips .chip {
  font: 600 8.5px/1.3 var(--mono); letter-spacing: 0.04em;
  background: #fff; border: 1px solid var(--rule-d); color: var(--bg-deep);
  padding: 4px 9px; border-radius: 999px; text-transform: uppercase;
}

/* ===========================================================================
   SECTOR CARDS
   =========================================================================== */
.sector-card { border: 1px solid var(--rule); border-radius: 9px; overflow: hidden; margin-bottom: 10px; break-inside: avoid; }
.sc-head {
  display: flex; align-items: center; gap: 11px; padding: 8px 13px;
  background: var(--bg-alt); border-bottom: 1px solid var(--rule);
}
.sector-ico { flex: 0 0 auto; width: 30px; height: 30px; display: grid; place-items: center; background: var(--accent-10); color: var(--accent); border-radius: 7px; }
.sector-ico svg { width: 18px; height: 18px; }
.sc-head .sc-title { font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--bg-deep); }
.sc-head .count { margin-left: auto; font: 600 9px/1 var(--mono); color: #fff; background: var(--accent); border-radius: 999px; padding: 4px 9px; letter-spacing: 0.04em; }
.sc-body { padding: 10px 14px; }

.client-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 22px; }
.client { break-inside: avoid; }
.client .nm { font-size: 10px; line-height: 1.3; color: var(--ink); font-weight: 600; }
.client .nm .loc { color: var(--muted); font-weight: 400; }
.client .scope { font-size: 9.5px; line-height: 1.4; color: var(--muted); margin-top: 1px; }
.client .tag {
  display: inline-block; vertical-align: middle;
  font: 600 8px/1 var(--mono); letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-10); border-radius: 999px; padding: 2px 6px; margin-left: 5px;
}
.client.multi { grid-column: 1 / -1; }
.client .sites { list-style: none; margin: 3px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 3px 14px; }
.client .sites li { font-size: 9.5px; line-height: 1.4; color: var(--ink-soft); position: relative; padding-left: 11px; }
.client .sites li::before { content: "›"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }

.subgroup { margin-top: 9px; }
.subgroup:first-child { margin-top: 0; }
.subgroup .sg-title {
  display: flex; align-items: center;
  font: 700 9px/1 var(--mono); letter-spacing: 0.10em; text-transform: uppercase; color: var(--accent);
  margin: 0 0 6px; padding-bottom: 5px; border-bottom: 1px dashed var(--rule-d);
}
.subgroup .sg-title svg { width: 14px; height: 14px; }

/* ===========================================================================
   AREAS OF WORK
   =========================================================================== */
.area { display: grid; grid-template-columns: 30px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); break-inside: avoid; }
.area:last-child { border-bottom: 0; }
.area-ico { width: 30px; height: 30px; display: grid; place-items: center; background: var(--accent-10); color: var(--accent); border-radius: 7px; }
.area-ico svg { width: 18px; height: 18px; }
.area h3 { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--bg-deep); margin-bottom: 3px; }
.area p { font-size: 10px; line-height: 1.5; color: var(--ink-soft); margin: 0 0 6px; }


/* ===========================================================================
   CLOSING / CONTACT
   =========================================================================== */
.commit {
  text-align: center; font-style: italic; font-size: 12px; line-height: 1.5; color: var(--bg-deep);
  background: var(--bg-alt); border-radius: 8px; padding: 14px 26px; margin: 14px 0 16px; break-inside: avoid;
}
/* auto-fit so the row stays balanced whoever is listed — the card count changes
   as contacts are added or removed, and a fixed column count leaves a hole. */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; text-align: center; margin-bottom: 14px; break-inside: avoid; }
.contact-grid .person {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 8px; border: 1px solid var(--rule); border-radius: 8px; background: #fff; text-decoration: none;
}
.contact-grid .person svg { width: 13px; height: 13px; color: var(--accent); }
.contact-grid .person .tel { font: 600 11.5px/1.5 var(--mono); color: var(--bg-deep); }
.contact-foot { display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center; font-size: 10.5px; line-height: 1.5; color: var(--ink-soft); break-inside: avoid; }
.contact-foot .row { display: inline-flex; align-items: center; gap: 7px; }
.contact-foot svg { width: 13px; height: 13px; color: var(--accent); }
.contact-foot a { color: var(--ink-soft); text-decoration: none; }
.contact-foot .addr { color: var(--ink); font-weight: 600; }

/* commitment + contact close the last page, pushed to sit above the footer */
.closing-body { margin-top: auto; padding-top: 8mm; break-inside: avoid; }
.contact-label { justify-content: center; border: 0; margin-bottom: 12px; }

/* ===========================================================================
   PRODUCTS DISTRIBUTION PAGE
   =========================================================================== */
.pdb-table { border: 1px solid var(--rule); border-radius: 9px; overflow: hidden; margin-top: 8px; }
.pdb-row {
  display: grid; grid-template-columns: 34mm 1fr; gap: 16px; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--rule); break-inside: avoid;
}
.pdb-row:last-child { border-bottom: 0; }
.pdb-logo { display: flex; align-items: center; justify-content: center; height: 12mm; }
.pdb-logo picture, .pdb-logo img { display: block; max-width: 100%; max-height: 10mm; width: auto; height: auto; object-fit: contain; }
.pdb-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.pdb-name { font-size: 12.5px; font-weight: 700; color: var(--bg-deep); }
.pdb-role { font: 600 9px/1.3 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }
.pdb-range { font-size: 10px; line-height: 1.45; color: var(--muted); margin-top: 2px; }
.pdb-chips { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.pdb-chips li {
  font: 500 8.5px/1.3 var(--mono); letter-spacing: 0.02em; color: var(--bg-deep);
  background: var(--bg-alt); border: 1px solid var(--rule); border-radius: 999px; padding: 3px 8px;
}
.pdb-note {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px;
  margin-top: 12px; font-size: 10px; color: var(--ink-soft);
}
.pdb-note .row { display: inline-flex; align-items: center; gap: 6px; }
.pdb-note svg { width: 13px; height: 13px; color: var(--bg-deep); }
.pdb-note a { color: var(--bg-deep); font-weight: 600; text-decoration: none; }

/* ===========================================================================
   PRINT — each .sheet is exactly one A4 page
   =========================================================================== */
@page { size: A4; margin: 0; }

@media print {
  html, body.profile-doc { background: #fff; margin: 0; padding: 0; }
  .no-print, .doc-toolbar { display: none !important; }
  .doc { display: block; padding: 0; gap: 0; }

  .sheet {
    width: 210mm; min-height: 297mm; margin: 0; box-shadow: none;
    page-break-after: always; break-after: page;
  }
  .sheet:last-child { page-break-after: auto; break-after: auto; }

  /* render backgrounds, badges, cover photo in colour */
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }

  .sector-card, .sc-head, .client, .area, .pdb-row,
  .contact-grid .person, .chapter-head, .block-label, .stat-row, .vert, h1, h2, h3 { break-inside: avoid; }
  .sc-head, .chapter-head, .block-label, .sg-title { break-after: avoid; }
}

/* ---- narrower than an A4 sheet: reflow into readable cards ---------------
   The A4 type sizes (9-11px) are right on paper but too small on a phone, so
   the reflowed view steps them up. Print is unaffected (screen-only query). */
@media screen and (max-width: 840px) {
  .doc { padding: 16px 12px 48px; gap: 14px; }
  .sheet { width: 100%; max-width: 640px; min-height: 0; padding: 20px; }
  .cover-band { height: 220px; margin: -20px -20px 16px; }
  .cover-head { left: 20px; right: 20px; bottom: 18px; }
  .cover-head h1 { font-size: 24px; }
  .cover-head .desc { font-size: 13px; }
  .cover-top { top: 18px; left: 20px; right: 20px; }
  .cover-mark { width: 120px; }
  .cover-top .eyebrow { font-size: 10px; padding: 6px 9px; letter-spacing: 0.24em; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
  .stat .l { font-size: 10px; }
  .verticals { grid-template-columns: 1fr; }
  .vert .vh { font-size: 13px; }
  .vert p { font-size: 14px; }
  .lead-copy, .bio { font-size: 14px; line-height: 1.6; }
  .chips .chip { font-size: 10px; }
  .block-label { font-size: 14px; }
  .chapter-head { flex-wrap: wrap; }
  .chapter-head h2 { font-size: 18px; }
  .chapter-head .sub { margin-left: 0; width: 100%; text-align: left; font-size: 10.5px; }
  .sc-head .sc-title { font-size: 13px; }
  .client-list { grid-template-columns: 1fr; gap: 9px; }
  .client .nm { font-size: 14px; }
  .client .scope, .client .sites li { font-size: 13px; }
  .client .tag { font-size: 9.5px; }
  .subgroup .sg-title { font-size: 10.5px; }
  .area h3 { font-size: 14px; }
  .area p { font-size: 13.5px; }
  .commit { font-size: 15px; padding: 16px 18px; }
  .pdb-row { grid-template-columns: 1fr; gap: 8px; }
  .pdb-logo { justify-content: flex-start; height: 36px; }
  .pdb-logo picture, .pdb-logo img { max-height: 32px; }
  .pdb-name { font-size: 16px; }
  .pdb-role { font-size: 10.5px; }
  .pdb-range { font-size: 14px; }
  .pdb-chips li { font-size: 11px; }
  .pdb-note { font-size: 13px; }
  .contact-grid { grid-template-columns: 1fr; }
  .contact-grid .person .tel { font-size: 15px; }
  .contact-foot { font-size: 14px; }
  .sheet-foot { font-size: 9.5px; gap: 12px; }
}

/* ---- phone toolbar: icon buttons, label dropped --------------------------- */
@media screen and (max-width: 840px) {
  .doc-toolbar { gap: 8px; padding: 8px 12px; }
  .doc-toolbar .doc-label { display: none; }
  .doc-home span { display: none; }
  .doc-actions { gap: 6px; }
  .doc-actions .act { padding: 9px 10px; }
  .doc-actions .act span { display: none; }
  .doc-actions .act-primary span, .doc-actions .act-wa span { display: inline; }
  .doc-actions .act-print { display: none; }
}

/* very small phones: every button icon-only, and the cover stacks in normal
   flow so a three-line title can't run into the wordmark */
@media screen and (max-width: 380px) {
  .doc-actions .act-primary span, .doc-actions .act-wa span { display: none; }
  .cover-band { height: auto; padding: 18px 20px 20px; }
  .cover-top, .cover-head { position: static; }
  .cover-head { margin-top: 26px; }
  .cover-head h1 { font-size: 21px; }
  .cover-top .eyebrow { white-space: nowrap; letter-spacing: 0.12em; font-size: 9px; }
}
