/* Base styles shared by every page outside the blog:
   fonts, theme tokens, elements, typography, buttons and the theme toggle. */

/* Fonts ---------------------------------------------------------------- */

@font-face {
  font-family: 'Heebo';
  font-style: normal;
  font-weight: 400;
  src: url('fonts/heebo/heebo-v17-latin-regular.woff2') format('woff2');
}

@font-face {
  font-family: 'Heebo';
  font-style: normal;
  font-weight: 600;
  src: url('fonts/heebo/heebo-v17-latin-600.woff2') format('woff2');
}

@font-face {
  font-family: 'Heebo';
  font-style: normal;
  font-weight: 700;
  src: url('fonts/heebo/heebo-v17-latin-700.woff2') format('woff2');
}

@font-face {
  font-family: 'Source Sans Pro';
  font-style: normal;
  font-weight: 400;
  src: url('fonts/source-sans-pro/source-sans-pro-v18-latin-regular.woff2') format('woff2');
}

@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 400;
  src: url('fonts/playfair-display/playfair-display-v28-latin-regular.woff2') format('woff2');
}

@font-face {
  font-family: 'Playfair Display';
  font-style: italic;
  font-weight: 400;
  src: url('fonts/playfair-display/playfair-display-v28-latin-italic.woff2') format('woff2');
}

/* Icon font: only the glyphs listed under "Icons" below are used. */
@font-face {
  font-family: 'fontello';
  font-style: normal;
  font-weight: normal;
  src: url('fonts/fontello/font/fontello.woff2?51594689') format('woff2');
}

/* Theme tokens ----------------------------------------------------------
   Light is the default; js/theme.js (inlined in each <head>) sets
   data-theme="dark" on <html> before first paint. */

:root {
  --bg-primary: #faf6f1;
  --text-primary: #2f2e2b;
  --text-secondary: #4a4a4a;
  --text-muted: #666666;
  --accent-primary: #2f2e2b;
  --accent-hover: #534c46;
  --border-color: #eeeeee;
  --card-shadow: #ebe7e2;
}

[data-theme="dark"] {
  --bg-primary: #1a1a1a;
  --text-primary: #e0e0e0;
  --text-secondary: #b0b0b0;
  --text-muted: #888888;
  --accent-primary: #e0e0e0;
  --accent-hover: #c0c0c0;
  --border-color: #333333;
  --card-shadow: rgba(0, 0, 0, 0.4);
}

/* Elements ------------------------------------------------------------- */

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

html {
  font-size: 100%;
  -webkit-font-smoothing: antialiased;
  background-color: var(--bg-primary);
}

/* Set while the page loads so the theme does not animate in. */
html.no-transition,
html.no-transition *,
html.no-transition *::before,
html.no-transition *::after {
  transition: none !important;
  animation: none !important;
}

body {
  margin: 0;
  font-family: 'Heebo', sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-text-size-adjust: none;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  transition: background-color 0.5s ease, color 0.5s ease;
  transition-delay: 0.25s;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  outline: none;
}

a:hover {
  color: #000;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 3px;
}

ul {
  margin: 0.2em 0 1em 0;
  list-style: disc;
}

img,
figure {
  max-width: 100%;
  height: auto;
}

::selection {
  text-shadow: none;
  color: #333;
  background: #f6dcb9;
}

@media screen and (min-width: 992px) {
  *::-webkit-scrollbar {
    width: 8px;
  }

  *::-webkit-scrollbar:horizontal {
    height: 8px;
  }

  *::-webkit-scrollbar-thumb {
    border-radius: 4px;
    background-color: rgba(28, 38, 43, 0.2);
  }
}

/* Typography ----------------------------------------------------------- */

h1,
h2,
h3,
h4,
h5 {
  font-family: 'Playfair Display', serif;
}

h1 {
  font-size: 1.8em;
  font-weight: 400;
  line-height: 1.2;
  margin: 0.8em 0 0.4em 0;
  word-wrap: break-word;
}

h2 {
  font-size: 1.2em;
  line-height: 1.3;
  margin: 1em 0 0.6em 0;
}

h3 {
  font-size: 1em;
  font-weight: 700;
  margin: 1em 0 0.6em 0;
}

h4 {
  font-size: 0.9em;
  margin: 2em 0 0.6em 0;
}

