:root {
  color-scheme: light;
  --background: #ffffff;
  --text: #111111;
  --muted: #666666;
  --rule: #dddddd;
  --link: #111111;
  --link-hover: #065fd4;
  --code-background: #f5f5f5;
}

* { box-sizing: border-box; }

html {
  background: var(--background);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}

body { margin: 0; min-width: 320px; background: var(--background); }
::selection { color: #fff; background: var(--link-hover); }

.page { width: min(760px, calc(100% - 40px)); margin: 0 auto; }

.site-header {
  display: flex;
  align-items: baseline;
  gap: 24px;
  padding: 36px 0 28px;
  border-bottom: 1px solid var(--rule);
}

.site-title, .site-nav a {
  color: var(--text);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.2;
  text-decoration: none;
}

.site-title { margin: 0; }

a {
  color: var(--link);
  text-decoration: none;
  transition: color 120ms ease;
}

a:hover, a:focus-visible, .site-nav a:hover, .site-nav a:focus-visible {
  color: var(--link-hover);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

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

.intro { padding: 50px 0 80px; }
.bio::after { display: block; clear: both; content: ""; }
.bio p { margin: 0 0 1.35rem; }
.bio p:last-child { margin-bottom: 0; }

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

.bio a:hover,
.bio a:focus-visible {
  color: var(--link-hover);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

.gallery-figure {
  float: right;
  width: 280px;
  margin: 0 0 22px 36px;
}

.gallery-image-frame {
  display: block;
  width: 280px;
  height: 280px;
  overflow: hidden;
  background: #f2f2f2;
  border-radius: 50%;
}

.gallery-figure img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 160ms ease;
}

.gallery-caption {
  min-height: 3.4em;
  margin-top: 11px;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.72rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
  text-align: center;
}

.gallery-caption a { color: inherit; }
.gallery-caption a:hover, .gallery-caption a:focus-visible { color: var(--link-hover); }

.section, .post { max-width: 720px; padding: 50px 0 80px; }
.section-header { margin-bottom: 36px; }
.section h1, .post h1 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.post-list { margin: 0; padding: 0; list-style: none; }
.post-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  padding: 7px 0;
}

.post-list time, .post-date {
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
  white-space: nowrap;
}

.post-header { margin-bottom: 42px; }
.post-date { display: block; margin-top: 9px; }
.post-content h2, .post-content h3, .post-content h4 {
  margin: 2.2rem 0 0.7rem;
  font-weight: 500;
  line-height: 1.35;
}
.post-content h2 { font-size: 1.3rem; }
.post-content h3 { font-size: 1.1rem; }
.post-content p, .post-content ul, .post-content ol, .post-content blockquote { margin: 0 0 1.25rem; }
.post-content img, .post-content video { display: block; max-width: 100%; height: auto; margin: 1.8rem 0; }
.post-content blockquote { padding-left: 1rem; border-left: 2px solid var(--text); color: var(--muted); }
.post-content pre {
  max-width: 100%;
  margin: 1.6rem 0;
  padding: 16px 18px;
  overflow-x: auto;
  background: var(--code-background);
  border: 1px solid var(--rule);
  font-size: 0.86rem;
  line-height: 1.55;
}
.post-content code {
  padding: 0.12em 0.3em;
  background: var(--code-background);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.88em;
}
.post-content pre code { padding: 0; background: transparent; }
.post-content table { display: block; width: max-content; max-width: 100%; margin: 1.6rem 0; overflow-x: auto; border-collapse: collapse; font-size: 0.92rem; }
.post-content th, .post-content td { padding: 8px 10px; border: 1px solid var(--rule); text-align: left; }
.post-content hr { margin: 2.5rem 0; border: 0; border-top: 1px solid var(--rule); }

.site-footer {
  padding: 22px 0 36px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.72rem;
}

@media (max-width: 620px) {
  .page { width: min(100% - 30px, 520px); }
  .site-header { padding-top: 25px; }
  .intro { padding-top: 38px; }
  .gallery-figure { float: none; width: min(280px, 78vw); margin: 0 auto 34px; }
  .gallery-image-frame { width: min(280px, 78vw); height: min(280px, 78vw); }
}

@media (max-width: 440px) {
  .site-header { gap: 18px; }
  .post-list li { grid-template-columns: 1fr; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
