/* The glass surface belongs to navigation; reading surfaces stay clear. */
:root {
  --paper: #141b22;
  --ink: #eff5f8;
  --quiet: #b2c1cc;
  --field: #202e3a;
  --accent: #b9dff5;
  --section-gap: clamp(3.25rem, 7vw, 4.75rem);
  --surface-radius: 1.5rem;
  --glass-line: rgb(235 248 255 / 17%);
  --glass-shadow: 0 12px 36px rgb(4 12 19 / 18%), 0 2px 7px rgb(4 12 19 / 12%);
}

html {
  scroll-padding-top: 7.5rem;
}

body {
  min-width: 0;
  background: radial-gradient(ellipse 52rem 23rem at 50% -9rem, #263e50 0%, transparent 76%), var(--paper);
  background-repeat: no-repeat;
}

.shell {
  width: min(calc(100% - 2 * var(--gutter)), 55rem);
}

.skip-link {
  z-index: 40;
  border-radius: 0.75rem;
}

.site-header {
  position: sticky;
  top: max(0.75rem, env(safe-area-inset-top));
  z-index: 20;
  isolation: isolate;
  min-height: 4.5rem;
  gap: 1rem;
  margin-block-start: 1.125rem;
  padding: 0.625rem 1.375rem;
  border: 1px solid var(--glass-line);
  border-radius: 1.875rem;
  background:
    linear-gradient(125deg, rgb(255 255 255 / 9%), rgb(255 255 255 / 2%) 46%, rgb(201 230 249 / 5%)),
    rgb(20 32 43 / 75%);
  -webkit-backdrop-filter: blur(24px) saturate(155%);
  backdrop-filter: blur(24px) saturate(155%);
  box-shadow: var(--glass-shadow), inset 0 1px 0 rgb(255 255 255 / 19%), inset 0 -1px 0 rgb(238 250 255 / 4%);
}

.site-header::before,
.site-header::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
}

.site-header::before {
  padding: 1px;
  background: linear-gradient(135deg, rgb(255 255 255 / 47%), rgb(255 255 255 / 3%) 29%, rgb(255 255 255 / 4%) 68%, rgb(205 235 255 / 24%));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.site-header::after {
  background: radial-gradient(ellipse 18rem 5rem at var(--glass-x, 50%) var(--glass-y, 0%), rgb(232 249 255 / 10%), transparent 75%);
}

.site-header .wordmark .notch-wordmark {
  width: 4.25rem;
}

.site-header nav {
  gap: 0.25rem;
  align-items: center;
}

.site-header nav a {
  justify-content: center;
  min-height: 44px;
  padding: 0.375rem 0.875rem;
  border: 1px solid transparent;
  border-radius: 1.125rem;
  color: var(--ink);
  font-weight: 450;
  letter-spacing: 0;
  transition: background-color 140ms ease, border-color 140ms ease;
}

.site-header nav a:hover,
.site-header nav a:focus-visible {
  background: rgb(221 244 255 / 9%);
  border-color: rgb(231 249 255 / 13%);
  text-decoration: none;
}

.home-page {
  padding-block-start: clamp(2.25rem, 5vw, 3rem);
}

.home-page > .entry {
  display: block;
}

.home-page .entry > h2 {
  margin-bottom: 1.25rem;
  color: var(--ink);
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: 0;
}

.home-posts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.5rem 1.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
  line-break: strict;
  overflow-wrap: anywhere;
}

.home-posts > li:first-child {
  grid-column: 1 / -1;
}

.home-post {
  display: block;
  border-radius: var(--surface-radius);
  color: var(--ink);
  text-decoration: none;
}

.home-post-image {
  display: block;
  width: 100%;
  aspect-ratio: 1.75;
  overflow: hidden;
  border-radius: var(--surface-radius);
  background: var(--field);
}

.home-post-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-post--featured .home-post-image {
  aspect-ratio: 2.4;
}

.home-post-copy {
  padding-block-start: 1.25rem;
}

.home-post:not(:has(.home-post-image)) .home-post-copy {
  padding-block-start: 0;
}

.home-post-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.375rem 1.5rem;
  color: var(--quiet);
  font-size: var(--type-small);
  line-height: 1.7;
}

.home-post-meta time {
  white-space: nowrap;
}

.home-post-title {
  margin: 0.5rem 0 0;
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  font-weight: 500;
  line-height: 1.65;
}

.home-post--featured .home-post-title {
  font-size: clamp(1.5rem, 3.3vw, 2rem);
  letter-spacing: -0.025em;
}

.home-post-title > span {
  display: inline-block;
  max-width: 100%;
}

.home-post:hover .home-post-title {
  text-decoration: underline;
  text-underline-offset: 0.24em;
  text-decoration-thickness: 1px;
}

.home-post-summary {
  display: block;
  max-width: 66ch;
  margin: 0.625rem 0 0;
  color: var(--quiet);
  font-size: var(--type-caption);
  line-height: 1.95;
}

.home-post-read {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  margin-top: 0.25rem;
  color: var(--accent);
  font-size: var(--type-small);
}

.home-page .project-list {
  gap: 2.25rem 1.75rem;
}

