/* =============================================================================
   Matthew Mangion: site styles
   Colours are named after places on the Maltese coast. Light only, by choice:
   the reference is a bright civic page, and every prototype paints its own ground.
   ========================================================================== */

:root {
  --paper: #FFFFFF;
  --ink: #0B1630;          /* Harbour: headlines and primary text */
  --ink-2: #576176;        /* the grey continuation in captions */
  --ink-3: #8A92A4;        /* meta, placeholders */
  --rule: #E2E6EE;
  --mist: #F2F4F7;         /* Limestone: light grey card */
  --mist-2: #E8EBF0;
  --lagoon: #D4E7FA;       /* Comino lagoon: pale blue card */
  --lagoon-2: #BFDAF6;
  --grotto: #1C4DFF;       /* Blue Grotto: electric accent */
  --grotto-2: #3D66FF;
  --grotto-ink: #0E2A8F;
  --night: #050B1C;        /* dark card ground */
  --night-2: #13306E;
  --send: #0D2B73;         /* round navy buttons */
  --luzzu: #FFC21A;        /* yellow spot, used sparingly */
  --signal: #E2336B;       /* one-off highlight, used once per page at most */
  --ok: #138A5B;

  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: "Martian Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --gutter: clamp(16px, 4.2vw, 68px);
  --max: 1480px;
  --r-card: clamp(26px, 3.4vw, 56px);
  --r-soft: clamp(18px, 1.6vw, 26px);
  --shadow-float: 0 1px 0 rgba(11, 22, 48, .04), 0 22px 56px -18px rgba(11, 22, 48, .26), 0 8px 18px -10px rgba(11, 22, 48, .10);
  --shadow-card: 0 1px 2px rgba(11, 22, 48, .05), 0 18px 40px -24px rgba(11, 22, 48, .30);
  --ease: cubic-bezier(.2, .7, .1, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.55 var(--sans);
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, video, canvas, iframe { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
:focus-visible { outline: 2.5px solid var(--grotto); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--lagoon-2); color: var(--ink); }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--narrow { max-width: 980px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------------------------------------------------------------- type --- */
.serif { font-family: var(--serif); }
.display-xl, .display-l, .display-m, .display-s {
  font-family: var(--serif);
  font-weight: 460;
  font-optical-sizing: auto;
  font-variation-settings: "opsz" 72;
  color: var(--ink);
  text-wrap: balance;
}
.display-xl { font-size: clamp(44px, 7vw, 120px); line-height: .97; letter-spacing: -.048em; }
.display-l  { font-size: clamp(40px, 5.2vw, 88px); line-height: .98; letter-spacing: -.042em; }
.display-m  { font-size: clamp(32px, 3.6vw, 60px); line-height: 1.02; letter-spacing: -.034em; }
.display-s  { font-size: clamp(26px, 2.4vw, 38px); line-height: 1.08; letter-spacing: -.026em; }
.statement-sans {
  font-family: var(--sans);
  font-weight: 600;
  font-stretch: 92%;
  font-size: clamp(34px, 3.9vw, 64px);
  line-height: 1.0;
  letter-spacing: -.045em;
  text-wrap: balance;
}
.lead {
  font-size: clamp(19px, 1.62vw, 25px);
  line-height: 1.42;
  letter-spacing: -.012em;
  color: var(--ink-2);
  text-wrap: pretty;
}
.lead + .lead { margin-top: .9em; }
.lead a { color: var(--ink-2); text-decoration-thickness: 1px; text-underline-offset: .18em; }
.lead a:hover { color: var(--ink); }
.eyebrow {
  font: 500 12px/1.2 var(--mono);
  font-stretch: 87.5%;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.tabular { font-variant-numeric: tabular-nums; }

/* Caption under a card: a dark lead phrase, then grey continuation. */
.caption {
  font-size: clamp(18px, 1.42vw, 22px);
  line-height: 1.42;
  letter-spacing: -.012em;
  color: var(--ink-2);
  max-width: 44ch;
  padding-inline: clamp(8px, 2.2vw, 44px);
  text-wrap: pretty;
}
.caption b, .caption strong { font-weight: 500; color: var(--ink); }

.link-strong {
  display: inline-flex; align-items: center; gap: .45em;
  font: 600 clamp(16px, 1.2vw, 19px)/1.2 var(--sans);
  letter-spacing: -.01em;
  color: var(--ink);
  text-decoration: none;
  background: none; border: 0; padding: 0; cursor: pointer;
}
.link-strong::after { content: "→"; transition: transform .25s var(--ease); }
.link-strong:hover::after { transform: translateX(4px); }

/* ------------------------------------------------------------- header --- */
.site-head { position: relative; z-index: 20; }
.site-head__in { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 84px; }
.wordmark {
  font: 500 22px/1 var(--serif);
  font-variation-settings: "opsz" 36;
  letter-spacing: -.025em;
  text-decoration: none; color: var(--ink);
  display: inline-flex; align-items: center; gap: 10px; white-space: nowrap;
}
.wordmark__mark { width: 39px; height: 26px; flex: none; }
.site-nav { display: flex; gap: clamp(14px, 2.2vw, 34px); }
.site-nav a { font: 500 16px/1 var(--sans); color: var(--ink-2); text-decoration: none; letter-spacing: -.01em; }
.site-nav a:hover { color: var(--ink); }
@media (max-width: 700px) { .site-nav { display: none; } }

/* -------------------------------------------------------------- cards --- */
.card {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-card);
  aspect-ratio: 3 / 2;
  max-width: 100%;
  isolation: isolate;
  background: var(--mist);
}
.card--lagoon { background: var(--lagoon); }
.card--grotto { background: var(--grotto); color: #fff; }
.card--mist { background: var(--mist); }
.card--night { background: linear-gradient(180deg, var(--night) 0%, #0A1840 62%, var(--night-2) 100%); color: #fff; }
.card--ink { background: var(--ink); color: #fff; }
.card--outline { background: #F7F8FA; box-shadow: inset 0 0 0 1px var(--rule); }
.card > img.cover, .card > video.cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(12px, 1.3vw, 22px); }
.card-pair > figure { display: grid; gap: clamp(18px, 2vw, 30px); align-content: start; }
@media (max-width: 820px) { .card-pair { grid-template-columns: 1fr; gap: 44px; } }

/* Round pause/play control, bottom right of animated cards. */
.pause {
  position: absolute; z-index: 5;
  right: clamp(14px, 2.1vw, 34px); bottom: clamp(14px, 2.1vw, 34px);
  width: clamp(38px, 3.1vw, 48px); height: clamp(38px, 3.1vw, 48px);
  border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  display: grid; place-items: center;
  background: rgba(88, 96, 112, .78);
  color: #fff;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: transform .2s var(--ease), background .2s;
}
.pause:hover { transform: scale(1.06); }
.pause svg { width: 38%; height: 38%; }
.pause .i-play { display: none; }
[data-paused="true"] > .pause .i-play, [data-paused="true"] .pause--own .i-play { display: block; }
[data-paused="true"] > .pause .i-pause, [data-paused="true"] .pause--own .i-pause { display: none; }
.card--grotto > .pause { background: #0B1D63; }
.card--night > .pause, .card--ink > .pause { background: rgba(255, 255, 255, .16); }
[data-paused="true"] *, [data-offscreen] * { animation-play-state: paused !important; }

/* ----------------------------------------------------------- buttons --- */
.btn-pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 64px; padding: 0 34px; border-radius: 999px; border: 0; cursor: pointer;
  background: #000; color: #fff; text-decoration: none;
  font: 500 18px/1 var(--sans); letter-spacing: -.01em;
  box-shadow: 0 18px 36px -16px rgba(0, 0, 0, .55);
  transition: transform .25s var(--ease), box-shadow .25s;
}
.btn-pill:hover { transform: translateY(-2px); box-shadow: 0 22px 42px -16px rgba(0, 0, 0, .6); }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--rule); background: #fff; color: var(--ink);
  font: 500 15px/1 var(--sans); text-decoration: none; cursor: pointer;
}
.btn-ghost:hover { border-color: #C9CFDA; }
.copy-field {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 6px 6px 18px; border-radius: 999px;
  border: 1px solid var(--rule); background: #fff;
  font: 500 17px/1.2 var(--sans);
  max-width: 100%;
}
.copy-field span { user-select: all; overflow-wrap: anywhere; }
.copy-field button {
  flex: none; height: 36px; padding: 0 14px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--mist); font: 500 14px/1 var(--sans);
}
.copy-field button:hover { background: var(--mist-2); }

/* The reference's "Sources" sheet, used as the education card. */
.sources {
  position: relative;
  width: min(460px, 100%);
  padding: 22px 24px 18px;
  border-radius: 30px;
  background: #fff;
  box-shadow: var(--shadow-float), 0 0 0 1px rgba(11, 22, 48, .06);
}
.sources__head { display: grid; grid-template-columns: 1fr auto; align-items: center; margin-bottom: 8px; }
.sources__head h3 { font: 600 17px/1 var(--sans); text-align: center; grid-column: 1 / -1; grid-row: 1; letter-spacing: -.01em; }
.sources__head button { grid-column: 2; grid-row: 1; width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--mist); cursor: pointer; display: grid; place-items: center; }
.sources__head button svg { width: 14px; height: 14px; }
.src-group { padding: 12px 0; border-top: 1px solid var(--rule); }
.src-group:first-of-type { border-top: 0; }
.src-row { display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: center; }
.src-seal {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ink); color: #fff;
  box-shadow: inset 0 0 0 2px var(--ink), inset 0 0 0 3.5px rgba(255, 255, 255, .55);
  font: 600 10.5px/1 var(--sans); letter-spacing: .04em;
}
.src-row b { display: block; font: 500 16px/1.25 var(--sans); }
.src-row span { display: block; font: 400 14.5px/1.3 var(--sans); color: var(--ink-2); }
.src-links { display: grid; gap: 10px; margin: 12px 0 0 54px; }
.src-links a, .src-links span.src-item {
  font: 400 15.5px/1.35 var(--sans); color: var(--grotto-ink);
  text-decoration: underline dotted; text-decoration-thickness: 1.5px; text-underline-offset: .22em;
}
.src-links span.src-item { color: var(--ink); text-decoration: none; }

/* ------------------------------------------------------------- footer --- */
.site-foot { padding-block: clamp(80px, 9vw, 140px) clamp(120px, 12vw, 170px); border-top: 1px solid var(--rule); }
.site-foot__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; align-items: start; }
.site-foot h2 { font: 460 clamp(34px, 3.6vw, 56px)/1 var(--serif); letter-spacing: -.035em; text-wrap: balance; }
.site-foot dl { display: grid; gap: 18px; }
.site-foot dt { font: 500 12px/1.2 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.site-foot dd { font-size: 16px; color: var(--ink-2); }
.site-foot dd a { color: var(--ink); }
.site-foot small { display: block; margin-top: 56px; color: var(--ink-3); font-size: 13.5px; }
@media (max-width: 860px) { .site-foot__grid { grid-template-columns: 1fr; } }

/* -------------------------------------------------------------- toast --- */
.toast {
  position: fixed; z-index: 120; left: 50%; top: calc(18px + env(safe-area-inset-top, 0px));
  transform: translate(-50%, -20px); opacity: 0;
  padding: 12px 18px; border-radius: 999px; background: var(--ink); color: #fff;
  font: 500 14px/1.2 var(--sans); box-shadow: var(--shadow-float);
  transition: opacity .25s, transform .35s var(--ease-out); pointer-events: none;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

.nb { white-space: nowrap; }
