:root {
  --page-background: #060709;
  color-scheme: dark;
  background: var(--page-background);
  color: #f0f0f2;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }

/* The current homepage is intentionally one screen. Lock the document itself so
   Safari cannot create a scroll range or rubber-band the page before more
   content is added. */
html {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background-color: var(--page-background);
}

body {
  position: fixed;
  inset: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  min-width: 240px;
  min-height: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--page-background) url("background.svg") center / cover no-repeat fixed;
}

#liquid {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  /* Keep the canvas fallback opaque while WebGL initializes. */
  background-color: var(--page-background);
  display: block;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s ease;
}

#liquid.is-ready { opacity: 1; }

/* Safari 26 derives its bottom toolbar tint from viewport-edge elements.
   Supply a dedicated bottom-anchored source instead of relying on the canvas.
   Keep this real, opaque element anchored to the bottom (not a pseudo-element,
   a transparent overlay, or a taller page). It adds no document height or UI.
   Reference: https://bugs.webkit.org/show_bug.cgi?id=301756 */
.safari-toolbar-tint { display: none; }

@supports (-webkit-touch-callout: none) {
  @media (hover: none) and (pointer: coarse) {
    .safari-toolbar-tint {
      display: block;
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      height: 4px;
      background-color: var(--page-background);
      pointer-events: none;
      z-index: 2;
    }
  }
}

@media (display-mode: standalone), (display-mode: fullscreen), (forced-colors: active) {
  .safari-toolbar-tint { display: none; }
}

main {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
}

.project-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.project-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 16px;
  min-height: 56px;
  padding: 12px 16px;
  color: inherit;
  font-size: clamp(28px, 3vw, 36px);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 1;
  text-decoration: none;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.65);
  -webkit-tap-highlight-color: transparent;
}

.project-link::after {
  content: "";
  position: absolute;
  bottom: 3px;
  left: 16px;
  right: 16px;
  height: 1px;
  background: currentColor;
  opacity: 0;
  transform: scaleX(0.75);
  transform-origin: left;
  transition: opacity 250ms ease, transform 450ms cubic-bezier(.2, .7, .2, 1);
}

.project-link svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .6;
  transition: opacity 250ms ease, transform 450ms cubic-bezier(.2, .7, .2, 1);
}

.project-link:focus-visible {
  outline: 1px solid #f0f0f2;
  outline-offset: 8px;
  border-radius: 4px;
}

@media (hover: hover) and (pointer: fine) {
  .project-link:hover::after { opacity: .55; transform: scaleX(1); }
  .project-link:hover svg { opacity: 1; transform: translate(2px, -2px); }
}

@media (prefers-reduced-motion: reduce) {
  #liquid, .project-link::after, .project-link svg { transition: none; }
}

@media (forced-colors: active) {
  html, body { background: Canvas; }
  #liquid { display: none; }
  .project-link { color: LinkText; text-shadow: none; }
  .project-link:focus-visible { outline-color: Highlight; }
}
