/* ReSolut Group profile pages. One shared stylesheet for every person. */

:root {
  --navy: #1d3a56;      /* headings */
  --ink: #3b4a5a;       /* text */
  --muted: #5c6b7a;
  --blue: #2c6587;      /* links, icons, buttons */
  --blue-deep: #235270;
  --cyan: #86b8d3;      /* quiet accent */
  --line: #dfe7ed;
  --tint: #f3f7f9;
  --chip: #e7f0f5;
  --radius: 0.75rem;
  --header: 4.5rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header) + 1rem);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background: #fff;
  color: var(--ink);
  font: 400 1.0625rem/1.6 'Source Sans 3', system-ui, sans-serif;
  font-size-adjust: from-font;
  overflow-wrap: break-word;
}

img { display: block; max-width: 100%; height: auto; }
ul, ol { list-style: none; padding: 0; }
h1, h2, h3 { color: var(--navy); line-height: 1.2; text-wrap: balance; }
p, li, dd, blockquote { text-wrap: pretty; }
a { color: var(--blue); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 3px; }
main:focus, section:focus { outline: none; }

.wrap { width: 100%; max-width: 72rem; margin-inline: auto; padding-inline: var(--gutter); }

.skip {
  position: absolute; left: 1rem; top: -5rem; z-index: 20;
  padding: 0.6rem 1rem; background: var(--navy); color: #fff;
}
.skip:focus { top: 1rem; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: #fff; border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 2rem;
  min-height: var(--header);
}
.logo { flex: none; }
.logo img { width: 11rem; }
#menu { display: flex; gap: clamp(0.9rem, 1.8vw, 1.75rem); scroll-target-group: auto; }
#menu a {
  display: block; padding-block: 0.6rem;
  color: var(--navy); font-size: 1rem; text-decoration: none;
  border-block-end: 2px solid transparent;
}
#menu a:hover { text-decoration: underline; }
#menu a:target-current { border-color: var(--cyan); font-weight: 600; }
@supports not (scroll-target-group: auto) {
  #menu a[aria-current] { border-color: var(--cyan); font-weight: 600; }
}
.menu-toggle { display: none; }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  min-height: 3rem; padding: 0.6rem 1.35rem;
  background: #fff; color: var(--blue-deep);
  border: 1px solid #b9cddb; border-radius: var(--radius);
  font-weight: 600; text-decoration: none;
}
.button:hover { background: var(--tint); border-color: var(--blue); }
.button.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.button.primary:hover { background: var(--blue-deep); border-color: var(--blue-deep); }
.button:active { translate: 0 1px; }
.text-button {
  display: inline-flex; align-items: center; gap: 0.5rem;
  min-height: 2.75rem; padding: 0.4rem 0.9rem;
  border: 0; border-radius: var(--radius); background: none;
  color: var(--blue); font-weight: 600;
}
.text-button:hover { background: var(--chip); }

/* Icons: inline symbols that take the colour of the text around them */
.symbols { display: none; }
.icon { width: 1.2em; height: 1.2em; flex: none; }


/* Opening */
.intro {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 30rem);
  gap: clamp(2rem, 5vw, 4.5rem); align-items: center;
  padding-block: clamp(2.5rem, 6vw, 5rem);
}
h1 { font-size: clamp(2.25rem, 1.5rem + 2.6vw, 3.4rem); line-height: 1.08; letter-spacing: -0.015em; }
.role { margin-top: 0.6rem; color: var(--navy); font-size: 1.375rem; line-height: 1.3; }
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1rem; }
.tags li {
  padding: 0.25rem 0.75rem; border-radius: 100vmax;
  background: var(--chip); color: var(--navy);
  font-size: 0.9375rem; line-height: 1.4;
}
.summary { margin-top: 1.5rem; max-width: 34em; font-size: 1.1875rem; line-height: 1.55; }
.intro .details { margin-block: 1.75rem; }

.details { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.35rem 1.5rem; }
.details dt { display: flex; align-items: center; gap: 0.6rem; color: var(--muted); }
.details .icon { color: var(--blue); }
.details dd { color: var(--navy); }

