/* blog font */
@import url("https://cdn.jsdelivr.net/gh/edwardtufte/et-book@gh-pages/et-book.css");

:root {
  color-scheme: dark;
  --background: #020203;
  --surface: #070708;
  --surface-2: #0d0d0e;
  --heading-surface: #11070c;
  --ink: #eeeeee;
  --muted: #c7c7c7;
  --border: #202023;
  --header: rgba(2, 2, 3, 0.97);
  --scroll-thumb: #303034;
  --page-accent: #d25c92;
  --pink-cloud: 0 0 7px rgba(210, 92, 146, 0.8), 0 0 16px rgba(210, 92, 146, 0.45);
  --max-width: 1080px;
  --font-main: "et-book", "et-book", "et-book";
  --font-blog: "et-book", "et-book", "et-book", "et-book";
  --text-small: 1rem;
  --text-body: 1.125rem;
  --text-large: 1.25rem;
  --text-subheading: 1.5rem;
  --text-heading: clamp(1.8rem, 3vw, 2.6rem);
  --text-display: clamp(2.5rem, 5vw, 4.25rem);
}

:root[data-theme="light"] {
  color-scheme: light;
  --background: #f3f3f3;
  --surface: #ffffff;
  --surface-2: #e9e9e9;
  --heading-surface: #fff3f8;
  --ink: #171717;
  --muted: #505050;
  --border: #d2d2d2;
  --header: rgba(243, 243, 243, 0.96);
  --scroll-thumb: #b8b8bc;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--background);
  scrollbar-color: var(--scroll-thumb) var(--background);
  scrollbar-width: thin;
}

html::-webkit-scrollbar {
  width: 10px;
}

html::-webkit-scrollbar-track {
  background: var(--background);
}

html::-webkit-scrollbar-thumb {
  border: 2px solid var(--background);
  border-radius: 0;
  background: var(--scroll-thumb);
}

html::-webkit-scrollbar-thumb:hover {
  background: var(--page-accent);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--background);
  font-family: var(--font-main);
  font-size: var(--text-body);
  line-height: 1.6;
}

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

a {
  color: inherit;
  text-underline-offset: 0.2em;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
  font: inherit;
}

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

.shell {
  width: min(var(--max-width), calc(100% - 3rem));
  margin-inline: auto;
}

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

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.65rem 0.9rem;
  color: var(--background);
  background: var(--ink);
  transform: translateY(-150%);
}

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

#site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background: var(--header);
}

.loading-bar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  width: 100%;
  height: 3px;
  background: var(--page-accent);
  pointer-events: none;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 80ms linear, opacity 120ms ease-out;
}

.loading-bar.started {
  transform: scaleX(0.72);
}

.loading-bar.complete {
  opacity: 0;
  transform: scaleX(1);
}

/* nav */
.nav {
  width: calc(100% - 2rem);
  max-width: 1400px;
  min-height: 70px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 2rem;
}

.brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-size: var(--text-large);
  font-weight: 700;
  text-decoration: none;
}

.brand > span:last-child {
  color: var(--muted);
}

.brand:hover > span:last-child {
  color: var(--page-accent);
  text-shadow: var(--pink-cloud);
}

.brand.active > span:last-child {
  color: var(--page-accent);
}

.brand-mark {
  width: 1.75rem;
  height: 1.75rem;
  flex: 0 0 1.75rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: url("../media/profile/profile.png?v=11") center / cover no-repeat;
}

.nav-links {
  grid-column: 2;
  display: flex;
  align-items: center;
  gap: clamp(0.45rem, 1vw, 0.8rem);
}

.nav-link {
  padding-block: 0.2rem;
  color: var(--muted);
  font-size: var(--text-large);
  text-decoration: none;
}

.nav-separator,
.footer-separator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-blog);
  font-size: var(--text-large);
  line-height: 1;
  transform: translateY(0.19em);
}

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

.nav-separator.active,
.footer-separator {
  color: var(--page-accent);
}

.nav-link:hover {
  color: var(--page-accent);
  text-shadow: var(--pink-cloud);
}

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