.project-preview {
  overflow: hidden;
  border-radius: var(--surface-radius);
  background: var(--field);
}

.home-page .project-preview {
  aspect-ratio: 1.6;
}

.home-page .project-preview--orbit img {
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-page .project-preview--tadori .tadori-icon {
  width: 34%;
  max-width: none;
  height: auto;
}

.home-page .project-preview .notch-wordmark {
  width: min(60%, 15rem);
}

.home-page .project-preview .pad-grid {
  width: min(43%, 12rem);
  pointer-events: none;
}

.project-card :is(h2, h3) {
  margin-top: 0.625rem;
  font-weight: 500;
  line-height: 1.5;
}

.project-card p {
  line-height: 1.85;
}

/* Static artwork for the project card; the real player stays in navigation. */
.music-preview {
  display: grid;
  justify-items: center;
  width: min(58%, 10rem);
  padding: 0.625rem 0.875rem 0.75rem;
  border: 1px solid var(--glass-line);
  border-radius: 1rem;
  background: linear-gradient(145deg, rgb(255 255 255 / 5%), transparent 65%), #192a37;
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 12%);
}

.music-preview-title {
  justify-self: start;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
}

.music-preview-progress {
  position: relative;
  display: block;
  width: 100%;
  height: 2px;
  margin: 0.375rem 0 0.625rem;
  border-radius: 2px;
  background: rgb(226 244 255 / 20%);
}

.music-preview-progress::before {
  content: "";
  position: absolute;
  left: 0;
  top: -1px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}

.music-preview-wheel {
  display: grid;
  place-items: center;
  width: 65%;
  aspect-ratio: 1;
  border: 1px solid rgb(227 246 255 / 18%);
  border-radius: 50%;
  background: rgb(255 255 255 / 2%);
}

.music-preview-play {
  display: grid;
  place-items: center;
  width: 38%;
  aspect-ratio: 1;
  border: 1px solid rgb(227 246 255 / 20%);
  border-radius: 50%;
  background: #293e4e;
}

.music-preview-play::after {
  content: "";
  width: 0;
  height: 0;
  margin-inline-start: 2px;
  border-block: 4px solid transparent;
  border-inline-start: 6px solid var(--ink);
}

.home-page .about-profile {
  max-width: 42rem;
  grid-template-columns: 5.125rem minmax(0, 1fr);
  gap: 1.5rem;
}

.about-profile > img {
  border-radius: 1.375rem;
}

.site-footer {
  margin-block-start: 3.5rem;
  padding-block: 1rem 2rem;
  border-top: 1px solid rgb(207 231 249 / 16%);
}

.post-page {
  padding-block-start: clamp(2.25rem, 5vw, 3rem);
}

article.post-body figure img,
.orbit-detail img {
  border-radius: 1.25rem;
}

/* Anchor navigation must leave room for the floating control layer. */
@media (max-width: 32rem) {
  html { scroll-padding-top: 9.5rem; }
  .site-header { flex-wrap: wrap; gap: 0.25rem; padding: 0.5rem 0.875rem; border-radius: 1.75rem; }
  .site-header .wordmark { flex-basis: 100%; min-height: 36px; }
  .site-header nav { width: 100%; justify-content: space-between; gap: 0; }
  .site-header nav a { flex: 1; padding-inline: 0.625rem; }
  .site-header--article { flex-wrap: nowrap; min-height: 4rem; gap: 1rem; border-radius: 1.5rem; }
  .site-header--article .wordmark { flex-basis: auto; min-height: 44px; flex-shrink: 0; }
  .site-header--article nav { width: auto; flex-wrap: nowrap; justify-content: flex-end; margin-inline-start: auto; }
  .site-header--article nav a { flex: 0 0 auto; }
  .home-page { padding-block-start: 2rem; }
  .home-posts { grid-template-columns: minmax(0, 1fr); }
  .home-post--featured .home-post-image { aspect-ratio: 1.8; }
  .home-post-image { border-radius: 1.375rem; }
  .home-post-copy { padding-block-start: 1rem; }
  .home-post-meta { font-size: 0.75rem; }
  .home-post-summary { font-size: 0.875rem; }
  .home-page .project-list { grid-template-columns: minmax(0, 1fr); gap: 1.875rem; }
  .home-page .about-profile { grid-template-columns: 3.75rem minmax(0, 1fr); gap: 1rem; }
  .about-profile > img { border-radius: 1rem; }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header { background: #20303e; }
  .site-header::after { display: none; }
}

@supports not ((mask-composite: exclude) or (-webkit-mask-composite: xor)) {
  .site-header::before { display: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .site-header { background: #20303e; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .site-header::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .site-header nav a { transition: none; }
  .site-header::after { display: none; }
}

@media (prefers-contrast: more) {
  :root { --quiet: #d4e0e8; }
  .site-header { background: #172734; border-color: #b2c9d8; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .site-header::before, .site-header::after { display: none; }
}

@media (forced-colors: active) {
  .site-header { background: Canvas; border: 1px solid CanvasText; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .site-header::before, .site-header::after { display: none; }
}
