/* Shared chrome for every page. Page-specific rules stay inline in each file. */

:root {
  --white: #faf5f6;
  --transwhite: #faf5f6;
  --black: #252525;
  --transblack: rgba(37, 37, 37, .7);
  --highlight: #e5ffc3;
  --red: #e4002b;
  --green: #24d05a;
  --pink: #eb4888;
  --blue: #10a2f5;
  --yellow: #e9bc3f;
  --gray: #c9c9c9;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scrollbar-gutter: stable;
}

body {
  margin: auto;
  padding: 20px;
  max-width: 70ch;
  overflow-wrap: break-word;
  scroll-behavior: smooth;
  font-family: 'iA Writer Mono', ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, 'DejaVu Sans Mono', monospace;
  background: var(--black);
  color: var(--white);
  line-height: 1.6;
  font-size: 1.25rem;
}

::selection {
  background: var(--highlight);
  color: var(--black);
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 2rem 0 1.5rem;
  max-width: 100%;
}

.header-text h1 {
  font-size: 2.15rem;
  font-weight: bold;
  margin-bottom: 0.4rem;
}

.avatar-frame {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  box-shadow: 0 0 0 3px transparent;
  transition: box-shadow .25s ease;
}

.avatar-frame img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}

/* Sticky nav */
nav {
  position: sticky;
  top: 0;
  background: var(--transblack);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  text-align: center;
  padding: 0.75rem 20px;
  margin: 0 -20px;
  z-index: 100;
}

nav a {
  color: var(--white);
  text-decoration: none;
  font-size: 1.1rem;
  margin: 0 0.75rem;
  text-decoration-thickness: .3ex;
  text-underline-offset: .3ex;
}

nav a:hover,
nav a.active {
  font-weight: bolder;
  text-decoration: underline;
  text-underline-offset: .3ex;
  text-decoration-thickness: .3ex;
}

/* Links */
a {
  color: var(--white);
  text-decoration: underline;
  text-decoration-thickness: .3ex;
  text-underline-offset: .3ex;
}

main {
  margin-top: 2.5rem;
}

.section-heading {
  font-size: 1.85rem;
  font-weight: bold;
  color: var(--white);
  margin: 3rem 0 1.75rem;
}

.page-intro {
  color: var(--transwhite);
  margin-bottom: 1.1rem;
  line-height: 1.75;
}

/* Color rule separator */
.color-rule {
  display: flex;
  gap: 0;
  height: 3px;
  margin: 2.5rem 0;
  border-radius: 2px;
  overflow: hidden;
}

.color-rule span { flex: 1; }

/* Footer */
footer {
  padding: 25px 0;
  text-align: center;
  font-size: 1.05rem;
  color: var(--gray);
  margin-top: 3rem;
}

footer a {
  color: var(--gray);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem 1rem;
}

.copy-email {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: .3ex;
  text-underline-offset: .3ex;
}


/* Light theme.
   Variable names are historical: --black holds the page ground and --white the
   foreground, so in light mode --black is cream and --white is near-black.
   Accents stay close to their dark-mode values because every accent on this
   site is decorative (rules, borders, underlines, the avatar ring) and never
   carries text, so it does not need text-level contrast. */
:root[data-theme="light"] {
  --white: #29241d;
  --transwhite: #362f25;
  --black: #ebe0cc;
  --transblack: rgba(235, 224, 204, .72);
  --highlight: #d9f0a8;
  --red: #c9002a;
  --green: #17a34a;
  --pink: #d8306e;
  --blue: #0d84cc;
  --yellow: #c08f17;
  --gray: #675d4e;
}

.toggle-icon {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
}

.theme-toggle span {
  text-decoration: underline;
  text-decoration-thickness: .3ex;
  text-underline-offset: .3ex;
}

/* Cross-page transitions: header holds still, content fades and lifts */
@view-transition {
  navigation: auto;
}

.site-header { view-transition-name: site-header; }
nav { view-transition-name: site-nav; }

::view-transition-old(root) {
  animation: page-fade-out .18s ease both;
}

::view-transition-new(root) {
  animation: page-fade-lift .28s ease both;
}

@keyframes page-fade-out {
  to { opacity: 0; }
}

@keyframes page-fade-lift {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}
