@font-face {
  font-family: "TX-02";
  src: url("assets/fonts/TX02NerdFontMono-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "TX-02";
  src: url("assets/fonts/TX02NerdFontMono-Medium.ttf") format("truetype");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #ffffff;
  --shell-bg: rgba(255, 255, 255, 0.4);
  --surface: #f5f5f5;
  --surface-hover: #e5e5e5;
  --text: #171717;
  --body-text: #374151;
  --muted: #4b5563;
  --soft: #737373;
  --line: #e8e8e8;
  --accent: #1976d2;
  --pattern: #d1d5db;
}

:root.dark {
  color-scheme: dark;
  --bg: #000000;
  --shell-bg: rgba(0, 0, 0, 0.4);
  --surface: #181818;
  --surface-hover: #262626;
  --text: #ffffff;
  --body-text: #d1d5db;
  --muted: #d1d5db;
  --soft: #a3a3a3;
  --line: #262626;
  --accent: #ffffff;
  --pattern: #9ca3af;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "TX-02", ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, "Courier New", monospace;
  font-size: 16px;
  line-height: 1.5;
  transition: background-color 180ms ease, color 180ms ease;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

button {
  font: inherit;
}

.background-pattern {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: 0.1;
}

.pattern-stream {
  position: absolute;
  top: 0;
  left: 0;
  margin: 0;
  color: var(--pattern);
  font: 0.75rem/1.25 "TX-02", ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, "Courier New", monospace;
  white-space: pre;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 672px);
  margin: 0 auto;
  padding: 64px 32px;
  background: transparent;
}

.profile {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 0;
}

.avatar {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  border-radius: 50%;
  background: var(--surface);
  object-fit: cover;
}

.profile-content {
  min-width: 0;
  flex: 1;
}

.profile-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

h1,
h2,
p {
  margin: 0;
}

h1,
h2 {
  font-weight: 500;
  letter-spacing: 0;
}

h1 {
  font-size: 1.5rem;
  line-height: 2rem;
}

h2 {
  margin-bottom: 16px;
  font-size: 1.5rem;
  line-height: 2rem;
}

h2 span {
  color: var(--soft);
}

.actions,
.meta,
.meta span,
.copy-email,
.entry-head,
.socials {
  display: flex;
  align-items: center;
}

.actions {
  gap: 8px;
  flex: 0 0 auto;
}

.icon-button {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background-color 150ms ease, transform 150ms ease;
}

.icon-button:hover,
.copy-email:hover,
.socials a:hover {
  background: var(--surface-hover);
}

.icon-button:active {
  transform: translateY(1px);
}

.icon-button svg,
.meta svg,
.copy-email svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.theme-dot {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #d4d4d4;
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

:root.dark .theme-dot {
  background: #525252;
}

.meta {
  flex-wrap: wrap;
  gap: 16px;
  color: var(--muted);
  font-size: 0.875rem;
}

.meta span,
.copy-email {
  gap: 6px;
}

.copy-email {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: color 160ms ease;
}

.copy-email.copied {
  color: var(--accent);
}

.section {
  margin-top: 48px;
}

.section h2 {
  margin-bottom: 32px;
}

#about h2 {
  margin-bottom: 16px;
}

.back-link {
  display: inline-block;
  margin-bottom: 48px;
  color: var(--muted);
  font-size: 0.875rem;
}

.article {
  max-width: none;
}

.article-page {
  width: min(100%, 800px);
  padding: 8px 16px 64px;
}

.article-page-wide {
  width: min(100%, 896px);
  padding: 64px 32px;
}

.article-header {
  margin-bottom: 48px;
}

.article-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
}

.article-toolbar .back-link {
  margin-bottom: 0;
}

.article-actions {
  justify-content: flex-end;
}

.article-heading h1 {
  margin: 0 0 16px;
  font-size: 2.25rem;
  line-height: 1.12;
  font-weight: 500;
}

.article-heading time {
  color: var(--muted);
  font-size: 0.875rem;
}

.article h1 {
  margin-bottom: 10px;
  font-size: 2rem;
  line-height: 1.28;
}