/* Business card */
.card-area { perspective: 90rem; }
.card { display: grid; transform-style: preserve-3d; }
.card img {
  grid-area: 1 / 1; width: 100%;
  border: 1px solid var(--line); border-radius: 1rem; backface-visibility: hidden;
}
.card img:last-child { rotate: y 180deg; }
.card.is-back { rotate: y 180deg; }
.card-controls { display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0.5rem 0 0 -0.9rem; }
@media (prefers-reduced-motion: no-preference) { .card { transition: rotate 450ms ease-in-out; } }

/* Sections: heading in the margin, content beside it */
.section { border-block-start: 1px solid var(--line); }
.section > .wrap {
  display: grid; grid-template-columns: 13rem minmax(0, 1fr);
  gap: 1.5rem clamp(2rem, 5vw, 5rem);
  padding-block: clamp(2.75rem, 5vw, 4.5rem);
}
h2 { font-size: 1.625rem; }
.section > .wrap > h2 { position: sticky; top: calc(var(--header) + 1.5rem); align-self: start; }
h3 { font-size: 1.1875rem; }
.lead { font-size: 1.3125rem; line-height: 1.45; color: var(--navy); }
.prose { max-width: 42em; }
.prose > * + * { margin-top: 1.1em; }
.section-note { max-width: 42em; margin-bottom: 1.75rem; color: var(--muted); }

.facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 1.5rem 2rem;
  margin-top: 2.5rem; padding-top: 1.75rem; border-block-start: 1px solid var(--line);
}
.facts div { display: flex; flex-direction: column; }
.facts dt { order: 2; color: var(--navy); font-weight: 600; line-height: 1.35; }
.facts .num { order: 1; color: var(--navy); font-size: 2.25rem; font-weight: 600; line-height: 1.2; font-variant-numeric: lining-nums; }
.facts .note { order: 3; color: var(--muted); font-size: 1rem; line-height: 1.4; }

.pairs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.75rem clamp(2rem, 4vw, 3.5rem); }
.pairs h3 + p { margin-top: 0.25rem; }
:is(.pairs > div, .holdings li) > .icon { display: block; width: 1.75rem; height: 1.75rem; margin-bottom: 0.7rem; color: var(--blue); }

.history li { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 0.25rem 2rem; padding-block: 1.6rem; border-block-start: 1px solid var(--line); }
.history li:first-child { padding-top: 0; border: 0; }
.history li:last-child { padding-bottom: 0; }
.when { color: var(--navy); font-weight: 600; font-variant-numeric: tabular-nums; }
.field { display: block; color: var(--muted); font-size: 1rem; font-weight: 400; }
.history .post { color: var(--navy); }
.history .post + p { margin-top: 0.5rem; max-width: 40em; }

.holdings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.25rem clamp(2rem, 4vw, 3.5rem); }
.logo-slot { display: flex; align-items: center; height: 4rem; margin-bottom: 0.75rem; }
.logo-slot img { width: auto; max-width: 11rem; max-height: 4rem; object-fit: contain; object-position: left; }
#ecosystem { background: var(--tint); }
.holdings .kind { color: var(--muted); }
.holdings .kind + p { margin-top: 0.4rem; }

.awards li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 2rem; padding-block: 1rem; border-block-start: 1px solid var(--line); }
.awards li:first-child { padding-top: 0; border: 0; }
.awards p { color: var(--muted); }
.awards .year { color: var(--navy); font-variant-numeric: tabular-nums; text-align: end; }

.columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem clamp(2rem, 4vw, 3.5rem); }
.columns > div > h3 { padding-bottom: 0.6rem; border-block-end: 1px solid var(--line); }
.columns li { margin-top: 1.1rem; line-height: 1.5; }
.columns strong { display: block; color: var(--navy); font-weight: 600; }

