* {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --bg: #030303;
  --panel: #090909d4;
  --line: #1a1a1a;
  --text: #ececec;
  --muted: #8e8e8e;
  --accent: #b3c0ff;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", Inter, ui-sans-serif, system-ui, -apple-system,
    Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: grid;
  place-items: center;
  overflow: hidden;
  text-transform: lowercase;
}

#asteroid-field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.shell {
  width: min(58vw, 300px);
  height: 120px;
  margin: 2.5vh 0;
  padding: 1.7rem 1.15rem;
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(1px);
  position: relative;
  z-index: 1;
  border-radius: 18px;
  clip-path: polygon(
    0 14px,
    14px 0,
    calc(100% - 14px) 0,
    100% 14px,
    100% calc(100% - 18px),
    calc(100% - 18px) 100%,
    18px 100%,
    0 calc(100% - 18px)
  );
  transform-origin: center;
  will-change: transform, opacity;
  transition:
    width 1300ms cubic-bezier(0.2, 0.8, 0.2, 1),
    height 1300ms cubic-bezier(0.2, 0.8, 0.2, 1),
    padding 1300ms cubic-bezier(0.2, 0.8, 0.2, 1),
    border-radius 1300ms cubic-bezier(0.2, 0.8, 0.2, 1),
    clip-path 1300ms cubic-bezier(0.2, 0.8, 0.2, 1),
    border-color 1000ms ease,
    box-shadow 1000ms ease;
}

.shell.view-home:hover,
.shell.view-home:focus-within {
  width: min(92vw, 500px);
  height: 230px;
  padding: 1.8rem 1.35rem 1.3rem;
  border-color: #2b2b2b;
  box-shadow: 0 0 0 1px rgba(179, 192, 255, 0.1) inset;
  border-radius: 0;
  clip-path: inset(0);
}

.shell.view-work,
.shell.view-writing,
.shell.view-connect {
  width: min(92vw, 640px);
  height: clamp(420px, 68vh, 560px);
  padding: 1.7rem 1.25rem;
  border-radius: 0;
  clip-path: inset(0);
}

h1 {
  margin: 0;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-align: center;
}

.meta {
  margin: 0.55rem 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.nav {
  margin-top: 1.4rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.view-stage {
  position: relative;
  height: 100%;
}

.quote {
  margin: 0.95rem auto 0;
  max-width: 34ch;
  color: var(--muted);
  line-height: 1.45;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transform: translateY(6px);
  transition: opacity 900ms ease, transform 900ms ease, max-height 900ms ease;
}

.quote-attribution {
  margin: 0.45rem auto 0;
  color: var(--muted);
  line-height: 1.3;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transform: translateY(6px);
  transition: opacity 700ms ease, transform 700ms ease, max-height 700ms ease;
}

.nav-home {
  margin-top: 0.95rem;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 700ms ease, transform 700ms ease, max-height 700ms ease;
}

.nav-home a {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 550ms ease, transform 550ms ease;
}

.shell.view-home:hover .quote,
.shell.view-home:focus-within .quote,
.shell.view-home:hover .quote-attribution,
.shell.view-home:focus-within .quote-attribution,
.shell.view-home:hover .nav-home,
.shell.view-home:focus-within .nav-home {
  opacity: 1;
  max-height: 8rem;
  transform: translateY(0);
}

.shell.view-home:hover .quote,
.shell.view-home:focus-within .quote {
  transition-delay: 850ms;
}

.shell.view-home:hover .quote-attribution,
.shell.view-home:focus-within .quote-attribution {
  transition-delay: 1220ms;
}

.shell.view-home:hover .nav-home,
.shell.view-home:focus-within .nav-home {
  transition-delay: 1750ms;
}

.shell.view-home:hover .nav-home a,
.shell.view-home:focus-within .nav-home a {
  opacity: 1;
  transform: translateY(0);
}

.shell.view-home:hover .nav-home a:nth-child(1),
.shell.view-home:focus-within .nav-home a:nth-child(1) {
  transition-delay: 1850ms;
}

.shell.view-home:hover .nav-home a:nth-child(2),
.shell.view-home:focus-within .nav-home a:nth-child(2) {
  transition-delay: 2020ms;
}

.shell.view-home:hover .nav-home a:nth-child(3),
.shell.view-home:focus-within .nav-home a:nth-child(3) {
  transition-delay: 2190ms;
}

.shell.view-home:hover .nav-home,
.shell.view-home:focus-within .nav-home {
  pointer-events: auto;
}

.view-section {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  overflow: hidden;
  padding-right: 0;
  transition: opacity 750ms ease, transform 900ms ease;
}

.view-section[data-view="home"] {
  justify-content: center;
  text-align: center;
}

.view-section[data-view="work"],
.view-section[data-view="writing"],
.view-section[data-view="connect"] {
  justify-content: flex-start;
}

.view-section.view-active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.view-section.view-out {
  opacity: 0;
  transform: translateY(-10px);
}

a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.nav a.is-active {
  color: var(--accent);
}

.list {
  margin-top: 1.25rem;
  display: grid;
  gap: 0.85rem;
}

.item {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.item p {
  margin: 0;
}

.item p + p {
  margin-top: 0.4rem;
}