.article > time {
  display: block;
  font-size: 0.875rem;
}

.article h2 {
  margin: 32px 0 16px;
}

.article h3 {
  margin: 24px 0 12px;
  font-size: 1.125rem;
  line-height: 1.5;
  font-weight: 500;
}

.article time,
.article p {
  color: var(--muted);
}

.article p {
  margin: 0 0 16px;
  line-height: 1.625;
}

.article ul,
.article ol {
  margin: 0 0 16px;
  padding-left: 24px;
  color: var(--muted);
}

.article li {
  line-height: 1.625;
}

.article li + li {
  margin-top: 8px;
}

.article hr {
  margin: 32px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.article hr + h2 {
  margin-top: 32px;
}

.article pre {
  overflow-x: auto;
  margin: 0 0 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
  color: var(--muted);
  font: 0.875rem/1.45 "TX-02", ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, "Courier New", monospace;
}

.article code {
  font: inherit;
}

.article pre code {
  display: grid;
}

.article table {
  width: 100%;
  margin: 0 0 24px;
  border-collapse: collapse;
  color: var(--muted);
  font-size: 0.875rem;
}

.article th,
.article td {
  border: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
}

.article th {
  color: var(--text);
  font-weight: 500;
}

.code-line {
  min-height: 1.45em;
}

.code-keyword {
  color: #a0a0a0;
}

.code-string {
  color: #047857;
}

.code-number,
.code-call {
  color: #b45309;
}

.code-comment {
  color: rgba(107, 114, 128, 0.72);
}

:root.dark .article pre {
  background: #101010;
}

:root.dark .code-string {
  color: #99ffe4;
}

:root.dark .code-number,
:root.dark .code-call {
  color: #ffc799;
}

:root.dark .code-comment {
  color: rgba(139, 139, 139, 0.58);
}

.article :not(pre) > code {
  border-radius: 3px;
  background: var(--surface-hover);
  padding: 1px 4px;
  color: var(--text);
}

.article-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 56px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
  color: var(--muted);
  font-size: 0.875rem;
}

.section > p,
.entry-body > p,
.project span {
  color: var(--body-text);
}

.section > p {
  line-height: 1.625;
}

.entry-body > p,
.project span {
  font-size: 0.875rem;
  line-height: 1.625;
}

.live-age {
  cursor: default;
  outline: none;
}

.age-value {
  display: none;
}

#about:hover .age-static,
#about:focus-within .age-static {
  display: none;
}

#about:hover .age-value,
#about:focus-within .age-value {
  display: inline;
}

.timeline {
  display: grid;
  gap: 32px;
}

.entry {
  display: flex;
  gap: 16px;
}

.entry-logo {
  display: flex;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--surface);
  padding: 9px;
}

.entry-logo img {
  width: 100%;
  height: 100%;
}

.entry-body {
  min-width: 0;
  flex: 1;
}

.entry-head {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 2px;
}

.entry-head a,
.project strong,
.notes span {
  font-weight: 500;
}

.entry-head time,
.notes time {
  flex: 0 0 auto;
  color: var(--soft);
  font-size: 0.875rem;
}

.role {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.875rem;
}

.project-list,
.notes {
  display: grid;
  gap: 24px;
}

.project {
  display: grid;
  gap: 8px;
}

.notes a {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.notes span {
  flex: 1;
}

.socials {
  flex-wrap: wrap;
  gap: 12px;
}

.socials a {
  border-radius: 4px;
  background: var(--surface);
  padding: 8px 14px;
  color: var(--text);
  font-size: 0.875rem;
  transition: background-color 160ms ease;
}

@keyframes pulse {
  50% {
    opacity: 0.5;
  }
}

@media (max-width: 640px) {
  .page-shell {
    padding: 64px 32px;
  }

  .profile {
    gap: 24px;
  }

  .avatar {
    width: 64px;
    height: 64px;
    flex-basis: 64px;
  }

  .article-page {
    padding: 8px 16px 40px;
  }

  .article h1 {
    font-size: 1.75rem;
  }
}

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