/* Trilode – minimal site. No external requests: all fonts are served from assets/fonts.
   Font paths are relative to this file, so the site also works when opened straight from the folder. */

/* Headings and interface: Instrument Sans (SIL OFL 1.1) */
@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/instrument-sans.woff2") format("woff2-variations"),
       url("fonts/instrument-sans.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

/* Body text and wordmark: Newsreader (SIL OFL 1.1) */
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("fonts/newsreader-opsz.woff2") format("woff2-variations"),
       url("fonts/newsreader-opsz.woff2") format("woff2");
}
@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url("fonts/newsreader-italic.woff2") format("woff2-variations"),
       url("fonts/newsreader-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url("fonts/newsreader-italic-ext.woff2") format("woff2-variations"),
       url("fonts/newsreader-italic-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

:root {
  --paper: #ffffff;
  --ink: #000000;
  --vein: #b5121b;     /* red: links, the rule beside the dictionary entry */
  --muted: #5c5c5c;    /* 6.7:1 on white */
  --grey: #737373;     /* 4.7:1 on white: inactive language */
  --measure: 38rem;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: 1.125rem;
  line-height: 1.6;
  font-kerning: normal;
  overflow-wrap: break-word;
}

h1, h2 {
  font-family: var(--sans);
  font-weight: 500;
  color: var(--ink);
}
:lang(de) h1, :lang(de) h2, :lang(de) p, :lang(de) li { hyphens: auto; }
/* Compounds the browser's dictionary splits badly ("Analy-sewerkzeuge"): break only at &shy; */
.manual-hyphens { hyphens: manual; }

.wrap {
  width: 100%;
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding-inline: var(--gutter);
}

/* Header: wordmark left, language switch right */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-block: clamp(1.25rem, 4vw, 2.25rem);
}
.wordmark {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
}

.lang-switch {
  display: flex;
  gap: 0.9rem;
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1;
}
/* The other language is greyed out: grey text (still 4.5:1 contrast, WCAG AA) and a greyscale flag */
.lang-switch a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.75rem;     /* 44 px tap target on phones */
  color: var(--grey);
  text-decoration: none;
  transition: color .2s;
}
.lang-switch img {
  display: block;
  width: 1.3125rem;
  height: 0.875rem;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .14);
  filter: grayscale(1);
  opacity: 0.5;
  transition: filter .2s, opacity .2s;
}
.lang-switch a:hover,
.lang-switch a:focus-visible,
.lang-switch a[aria-current] { color: var(--ink); }
.lang-switch a:hover img,
.lang-switch a:focus-visible img,
.lang-switch a[aria-current] img {
  filter: none;
  opacity: 1;
}

/* Links */
a {
  color: var(--vein);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover { text-decoration-thickness: 2px; }
a:focus-visible {
  outline: 2px solid var(--vein);
  outline-offset: 3px;
  border-radius: 2px;
}
.wordmark:focus-visible, .lang-switch a:focus-visible { outline-color: var(--ink); }

/* Landing */
main { flex: 1 0 auto; }

.home {
  padding-block: clamp(1.5rem, 7vh, 5rem) clamp(2.5rem, 8vh, 5rem);
}

/* Dictionary entry at the top of the landing page */
.entry {
  margin: 0 0 clamp(2.5rem, 7vh, 4rem);
  padding-left: 1rem;
  border-left: 2px solid var(--vein);
  line-height: 1.5;
}
.home .entry p { margin: 0; }
.entry .hw {
  font-style: normal;
  font-weight: 650;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}
.entry .pron,
.entry .pos { color: var(--muted); }
.entry .sense { margin-top: 0.3rem; }
.entry .etym {
  margin-top: 0.3rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.home h1 {
  font-size: clamp(2.25rem, 1.5rem + 3.4vw, 3.5rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0 0 1.5rem;
  text-wrap: balance;
}

.home p {
  max-width: 34em;
  margin: 0 0 1.1rem;
}

.email { white-space: nowrap; }

/* Legal pages */
.legal {
  padding-block: clamp(1rem, 5vh, 3.5rem) clamp(2.5rem, 8vh, 5rem);
}
.legal h1 {
  font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.35rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 1.5rem;
}
.legal h2 {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.005em;
  margin: 2.25rem 0 0.6rem;
}
.legal p, .legal ul, .legal address {
  max-width: 36em;
  margin: 0 0 1rem;
}
.legal address { font-style: normal; }
.legal ul { padding-left: 1.2rem; }
.legal li { margin-bottom: 0.35rem; }
.legal .note {
  font-size: 0.95rem;
  color: var(--muted);
}

/* Footer */
.site-footer {
  padding-block: 1rem max(1.5rem, env(safe-area-inset-bottom));
  font-family: var(--sans);
  font-size: 0.875rem;
  color: var(--muted);
}
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  align-items: baseline;
}
.site-footer a {
  display: inline-block;
  padding-block: 0.5rem;   /* comfortable tap target */
  color: var(--muted);
}
.site-footer a:hover { color: var(--vein); }

/* Phones */
@media (max-width: 30rem) {
  body { font-size: 1.0625rem; }
  .lang-switch { gap: 0.75rem; }
  .entry .hw { font-size: 1.375rem; }
}

@media print {
  .lang-switch { display: none; }
  a { color: var(--ink); }
}
