/* Shared stylesheet for the pages of quadripoint.sg */

/* Inter (SIL OFL 1.1, see fonts/OFL.txt): Latin subset, weights 400-600 */
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}
:root {
  --bg: #f7f8fa;
  --text: #13213b;
  --muted: #5d6879;
  --rule: #dde2ea;
  --brand: #1f3a6b;
  /* Type scale: every size on the site is one of these */
  --fs-label: 12px;
  --fs-body: 16px;
  --fs-lead: clamp(18px, 2vw, 20px);
  --fs-title: clamp(32px, 4.4vw, 40px);
  /* One vertical gap between every block of content */
  --gap: clamp(40px, 5vw, 64px);
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1f3a6b;
    --text: #f4f6fa;
    --muted: #b4c1d8;
    --rule: #3b5687;
    --brand: #ffffff;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}
.wrap {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 56px);
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}
a:hover, a:focus-visible { color: var(--brand); text-decoration-color: var(--brand); }
a:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }

::selection { background: var(--brand); color: var(--bg); }

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  padding: 8px 12px;
  background: var(--bg);
  font-size: var(--fs-body);
}
.skip:focus { top: 12px; }

/* Small caps labels: nav, section labels, definition terms */
.label, dt, .nav a {
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---- Header -------------------------------------------------------- */

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: clamp(20px, 4vw, 36px);
  padding-bottom: 8px;
  min-height: 72px;
}
.home-link { text-decoration: none; }
.home-link:hover .lockup, .home-link:focus-visible .lockup { opacity: 0.8; }
.nav {
  display: flex;
  gap: clamp(18px, 3vw, 32px);
  margin-left: auto;
}
.nav a { text-decoration: none; padding: 6px 0; }
.nav a:hover, .nav a:focus-visible { color: var(--brand); }
.nav a[aria-current="page"] {
  color: var(--text);
  box-shadow: inset 0 -1px 0 var(--text);
}

/* ---- The lockup: quadrant mark + spaced wordmark ------------------- */

.lockup {
  display: flex;
  align-items: center;
  gap: 0.46em;
  margin: 0;
  color: var(--brand);
  font-size: clamp(24px, 7.4vw, 52px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.lockup.small { font-size: 14px; transition: opacity 0.15s ease; }
.mark { flex: none; display: block; width: 1.5em; height: 1.5em; overflow: visible; }
/* spaced caps carry trailing tracking; pull it back so edges align */
.word { margin-right: -0.16em; }

/* ---- Home hero ----------------------------------------------------- */

.hero { padding: clamp(56px, 13vh, 150px) 0 var(--gap); }
.intro, .lead {
  margin: clamp(28px, 4vw, 44px) 0 0;
  max-width: 36em;
  text-wrap: pretty;
  font-size: var(--fs-lead);
  line-height: 1.5;
  color: var(--muted);
}

/* ---- Inner page heading -------------------------------------------- */

.page-head { padding: clamp(48px, 8vw, 96px) 0 var(--gap); }
.page-head h1 {
  margin: 0;
  font-size: var(--fs-title);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--brand);
}
.page-head .lead { margin-top: clamp(16px, 2.4vw, 24px); }

/* ---- Sections: a label column beside the text ---------------------- */

.section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
  gap: 12px clamp(24px, 4vw, 48px);
  padding: 20px 0 var(--gap);
  border-top: 1px solid var(--rule);
}
.section > .label, .section > h2 { margin: 0; padding-top: 3px; }
.section h2:not(.label) {
  font-size: var(--fs-body);
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
  text-wrap: balance;
}
.body { max-width: 40em; }
.body > :first-child { margin-top: 0; }
.body > :last-child { margin-bottom: 0; }
.body p { margin: 0 0 1em; text-wrap: pretty; }
.body ul { margin: 0 0 1em; padding-left: 1.2em; }
.body li { margin-bottom: 0.4em; }
.note { color: var(--muted); }
.section:target h2 { color: var(--brand); }

/* A list of links with hairlines between them (home: services) */
.index { list-style: none; margin: 0; padding: 0; }
.index li + li { border-top: 1px solid var(--rule); }
.index a {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  text-decoration: none;
}
.index li:first-child a { padding-top: 0; }
.index li:last-child a { padding-bottom: 0; }
.index a::after { content: "\2192"; color: var(--muted); transition: transform 0.15s ease; }
.index a:hover::after, .index a:focus-visible::after { color: var(--brand); transform: translateX(3px); }

/* ---- Registered details: a grid of label/value pairs inside a section,
   no rules of their own (the section's rule is the only one) ---------- */

dl.details {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px clamp(24px, 4vw, 48px);
}
dl.details.pairs { grid-template-columns: repeat(2, 1fr); }
dt { margin-bottom: 6px; }
dd { margin: 0; }
.entity { font-weight: 600; }
.num { font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }

/* ---- Footer -------------------------------------------------------- */

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 24px;
  padding-bottom: clamp(24px, 4vw, 40px);
  font-size: var(--fs-label);
  color: var(--muted);
}
.site-footer nav { display: flex; gap: 20px; }

/* ---- Motion -------------------------------------------------------- */

/* Entrance: the four quadrants converge on the centre point, then the
   rest of the page settles in. Runs once, CSS only. */
@keyframes converge {
  from { opacity: 0; transform: translate(var(--x), var(--y)); }
  to   { opacity: 1; transform: none; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.hero .q { animation: converge 900ms cubic-bezier(0.16, 1, 0.3, 1) both; }
.nw { --x: -9px; --y: -9px; animation-delay: 0ms; }
.ne { --x:  9px; --y: -9px; animation-delay: 60ms; }
.se { --x:  9px; --y:  9px; animation-delay: 120ms; }
.sw { --x: -9px; --y:  9px; animation-delay: 180ms; }
.hero .word, .reveal {
  animation: rise 800ms cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: var(--d, 0ms);
}
.hero .word { --d: 360ms; }
@media (prefers-reduced-motion: reduce) {
  .q, .word, .reveal { animation: none !important; }
}

/* ---- Phones -------------------------------------------------------- */

@media (max-width: 720px) {
  :root { --fs-label: 11px; }
  .site-header .wrap { min-height: 60px; padding-top: 16px; }
  .lockup.small .word { display: none; }
  .lockup.small { font-size: 16px; }
  .nav { gap: 20px; }

  .hero { padding: 12vh 0 10vh; }
  .intro { margin-top: 20px; }

  .section { grid-template-columns: 1fr; }

  /* Details become a compact colophon: label beside value */
  dl.details, dl.details.pairs { grid-template-columns: 1fr; gap: 14px; }
  .item { display: grid; grid-template-columns: 112px 1fr; gap: 12px; }
  dt { margin: 0; padding-top: 3px; }
  dd { line-height: 1.55; overflow-wrap: anywhere; }
}