/* Quotation */
.quote { position: relative; border-block-start: 1px solid var(--line); background: #f6fafc; }
.quote::before {
  content: ''; position: absolute; inset: 0;
  background: url('../assets/ribbon.webp') center / cover no-repeat;
  opacity: 0.4;
}
.quote .wrap { position: relative; padding-block: clamp(3rem, 7vw, 5.5rem); }
blockquote { max-width: 26em; color: var(--navy); font-size: clamp(1.4rem, 1rem + 1.5vw, 2rem); line-height: 1.35; }
.quote figcaption { margin-top: 1.25rem; color: var(--ink); }

.contact-layout { display: grid; gap: 1.75rem; justify-items: start; }

/* Footer */
.site-footer { border-block-start: 1px solid var(--line); padding-block: 2rem; color: var(--muted); font-size: 1rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; }
.motto { color: var(--navy); font-weight: 600; letter-spacing: 0.06em; }

/* Card dialog */
dialog { width: min(58rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); margin: auto; padding: 1.25rem; border: 0; border-radius: 1.25rem; color: var(--ink); }
dialog:modal { overscroll-behavior: contain; }
dialog::backdrop { background: rgb(29 58 86 / 0.6); overflow: hidden; overscroll-behavior: contain; }
.dialog-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.dialog-bar h1 { font-size: 1.375rem; letter-spacing: 0; }
dialog img { width: 100%; border: 1px solid var(--line); border-radius: 0.75rem; }
dialog img + img { margin-top: 1rem; }

@media (max-width: 70rem) {
  .site-header nav { display: contents; }
  .menu-toggle { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0.4rem 1rem; border: 1px solid #b9cddb; border-radius: var(--radius); background: #fff; color: var(--blue-deep); font-weight: 600; }
  #menu {
    display: none; position: absolute; inset: 100% 0 auto; flex-direction: column; gap: 0;
    max-height: calc(100dvh - var(--header)); overflow-y: auto;
    padding: 0.5rem var(--gutter) 1.25rem; background: #fff; border-block-end: 1px solid var(--line);
  }
  #menu.is-open { display: flex; }
  #menu a { padding-block: 0.8rem; }
  #menu a { border-color: transparent !important; }
  .intro { grid-template-columns: minmax(0, 1fr); }
  .card-area { max-width: 34rem; }
  .section > .wrap { grid-template-columns: minmax(0, 1fr); }
  .section > .wrap > h2 { position: static; }
}

@media (max-width: 40rem) {
  :root { --header: 4rem; }
  .logo img { width: 9.5rem; }
  .pairs, .holdings, .columns { grid-template-columns: minmax(0, 1fr); }
  .history li, .awards li { grid-template-columns: minmax(0, 1fr); }
  .awards .year { text-align: start; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .details { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .details dd { margin-bottom: 0.7rem; }
}
/* Older phones narrower than 20rem */
@media (max-width: 20rem) { .facts { grid-template-columns: minmax(0, 1fr); } }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

@media print {
  @page { margin: 16mm; }
  html { font-size: 9.5pt; }
  body { font-size: 1rem; line-height: 1.45; }
  .card, .card.is-back { transform-style: flat; rotate: none; }
  .card img:last-child { display: none; }
  .site-header, .actions, .card-controls, .skip, dialog, .quote::before { display: none !important; }
  .intro { grid-template-columns: 1fr 68mm; padding-block: 0 8mm; gap: 8mm; }
  .section > .wrap { grid-template-columns: 32mm minmax(0, 1fr); gap: 6mm; padding-block: 6mm; }
  .section > .wrap > h2 { position: static; font-size: 1.3rem; }
  .history li { grid-template-columns: 34mm minmax(0, 1fr); padding-block: 4mm; }
  .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .wrap { max-width: none; padding-inline: 0; }
  .history li, .awards li, .columns li, .holdings li, .pairs > div, .facts, .quote, #contact { break-inside: avoid; }
  .columns > div > h3, h2 { break-after: avoid; }
  .columns { break-inside: avoid; }
  .quote, #ecosystem { background: none; }
  .quote { border-block-start: 1px solid var(--line); }
  .quote .wrap { padding-block: 6mm; }
  .quote figcaption { color: var(--muted); }
  a { color: inherit; text-decoration: none; }
}