.nav-actions {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.theme-toggle {
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.theme-toggle:hover {
  color: var(--page-accent);
  border-color: var(--page-accent);
  box-shadow: var(--pink-cloud);
  text-shadow: var(--pink-cloud);
}

.theme-icon,
.theme-icon svg {
  width: 1.2rem;
  height: 1.2rem;
}

.theme-icon svg {
  display: none;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

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

.menu-button {
  width: 2.4rem;
  height: 2.25rem;
  padding: 0.45rem;
  display: none;
  border: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  cursor: pointer;
}

.menu-button span:not(.sr-only) {
  display: block;
  height: 1px;
  margin: 4px 0;
  background: var(--ink);
}

main {
  min-height: calc(100vh - 150px);
}

/* page headings */
.page-heading {
  margin-block: 4rem 4.5rem;
  padding: 3.5rem 2rem;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 0.125rem;
  background: var(--heading-surface);
}

.page-heading h1,
.hero h1,
.article-header h1 {
  margin: 0;
  font-size: var(--text-display);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.page-heading .lead {
  max-width: 680px;
  margin: 1rem auto 0;
  color: var(--muted);
  font-size: var(--text-large);
}

.hero {
  min-height: calc(100vh - 70px);
  padding-block: 5rem;
  display: grid;
  grid-template-columns: 1fr minmax(280px, 420px);
  align-items: center;
  gap: clamp(3rem, 8vw, 7rem);
}

/* home */
.hero-copy {
  max-width: 650px;
}

.hero-intro {
  margin: 1.5rem 0 2rem;
  color: var(--muted);
  font-size: var(--text-large);
}

.hero-placeholder {
  width: 100%;
  aspect-ratio: 4 / 5;
  border: 1px solid #444444;
  background: #050505;
}

.button {
  min-height: 2.8rem;
  padding: 0.65rem 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--surface);
  font-size: var(--text-body);
  font-weight: 700;
  text-decoration: none;
}

.button:hover {
  color: var(--page-accent);
  text-shadow: var(--pink-cloud);
}

.document-view-link {
  min-height: 0;
  padding: 0;
  border: 0;
  color: var(--page-accent);
  background: transparent;
}

.document-view-link:hover {
  text-decoration: underline;
  text-shadow: none;
}

.plain-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--page-accent);
  font-size: var(--text-body);
  font-weight: 700;
  text-decoration: none;
}

.plain-link:hover {
  text-decoration: underline;
}

.plain-link svg {
  width: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.about-layout {
  padding-block: 4.5rem 7rem;
}

/* cards */
.large-copy {
  max-width: 900px;
  margin: 0 auto 3.5rem;
  font-size: var(--text-large);
  text-align: center;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.detail-grid article {
  padding: 1.75rem;
  border: 1px solid var(--border);
  background: var(--surface);
}

.detail-grid h2 {
  margin: 0 0 0.6rem;
  color: var(--page-accent);
  font-size: var(--text-body);
}

.detail-grid p {
  margin: 0;
  color: var(--muted);
}

.projects,
.documents {
  padding-top: 2rem;
  padding-bottom: 7rem;
  display: grid;
  gap: 1rem;
}

.project-row,
.document-row {
  padding: clamp(1.5rem, 4vw, 2.5rem);
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(320px, 1.2fr);
  align-items: center;
  gap: clamp(2.5rem, 7vw, 6rem);
  border: 1px solid var(--border);
  background: var(--surface);
}

.project-copy h2,
.document-copy h2 {
  margin: 0 0 0.75rem;
  font-size: var(--text-heading);
}

.project-copy p,
.document-copy p {
  margin: 0 0 1.4rem;
  color: var(--muted);
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.project-placeholder,
.document-preview {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  border: 1px solid var(--border);
  background: var(--surface);
}

.blog-index {
  max-width: 900px;
  padding-bottom: 7rem;
}

.blog-list {
  padding-block: 1.5rem;
  display: grid;
  gap: 1rem;
  font-family: var(--font-blog);
}

/* blog list */
.blog-pagination {
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
  padding: 0.55rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 1px solid var(--border);
  border-radius: 0;
  color: var(--page-accent);
  background: var(--surface-2);
  font-family: var(--font-main);
}

.page-number-input {
  border: 1px solid var(--border);
  border-radius: 0;
  color: var(--page-accent);
  background: var(--surface);
  font: inherit;
}

.blog-pagination button {
  min-width: 0;
  min-height: 0;
  padding: 0 0.15rem;
  border: 0;
  color: var(--page-accent);
  background: transparent;
  font: inherit;
  font-size: var(--text-large);
  line-height: 1;
  cursor: pointer;
}

.blog-pagination button:hover:not(:disabled) {
  color: var(--page-accent);
  text-shadow: var(--pink-cloud);
}

.blog-pagination button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.blog-pagination label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  font-size: var(--text-large);
}

.page-number-input {
  width: 2.75rem;
  min-height: 2rem;
  padding-inline: 0.2rem;
  text-align: center;
  font-size: var(--text-small);
}

.page-number-input:focus {
  border-color: var(--page-accent);
  outline: 2px solid transparent;
}

.blog-entry {
  border: 1px solid var(--border);
  background: var(--surface);
}

.blog-entry-link {
  padding: 1.75rem;
  display: grid;
  grid-template-columns: 150px 1fr;
  align-items: start;
  gap: 2rem;
  text-decoration: none;
}

.blog-entry-link time {
  padding-top: 0.25rem;
  color: var(--muted);
  font-family: var(--font-main);
  font-size: var(--text-large);
}

.blog-entry-link h2 {
  margin: 0 0 0.35rem;
  color: var(--page-accent);
  font-family: var(--font-main);
  font-size: var(--text-subheading);
  line-height: 1.25;
}

.blog-entry-link:hover h2 {
  text-shadow: var(--pink-cloud);
}

.blog-entry-link p {
  max-width: 580px;
  margin: 0;
  color: var(--muted);
  font-family: var(--font-main);
  font-size: var(--text-large);
}

.contact-list {
  max-width: 680px;
  padding-block: 3rem 7rem;
  display: grid;
  gap: 0.75rem;
}

/* contact */
.contact-row {
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border: 1px solid var(--border);
  background: var(--surface);
}

.contact-icon-link {
  width: 2.4rem;
  flex: 0 0 2.4rem;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  text-decoration: none;
}

.contact-icon-link:hover {
  color: var(--page-accent);
  border-color: var(--page-accent);
}

.contact-icon-link svg {
  width: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.contact-icon-link svg.icon-fill {
  fill: currentColor;
  stroke: none;
}

.contact-row strong,
.contact-value {
  display: block;
}

.contact-row strong {
  color: var(--ink);
  font-size: var(--text-body);
}

.contact-value {
  color: var(--page-accent);
  text-decoration: none;
}

.contact-value:hover {
  text-decoration: underline;
}

.article {
  width: min(820px, calc(100% - 3rem));
  padding-block: 5rem 7rem;
  font-family: var(--font-blog);
}

/* blog post */
.article-header {
  padding-bottom: 2.75rem;
  border-bottom: 1px solid var(--border);
}

.article-meta {
  margin-bottom: 1.25rem;
  display: flex;
  gap: 0.55rem;
  color: var(--muted);
  font-family: var(--font-main);
  font-size: var(--text-small);
}

.article-meta a {
  color: var(--page-accent);
  text-decoration: none;
}

.article-meta a:hover {
  text-shadow: var(--pink-cloud);
}

.article-header h1 {
  max-width: 720px;
  font-family: var(--font-main);
  font-size: var(--text-display);
}

.article-header > p {
  max-width: 650px;
  margin: 1.5rem 0 0;
  color: var(--muted);
  font-family: var(--font-main);
  font-size: var(--text-large);
}

.article-body {
  max-width: 680px;
  margin-inline: auto;
  padding-block: 3rem;
  font-size: var(--text-large);
  line-height: 1.8;
}

.article-body h2 {
  margin: 2.75rem 0 0.8rem;
  font-size: var(--text-subheading);
}

.article-body p {
  margin: 0 0 1.45rem;
}

.article-body blockquote {
  margin: 2rem 0;
  padding: 0.2rem 0 0.2rem 1.25rem;
  border-left: 3px solid var(--page-accent);
  color: var(--muted);
}

.math-block {
  overflow-x: auto;
  margin: 2rem 0;
  padding: 0.5rem 0 0.5rem 1.25rem;
  border-left: 5px solid var(--page-accent);
  background: transparent;
}

.article-footer {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: var(--text-small);
}

.article-footer a {
  color: var(--page-accent);
  font-family: var(--font-main);
  text-decoration: none;
}

.article-footer a:hover {
  text-shadow: var(--pink-cloud);
}

#site-footer {
  border-top: 1px solid var(--border);
}

/* footer */
.footer {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  color: var(--muted);
  font-size: var(--text-small);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.footer-links a {
  color: var(--page-accent);
  text-decoration: none;
}

.footer-links a:hover {
  text-shadow: var(--pink-cloud);
}

.footer-links .external-link:hover {
  text-decoration: underline;
  text-shadow: none;
}

@media (max-width: 800px) {
  .nav {
    grid-template-columns: 1fr auto;
  }

  .nav-actions {
    grid-column: 2;
  }

  .menu-button {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    padding: 0.75rem 1rem 1rem;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    border-bottom: 1px solid var(--border);
    background: var(--background);
  }

  .nav-separator {
    display: none;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-link {
    padding: 0.7rem 0;
    border-bottom: 0;
  }

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

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .hero-placeholder {
    width: min(75%, 380px);
    margin-inline: auto;
  }

  .project-row,
  .document-row {
    grid-template-columns: 1fr;
  }

  .project-placeholder,
  .document-preview {
    order: 2;
  }

  .blog-entry {
    display: block;
  }

  .blog-entry-link {
    grid-template-columns: 120px 1fr;
  }
}

@media (max-width: 560px) {
  .shell,
  .article {
    width: calc(100% - 2rem);
  }

  .brand > span:last-child {
    display: none;
  }

  .theme-toggle {
    width: 2.25rem;
    padding: 0;
    justify-content: center;
  }

  .page-heading {
    padding-block: 3.5rem;
  }

  .hero {
    padding-block: 3.5rem 5rem;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-grid article,
  .detail-grid article:nth-child(odd) {
    padding: 1.25rem;
  }

  .blog-entry-link {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }

  .article {
    padding-block: 3.5rem 5rem;
  }

  .footer {
    padding-block: 1.5rem;
    align-items: flex-start;
    flex-direction: column;
    gap: 0.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
