/* Fonts: Lora and Fira Sans (SIL Open Font License 1.1), latin subsets from @fontsource,
   self-hosted so a visit sends nothing to a third party. */
@font-face {
  font-family: 'Lora';
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url('/fonts/lora-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Fira Sans';
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url('/fonts/fira-sans-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Fira Sans';
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url('/fonts/fira-sans-latin-700-normal.woff2') format('woff2');
}

/* Medaffcon's own palette, read from medaffcon.com on 2026-10-09. */
:root {
  --red: #c61531;
  --rose: #894754;
  --pink: #eddee0;
  --ink: #333333;
  --paper: #ffffff;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --measure: 62rem;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Fira Sans', system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.5;
}

.masthead,
main,
footer {
  width: 100%;
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* The red block hangs from the top edge of the page, tilted like the block in Medaffcon's logo. */
.masthead {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  height: 6.5rem;
  overflow: hidden;
}

.mark {
  flex: none;
  align-self: flex-start;
  width: 3.75rem;
  height: 5.5rem;
  margin-top: -1rem;
  border-radius: 0.75rem;
  background: var(--red);
  transform: rotate(-8deg);
}

.wordmark {
  padding-bottom: 0.35rem;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

main {
  align-self: center;
  padding-block: clamp(2.5rem, 8vh, 5rem);
}

h1 {
  margin: 0 0 clamp(2rem, 6vh, 3.5rem);
  max-width: 14ch;
  color: var(--rose);
  font-family: 'Lora', Georgia, serif;
  font-weight: 400;
  font-size: clamp(2.5rem, 7.5vw, 4.75rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.tools {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.tool {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: clamp(1.25rem, 3vw, 1.75rem) clamp(1.25rem, 3vw, 2rem);
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  transition:
    background-color 120ms ease-out,
    border-color 120ms ease-out,
    color 120ms ease-out;
}

.tool-text {
  display: grid;
  gap: 0.25rem;
}

.tool-name {
  font-weight: 700;
  font-size: clamp(1.25rem, 2.6vw, 1.625rem);
  line-height: 1.2;
}

.tool-about {
  max-width: 56ch;
}

.tool-open {
  flex: none;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
}

.tool:active {
  background: var(--pink);
}

@media (hover: hover) {
  .tool:hover {
    background: var(--red);
    border-color: var(--red);
    color: var(--paper);
  }
}

.tool:focus-visible,
footer a:focus-visible {
  outline: 3px solid var(--rose);
  outline-offset: 4px;
}

footer {
  padding-block: 1.5rem 2rem;
  font-size: 0.9375rem;
}

footer a {
  color: var(--rose);
  text-underline-offset: 0.25em;
}

@media (max-width: 34rem) {
  .tool {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tool {
    transition: none;
  }
}
