* { box-sizing: border-box; }
:root {
  --sun-bottom-offset: 24px;
  --page-pad: clamp(16px, 4vw, 32px);
  --page-max: 900px;
  --bg: radial-gradient(circle at 50% calc(100% - var(--sun-bottom-offset)), rgba(255, 231, 179, 0.36) 0%, rgba(255, 215, 194, 0.34) 35%, rgba(247, 154, 192, 0.32) 65%, rgba(216, 125, 255, 0.30) 100%);
  --text: #111;
  --muted: #333;
  --card-bg: rgba(255,255,255,0.7);
  --pill-bg: rgba(255, 255, 255, 0.24);
  --link-underline: currentColor;
}

body.dark {
  --bg: radial-gradient(
    circle at 50% calc(100% - var(--sun-bottom-offset)),
    #2d224a 0%,
    #241a3e 30%,
    #12152a 60%,
    #070a12 100%
  );
  --text: #e9e9ee;
  --muted: #b8b8c2;
  --card-bg: rgba(24,24,30,0.7);
  --pill-bg: rgba(255,255,255,0.08);
  --link-underline: #e9e9ee;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

body {
  overflow-x: hidden;
  font-family: "Untitled Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 17px;
  letter-spacing: 0.02em;
  line-height: 1.25;
  background: var(--bg);
  color: var(--text);
  transition: background 320ms ease;
  display: flex;
  flex-direction: column;
}

h1 {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-weight: 400;
  letter-spacing: normal;
  color: var(--text);
}

h2,
h3,
h4,
h5,
h6 {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-weight: 400;
  letter-spacing: normal;
  color: var(--text);
  margin-top: 0;
}

a,
a:visited,
a:hover,
a:active {
  color: inherit;
  text-decoration: none;
}

a {
  border-bottom: 0.5px dotted var(--link-underline);
}

a:hover {
  border-bottom-width: 1px;
}

p {
  margin: 0.75rem 0;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: inherit;
}

.site-header {
  width: 100%;
  margin-top: clamp(24px, 8vh, 80px);
  padding-inline: 0;
}

.page-content {
  width: auto;
  margin-inline: 20vw;
  padding-inline: 0;
  max-width: none;
}

@media (max-width: 1200px) {
  .page-content {
    margin-inline: max(24px, 10vw);
  }
}

@media (max-width: 900px) {
  .page-content {
    margin-inline: max(20px, 6vw);
  }
}

@media (max-width: 700px) {
  .page-content {
    margin-inline: 16px;
  }
  .site-header {
    margin-top: clamp(16px, 6vh, 44px);
  }
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav li.theme-control {
  margin-left: auto;
}

.site-nav a {
  display: inline-flex;
  align-items: baseline;
  padding: 4px 0;
  margin: 0;
  border-bottom: 1px solid transparent;
  font-weight: 400;
}

.site-nav a:hover {
  border-bottom-color: currentColor;
  text-decoration: none;
}

.site-nav .nav-active {
  border-bottom-color: currentColor;
}

.theme-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  display: inline-flex;
  align-items: center;
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

hr {
  display: block;
  border: none;
  border-top: 1px solid rgba(0, 0, 0, 0.2);
  margin: 1.2rem 0;
}

body.dark hr {
  border-top-color: rgba(255, 255, 255, 0.25);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.projects-grid {
  align-items: stretch;
}

.card-link {
  display: block;
  border-bottom: none;
}

.card-link:hover {
  border-bottom: none;
}

.card {
  border: none;
  padding: 0;
  border-radius: 14px;
  margin-bottom: 1rem;
  transition: box-shadow 160ms ease, transform 160ms ease;
  background: var(--card-bg);
  backdrop-filter: blur(6px) saturate(140%);
  -webkit-backdrop-filter: blur(6px) saturate(140%);
  box-shadow: 0 6px 18px rgba(0,0,0,0.14);
}

.card-link:hover .card {
  box-shadow: 0 12px 28px rgba(0,0,0,0.10);
  transform: translateY(-2px);
}

.project-card {
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.project-media {
  position: relative;
  min-height: 170px;
  background: linear-gradient(180deg, rgba(255,255,255,0.65) 0%, rgba(255, 215, 194, 0.35) 100%);
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.project-media--empty {
  display: none;
}

.project-img {
  width: 100%;
  height: auto;
  display: block;
  transition: filter 300ms ease;
}

.card-link:hover .project-img {
  filter: saturate(1.06) contrast(1.02);
}

.project-content {
  padding: 0.85rem 1rem 1rem;
}

.project-title {
  margin: 0 0 0.35rem 0;
  font-size: 1.25rem;
}

.project-desc {
  margin: 0.25rem 0 0.5rem 0;
  color: #1a1a1a;
  opacity: 0.9;
}

body.dark .project-desc {
  color: rgba(233, 233, 238, 0.85);
}

.project-tags {
  margin-top: 0.25rem;
}

.project-tags .tag {
  margin-bottom: 4px;
}

.tag {
  display: inline-block;
  padding: 4px 10px;
  border: none;
  border-radius: 999px;
  font-size: 12px;
  margin: 4px 6px 0 0;
  background: var(--card-bg);
  backdrop-filter: blur(4px) saturate(130%);
  -webkit-backdrop-filter: blur(4px) saturate(130%);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.pill-group {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin: 0.5rem 0 2rem;
}

.pill {
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  background: var(--pill-bg);
  color: var(--text);
  border: 0.5px solid rgba(255, 141, 184, 0.22);
  padding: 6px 10px;
  border-radius: 9999px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(6px) saturate(140%);
  -webkit-backdrop-filter: blur(6px) saturate(140%);
  font-size: 1rem;
  box-shadow: 0 0 0 2px rgba(255, 141, 184, 0.08);
  transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 60ms ease;
}

.pill:hover {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255, 141, 184, 0.38);
  box-shadow: 0 0 0 3px rgba(255, 141, 184, 0.12), 0 2px 10px rgba(0,0,0,0.08);
}

.pill:active {
  transform: translateY(1px);
}

.pill:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 141, 184, 0.18);
}

.pill.pill-active {
  background: rgba(255,255,255,0.85);
  color: #111;
  border-color: rgba(255, 141, 184, 0.36);
  box-shadow: 0 0 0 3px rgba(255, 141, 184, 0.12), 0 2px 8px rgba(0,0,0,0.04);
  font-weight: 600;
}

body.dark .pill.pill-active {
  color: #111;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(200px, 1fr);
  gap: 32px;
  align-items: start;
  margin-bottom: 2.5rem;
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: left;
  }
  .hero-photo {
    order: -1;
    justify-self: center;
  }
}

.hero-photo {
  position: relative;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto;
  box-shadow: 0 12px 36px rgba(0,0,0,0.16);
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero .tagline {
  font-style: italic;
  opacity: 0.88;
  margin-bottom: 1rem;
}

.hero-links {
  margin-top: 1rem;
  font-size: 0.95rem;
}

.hero-links a {
  border-bottom: none;
}

.hero-links a:hover {
  border-bottom: 1px solid currentColor;
}

body.dark .hero-links a:hover {
  border-bottom-color: currentColor;
}

main {
  flex: 1;
}

footer {
  border-top: none;
  padding: 0;
  position: relative;
  min-height: 294px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  margin-top: auto;
}

footer a img {
  width: 20px;
  height: 20px;
  display: inline-block;
  filter: grayscale(1) brightness(0) invert(40%) opacity(0.92);
  transition: filter 160ms ease;
}

footer a:hover img {
  filter: grayscale(1) brightness(0) invert(30%) opacity(1);
}

body.dark footer a img {
  filter: grayscale(1) brightness(0) invert(85%) opacity(0.95);
}

body.dark footer a:hover img {
  filter: grayscale(1) brightness(0) invert(95%) opacity(1);
}

footer a {
  border-bottom: none !important;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  align-items: center;
  position: relative;
  z-index: 1;
}

footer .copyright {
  text-align: center;
  font-size: 10px;
  color: var(--muted);
  margin-top: 0.25rem;
  margin-bottom: 1rem;
  z-index: 1;
}

.site-bg {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 294px;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
  opacity: 1;
}

.site-bg svg {
  display: block;
  width: 100%;
  height: 100%;
}

body.dark .site-bg circle {
  display: none;
}

body.dark .site-bg {
  opacity: 0.9;
}

body.dark .site-bg polygon {
  fill: #1a2130;
}

.sun-stop-1,
.sun-stop-2 {
  animation: none;
}

body.dark .sun-stop-1,
body.dark .sun-stop-2 {
  stop-color: #2d224a !important;
  stop-opacity: 0.0 !important;
}

.stars-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

.shooting-star {
  position: absolute;
  opacity: 0;
  will-change: offset-distance, opacity;
  filter: drop-shadow(0 0 8px rgba(255,255,255,0.8));
  offset-path: path(var(--path));
  offset-rotate: auto;
  offset-distance: 0%;
}

.shooting-star .trail {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--trail, 220px);
  height: var(--th, 3px);
  background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0.98));
  border-radius: 999px;
  transform: translateX(calc(-1 * var(--trail,220px)));
  transform-origin: left center;
}


