/* judyzhu.xyz — a quiet, personal index */

:root {
  color-scheme: light;
  --background: #fbfbfa;
  --surface: #ffffff;
  --surface-muted: #f2f2f0;
  --text: #20201f;
  --text-secondary: #62625f;
  --line: #dededb;
  --line-strong: #c5c5c1;
  --selection: #d9d9d5;
  --image-outline: rgba(0, 0, 0, 0.1);
  --shadow-border:
    0 0 0 1px rgba(0, 0, 0, 0.06),
    0 1px 2px -1px rgba(0, 0, 0, 0.06),
    0 2px 4px rgba(0, 0, 0, 0.04);
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --page: 43.25rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --background: #171717;
    --surface: #202020;
    --surface-muted: #242423;
    --text: #f3f3f1;
    --text-secondary: #b8b8b4;
    --line: #383836;
    --line-strong: #565653;
    --selection: #464643;
    --image-outline: rgba(255, 255, 255, 0.1);
    --shadow-border: 0 0 0 1px rgba(255, 255, 255, 0.08);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 2rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.625;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--selection);
  color: var(--text);
}

img {
  display: block;
  max-width: 100%;
  outline: 1px solid var(--image-outline);
  outline-offset: -1px;
}

a {
  color: inherit;
  text-decoration-thickness: from-font;
  text-underline-offset: 0.22em;
  text-underline-position: from-font;
}

:focus-visible {
  outline-offset: 4px;
}

#top,
#now,
#paintings {
  scroll-margin-top: 2rem;
}

.skip-link {
  position: fixed;
  inset-block-start: 0.75rem;
  inset-inline-start: 0.75rem;
  z-index: 20;
  padding: 0.625rem 0.875rem;
  background: var(--text);
  color: var(--background);
  transform: translateY(-160%);
}

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

.site-header,
main,
.site-footer {
  width: min(calc(100% - 3rem), var(--page));
  margin-inline: auto;
}

.site-header {
  display: flex;
  min-height: 5rem;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  border-bottom: 1px solid var(--line);
}

.site-name {
  display: inline-flex;
  min-height: 1.5rem;
  align-items: center;
  flex-shrink: 0;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.75rem 1.25rem;
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

.site-nav a {
  display: inline-flex;
  min-height: 1.5rem;
  align-items: center;
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--text);
}

.intro {
  padding-block: clamp(5rem, 11vw, 8rem) clamp(7rem, 14vw, 10rem);
}

.hello-mark,
.section-label {
  margin: 0 0 0.75rem;
  color: var(--text-secondary);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  line-height: 1.5;
  text-transform: uppercase;
}

.intro h1 {
  margin: 0;
  font-size: clamp(3.5rem, 9vw, 5rem);
  font-weight: 600;
  letter-spacing: -0.055em;
  line-height: 0.95;
  text-wrap: balance;
}

.intro-lede {
  max-width: 35rem;
  margin: 2rem 0 0;
  color: var(--text);
  font-size: clamp(1.125rem, 2.5vw, 1.25rem);
  line-height: 1.55;
  text-wrap: pretty;
}

.intro-note {
  max-width: 34rem;
  margin: 1.25rem 0 0;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  text-wrap: pretty;
}

.hero-art {
  margin: 4.5rem 0 0;
}

.hero-art picture,
.painting picture {
  display: block;
  overflow: hidden;
  background: var(--surface-muted);
  border-radius: 0;
  box-shadow: var(--shadow-border);
}

.hero-art img {
  width: 100%;
  height: auto;
}

.hero-art figcaption,
.painting figcaption {
  margin-top: 0.625rem;
  color: var(--text-secondary);
  font-family: var(--mono);
  font-size: 0.6875rem;
  line-height: 1.5;
}

.section {
  padding-block: 6.5rem;
}

.section-heading {
  max-width: 34rem;
  margin-bottom: 3.5rem;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.45;
  text-wrap: balance;
}

.section-heading > p:last-child {
  margin: 0.625rem 0 0;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  text-wrap: pretty;
}

.now-grid {
  display: flex;
  flex-direction: column;
  gap: 3.25rem;
}

.now-item {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 2rem;
}

.now-item h3 {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.625;
}

.now-item p {
  margin: 0;
  color: var(--text-secondary);
}

.book-list {
  margin: -0.625rem 0 0;
  padding: 0;
  list-style: none;
}

.book-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 0.625rem;
  border-bottom: 1px solid var(--line);
}

