/* Orlinis — personal website.
   Minimal single-page site. Layout, proportions and motion follow the
   reference minimal personal site (white background, 780px column,
   Times New Roman headlines, DM Sans body, DM Mono labels, quick .15s hovers),
   with a navy blue accent instead of purple and all-original text. */

/* Tinos is self-hosted so the Times face loads from the site itself —
   Android has no Times New Roman, and a third-party font request
   is one more thing that can fail to load. */
@font-face {
  font-family: "Tinos";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/tinos-latin-400.woff2") format("woff2");
}

@font-face {
  font-family: "Tinos";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/tinos-latin-700.woff2") format("woff2");
}

:root {
  --bg: #ffffff;
  --bg2: #f5f5f5;
  --ink: #1c1a17;
  --muted: #6a6050;
  --faint: #706860;
  --border: #ddd6c8;
  --border-soft: #e8e2d6;
  --accent: #1e3a5f;
  --accent-soft: #2c5282;
  --selection-bg: #dbeafe;
}

[data-theme="dark"] {
  --bg: #141210;
  --bg2: #1d1b17;
  --ink: #e8e2d6;
  --muted: #8a8070;
  --faint: #8c8070;
  --border: #2a2820;
  --border-soft: #232118;
  --accent: #7ea6d8;
  --accent-soft: #a8c4e4;
  --selection-bg: #16283f;
}

* {
  box-sizing: border-box;
}

html {
  background-color: var(--bg);
  transition: background-color 0.3s ease;
  scroll-behavior: smooth;
}

/* While the theme is switching, every themed property fades at the
   same speed, so the whole screen changes as one uniform wash
   instead of in separate blocks. */
.theme-switching *,
.theme-switching *::before,
.theme-switching *::after {
  transition: background-color 0.3s ease, color 0.3s ease,
    border-color 0.3s ease, opacity 0.3s ease !important;
}

body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  position: relative;
  color: var(--ink);
  background-color: var(--bg);
  font-family: "DM Sans", "Helvetica Neue", sans-serif;
  font-size: 14px;
  line-height: 1.65;
  transition: background-color 0.3s ease, color 0.3s ease;
}

::selection {
  background: var(--selection-bg);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- Nav ---------- */
.main-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 48px 36px 36px;
  max-width: 780px;
  margin: 0 auto;
  transition: background-color 0.3s ease;
}

.logo {
  font-family: "Caveat", cursive;
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  line-height: 1;
  position: relative;
  transition: color 0.3s ease;
}

.logo:hover {
  color: var(--accent);
}

.logo:active {
  color: var(--accent);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  font-family: "DM Mono", monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--faint);
  text-decoration: none;
  position: relative;
  transition: color 0.15s ease, opacity 0.15s ease;
}

.nav-link:hover {
  color: var(--accent);
}

.nav-link:active {
  opacity: 0.7;
}

/* Current page: green link with a dot underneath. */
.nav-link.active {
  color: var(--accent);
}

.nav-link.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateX(-50%);
}

/* ---------- Light / dark toggle: animated sun / moon ---------- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: none;
  border: 1px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  margin: 0;
  color: var(--faint);
  line-height: 1;
  position: relative;
  overflow: hidden;
  transition: color 0.15s ease, border-color 0.2s ease,
    background-color 0.3s ease, opacity 0.15s ease;
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--border);
  background: var(--bg2);
}

.theme-toggle:active {
  opacity: 0.55;
}

.theme-toggle .icon {
  position: absolute;
  width: 18px;
  height: 18px;
  transition: opacity 0.2s ease;
}

/* Light mode: show the moon (tap to go dark). Dark mode: show the sun. */
.theme-toggle .icon-moon {
  opacity: 1;
}

.theme-toggle .icon-sun {
  opacity: 0;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  opacity: 0;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  opacity: 1;
}

/* ---------- Content ---------- */
.content {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 36px;
}

.hero {
  margin-bottom: 80px;
}

.hero-headline {
  font-family: "Times New Roman", "Tinos", Times, serif;
  font-size: 38px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0 0 16px;
  max-width: 520px;
  transition: color 0.3s ease;
}

.hero-bio {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.72;
  margin: 0 0 20px;
  max-width: 480px;
  transition: color 0.3s ease;
}

.hero-bio a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.hero-bio a:hover {
  opacity: 0.7;
  text-decoration: underline;
}

/* ---------- Books ---------- */
.book-label {
  font-family: "DM Mono", monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--faint);
  margin: 28px 0 0;
}

.book-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 560px;
}

.book-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.book-list li:first-child {
  border-top: 1px solid var(--border);
}

.book-title {
  font-size: 16px;
}

/* Book links: plain text colour, never underlined — they turn
   red on hover or press, and take you to the article on click. */
.book-list a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

.book-list a:hover,
.book-list a:active {
  color: var(--accent);
}

.book-date {
  font-family: "DM Mono", monospace;
  font-size: 12px;
  color: var(--faint);
  white-space: nowrap;
}

/* ---------- Footer ---------- */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 780px;
  margin: 56px auto 0;
  padding: 28px 36px;
  transition: background-color 0.3s ease;
}

.footer-copyright {
  font-family: "DM Mono", monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--faint);
  transition: color 0.3s ease;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.footer-link {
  font-family: "DM Mono", monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--faint);
  text-decoration: none;
  transition: color 0.15s ease, opacity 0.15s ease;
}

.footer-link:hover {
  color: var(--accent);
}

.footer-link:active {
  opacity: 0.7;
}

.footer-top {
  font-family: "DM Mono", monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--faint);
  text-decoration: none;
  transition: color 0.15s ease, opacity 0.15s ease;
}

.footer-top:hover {
  color: var(--accent);
}

.footer-top:active {
  opacity: 0.7;
}

/* ---------- Small screens ---------- */
@media (max-width: 590px) {
  .main-nav {
    padding: 28px 24px 20px;
  }

  .content,
  .site-footer {
    padding-left: 24px;
    padding-right: 24px;
  }

  .hero {
    margin-bottom: 56px;
  }

  .hero-headline {
    font-size: 30px;
  }

  .site-footer {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 16px;
    padding-top: 28px;
    padding-bottom: 20px;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  html {
    scroll-behavior: auto;
  }
}