.shooting-star .head {
  position: absolute;
  width: var(--head,5px);
  height: var(--head,5px);
  background: radial-gradient(circle, rgba(255,255,255,1) 0%, rgba(255,255,255,0.2) 70%, rgba(255,255,255,0) 80%);
  border-radius: 50%;
  transform: translate(-2px, -2px);
}

@keyframes starMotion {
  0% {
    opacity: 1;
    offset-distance: 0%;
  }
  100% {
    opacity: 0;
    offset-distance: 100%;
  }
}

footer .page-content,
main.page-content {
  position: relative;
  z-index: 1;
}

.hero-intro em {
  font-style: italic;
  opacity: 0.7;
}

.hero-intro a {
  border-bottom-style: dotted;
}

/* Simple week list layout for any future markdown pages */
.article-container {
  max-width: var(--page-max);
  margin: 0 auto;
}

.article-container h1 {
  font-size: 2.75rem;
  line-height: 1.1;
  margin-bottom: 0.2rem;
}

.article-meta {
  font-size: 0.9rem;
  color: var(--muted);
}

.weeks-list {
  list-style: none;
  padding: 0;
  margin: 2rem 0;
}

.weeks-list li {
  margin: 1.5rem 0;
}

.weeks-list p {
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
  color: inherit;
}