h5 {
  font-size: 0.9em;
  margin: 1em 0 0.6em 0;
}

@media screen and (min-width: 768px) {
  h1 { font-size: 54px; }
  h2 { font-size: 28px; }
  h3 { font-size: 18px; }
  h4 { font-size: 1em; }
}

p {
  margin: 1em 0 1.4em 0;
}

code {
  display: inline-block;
  max-width: 100%;
  overflow: auto;
  margin: 0 0.4em;
  padding: 1px 6px;
  font-family: Monaco, Menlo, Consolas, "Courier New", monospace;
  font-size: 12px;
  white-space: pre;
  color: #333333;
  background: #fff;
  border: 1px solid #dde4e6;
  box-shadow: 1px 1px 0 #fff, 2px 2px 0 #dde4e6;
}

[data-theme="dark"] code {
  color: #d0d0d0;
  background-color: #2a2a2a;
  border-color: #3a3a3a;
  box-shadow: 1px 1px 0 #2a2a2a, 2px 2px 0 #3a3a3a;
}

.center {
  text-align: center;
}

/* Icons (fontello) -----------------------------------------------------
   Glyphs: user, vcard (card nav), external (buttons), up-open-big
   (back to top), way (404). */

[class^="pw-icon-"]::before {
  display: inline-block;
  width: 1em;
  margin-right: 0.2em;
  margin-left: 0.2em;
  font-family: "fontello";
  font-style: normal;
  font-weight: normal;
  font-variant: normal;
  line-height: 0.8em;
  text-align: center;
  text-decoration: inherit;
  text-transform: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.pw-icon-vcard::before { content: '\e83a'; }
.pw-icon-user::before { content: '\e85e'; }
.pw-icon-external::before { content: '\e86a'; }
.pw-icon-up-open-big::before { content: '\e86f'; }
.pw-icon-way::before { content: '\e878'; }

/* Skip link ------------------------------------------------------------ */

.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1000;
  padding: 0.6rem 1rem;
  color: #fff;
  background: #111;
  transform: translateY(-120%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* Buttons --------------------------------------------------------------
   .button is a link styled as an outlined button whose fill slides in
   from the left on hover (the ::after layer). */

button,
.button {
  display: inline-block;
  position: relative;
  overflow: hidden;
  margin: 10px 20px 0 0;
  padding: 18px 32px;
  font-family: inherit;
  font-size: 11px;
  font-weight: bold;
  line-height: 1;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
  color: #534c46;
  background: none;
  border: 1px solid #bcb1a6;
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  transition: all 0.3s;
}

button:not(.button):hover {
  color: #fff;
  background: #bcb1a6;
}

.button:last-child {
  margin-right: 0;
}

.button::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  z-index: -1;
  width: 0%;
  height: 100%;
  background: #bcb1a6;
}

.button:hover,
.button:active {
  color: #fff !important;
}

.button:hover::after,
.button:active::after {
  width: 100%;
}

.button:active {
  outline: 0;
  transform: scale(0.9);
  transition: all 0.1s;
}

.button i {
  display: inline-block;
  margin-right: 5px;
}

.button i::before {
  font-size: 120%;
}

[data-theme="dark"] .button {
  color: #e0e0e0;
  border-color: #7a7a7a;
}

[data-theme="dark"] .button:hover {
  background: #7a7a7a;
}

[data-theme="dark"] .button.secondary {
  color: #d0d0d0;
  border-color: #6a6a6a;
}

[data-theme="dark"] .button.secondary::after {
  background: #6a6a6a;
}

/* Theme toggle ---------------------------------------------------------
   .theme-toggle floats top right; .theme-toggle-footer sits in the home
   page footer. Both show the moon in light mode and the sun in dark. */

.theme-toggle,
.theme-toggle-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  background: transparent;
  border: none;
  opacity: 0.6;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
}

.theme-toggle-footer {
  position: static;
  display: inline-flex;
  vertical-align: middle;
  margin-right: 0.5rem;
}

.theme-toggle:hover,
.theme-toggle-footer:hover {
  opacity: 1;
}

.theme-toggle svg,
.theme-toggle-footer svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--text-primary);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.3s ease;
}

.icon-sun,
[data-theme="dark"] .icon-moon {
  display: none;
}

.icon-moon,
[data-theme="dark"] .icon-sun {
  display: block;
}
