/* Shared by every page of mimimi.hr. The home page adds its own rules for
   the rotated text block inline. */

/* Inter 4 Regular, subset to Latin, punctuation and arrows (OFL, see
   fonts/Inter-LICENSE.txt). Self-hosted so no third party sees visitors. */
@font-face {
  font-family: "Inter";
  src: url("/fonts/Inter-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root { --bg: #fff; --ink: #000; --dim: rgba(0, 0, 0, 0.5); }
@media (prefers-color-scheme: dark) {
  :root { --bg: #000; --ink: #fff; --dim: rgba(255, 255, 255, 0.5); }
}

* { box-sizing: border-box; margin: 0; padding: 0; font: inherit; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 13px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--ink); color: var(--bg); }
ul { list-style: none; }
.nowrap { white-space: nowrap; }

a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; transition: color 120ms ease; }
a:focus-visible { outline: 1px solid var(--ink); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  a:hover { color: var(--dim); }
}

/* One column; items that share a row sit in the same cell and are pushed
   to its sides with justify-self. The name, the menu and the mail share
   the top row. */
.site {
  display: grid;
  min-height: 100vh; min-height: 100dvh;
  padding: 20px 24px;
  overflow-x: clip;
}
.site > * { grid-column: 1; }

/* The rule between the name and the tagline is drawn rather than typed,
   so on phones it can stretch to the right margin. It copies Inter's em
   dash: three of them wide, 0.08em thick, 0.27em above the baseline. */
.brand { grid-row: 1; align-self: start; justify-self: start; display: flex; align-items: baseline; gap: 0.26em; white-space: nowrap; text-decoration: none; }
.brand .rule { flex: none; width: 2.94em; height: 0.08em; background: currentColor; transform: translateY(-0.27em); }

.nav { grid-row: 1; align-self: start; justify-self: center; display: flex; gap: 16px; }
.nav a { text-decoration: none; }
.nav a[aria-current="page"] { text-decoration: underline; }

.mail { grid-row: 1; align-self: start; justify-self: end; }

/* Text pages: label on the left, text on the right, centred under the
   header. */
.page { grid-template-rows: auto 1fr; }
.doc { grid-row: 2; justify-self: center; width: min(560px, 100%); padding: 120px 0 96px; line-height: 1.3; }
.doc section { display: grid; grid-template-columns: 136px minmax(0, 1fr); column-gap: 24px; }
.doc section + section { margin-top: 28px; }
.doc h1, .doc h2 { color: var(--dim); }
.doc section > div > * + * { margin-top: 8px; }
.doc .foot { margin: 56px 0 0 160px; color: var(--dim); }

/* Phones and narrow windows: the name spans the width with the menu under
   it, and the mail moves to the bottom-left corner. */
@media (max-width: 860px) {
  .site { padding: 20px 16px; }
  .brand { justify-self: stretch; }
  .brand .rule { flex: 1; }
  .nav { justify-self: start; margin-top: calc(1.1em + 8px); }
  .mail { grid-row: 3; align-self: end; justify-self: start; }
  .page { grid-template-rows: auto 1fr auto; }
  .doc { padding: 72px 0 48px; }
  .doc section { grid-template-columns: minmax(0, 1fr); row-gap: 6px; }
  .doc .foot { margin-left: 0; }
}
