/*
 * vrypan.net home — shares the look & feel of the blog (vrypan2026 theme)
 * so moving between vrypan.net and blog.vrypan.net feels like one site.
 * Palette, typography, layout and the auto/light/dark toggle are kept in
 * sync with blog.vrypan.net's theme; only the navigation differs.
 */

:root {
  color-scheme: dark;
  /* Slightly cooler "paper" than the blog (#1a1714) so visitors can tell
     they're on vrypan.net, not the blog — same everything else. */
  --color-page: #15171a;
  --color-text: #d9cfc4;
  --color-heading: #f2eae2;
  --color-link: #e6705a;
  --color-link-hover: #f0917f;
  --color-muted: #9a8e82;
  --color-faint: #6f655b;
  --color-border: #38302a;
  --color-panel: #241f1b;
  --color-highlight: rgba(240, 190, 95, 0.28);
  --color-title: #cdbfb2;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-body: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "Noto Serif", Cambria, Georgia, serif;
  --font-heading: var(--font-sans);
  --font-display: "Archivo Expanded", "Arial Narrow", var(--font-sans);

  --container-width: 960px;
  --sidebar-width: 184px;
  --content-width: 68ch;
}

/* Light palette — applied via prefers-color-scheme (set by the inline
   no-FOUC script) or the manual toggle (data-theme="light"). */
:root[data-theme="light"] {
  color-scheme: light;
  /* Cooler paper than the blog (#f6f1e8). */
  --color-page: #eef1f4;
  --color-text: #3c352d;
  --color-heading: #221d18;
  --color-link: #bf4f2c;
  --color-link-hover: #9c3c1d;
  --color-muted: #786d60;
  --color-faint: #9c9183;
  --color-border: #e3dccf;
  --color-panel: #efe8dc;
  --color-highlight: rgba(216, 150, 40, 0.22);
  --color-title: #4a4137;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--color-page);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-page);
  color: var(--color-text);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body :target,
body [fragmention] {
  background-color: var(--color-highlight);
}

a {
  color: var(--color-link);
  text-decoration: none;
  text-underline-offset: 0.16em;
}

a:hover,
a:focus {
  color: var(--color-link-hover);
  text-decoration: underline;
}

a:focus-visible {
  outline: 2px solid var(--color-link);
  outline-offset: 3px;
}

p {
  margin: 0 0 1.05rem;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--color-heading);
  font-family: var(--font-heading);
  line-height: 1.3;
  letter-spacing: -0.011em;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

button,
input,
select {
  font: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  white-space: nowrap;
  border: 0;
  clip: rect(0, 0, 0, 0);
}

.muted {
  color: var(--color-muted);
}

/* ============================================================
   Layout: sticky left sidebar + main column
   ============================================================ */

.site {
  display: flex;
  gap: 3.5rem;
  width: min(var(--container-width), calc(100% - 2rem));
  margin: 0 auto;
  padding: 3.25rem 0 5rem;
}

.sidebar {
  flex: 0 0 var(--sidebar-width);
}

.sidebar-inner {
  position: sticky;
  top: 2.5rem;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 4.25rem;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background: var(--color-panel);
}

.brand-mark img {
  width: 44px;
  height: 44px;
  object-fit: cover;
}

.mobile-title {
  display: none;
}

.nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  margin-left: -0.45rem;
  margin-bottom: 2.4rem;
}

.nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 1.55rem;
  font-family: var(--font-sans);
  color: var(--color-muted);
  font-size: 0.94rem;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  transition: color 160ms ease, opacity 160ms ease;
}

.nav a::before {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  content: "";
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 160ms ease, transform 160ms ease;
}

.nav a[aria-current="page"],
.nav a:hover,
.nav a:focus {
  color: var(--color-link);
  text-decoration: none;
}

.nav a[aria-current="page"]::before,
.nav a:hover::before,
.nav a:focus::before {
  opacity: 1;
  transform: scale(1);
}

.nav a .ext-icon {
  width: 0.85em;
  height: 0.85em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.55;
  transition: opacity 160ms ease;
}

.nav a:hover .ext-icon,
.nav a:focus .ext-icon {
  opacity: 1;
}

.main {
  flex: 1 1 auto;
  min-width: 0;
  max-width: var(--content-width);
}

.site-title {
  margin: 0 0 5.1rem;
  color: var(--color-title);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.015em;
  line-height: 1.25;
  text-transform: uppercase;
}

.site-title a {
  color: inherit;
  text-decoration: none;
}

.desktop-title {
  display: flex;
  align-items: center;
  min-height: 44px;
  margin-bottom: 4.25rem;
}

/* ============================================================
   Theme switch: auto / light / dark (icon + label, all clickable)
   ============================================================ */

.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.6rem 0 0 -0.35rem;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--color-muted);
  font: inherit;
  cursor: pointer;
}

.theme-switch:focus-visible {
  outline: 2px solid var(--color-link);
  outline-offset: 2px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 2rem;
  height: 2rem;
  border-radius: 4px;
  color: var(--color-muted);
  transition: background-color 160ms ease, color 160ms ease;
}

.theme-switch:hover .theme-toggle,
.theme-switch:focus-visible .theme-toggle {
  background: var(--color-panel);
  color: var(--color-link);
}

.theme-label {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--color-muted);
  transition: color 160ms ease;
}

.theme-switch:hover .theme-label,
.theme-switch:focus-visible .theme-label {
  color: var(--color-link);
}

.theme-toggle__icon {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: none;
}

:root:not([data-theme-pref]) .theme-toggle__auto,
:root[data-theme-pref="auto"] .theme-toggle__auto,
:root[data-theme-pref="light"] .theme-toggle__sun,
:root[data-theme-pref="dark"] .theme-toggle__moon {
  display: inline;
}

/* ============================================================
   Content
   ============================================================ */

.content {
  max-width: var(--content-width);
  font-family: var(--font-sans);
  font-size: 1.04rem;
  line-height: 1.6;
}

.content h2 {
  margin: 2.4rem 0 0.9rem;
  color: var(--color-heading);
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
}

.content h2:first-child {
  margin-top: 0;
}

.content a {
  color: var(--color-link);
}

.content a:hover {
  color: var(--color-link-hover);
}

.retired-list {
  margin: 0 0 1rem 1.2rem;
  padding: 0;
}

.retired-list li {
  margin-bottom: 0.45rem;
  padding-left: 0.15rem;
}

/* ============================================================
   Social icons
   ============================================================ */

.social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.about-social {
  justify-content: flex-start;
  margin: 1.2rem 0 2.8rem -0.35rem;
}

.social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 4px;
  color: var(--color-muted);
  font-size: 1.2rem;
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease;
}

.social a:hover,
.social a:focus {
  background: var(--color-panel);
  color: var(--color-link);
  text-decoration: none;
}

/* ============================================================
   Footer
   ============================================================ */

.footer {
  max-width: var(--content-width);
  margin-top: 4.5rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-faint);
  font-size: 0.9rem;
  line-height: 1.5;
}

.footer a {
  color: var(--color-muted);
}

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

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 860px) {
  .site {
    display: block;
    width: min(100% - 2rem, var(--content-width));
    padding: 2rem 0 3rem;
  }

  .sidebar-inner {
    position: static;
  }

  .brand-mark {
    margin-bottom: 1.5rem;
  }

  .mobile-title {
    display: block;
    margin: 0 0 1.75rem;
  }

  .desktop-title {
    display: none;
  }

  .nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 0 0 1.6rem;
  }

  .nav a::before {
    opacity: 1;
  }

  .content {
    font-size: 1rem;
  }
}