.week-status {
  margin: 2rem 0 0;
  color: var(--muted);
}

.week-status p {
  margin: 0;
}

.weeks-list .week-card {
  display: block;
  padding: 1.25rem 1.5rem;
  border-radius: 16px;
  text-decoration: none;
  background: var(--card-bg);
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  transition: transform 160ms ease, box-shadow 160ms ease;
  color: inherit;
  border: 2px solid transparent;
}

.weeks-list .week-card:hover,
.weeks-list .week-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(0,0,0,0.12);
}

.week-card-title {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-size: 1.1rem;
  margin: 0;
}

.week-card-title.single-line {
  gap: 0.25rem;
}

.week-card-title strong {
  font-family: "Untitled Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.week-card-title span {
  font-size: 1.35rem;
  font-weight: 500;
}

.week-header {
  margin-bottom: 1.5rem;
}

.week-header h1 {
  margin-bottom: 0.35rem;
}

.week-header .week-meta {
  margin: 0;
  font-size: 0.95rem;
}

.week-download {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.9rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.12);
  background: var(--card-bg);
  color: inherit;
  text-decoration: none;
  font-size: 0.95rem;
  transition: transform 160ms ease, box-shadow 160ms ease, border 160ms ease;
}

.week-download:hover,
.week-download:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(0,0,0,0.12);
  border-color: rgba(0,0,0,0.2);
}

body.dark .week-download {
  border-color: rgba(255,255,255,0.16);
}

body.dark .week-download:hover,
body.dark .week-download:focus-visible {
  border-color: rgba(255,255,255,0.32);
}

.week-content h1 {
  font-size: 2.1rem;
}

.week-content h2 {
  font-size: 1.6rem;
}

.week-content h3 {
  font-size: 1.32rem;
}

.week-content p,
.week-content li {
  line-height: 1.55;
}

.week-content ul {
  padding-left: 1.4rem;
}


.toc {
  position: fixed;
  right: -6px;
  top: 6.5rem;
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  overflow-x: hidden;
  width: 260px;
  box-sizing: border-box;
  padding-right: 12px;
  scrollbar-gutter: stable both-edges;
}

.toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc li {
  margin: 0.25rem 0;
  font-size: 0.72em;
  max-width: 100%;
}

@media (max-width: 1199px) {
  .toc {
    display: none;
  }
}

/* Simple likes layout */
.likes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.likes-header h1 {
  margin: 0;
}

.likes-grid {
  display: grid;
  gap: 1.5rem;
}

.likes-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 1rem 1.25rem;
  box-shadow: 0 6px 18px rgba(0,0,0,0.14);
}

.likes-card small {
  color: var(--muted);
}

.hero-links span {
  white-space: nowrap;
}
