/* Text styling for basil.contovou.net.

Written in 2025 by Basil L. Contovounesios <basil@contovou.net>.

To the extent possible under law, the author has dedicated all
copyright and related and neighbouring rights to this software to
the public domain worldwide.  This software is distributed without
any warranty.

You should have received a copy of the CC0 Public Domain Dedication
along with this software.  If not, see
<https://creativecommons.org/publicdomain/zero/1.0>. */

@font-face {
  font-family: 'Alegreya';
  src: url('font/Alegreya-Black.woff2') format(woff2);
  font-display: block;
  font-style: normal;
  font-weight: 900;
}

@font-face {
  font-family: 'Alegreya';
  src: url('font/Alegreya-BlackItalic.woff2') format(woff2);
  font-display: block;
  font-style: italic;
  font-weight: 900;
}

@font-face {
  font-family: 'Alegreya';
  src: url('font/Alegreya-Bold.woff2') format(woff2);
  font-display: block;
  font-style: normal;
  font-weight: bold;
}

@font-face {
  font-family: 'Alegreya';
  src: url('font/Alegreya-BoldItalic.woff2') format(woff2);
  font-display: block;
  font-style: italic;
  font-weight: bold;
}

@font-face {
  font-family: 'Alegreya';
  src: url('font/Alegreya-ExtraBold.woff2') format(woff2);
  font-display: block;
  font-style: normal;
  font-weight: 800;
}

@font-face {
  font-family: 'Alegreya';
  src: url('font/Alegreya-ExtraBoldItalic.woff2') format(woff2);
  font-display: block;
  font-style: italic;
  font-weight: 800;
}

@font-face {
  font-family: 'Alegreya';
  src: url('font/Alegreya-Italic.woff2') format(woff2);
  font-display: block;
  font-style: italic;
  font-weight: normal;
}

@font-face {
  font-family: 'Alegreya';
  src: url('font/Alegreya-Medium.woff2') format(woff2);
  font-display: block;
  font-style: normal;
  font-weight: 500;
}

@font-face {
  font-family: 'Alegreya';
  src: url('font/Alegreya-MediumItalic.woff2') format(woff2);
  font-display: block;
  font-style: italic;
  font-weight: 500;
}

@font-face {
  font-family: 'Alegreya';
  src: url('font/Alegreya-Regular.woff2') format(woff2);
  font-display: block;
  font-style: normal;
  font-weight: normal;
}

@font-face {
  font-family: 'Alegreya Sans';
  src: url('font/AlegreyaSans-Black.woff2') format(woff2);
  font-display: block;
  font-style: normal;
  font-weight: 900;
}

@font-face {
  font-family: 'Alegreya Sans';
  src: url('font/AlegreyaSans-BlackItalic.woff2') format(woff2);
  font-display: block;
  font-style: italic;
  font-weight: 900;
}

@font-face {
  font-family: 'Alegreya Sans';
  src: url('font/AlegreyaSans-Bold.woff2') format(woff2);
  font-display: block;
  font-style: normal;
  font-weight: bold;
}

@font-face {
  font-family: 'Alegreya Sans';
  src: url('font/AlegreyaSans-BoldItalic.woff2') format(woff2);
  font-display: block;
  font-style: italic;
  font-weight: bold;
}

@font-face {
  font-family: 'Alegreya Sans';
  src: url('font/AlegreyaSans-ExtraBold.woff2') format(woff2);
  font-display: block;
  font-style: normal;
  font-weight: 800;
}

@font-face {
  font-family: 'Alegreya Sans';
  src: url('font/AlegreyaSans-ExtraBoldItalic.woff2') format(woff2);
  font-display: block;
  font-style: italic;
  font-weight: 800;
}

@font-face {
  font-family: 'Alegreya Sans';
  src: url('font/AlegreyaSans-Italic.woff2') format(woff2);
  font-display: block;
  font-style: italic;
  font-weight: normal;
}

@font-face {
  font-family: 'Alegreya Sans';
  src: url('font/AlegreyaSans-Light.woff2') format(woff2);
  font-display: block;
  font-style: normal;
  font-weight: 300;
}

@font-face {
  font-family: 'Alegreya Sans';
  src: url('font/AlegreyaSans-LightItalic.woff2') format(woff2);
  font-display: block;
  font-style: italic;
  font-weight: 300;
}

@font-face {
  font-family: 'Alegreya Sans';
  src: url('font/AlegreyaSans-Medium.woff2') format(woff2);
  font-display: block;
  font-style: normal;
  font-weight: 500;
}

@font-face {
  font-family: 'Alegreya Sans';
  src: url('font/AlegreyaSans-MediumItalic.woff2') format(woff2);
  font-display: block;
  font-style: italic;
  font-weight: 500;
}

