/* Stylesheet of the website. The sister site uses the same file with its own colours.
 * Design "Facette" translated to the web: an ink cover with a facet field on the
 * right, a light band of facts below it and the slanted footer bands of the PDFs.
 * Brand colours come from the custom properties set in each page's <head>.
 */

@font-face {
  font-family: "Montserrat";
  src: url("fonts/montserrat-latin-wght-normal.woff2") format("woff2-variations"),
       url("fonts/montserrat-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("fonts/inter-latin-wght-normal.woff2") format("woff2-variations"),
       url("fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--page);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--page);
  color: var(--text);
  font-family: var(--font-text);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

.wrap {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: clamp(16px, 5vw, 72px);
}

/* ---- Cover ------------------------------------------------------------ */

.cover {
  position: relative;
  flex: 1 0 auto;
  min-height: 64vh;
  min-height: 64svh;
  background: var(--ink);
  color: #fff;
  display: flex;
}

.cover .wrap {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
  padding-block: clamp(28px, 5vw, 56px) clamp(36px, 6vw, 72px);
}

.mark {
  display: block;
  width: clamp(44px, 5vw, 60px);
  height: auto;
}

.title {
  margin: 0;
  width: fit-content;
  max-width: 100%;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(2.1rem, 1.05rem + 4.6vw, 4.8rem);
  line-height: 1.04;
  letter-spacing: -0.012em;
  color: #fff;
}

.title::after {
  content: "";
  display: block;
  width: 56px;
  height: 4px;
  margin-top: clamp(18px, 2.4vw, 28px);
  background: var(--accent-on-ink);
}

/* Facet field: drawn by facets.js, covers the cover and reaches below its edge. */
.facets {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 1;
  width: 100%;
  pointer-events: none;
  overflow: hidden;
}

.facets polygon {
  stroke-width: 0.75;
  stroke-linejoin: miter;
}

@media (prefers-reduced-motion: no-preference) {
  .facets polygon {
    opacity: 0;
    animation: facet-in 900ms cubic-bezier(.2, .7, .2, 1) forwards;
    animation-delay: var(--d, 0ms);
  }
  .facets polygon.breathe {
    animation: facet-in 900ms cubic-bezier(.2, .7, .2, 1) forwards,
               facet-breathe var(--b, 9s) ease-in-out infinite;
    animation-delay: var(--d, 0ms), calc(var(--d, 0ms) + 900ms);
  }
}

@keyframes facet-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

@keyframes facet-breathe {
  0%, 100% { opacity: 1; }
  50%      { opacity: .28; }
}

/* ---- Facts band (clocks on frommwieser.eu, register facts on alfro.de) --- */

.facts {
  position: relative;
  background: var(--page);
}

.facts .wrap {
  padding-block: clamp(32px, 4.5vw, 52px) clamp(44px, 6vw, 76px);
}

.fact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), max-content);
  gap: 28px clamp(32px, 5vw, 72px);
}

.fact { min-width: 0; }

.fact-label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--signal);
}

.fact-value {
  display: block;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.12rem;
  line-height: 1.3;
  color: var(--text);
}

.fact-note {
  display: block;
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Clocks */
.clocks .fact-value {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.clock-glyph { flex: none; width: 13px; height: 12px; }
.clock-glyph polygon { fill: var(--glyph, var(--signal)); }

@media (prefers-reduced-motion: no-preference) {
  .colon { animation: colon 2s steps(1, end) infinite; }
}

@keyframes colon { 50% { opacity: .25; } }

/* Clocks need JavaScript; without it the band stays empty instead of wrong. */
html:not(.js) .clocks { visibility: hidden; }

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

.bands {
  position: relative;
  min-height: 28px;
  flex: none;
  display: flex;
  align-items: center;
}

/* Copyright: on the ink band, flush with the right edge of the content. */
.footer-text {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
  padding-block: 5px;
}

.copyright {
  margin: 0;
  max-width: calc(79vw - 64px);   /* stays clear of the slanted signal band */
  font-size: 0.6875rem;
  line-height: 1.35;
  letter-spacing: 0.02em;
  text-align: right;
  text-wrap: balance;
  color: rgba(255, 255, 255, 0.82);
}

.band {
  position: absolute;
  top: 0;
  bottom: 0;
}

.band-signal {
  left: 0;
  width: calc(21% + 32px);
  background: var(--signal-band);
  clip-path: polygon(0 0, 100% 0, calc(100% - 32px) 100%, 0 100%);
}

.band-ink {
  right: 0;
  left: calc(21% + 8px);
  background: var(--ink);
  clip-path: polygon(32px 0, 100% 0, 100% 100%, 0 100%);
}

/* Short screens (small laptops, landscape): leave room for the band below. */
@media (max-height: 700px) {
  .cover { min-height: 52vh; min-height: 52svh; }
  .cover .wrap { gap: 28px; padding-block: 24px 32px; }
  .title { font-size: min(clamp(2.1rem, 1.05rem + 4.6vw, 4.8rem), 9.5vh); }
  .facts .wrap { padding-block: 26px 36px; }
}

/* ---- Small screens ---------------------------------------------------- */

@media (max-width: 720px) {
  .cover { min-height: 58vh; min-height: 58svh; }
  .fact-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts-3 .fact-list { grid-template-columns: minmax(0, 1fr); }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
