/* hendraatmaja.com
   Palette from Javanese batik: wedel (indigo dye), mori (undyed cotton), soga (brown dye). */

@font-face {
  font-family: "Bodoni Moda";
  src: url("/fonts/bodoni-moda-v1.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --wedel: #16244b;
  --mori: #efe8d8;
  --haze: #9aa7cc;
  --soga: #d0935a;

  --cols: 4;
  --rows: 3;
  --pad: clamp(1.25rem, 4.5vw, 4.5rem);
  --foot: 6.5rem;

  /* Letter size follows whichever runs out first: column width or row height. */
  --view-h: 100vh;
  --size: min(
    calc((100vw - 2 * var(--pad)) / var(--cols) * 0.86),
    calc((var(--view-h) - var(--foot)) / var(--rows) * 0.86)
  );
  /* One column is as wide as the widest letter (M). Columns spread edge to edge. */
  --box: calc(var(--size) * 0.82);

  color-scheme: dark;
}

@supports (height: 100dvh) {
  :root {
    --view-h: 100dvh;
  }
}

/* Tall screens: the same twelve letters break into four rows of three. */
@media (max-aspect-ratio: 1/1) {
  :root {
    --cols: 3;
    --rows: 4;
  }
}

html {
  background: var(--wedel);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  padding-inline: var(--pad);
  display: grid;
  grid-template-rows: 1fr auto;
  color: var(--mori);
  font-family: "Bodoni Moda", "Bodoni 72", Didot, "Bodoni MT", serif;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

main {
  display: grid;
}

.block {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(var(--cols), var(--box));
  grid-template-rows: repeat(var(--rows), 1fr);
  justify-content: space-between;
  align-items: center;
  font-size: var(--size);
  font-weight: 500;
  line-height: 1;
}

.block span {
  /* Pull each letter back by its side bearing so the stems line up with the links below. */
  margin-left: -0.014em;
  transition: color 0.5s ease;
}

.block span.unset {
  color: var(--haze);
  opacity: 0.5;
  transition: none;
}

/* Contact links: centred under the block, icons from Bootstrap Icons (MIT). */
.links {
  min-height: var(--foot);
  box-sizing: border-box;
  padding-top: 0.75rem;
  padding-bottom: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.25rem 2rem;
  font-size: 1.0625rem;
  line-height: 1.4;
  letter-spacing: 0.01em;
}

.links a {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 2.75rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

.links a:hover {
  color: var(--soga);
}

.links a.mark {
  min-width: 2.75rem;
  justify-content: center;
}

.links svg {
  flex: none;
  width: 1.375rem;
  height: 1.375rem;
  fill: currentColor;
}

a {
  justify-self: start;
  color: var(--mori);
  text-decoration: underline;
  text-decoration-color: rgb(154 167 204 / 0.55);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.32em;
  transition: text-decoration-color 0.2s ease;
}

a:hover {
  text-decoration-color: var(--soga);
}

a:focus-visible {
  outline: 2px solid var(--soga);
  outline-offset: 5px;
  border-radius: 1px;
}

/* 404 page */
.lost {
  align-self: center;
  max-width: 34rem;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  line-height: 1.25;
  font-weight: 500;
}

.lost p {
  margin: 0 0 1.5rem;
}

.lost a {
  font-size: 1.0625rem;
}

/* Contact-card pages (/gotrade-vqr, /gotrade-id-vqr): name, QR code, save button. */
body.contact {
  box-sizing: border-box;
  grid-template-rows: none;
  place-items: center;
  padding-block: 1.5rem;
}

.vcard {
  width: min(100%, 22rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.vcard h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 500;
  line-height: 1.15;
}

.vcard .role {
  margin: 0.4rem 0 0;
  font-size: 1.0625rem;
  line-height: 1.4;
  color: var(--haze);
}

/* The QR stays dark on white with its own margin: that is what cameras read best. */
.vcard .qr {
  margin-top: 1.75rem;
  width: min(100%, 52vh);
  height: auto;
  border-radius: 0.75rem;
}

.vcard .hint {
  margin: 1.5rem 0 0;
  max-width: 17rem;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--haze);
}

.vcard .save {
  margin-top: 1rem;
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 1.5rem;
  border-radius: 0.5rem;
  background: var(--mori);
  color: var(--wedel);
  font-size: 1.0625rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.vcard .save:hover {
  background: var(--soga);
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