@font-face {
  font-family: 'Alegreya Sans';
  src: url('font/AlegreyaSans-Regular.woff2') format(woff2);
  font-display: block;
  font-style: normal;
  font-weight: normal;
}

@font-face {
  font-family: 'Alegreya Sans';
  src: url('font/AlegreyaSans-Thin.woff2') format(woff2);
  font-display: block;
  font-style: normal;
  font-weight: 100;
}

@font-face {
  font-family: 'Alegreya Sans';
  src: url('font/AlegreyaSans-ThinItalic.woff2') format(woff2);
  font-display: block;
  font-style: italic;
  font-weight: 100;
}

@font-face {
  font-family: 'Commit Mono';
  src: url('font/CommitMono-VariableFont.woff2') format('woff2-variations');
  src: url('font/CommitMono-VariableFont.woff2') format(woff2) tech(variations);
  font-display: block;
  font-weight: 200 700;
}

@font-feature-values 'Commit Mono' {
  @styleset {
    dlig: 1 2;
    kern: 3 4 5;
  }
}

@font-face {
  font-family: 'GFS Didot';
  src: url('font/GFSDidot.woff2') format(woff2);
  font-display: block;
  font-style: normal;
  font-weight: normal;
}

@font-face {
  font-family: 'GFS Didot';
  src: url('font/GFSDidotBold.woff2') format(woff2);
  font-display: block;
  font-style: normal;
  font-weight: bold;
}

@font-face {
  font-family: 'GFS Didot';
  src: url('font/GFSDidotBoldItalic.woff2') format(woff2);
  font-display: block;
  font-style: italic;
  font-weight: bold;
}

@font-face {
  font-family: 'GFS Didot';
  src: url('font/GFSDidotItalic.woff2') format(woff2);
  font-display: block;
  font-style: italic;
  font-weight: normal;
}

:root {
  --serif: 'Alegreya', serif;
  --serif-greek: 'GFS Didot', var(--serif);
  --sans: 'Alegreya Sans', sans-serif;
  --mono: 'Commit Mono', monospace;

  --small: clamp(0.8rem, 0.75rem + 0.2vw, 0.9rem);
  --medium: clamp(1rem, 0.95rem + 0.3vw, 1.2rem);
  --large: clamp(1.25rem, 1.2rem + 0.3vw, 1.5rem);

  --features: 'ccmp', 'locl', 'mark', 'mkmk';

  --mono-weight-light: 450;
  --mono-weight-dark: 400;
  --mono-weight: var(--mono-weight-light);
  --mono-italic: 0;

  &:has(.theme-light > :checked) {
    --mono-weight: var(--mono-weight-light);
  }

  &:has(.theme-dark > :checked) {
    --mono-weight: var(--mono-weight-dark);
  }

  font-feature-settings: var(--features);
  font-size-adjust: from-font;
  font-synthesis: none;
  hyphens: auto;
  text-decoration-thickness: from-font;
  text-rendering: optimizeLegibility;
  text-underline-position: from-font;
}

@media (prefers-color-scheme: dark) {
  :root {
    --mono-weight: var(--mono-weight-dark);
  }
}

.caps {
  font-feature-settings: 'case', 'cpsp', var(--features);
  text-wrap-mode: nowrap;
}

.pub-title {
  font-family: var(--sans);
  font-size: var(--medium);
  font-weight: bold;
}

.pub-authors {
  font-size: smaller;
  font-style: normal;
}

.pub-me {
  font-weight: bold;
}

.pub-venue {
  font-size: smaller;
  font-style: italic;
}

.pub-abstract {
  font-size: var(--small);

  summary {
    font-family: var(--sans);
  }
}

body {
  font-family: var(--serif);
  font-size: var(--medium);
  line-height: 1.5;

  :lang(el) {
    font-family: var(--serif-greek);
  }
}

header, h1 {
  font-family: var(--sans);
}

h3 {
  font-size: var(--medium);
  font-weight: normal;
}

address {
  font-style: normal;
}

code {
  font-family: var(--mono);
  font-weight: var(--mono-weight);
  font-variant-alternates: styleset(kern);
  font-variation-settings: 'wght' var(--mono-weight), 'ital' var(--mono-italic);
}

#home {
  font-size: larger;
}

#theme-label {
  font: caption;
}

footer {
  font-family: var(--sans);
  font-size: var(--small);

  p {
    text-wrap: balance;
  }
}

@supports (text-wrap: pretty) {
  p, footer p, .pub-abstract {
    text-wrap: pretty;
  }
}

q:lang(en) {
  quotes: '‘' '’' '“' '”';
}