.book-list cite {
  font-family: var(--serif);
  font-size: 1.0625rem;
}

.book-list span {
  flex-shrink: 0;
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-align: end;
}

.painting-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 2rem 1.25rem;
  align-items: start;
}

.painting {
  min-width: 0;
  margin: 0;
}

.painting:nth-child(-n + 3) {
  grid-column: span 2;
}

.painting:nth-child(n + 4) {
  grid-column: span 3;
}

.painting img {
  width: 100%;
  height: auto;
}

.site-footer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 1.5rem 2rem;
  padding-block: 2.5rem 3.5rem;
  border-top: 1px solid var(--line);
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.site-footer > p {
  margin: 0.25rem 0 0;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem 1rem;
}

.social-links a {
  display: inline-flex;
  min-height: 1.5rem;
  align-items: center;
  text-decoration-color: var(--line-strong);
}

.social-links a:hover {
  color: var(--text);
  text-decoration-color: currentColor;
}

.bakery-door {
  grid-column: 1 / -1;
  display: inline-flex;
  width: fit-content;
  min-height: 3rem;
  align-items: center;
  gap: 0.75rem;
  color: var(--text);
  text-decoration: none;
}

.bakery-door img {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.375rem;
  object-fit: cover;
  object-position: center 22%;
}

.bakery-door span {
  display: flex;
  flex-direction: column;
  line-height: 1.4;
}

.bakery-door small {
  color: var(--text-secondary);
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.bakery-door:hover span {
  text-decoration: underline;
  text-decoration-thickness: from-font;
  text-underline-offset: 0.2em;
}

@media (min-width: 78rem) {
  .site-header {
    position: fixed;
    inset-block-start: 3rem;
    inset-inline-start: 3rem;
    z-index: 10;
    display: block;
    width: 13rem;
    min-height: 0;
    border: 0;
  }

  .site-nav {
    flex-direction: column;
    align-items: stretch;
    margin-top: 1.5rem;
    gap: 0.75rem;
  }

  .site-nav a {
    gap: 0.625rem;
  }

  .site-nav a::before {
    width: 0.75rem;
    height: 1px;
    flex-shrink: 0;
    background: var(--line-strong);
    content: "";
  }

  .site-nav a:hover::before {
    background: var(--text);
  }
}

@media (max-width: 47rem) {
  .site-header,
  main,
  .site-footer {
    width: min(calc(100% - 2rem), var(--page));
  }

  .site-header {
    min-height: 0;
    padding-block: 1.25rem;
  }

  .intro {
    padding-block: 4.5rem 7rem;
  }

  .hero-art {
    margin-top: 3.5rem;
  }

  .section {
    padding-block: 5.25rem;
  }

  .section-heading {
    margin-bottom: 3rem;
  }

  .now-item {
    display: block;
  }

  .now-item h3 {
    margin-bottom: 0.75rem;
  }

  .painting-grid {
    grid-template-columns: none;
    grid-auto-columns: calc(100% - 3rem);
    grid-auto-flow: column;
    gap: 1rem;
    margin-inline-end: -1rem;
    padding-inline-end: 3rem;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-padding-inline: 0;
    scroll-snap-type: inline mandatory;
  }

  .painting:nth-child(n) {
    grid-column: auto;
    scroll-snap-align: start;
  }

  .site-footer {
    display: block;
  }

  .social-links {
    justify-content: flex-start;
    margin-top: 1.25rem;
  }

  .bakery-door {
    margin-top: 2rem;
  }
}

@media (max-width: 30rem) {
  .site-header {
    display: block;
  }

  .site-nav {
    justify-content: flex-start;
    margin-top: 0.75rem;
    gap: 0.5rem 1rem;
  }

  .intro h1 {
    font-size: clamp(3rem, 19vw, 4rem);
  }

  .intro-lede {
    font-size: 1.125rem;
  }

  .book-list li {
    display: block;
  }

  .book-list span {
    display: block;
    margin-top: 0.125rem;
    text-align: start;
  }
}

@media (prefers-contrast: more) {
  :root {
    --text-secondary: #454543;
    --line: #b8b8b3;
    --line-strong: #80807c;
  }
}

@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root {
    --text-secondary: #d3d3d0;
    --line: #666661;
    --line-strong: #9c9c96;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .site-nav a,
  .social-links a {
    transition-property: color;
    transition-duration: 150ms;
    transition-timing-function: ease-out;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
